:root {
    --pink: #e8b4b8;
    --pink-dark: #d4a0a5;
    --cream: #faf6f0;
    --gold: #c9a962;
    --gold-light: #e8d5a3;
    --text: #2c2c2c;
    --text-muted: #6b6b6b;
    --sidebar-width: 260px;
    --border: #eee5e0;
    --shadow: 0 2px 12px rgba(44, 44, 44, 0.06);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--cream);
    margin: 0;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cream) 0%, #f5e6e8 50%, var(--pink) 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
}

.login-card .brand-icon {
    font-size: 3rem;
    color: var(--gold);
}

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.sidebar-brand i { font-size: 1.5rem; color: var(--gold); }
.brand-logo { max-height: 36px; width: auto; }

.sidebar-nav {
    padding: 1rem 0.75rem;
    overflow-y: auto;
    flex: 1;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 2px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover:not(.active) {
    background: var(--cream);
    color: var(--text);
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link.active:hover {
    background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
    color: #fff;
}

.sidebar-nav .nav-link.nav-highlight {
    font-weight: 600;
    border: 1px solid var(--gold-light);
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    background: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.content-area { padding: 1.5rem; flex: 1; }
.content-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #fff;
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    height: 100%;
}

.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.bg-pink-soft { background: rgba(232, 180, 184, 0.3); color: var(--pink-dark); }
.bg-gold-soft { background: rgba(201, 169, 98, 0.2); color: #8b7340; }
.bg-cream-soft { background: var(--cream); color: var(--text-muted); }

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink-dark), var(--pink));
    border: none;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--pink), var(--pink-dark));
    color: #fff;
}

.btn-gold {
    background: var(--gold);
    border: none;
    color: #fff;
}

.btn-gold:hover { background: #b8944f; color: #fff; }

.table { font-size: 0.9rem; }
.table thead th {
    background: var(--cream);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-critical { background: #dc3545; }
.badge-low { background: #ffc107; color: #000; }

/* POS */
.pos-page .content-area { padding: 0; }
.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    height: calc(100vh - 60px);
    gap: 0;
}

.pos-left {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    background: var(--cream);
}

.pos-search input {
    font-size: 1.25rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gold);
    border-radius: 10px;
}

.pos-cart {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.pos-right {
    background: #fff;
    border-left: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.pos-totals .total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.95rem;
}

.pos-totals .grand-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    border-top: 2px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

/* Receipt print */
@media print {
    body * { visibility: hidden; }
    .receipt-print, .receipt-print * { visibility: visible; }
    .receipt-print { position: absolute; left: 0; top: 0; width: 80mm; }
    .no-print { display: none !important; }
}

.receipt-thermal { width: 80mm; font-family: monospace; font-size: 12px; }
.receipt-thermal .center { text-align: center; }
.receipt-thermal hr { border: 1px dashed #000; }

/* Barcode label */
.barcode-label {
    width: 50mm;
    padding: 4mm;
    border: 1px dashed #ccc;
    text-align: center;
    page-break-inside: avoid;
    margin: 2mm;
    display: inline-block;
}

.barcode-label .store { font-size: 10px; font-weight: bold; }
.barcode-label .name { font-size: 9px; margin: 2px 0; }
.barcode-label .price { font-size: 14px; font-weight: bold; color: var(--gold); }
.barcode-label .meta { font-size: 8px; color: #666; }

/* Mobile */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .pos-container { grid-template-columns: 1fr; height: auto; }
}

.form-control:focus, .form-select:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 0.2rem rgba(232, 180, 184, 0.35);
}

.product-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }

.page-toolbar-title {
    font-size: 1.35rem;
    font-weight: 600;
}

.badge.bg-gold {
    background: var(--gold-light) !important;
    color: #5c4d28;
}
