:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --primary-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: rgba(99, 102, 241, 0.18);
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #059669;
    --success-bg: #ecfdf5;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --info: #0284c7;
    --info-bg: #f0f9ff;
    --radius: 16px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
}

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

html, body { height: 100%; }

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ============ LAYOUT ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 264px;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.25s ease;
}

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

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-grad);
    display: grid;
    place-items: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99,102,241,0.45);
}

.brand-logo.brand-logo-img {
    background: #fff;
    box-shadow: none;
    border: 1px solid var(--border);
    padding: 4px;
    overflow: hidden;
}
.brand-logo.brand-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.brand-logo.logo-flat {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}
.login-logo {
    width: 64px;
    height: 64px;
}
.receipt-logo {
    max-width: 100%;
    height: 56px;
    object-fit: contain;
    margin-bottom: 6px;
}

.brand-name { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #94a3b8; }

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

.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #64748b; padding: 12px 12px 6px; font-weight: 700; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    margin-bottom: 2px;
    color: #cbd5e1;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover { background: var(--sidebar-hover); color: #fff; }

.nav-link.active {
    background: var(--sidebar-active);
    color: #a5b4fc;
    border-left-color: var(--primary-light);
}

.nav-link svg { flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--primary-light); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 999px; }

.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 11px; color: #64748b; }

.main { flex: 1; margin-left: 264px; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar .page-sub { font-size: 12px; color: var(--text-muted); }

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

.btn-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-muted);
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1px solid var(--border); border-radius: 999px; background: #fff; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-chip .user-name { font-size: 13px; font-weight: 600; }

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

/* ============ CARDS ============ */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 22px; }
.card-body.no-pad { padding: 0; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.card-sub { font-size: 12px; color: var(--text-muted); }

.grid { display: grid; gap: 20px; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .grid-cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

/* Stat cards */
.stat-card { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-card-md { padding: 14px; gap: 16px; }
.stat-trend { font-size: 11px; font-weight: 600; margin-top: 2px; }

.bg-primary { background: var(--primary-grad); }
.bg-success { background: linear-gradient(135deg, #059669, #10b981); }
.bg-warning { background: linear-gradient(135deg, #d97706, #f59e0b); }
.bg-info { background: linear-gradient(135deg, #0284c7, #0ea5e9); }
.bg-danger { background: linear-gradient(135deg, #dc2626, #ef4444); }
.bg-purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.bg-pink { background: linear-gradient(135deg, #db2777, #ec4899); }

.text-primary { color: var(--primary-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,0.35); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-success { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.btn-success:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-danger-solid { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 12px; }

.btn-print { background: linear-gradient(135deg, #0891b2, #06b6d4); color: #fff; box-shadow: 0 4px 14px rgba(8,145,178,0.35); }
.btn-print:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-label .req { color: var(--danger); }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 90px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: 10px 0 0 10px; }
.input-group .input-addon { background: var(--bg); border: 1px solid var(--border); border-left: none; border-radius: 0 10px 10px 0; padding: 10px 14px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; }

.form-help { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; font-weight: 500; }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ============ TABLES ============ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    padding: 12px 18px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 13px 18px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }

.avatar-sm { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: var(--bg); display: grid; place-items: center; color: var(--text-muted); }

/* ============ BADGES ============ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: #eef2ff; color: var(--primary-dark); }
.badge-muted { background: #f1f5f9; color: var(--text-muted); }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ============ ALERTS ============ */
.alert { padding: 14px 18px; border-radius: 12px; font-size: 13px; font-weight: 500; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--info-bg); color: #075985; border-color: #bae6fd; }

/* ============ SEARCH BAR ============ */
.search-bar { position: relative; flex: 1; max-width: 420px; }
.search-bar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-bar .form-control { padding-left: 40px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }

/* ============ PAGINATION ============ */
.pagination { display: flex; gap: 6px; margin-top: 20px; justify-content: center; }
.pagination a, .pagination span { padding: 8px 13px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 13px; font-weight: 600; color: var(--text); }
.pagination a:hover { background: var(--bg); }
.pagination .active span, .pagination .disabled span { background: var(--primary-grad); color: #fff; border-color: transparent; }

/* ============ LOGIN ============ */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: #0f172a;
}
.auth-side {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
}
.auth-side-image {
    position: relative;
    height: 50%;
    min-height: 280px;
    background:
        linear-gradient(180deg, rgba(15,23,42,0.35) 0%, rgba(15,23,42,0.85) 100%),
        url('/bck.jpeg') center / cover no-repeat;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
}
.auth-side-bottom {
    height: 50%;
    padding: 32px 40px 24px;
    display: flex;
    flex-direction: column;
    overflow: auto;
}
.auth-side h2 { font-size: 30px; font-weight: 800; line-height: 1.25; margin: 18px 0 12px; }
.auth-side p { color: #a5b4fc; max-width: 440px; }
.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background:
        radial-gradient(at 15% 10%, rgba(99,102,241,0.12) 0, transparent 45%),
        radial-gradient(at 90% 90%, rgba(124,58,237,0.10) 0, transparent 45%),
        linear-gradient(160deg, #eef2ff 0%, #f8fafc 55%, #e0e7ff 100%);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #e0f2fe;
    border-radius: 22px;
    padding: 42px 40px;
    box-shadow: 0 25px 60px -12px rgba(30, 41, 59, 0.25);
    border: 1px solid rgba(14,165,233,0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}
.auth-card .brand-logo { width: 64px; height: 64px; margin: 0 auto 16px; }
.auth-card h1 { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.auth-card .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.auth-card .alert,
.auth-card form .form-group,
.auth-card form .flex { text-align: left; }
.auth-card .form-label { color: var(--text); font-weight: 600; }
.auth-card .form-control {
    background: #f8fafc;
    border-color: var(--border);
    color: var(--text);
}
.auth-card .form-control::placeholder { color: #94a3b8; }
.auth-card .form-control:focus {
    background: #fff;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.auth-card .form-check span { color: var(--text-muted); }
.auth-card .btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    border-color: #0ea5e9;
}
.auth-card .btn-primary:hover {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    border-color: #0284c7;
}
.auth-footer { font-size: 12px; color: #94a3b8; margin-top: 16px; }

.auth-chart-head { margin-bottom: 14px; }
.auth-chart-title { font-size: 16px; font-weight: 700; }
.auth-chart-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.auth-chart { flex: 1; min-height: 150px; position: relative; }
.auth-chart canvas { width: 100% !important; height: 100% !important; }

.auth-mini-stats {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.mini-stat {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
    text-align: center;
}
.mini-stat-value { font-size: 16px; font-weight: 800; color: #fff; }
.mini-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: #94a3b8; margin-top: 2px; }

.auth-brand .brand-logo { width: 68px; height: 68px; }
.auth-brand .brand-name { font-size: 28px; font-weight: 800; }
.auth-brand .brand-sub { font-size: 14px; }
.auth-side-image,
.auth-chart-head,
.auth-mini-stats,
.auth-footer { animation: fadeUp 0.7s ease both; }
.auth-chart-head { animation-delay: 0.1s; }
.auth-chart { animation: fadeUp 0.7s ease 0.2s both; }
.auth-mini-stats { animation-delay: 0.3s; }
.auth-footer { animation-delay: 0.4s; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}

/* ============ CUSTOMER PICKER (autocomplete) ============ */
.customer-picker { position: relative; }
.customer-picker-control { position: relative; }
.customer-picker-control .form-control { padding-right: 36px; }
.customer-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: grid;
    place-items: center;
}
.customer-clear:hover { background: #e2e8f0; color: var(--text); }
.customer-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 30;
    max-height: 260px;
    overflow-y: auto;
}
.customer-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.12s ease;
}
.customer-option:hover { background: #eef2ff; }
.customer-option + .customer-option { border-top: 1px solid var(--border); }
.customer-option .co-name { font-weight: 600; color: var(--text); }
.customer-option .co-tel { color: var(--text-muted); font-size: 12px; }
.customer-option.empty { justify-content: center; color: var(--text-muted); font-size: 12px; cursor: default; }
.customer-selected {
    margin-top: 8px;
    padding: 8px 12px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
}

/* ============ PRODUCT CARDS ============ */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; cursor: pointer; transition: all 0.15s ease; position: relative; }
.product-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.product-card .thumb { height: 130px; background: #f8fafc; display: grid; place-items: center; color: #94a3b8; position: relative; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb .pcode { position: absolute; top: 10px; left: 10px; background: rgba(15,23,42,0.75); color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 6px; font-weight: 700; letter-spacing: 0.5px; }
.product-card .thumb .stock-chip { position: absolute; top: 10px; right: 10px; font-size: 10px; padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.product-info { padding: 12px 14px; }
.product-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.product-spec { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.product-price { font-weight: 800; color: var(--primary-dark); font-size: 15px; }
.product-card.selected { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }

/* ============ CART (POS) ============ */
.pos-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .pos-layout { grid-template-columns: 1fr; } }
.cart-panel { position: sticky; top: 84px; }
.cart-items { max-height: 300px; overflow-y: auto; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; background: #f8fafc; }
.cart-item .qty-ctrl { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 700; font-size: 15px; display: grid; place-items: center; color: var(--text); }
.qty-btn:hover { background: var(--bg); }
.qty-val { font-weight: 700; min-width: 22px; text-align: center; }
.cart-item .name { font-size: 13px; font-weight: 600; }
.cart-item .price { font-size: 12px; color: var(--text-muted); }
.cart-total-line { display: flex; justify-content: space-between; padding: 10px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.cart-total-line:last-child { border-bottom: none; }
.cart-total-line strong { font-weight: 800; }
.cart-grand { font-size: 20px; font-weight: 800; color: var(--primary-dark); }

/* ============ RECEIPT ============ */
.receipt-paper {
    width: 58mm;
    margin: 0 auto;
    background: #fff;
    padding: 6px 8px;
    font-family: "Consolas", "Courier New", monospace;
    color: #000;
    font-size: 10px;
    line-height: 1.5;
    box-shadow: var(--shadow-lg);
}
.receipt-header { text-align: center; border-bottom: 2px dashed #000; padding-bottom: 6px; margin-bottom: 6px; }
.receipt-header .store { font-size: 13px; font-weight: 800; letter-spacing: 1px; }
.receipt-header .addr { font-size: 8px; }
.receipt-dashed { border-top: 1px dashed #000; margin: 6px 0; }
.receipt-row { display: flex; justify-content: space-between; gap: 6px; font-size: 10px; }
.receipt-item { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 2px; font-size: 10px; }
.receipt-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 12px; }
.receipt-center { text-align: center; font-size: 8px; }
.receipt-center b { font-size: 9px; }
.struck-label { font-size: 10px; font-weight: 800; letter-spacing: 1px; margin-top: 3px; }
.receipt-qr { text-align: center; margin-top: 6px; }
.receipt-qr svg { display: inline-block; }

/* ============ MISC ============ */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; }
.ml-auto { margin-left: auto; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-11 { font-size: 11px; } .fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-15 { font-size: 15px; } .fs-18 { font-size: 18px; } .fs-24 { font-size: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { margin-bottom: 12px; color: #cbd5e1; }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }

.login-hint { margin-top: 22px; padding: 14px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 12px; font-size: 12px; color: var(--text-muted); }
.login-hint strong { color: var(--text); }

.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 13px; }
.detail-grid .k { color: var(--text-muted); }
.detail-grid .v { font-weight: 600; }

.chart-box { position: relative; height: 300px; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .content { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .menu-toggle { display: grid !important; }
}
.menu-toggle { display: none; }

/* Overlay for mobile */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 35; display: none; }
.sidebar-overlay.show { display: block; }
@media (min-width: 769px) { .sidebar-overlay { display: none !important; } }

/* Print */
@page { margin: 0; size: 58mm auto; }
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin-left: 0; }
    .content { padding: 0; }
    body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .receipt-paper {
        box-shadow: none; width: 58mm; max-width: 58mm; padding: 4px 6px;
        font-size: 11px; color: #000; font-weight: 500;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .receipt-paper * { color: #000 !important; }
    .receipt-paper .store { font-size: 14px; font-weight: 900; letter-spacing: 1px; }
    .receipt-paper .addr { font-size: 9px; font-weight: 600; }
    .receipt-paper .receipt-total { font-size: 13px; font-weight: 900; }
    .receipt-paper .struck-label { font-size: 11px; font-weight: 900; letter-spacing: 1px; }
    .receipt-paper .receipt-row { font-weight: 600; }
    .receipt-paper .receipt-item { font-weight: 600; }
    .receipt-paper .receipt-center { font-weight: 600; }
    .receipt-paper .receipt-center b { font-weight: 900; font-size: 10px; }
}
