:root {
    --navy: #111827;
    --navy-2: #1f2937;
    --gold: #f4b000;
    --gold-dark: #c88800;
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --danger: #dc2626;
    --success: #15803d;
    --radius: 8px;
    --shadow: 0 10px 25px rgba(17, 24, 39, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

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

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

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 270px;
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    transition: transform .2s ease;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-block img,
.brand-mark,
.auth-logo {
    width: 46px;
    height: 46px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--gold);
    color: #111827;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.brand-block strong {
    display: block;
    font-size: 15px;
    line-height: 1.25;
}

.brand-block span {
    color: rgba(255,255,255,.65);
    font-size: 12px;
}

.side-nav {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.side-nav a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 7px;
    color: rgba(255,255,255,.82);
    margin-bottom: 3px;
}

.side-nav a:hover,
.side-nav a.active {
    background: rgba(244,176,0,.16);
    color: #fff;
}

.sidebar-footer {
    color: rgba(255,255,255,.68);
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 12px 14px;
}

.sidebar-footer a {
    color: #fff;
}

.main {
    margin-left: 270px;
    width: calc(100% - 270px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 74px;
    background: rgba(255,255,255,.95);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 22px;
    backdrop-filter: blur(8px);
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.topbar p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    border: 1px solid var(--line);
    background: #fff;
    min-width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: none;
}

.user-pill {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--radius);
    padding: 7px 10px;
    min-width: 120px;
}

.user-pill span,
.user-pill small {
    display: block;
}

.user-pill small {
    color: var(--muted);
}

.content {
    flex: 1;
    padding: 22px;
}

.developer-footer {
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
}

.page-footer {
    padding: 12px;
    color: var(--muted);
}

.page-footer a {
    color: var(--navy);
    font-weight: 700;
}

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

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

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

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

.panel,
.card,
.metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 18px;
    margin-bottom: 16px;
}

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

.panel-header h2,
.panel h2,
.panel h3 {
    margin: 0;
    font-size: 17px;
}

.metric {
    padding: 16px;
    border-left: 4px solid var(--gold);
}

.metric span {
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    display: block;
    font-size: 24px;
    margin-top: 6px;
}

.metric small {
    color: var(--muted);
}

.btn,
button.btn {
    border: 1px solid transparent;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 7px;
    background: var(--navy);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

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

.btn.accent {
    background: var(--gold);
    color: #111827;
    font-weight: 700;
}

.btn.ghost {
    background: #fff;
    color: var(--navy);
    border-color: var(--line);
}

.btn.danger {
    background: var(--danger);
}

.btn.small {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
}

.btn.whatsapp {
    background: #128c7e;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
}

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

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

label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 10px 11px;
    background: #fff;
    color: var(--text);
    min-height: 40px;
}

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

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

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

th,
td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    background: #f9fafb;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
}

tr.low-stock td {
    background: #fff7ed;
}

tr.out-stock td {
    background: #fef2f2;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
}

.badge.success {
    background: #dcfce7;
    color: var(--success);
}

.badge.warn {
    background: #fef3c7;
    color: #92400e;
}

.badge.danger {
    background: #fee2e2;
    color: var(--danger);
}

.badge.muted {
    background: #eef2f7;
    color: var(--muted);
}

.alert {
    padding: 11px 13px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.alert.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.alert.error,
.alert.danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.alert.warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(17,24,39,.92), rgba(31,41,55,.9)),
        radial-gradient(circle at 20% 20%, rgba(244,176,0,.5), transparent 35%),
        #111827;
}

.auth-card {
    width: min(440px, 100%);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 25px 70px rgba(0,0,0,.3);
    padding: 28px;
}

.auth-card h1 {
    margin: 12px 0 4px;
    font-size: 24px;
}

.auth-card p {
    color: var(--muted);
    margin: 0 0 18px;
}

.auth-footer {
    margin-top: 18px;
    color: var(--muted);
}

.auth-footer a {
    color: var(--navy);
    font-weight: 700;
}

.pos-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(360px, .7fr);
    gap: 16px;
}

.product-pick-list {
    max-height: 430px;
    overflow: auto;
}

.product-button {
    width: 100%;
    text-align: left;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}

.product-button strong {
    color: var(--navy);
}

.product-button small {
    color: var(--muted);
}

.receipt {
    background: #fff;
    padding: 22px;
    color: #111;
}

.receipt-header {
    text-align: center;
    border-bottom: 1px dashed #999;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.receipt-logo {
    max-width: 90px;
    max-height: 70px;
}

.print-actions {
    margin-bottom: 14px;
}

.chart-bars {
    display: grid;
    gap: 8px;
}

.chart-row {
    display: grid;
    grid-template-columns: 140px 1fr 90px;
    gap: 10px;
    align-items: center;
}

.bar-track {
    height: 12px;
    background: #edf2f7;
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}

.installer-shell {
    min-height: 100vh;
    background: var(--bg);
    display: grid;
    place-items: center;
    padding: 20px;
}

.installer {
    width: min(960px, 100%);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.installer-head {
    background: var(--navy);
    color: #fff;
    padding: 22px;
}

.installer-head h1 {
    margin: 0 0 6px;
}

.installer-body {
    padding: 22px;
}

.steps {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.step {
    flex: 1;
    min-width: 120px;
    padding: 9px;
    border-radius: 7px;
    background: #eef2f7;
    color: var(--muted);
    text-align: center;
    font-weight: 700;
    font-size: 12px;
}

.step.active {
    background: var(--gold);
    color: #111827;
}

@media (max-width: 1100px) {
    .grid.cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .pos-grid,
    .grid.two,
    .grid.three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main {
        margin-left: 0;
        width: 100%;
    }
    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }
    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 12px;
    }
    .topbar-actions {
        width: 100%;
        margin-left: 0;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .content {
        padding: 12px;
    }
    .form-grid,
    .form-grid.two,
    .grid.cards {
        grid-template-columns: 1fr;
    }
    .chart-row {
        grid-template-columns: 1fr;
    }
    th,
    td {
        padding: 8px;
    }
}

@media print {
    body {
        background: #fff;
    }
    .sidebar,
    .topbar,
    .print-actions,
    .page-footer,
    .no-print {
        display: none !important;
    }
    .main {
        margin: 0;
        width: 100%;
    }
    .content {
        padding: 0;
    }
    .panel,
    .receipt {
        box-shadow: none;
        border: 0;
    }
    .developer-footer {
        display: block !important;
        color: #111;
        margin-top: 12px;
    }
    @page {
        margin: 10mm;
    }
}

@media print and (max-width: 380px) {
    .receipt {
        width: 58mm;
        font-size: 11px;
        padding: 4mm;
    }
}

