@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
    --primary: #4F46E5;
    --primary-light: #EEF2FF;
    --primary-dark: #3730A3;
    --success: #10B981;
    --success-light: #ECFDF5;
    --warning: #F59E0B;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --bg: #F8F7FF;
    --surface: #FFFFFF;
    --surface2: #F1F0FA;
    --border: #E5E3F5;
    --text: #1E1B4B;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --sidebar-w: 220px;
    --topbar-h: 58px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(79,70,229,0.08);
    --shadow-md: 0 4px 12px rgba(79,70,229,0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.eb-nav-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 1px 6px rgba(0,0,0,.15);
}

.sidebar-logo {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

    .sidebar-logo .logo-box {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 18px;
        flex-shrink: 0;
    }

    .sidebar-logo .logo-name {
        font-size: 15px;
        font-weight: 600;
    }

    .sidebar-logo .logo-sub {
        font-size: 11px;
        color: var(--text-muted);
    }

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

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--text-light);
    text-transform: uppercase;
    padding: 12px 10px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 13.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s;
    margin-bottom: 2px;
}

    .nav-link:hover {
        background: var(--surface2);
        color: var(--text);
        text-decoration: none;
    }

    .nav-link.active {
        background: var(--primary-light);
        color: var(--primary);
        font-weight: 500;
    }

    .nav-link .nav-icon {
        font-size: 17px;
        width: 20px;
        text-align: center;
    }

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── TOPBAR ── */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-w);
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 90;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ── MAIN CONTENT ── */
.main-wrapper {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    min-height: 100vh;
}

.page-content {
    padding: 28px;
}

/* ── PAGE HEADER ── */
.page-header {
    margin-bottom: 24px;
}

    .page-header h2 {
        font-size: 20px;
        font-weight: 600;
    }

    .page-header p {
        font-size: 13px;
        color: var(--text-muted);
        margin-top: 3px;
    }

/* ── CARDS ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
}

/* ── METRIC CARDS ── */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.metric-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 10px;
}

    .metric-icon.purple {
        background: var(--primary-light);
    }

    .metric-icon.green {
        background: var(--success-light);
    }

    .metric-icon.amber {
        background: #FFFBEB;
    }

    .metric-icon.teal {
        background: #ECFEFF;
    }

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
}

/* ── TABLES ── */
.table-wrap {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    table.data-table thead th {
        text-align: left;
        padding: 10px 14px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--text-muted);
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }

    table.data-table tbody td {
        padding: 11px 14px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    table.data-table tbody tr:last-child td {
        border-bottom: none;
    }

    table.data-table tbody tr:hover td {
        background: var(--surface2);
    }

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-silver {
    background: #F1F5F9;
    color: #475569;
}

.badge-gold {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.badge-platinum {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge-success {
    background: var(--success-light);
    color: #065F46;
}

.badge-danger {
    background: var(--danger-light);
    color: #991B1B;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
}

    .btn:hover {
        text-decoration: none;
    }

    .btn:active {
        transform: scale(.98);
    }

.btn-primary {
    background: var(--primary);
    color: #fff !important;
}

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text) !important;
}

    .btn-outline:hover {
        background: var(--surface2);
    }

.btn-danger {
    background: var(--danger);
    color: #fff !important;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 11px 24px;
    font-size: 15px;
}

/* ── FORMS ── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s;
    outline: none;
}

    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(79,70,229,.1);
    }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-success {
    background: var(--success-light);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-danger {
    background: var(--danger-light);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid #C7D2FE;
}

/* ── CHART ── */
.chart-container {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    height: 130px;
    padding: 0 4px;
}

.chart-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-fill {
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: var(--primary);
    min-height: 4px;
}

.chart-bar-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.chart-bar-val {
    font-size: 11px;
    font-weight: 600;
}

/* ── RECEIPT ── */
.receipt-box {
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.receipt-head {
    background: var(--primary);
    color: #fff;
    padding: 18px 24px;
}

    .receipt-head h3 {
        font-size: 16px;
        font-weight: 600;
    }

    .receipt-head p {
        font-size: 12px;
        opacity: .75;
        margin-top: 2px;
    }

.receipt-body {
    padding: 20px 24px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

    .receipt-row.muted {
        color: var(--text-muted);
    }

    .receipt-row.total {
        font-weight: 600;
        font-size: 15px;
        border-top: 2px solid var(--border);
        padding-top: 10px;
        margin-top: 6px;
    }

.receipt-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* ── CART ── */
.cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

    .cart-item:last-child {
        border-bottom: none;
    }

.cart-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
}

.cart-name {
    font-size: 13px;
    font-weight: 500;
}

.cart-price {
    font-size: 12px;
    color: var(--text-muted);
}

.cart-total {
    font-size: 13px;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

.qty-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 10px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all .1s;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}

    .qty-btn:hover {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

.qty-val {
    font-size: 13px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* ── AUTH PAGE ── */
.auth-page {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.auth-logo-box {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
}

.auth-logo h1 {
    font-size: 17px;
    font-weight: 600;
}

.auth-logo p {
    font-size: 12px;
    color: var(--text-muted);
}

.auth-heading {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.auth-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ── MISC ── */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.ml-auto {
    margin-left: auto;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
    font-size: 12px;
}

.mono {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.search-wrap {
    position: relative;
}

    .search-wrap input {
        padding-left: 34px;
        width: 220px;
    }

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.print-only {
    display: none;
}

@media print {
    .sidebar, .topbar, .no-print {
        display: none !important;
    }

    .main-wrapper {
        margin: 0;
        padding: 0;
    }

    .print-only {
        display: block;
    }
}
