:root {
    --background: 240 10% 4%;
    --foreground: 0 0% 98%;
    --card: 240 6% 11%;
    --card-foreground: 0 0% 98%;
    --popover: 240 6% 11%;
    --popover-foreground: 0 0% 98%;
    --primary: 41 89% 56%;
    --primary-foreground: 0 0% 8%;
    --secondary: 240 5% 16%;
    --secondary-foreground: 0 0% 92%;
    --muted: 240 5% 16%;
    --muted-foreground: 240 5% 65%;
    --accent: 39 39% 17%;
    --accent-foreground: 41 89% 56%;
    --destructive: 0 72% 59%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 4% 18%;
    --input: 240 4% 18%;
    --ring: 41 89% 56%;
    --sidebar-background: 240 7% 12%;
    --sidebar-foreground: 0 0% 92%;
    --sidebar-primary: 41 89% 56%;
    --sidebar-primary-foreground: 0 0% 8%;
    --sidebar-accent: 39 34% 18%;
    --sidebar-accent-foreground: 41 89% 56%;
    --sidebar-border: 240 5% 18%;
    --radius: 0.9rem;
    --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Inter", Arial, sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 272px 1fr;
    background:
        radial-gradient(circle at top left, rgba(255, 191, 71, 0.04), transparent 22%),
        #09090b;
}

.sidebar {
    min-height: 100vh;
    padding: 14px 10px;
    background: hsl(var(--sidebar-background));
    color: hsl(var(--sidebar-foreground));
    border-right: 1px solid hsl(var(--sidebar-border));
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: width 0.2s ease, padding 0.2s ease, transform 0.2s ease;
}

.main {
    padding: 26px 30px;
    display: grid;
    gap: 18px;
    align-content: start;
    min-width: 0;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.08;
}

h1 {
    font-size: 1.02rem;
    font-weight: 700;
}

h2 {
    font-size: 1.95rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

h3 {
    font-size: 0.98rem;
    font-weight: 700;
}

.muted {
    color: hsl(var(--muted-foreground));
}

.brand-card,
.profile-box,
.card,
.auth-card {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    box-shadow: var(--shadow-card);
}

.brand-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0 12px;
    background: transparent;
    border: none;
    border-bottom: none;
    border-radius: 0;
    box-shadow: none;
}

.sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 14px;
    border-bottom: 1px solid hsl(var(--sidebar-border));
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 191, 71, 0.16);
    color: hsl(var(--primary));
}

.brand-mark-logo {
    width: 56px;
    height: 56px;
    padding: 4px;
    background: rgba(255, 191, 71, 0.12);
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-mark svg,
.nav-icon svg,
.stat-icon svg {
    width: 18px;
    height: 18px;
}

.tone-gold {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
}

.tone-blue {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.12);
}

.tone-green {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
}

.tone-purple {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.12);
}

.tone-red {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
}

.tone-emerald {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
}

.tone-orange {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.12);
}

.brand-card .muted {
    margin-top: 2px;
    font-size: 0.84rem;
}

.sidebar-copy {
    transition: opacity 0.16s ease;
}

.nav-list {
    display: grid;
    gap: 4px;
}

.nav-link,
.logout-link,
.btn,
.btn-secondary {
    min-height: 48px;
    border-radius: 14px;
    transition: 0.18s ease;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid transparent;
    color: hsl(var(--secondary-foreground));
    font-size: 0.88rem;
    font-weight: 600;
}

.nav-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    border-radius: 8px;
    background: transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    background: hsl(var(--sidebar-accent));
    color: hsl(var(--sidebar-accent-foreground));
    border-color: rgba(255, 191, 71, 0.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid hsl(var(--sidebar-border));
    display: grid;
    gap: 8px;
}

.profile-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: transparent;
    box-shadow: none;
}

.profile-box strong {
    display: block;
    font-size: 0.9rem;
}

.profile-box span {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    color: hsl(var(--muted-foreground));
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
    font-weight: 700;
}

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
}

.logout-link:hover {
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.topbar-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.topbar-copy {
    display: grid;
    gap: 2px;
}

.sidebar-toggle {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: 0.18s ease;
    flex: 0 0 38px;
    margin-top: 0;
}

.sidebar-toggle:hover {
    background: hsl(240 5% 19%);
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
}

.mobile-sidebar-toggle {
    display: none;
}

.topbar-badge,
.badge,
.badge-warn,
.badge-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid hsl(var(--border));
    font-size: 0.74rem;
    font-weight: 700;
}

.topbar-badge,
.badge {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.2);
}

.badge-warn {
    background: rgba(250, 204, 21, 0.1);
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.18);
}

.badge-danger {
    background: rgba(248, 113, 113, 0.11);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.18);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
}

.status-success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.2);
}

.status-warn {
    background: rgba(250, 204, 21, 0.1);
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.18);
}

.status-danger {
    background: rgba(248, 113, 113, 0.11);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.18);
}

.status-info {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.2);
}

.stats-grid,
.grid-2,
.form-grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-2 {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.card {
    padding: 20px;
    background: hsl(var(--card));
}

.stat-card {
    min-height: 108px;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.stat-card strong {
    display: block;
    margin-top: 22px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: hsl(var(--muted-foreground));
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

td {
    padding-right: 16px;
    font-size: 0.88rem;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill,
.btn,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid hsl(var(--border));
    padding: 0 12px;
    min-height: 34px;
    font-size: 0.78rem;
    font-weight: 600;
}

.pill,
.btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.pill:hover,
.btn-secondary:hover {
    background: hsl(240 5% 19%);
}

.btn {
    background: hsl(var(--primary));
    border-color: rgba(255, 191, 71, 0.2);
    color: hsl(var(--primary-foreground));
}

.btn-accent {
    background: #f7a813;
    border-color: #f7a813;
    color: #18181b;
}

.btn-accent:hover {
    background: #ffb422;
    border-color: #ffb422;
}

.btn:hover {
    filter: brightness(1.03);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid hsl(var(--input));
    background: hsl(240 5% 12%);
    color: hsl(var(--foreground));
}

input::placeholder,
textarea::placeholder {
    color: hsl(var(--muted-foreground));
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(255, 191, 71, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 191, 71, 0.08);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.helper {
    margin-top: 6px;
    color: hsl(var(--muted-foreground));
    font-size: 0.78rem;
}

.stack-gap {
    display: grid;
    gap: 14px;
}

.item-row {
    border: 1px solid hsl(var(--border));
    border-radius: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.item-row-head,
.list-row,
.list-row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.item-row-head {
    margin-bottom: 12px;
}

.list-row {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.list-row.compact {
    padding: 10px 0;
}

.list-row:last-child {
    border-bottom: none;
}

.list-row-meta {
    flex: 0 0 auto;
}

.alert-card {
    border: 1px solid rgba(250, 204, 21, 0.2);
    background: rgba(250, 204, 21, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    color: #facc15;
}

.products-shell {
    display: grid;
    gap: 14px;
}

.products-head {
    align-items: center;
    margin-bottom: 0;
}

.products-title {
    font-size: 1.05rem;
}

.product-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
}

.product-card {
    border: 1px solid hsl(var(--border));
    border-radius: 16px;
    background: hsl(var(--card));
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
}

.product-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.product-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.product-card-title strong {
    font-size: 0.98rem;
    line-height: 1.2;
    word-break: break-word;
}

.product-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
}

.product-card-photo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.product-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-icon-action {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: hsl(var(--muted-foreground));
    padding: 0;
    cursor: pointer;
}

.product-icon-action:hover {
    color: hsl(var(--foreground));
}

.product-icon-action svg {
    width: 18px;
    height: 18px;
}

.product-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.product-metric {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    padding: 12px;
    display: grid;
    gap: 5px;
}

.product-metric span {
    font-size: 0.78rem;
    color: hsl(var(--muted-foreground));
}

.product-metric strong {
    font-size: 0.95rem;
    line-height: 1.1;
}

.metric-gold {
    color: #fbbf24;
}

.metric-green {
    color: #4ade80;
}

.metric-blue {
    color: #60a5fa;
}

.product-card-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.84rem;
}

.stock-list {
    display: grid;
    gap: 12px;
}

.stock-card {
    border: 1px solid hsl(var(--border));
    border-radius: 16px;
    background: hsl(var(--card));
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.stock-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.stock-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
}

.stock-card-copy {
    min-width: 0;
}

.stock-card-copy strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.2;
}

.stock-card-side {
    display: grid;
    justify-items: end;
    gap: 6px;
    flex: 0 0 auto;
}

.stock-card-qty {
    font-size: 0.98rem;
    font-weight: 800;
    color: hsl(var(--foreground));
}

.stock-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.commerce-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
}

.commerce-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.commerce-search input {
    flex: 1 1 auto;
}

.commerce-card {
    border: 1px solid hsl(var(--border));
    border-radius: 16px;
    background: hsl(var(--card));
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    display: grid;
    gap: 16px;
}

.commerce-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.commerce-card-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.commerce-card-title strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.2;
    word-break: break-word;
}

.commerce-card-meta-line {
    margin-top: 2px;
    font-size: 0.8rem;
}

.commerce-card-meta-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.commerce-meta-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--muted-foreground));
    flex: 0 0 14px;
}

.commerce-meta-icon svg {
    width: 14px;
    height: 14px;
}

.commerce-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.commerce-metrics-colored {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-panel {
    position: relative;
    overflow: hidden;
}

.metric-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    pointer-events: none;
}

.metric-panel-warn {
    background: rgba(250, 204, 21, 0.08);
}

.metric-panel-blue {
    background: rgba(96, 165, 250, 0.08);
}

.metric-panel-gold {
    background: rgba(251, 191, 36, 0.08);
}

.metric-panel-green {
    background: rgba(74, 222, 128, 0.08);
}

.metric-panel-slate {
    background: rgba(148, 163, 184, 0.08);
}

.metric-panel-purple {
    background: rgba(192, 132, 252, 0.08);
}

.metric-panel-emerald {
    background: rgba(52, 211, 153, 0.08);
}

.metric-panel-orange {
    background: rgba(251, 146, 60, 0.08);
}

.commerce-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.panel-collapsible {
    padding: 16px;
    border: 1px solid hsl(var(--border));
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.transaction-card-list {
    display: grid;
    gap: 12px;
}

.transaction-card {
    border: 1px solid hsl(var(--border));
    border-radius: 16px;
    background: hsl(var(--card));
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    display: grid;
    gap: 14px;
}

.transaction-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.transaction-card-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.transaction-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
}

.transaction-card-copy strong {
    display: block;
    font-size: 1rem;
    word-break: break-word;
}

.transaction-card-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.transaction-card-info {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    gap: 12px;
}

.transaction-card-meta {
    font-size: 0.82rem;
    color: hsl(var(--muted-foreground));
}

.transaction-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.transaction-metric-box {
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 5px;
}

.transaction-metric-box span {
    font-size: 0.76rem;
    color: hsl(var(--muted-foreground));
}

.transaction-metric-box strong {
    font-size: 0.92rem;
    line-height: 1.2;
}

.transaction-items-box {
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.035);
    display: grid;
    gap: 6px;
}

.transaction-items-box span {
    font-size: 0.76rem;
    color: hsl(var(--muted-foreground));
}

.transaction-items-box strong {
    font-size: 0.88rem;
    line-height: 1.4;
    word-break: break-word;
}

.transaction-line-value,
.transaction-form-total-box {
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.035);
    display: grid;
    gap: 6px;
}

.transaction-line-value span,
.transaction-form-total-box span {
    font-size: 0.76rem;
    color: hsl(var(--muted-foreground));
}

.transaction-line-value strong,
.transaction-form-total-box strong {
    font-size: 0.95rem;
    line-height: 1.2;
    color: #fbbf24;
}

.transaction-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.transaction-form-footer,
.settlement-form-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.settlement-dual-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.settlement-card-grid,
.pista-card-grid,
.settlement-history-list {
    display: grid;
    gap: 14px;
}

.settlement-card-grid,
.pista-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.settlement-card,
.settlement-history-card,
.pista-card {
    border: 1px solid hsl(var(--border));
    border-radius: 16px;
    background: hsl(var(--card));
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    display: grid;
    gap: 14px;
}

.settlement-card-top,
.settlement-history-top,
.pista-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.settlement-card-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.settlement-card-main strong,
.settlement-history-card strong,
.pista-card strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
    word-break: break-word;
}

.settlement-card-subtitle {
    margin-top: 4px;
    font-size: 0.8rem;
}

.settlement-metrics,
.pista-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.settlement-metrics-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settlement-items-box {
    background: rgba(255, 255, 255, 0.03);
}

.note-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #f8f8fb;
    color: #747887;
    font-size: 0.8rem;
    font-weight: 700;
}

.note-button:hover {
    background: #ffffff;
    color: #4b5563;
}

.chart-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1.2fr 0.8fr;
}

.chart-card {
    border: 1px solid hsl(var(--border));
    border-radius: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
}

.mini-chart {
    display: flex;
    align-items: end;
    gap: 12px;
    min-height: 180px;
    margin-top: 18px;
    position: relative;
    padding-top: 8px;
}

.bar-group {
    flex: 1;
    display: grid;
    gap: 8px;
    justify-items: center;
}

.bar-stack {
    width: 100%;
    min-height: 140px;
    display: flex;
    align-items: end;
    justify-content: center;
}

.bar-stack-inner {
    display: flex;
    align-items: end;
    gap: 6px;
    height: 140px;
    width: 100%;
    justify-content: center;
}

.bar {
    width: 100%;
    max-width: 34px;
    border-radius: 10px 10px 4px 4px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, filter 0.18s ease;
    cursor: pointer;
}

.bar.sales {
    background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.bar.loans {
    background: linear-gradient(180deg, #fbbf24, #d97706);
}

.bar:hover {
    transform: translateY(-4px);
    filter: brightness(1.08);
}

.bar-label {
    font-size: 0.76rem;
    color: hsl(var(--muted-foreground));
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid hsl(var(--border));
    background: rgba(255, 255, 255, 0.02);
    color: hsl(var(--secondary-foreground));
    font-size: 0.82rem;
    font-weight: 600;
}

.dot-sales {
    background: #60a5fa;
}

.dot-loans {
    background: #fbbf24;
}

.pie-legend {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.donut-wrap {
    position: relative;
}

.donut-chart {
    width: 190px;
    height: 190px;
    display: block;
    margin: 10px auto;
}

.donut-chart circle[data-tooltip] {
    cursor: pointer;
    transition: opacity 0.18s ease, stroke-width 0.18s ease;
}

.donut-chart circle[data-tooltip]:hover {
    opacity: 1;
    stroke-width: 5;
}

.chart-tooltip {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-9999px, -9999px);
    pointer-events: none;
    z-index: 30;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 15, 18, 0.96);
    color: #fafafa;
    font-size: 0.78rem;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.modal {
    width: min(860px, calc(100vw - 28px));
    border: 1px solid hsl(var(--border));
    border-radius: 18px;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    padding: 0;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.modal-body {
    padding: 22px;
    max-height: min(92vh, 920px);
    overflow-y: auto;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.icon-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--secondary));
    color: hsl(var(--foreground));
    cursor: pointer;
}

.print-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px;
    color: #111827;
    background: #fff;
}

.print-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
}

.print-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media print {
    body.print-page {
        background: #fff;
    }

    .no-print {
        display: none !important;
    }
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(255, 191, 71, 0.06), transparent 20%),
        #09090b;
}

.auth-card {
    width: min(460px, 100%);
    padding: 28px;
    background: hsl(var(--card));
}

.auth-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.auth-logo {
    width: min(280px, 100%);
    max-height: 180px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.32));
}

.auth-card form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

form {
    margin: 0;
}

.storefront-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 191, 71, 0.1), transparent 24%),
        radial-gradient(circle at top right, rgba(255, 191, 71, 0.06), transparent 20%),
        #09090b;
    color: #f4efe8;
}

.storefront-shell {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.storefront-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 191, 71, 0.16);
    border-radius: 28px;
    background: rgba(24, 24, 27, 0.94);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.storefront-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.storefront-logo {
    width: 86px;
    height: 86px;
    object-fit: contain;
    flex: 0 0 86px;
    filter: drop-shadow(0 14px 24px rgba(73, 53, 18, 0.14));
}

.storefront-eyebrow {
    margin: 0 0 8px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #d7a33b;
}

.storefront-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #fff7ec;
}

.storefront-copy {
    max-width: 640px;
    margin: 10px 0 0;
    font-size: 0.98rem;
    line-height: 1.65;
    color: #b8ab99;
}

.storefront-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.storefront-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}

.storefront-button-primary {
    background: #f7a813;
    border-color: #f7a813;
    color: #18181b;
}

.storefront-button-primary:hover {
    background: #ffb422;
}

.storefront-button-secondary {
    background: #1f1f23;
    border-color: rgba(255, 191, 71, 0.16);
    color: #f0e7dc;
}

.storefront-button-secondary:hover {
    background: #27272c;
}

.storefront-alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    font-weight: 600;
}

.storefront-alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.18);
}

.storefront-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.18);
}

.storefront-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.storefront-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(255, 191, 71, 0.12);
    background: rgba(24, 24, 27, 0.96);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.storefront-card-body {
    display: grid;
    gap: 14px;
}

.storefront-card-media {
    display: grid;
    place-items: center;
    min-height: 180px;
    border-radius: 18px;
    background: linear-gradient(180deg, #19191d 0%, #232329 100%);
}

.storefront-card-image {
    max-width: 100%;
    max-height: 170px;
    object-fit: contain;
    display: block;
}

.storefront-card-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
}

.storefront-card-icon svg {
    width: 28px;
    height: 28px;
}

.storefront-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.storefront-card-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.25;
    color: #fff7ec;
}

.storefront-card-subtitle {
    margin: 6px 0 0;
    font-size: 0.84rem;
    color: #a69784;
}

.storefront-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.18);
    font-size: 0.74rem;
    font-weight: 700;
}

.storefront-card-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
}

.storefront-mini-box {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    width: 100%;
    min-height: 76px;
    align-content: space-between;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 191, 71, 0.1);
}

.storefront-mini-box span {
    font-size: 0.74rem;
    color: #9f9486;
}

.storefront-mini-box strong {
    font-size: 0.95rem;
    color: #fff5e8;
}

.storefront-modal::backdrop {
    background: rgba(0, 0, 0, 0.62);
}

.storefront-modal-body {
    background: #161619;
    color: #f5eee5;
}

.storefront-modal-body .muted,
.storefront-modal-body .helper {
    color: #aa9c8d;
}

.storefront-modal-body input,
.storefront-modal-body select,
.storefront-modal-body textarea {
    background: #101013;
    color: #f5eee5;
    border-color: rgba(255, 191, 71, 0.14);
}

.storefront-close {
    background: #232329;
    color: #f1e7da;
    border-color: rgba(255, 191, 71, 0.14);
}

.storefront-item-row {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 191, 71, 0.12);
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
        position: relative;
    }

    .layout.sidebar-open-mobile::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.48);
        z-index: 30;
    }

    .sidebar {
        min-height: auto;
        position: fixed;
        inset: 0 auto 0 0;
        width: min(320px, 86vw);
        z-index: 40;
        transform: translateX(0);
        overflow-y: auto;
    }

    .main {
        padding: 22px;
    }

    .grid-2,
    .chart-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .settlement-metrics,
    .pista-metrics,
    .settlement-metrics-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .layout.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    .mobile-sidebar-toggle {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .main {
        padding: 16px;
        gap: 14px;
    }

    .topbar,
    .topbar-main,
    .section-head,
    .product-card-top,
    .transaction-form-footer,
    .settlement-form-footer,
    .stock-card,
    .stock-card-main,
    .stock-card-meta,
    .commerce-card-top,
    .transaction-card-top,
    .transaction-card-actions,
    .settlement-card-top,
    .settlement-history-top,
    .pista-card-top,
    .modal-head {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-badge,
    .section-head .actions,
    .actions,
    .commerce-card-actions,
    .transaction-card-actions {
        width: 100%;
    }

    .actions > *,
    .commerce-card-actions > *,
    .transaction-card-actions > * {
        flex: 1 1 100%;
    }

    .actions form,
    .commerce-card-actions form,
    .transaction-card-actions form {
        width: 100%;
    }

    .actions form > *,
    .commerce-card-actions form > *,
    .transaction-card-actions form > * {
        width: 100%;
    }

    .stats-grid,
    .product-card-grid,
    .commerce-card-grid,
    .settlement-card-grid,
    .pista-card-grid,
    .chart-grid,
    .print-grid {
        grid-template-columns: 1fr;
    }

    .product-metrics,
    .commerce-metrics,
    .commerce-metrics-colored,
    .transaction-metrics,
    .settlement-metrics,
    .pista-metrics,
    .settlement-dual-summary,
    .settlement-metrics-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .transaction-card-tags {
        justify-content: flex-start;
    }

    .product-card-title,
    .commerce-card-title,
    .transaction-card-main,
    .settlement-card-main {
        min-width: 0;
    }

    .product-card-title > *,
    .commerce-card-title > *,
    .transaction-card-main > *,
    .settlement-card-main > * {
        min-width: 0;
    }

    .transaction-card-copy,
    .stock-card-copy {
        min-width: 0;
    }

    .transaction-card-copy .helper,
    .stock-card-copy .helper,
    .commerce-card-meta-line,
    .commerce-card-meta-with-icon,
    .transaction-card-meta,
    .helper {
        overflow-wrap: anywhere;
    }

    .stock-card-side {
        justify-items: start;
    }

    .commerce-search {
        flex-direction: column;
        align-items: stretch;
    }

    .card,
    .product-card,
    .stock-card,
    .commerce-card,
    .transaction-card,
    .settlement-card,
    .settlement-history-card,
    .pista-card,
    .modal-body,
    .auth-card {
        padding: 16px;
    }

    .modal {
        width: min(100vw - 16px, 860px);
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table {
        min-width: 640px;
    }
}

@media (max-width: 520px) {
    h2 {
        font-size: 1.55rem;
    }

    .eyebrow {
        font-size: 0.62rem;
    }

    .sidebar {
        width: min(286px, 88vw);
        padding: 12px 8px;
    }

    .main {
        padding: 14px;
    }

    .nav-link,
    .logout-link,
    .btn,
    .btn-secondary,
    .pill {
        min-height: 42px;
        font-size: 0.76rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        min-height: 96px;
    }

    .stat-card strong {
        font-size: 1.2rem;
    }

    .product-metrics,
    .commerce-metrics,
    .commerce-metrics-colored,
    .transaction-metrics,
    .settlement-metrics,
    .pista-metrics,
    .settlement-dual-summary,
    .settlement-metrics-compact,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .product-card-icon,
    .product-card-photo,
    .stock-card-icon,
    .transaction-card-icon,
    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .brand-mark-logo {
        width: 42px;
        height: 42px;
        padding: 3px;
    }

    .commerce-card-title,
    .transaction-card-main,
    .settlement-card-main {
        gap: 10px;
    }

    .section-head,
    .products-head {
        gap: 10px;
    }

    .section-head .actions,
    .products-head .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .stock-card,
    .product-card,
    .commerce-card,
    .transaction-card,
    .settlement-card,
    .settlement-history-card,
    .pista-card,
    .card,
    .modal-body,
    .auth-card {
        padding: 14px;
        border-radius: 14px;
    }

    .transaction-card-actions,
    .commerce-card-actions,
    .actions {
        gap: 6px;
    }

    .transaction-items-box,
    .transaction-line-value,
    .transaction-form-total-box,
    .product-metric,
    .transaction-metric-box {
        padding: 10px 12px;
    }

    .item-row {
        padding: 12px;
    }

    .item-row-head,
    .list-row,
    .list-row-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-head {
        gap: 8px;
    }

    .table-wrap {
        margin-inline: -6px;
    }

    th,
    td {
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

@media (min-width: 1101px) {
    .layout.sidebar-collapsed {
        grid-template-columns: 74px 1fr;
    }

    .layout.sidebar-collapsed .sidebar {
        padding-inline: 8px;
    }

    .layout.sidebar-collapsed .sidebar-head {
        display: grid;
        justify-items: center;
        gap: 8px;
    }

    .layout.sidebar-collapsed .brand-card {
        display: none;
    }

    .layout.sidebar-collapsed .sidebar-copy,
    .layout.sidebar-collapsed .nav-link span:not(.nav-icon),
    .layout.sidebar-collapsed .logout-link .sidebar-copy {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }

    .layout.sidebar-collapsed .nav-link,
    .layout.sidebar-collapsed .logout-link {
        justify-content: center;
        padding-inline: 0;
    }

    .layout.sidebar-collapsed .nav-link {
        width: 100%;
        min-height: 42px;
    }

    .layout.sidebar-collapsed .profile-box {
        justify-content: center;
        padding-inline: 0;
    }

    .layout.sidebar-collapsed .sidebar-toggle {
        width: 38px;
        height: 38px;
        margin-top: 0;
    }

    .layout.sidebar-collapsed .nav-list {
        justify-items: center;
    }

    .layout.sidebar-collapsed .nav-link,
    .layout.sidebar-collapsed .logout-link,
    .layout.sidebar-collapsed .profile-box {
        width: 42px;
        min-width: 42px;
        padding: 0;
        margin-inline: auto;
    }

    .layout.sidebar-collapsed .sidebar-footer {
        justify-items: center;
    }
}
