:root {
    --pos-primary: #2563eb;
    --pos-primary-dark: #1d4ed8;
    --pos-bg: #f4f7fb;
    --pos-text: #172033;
    --pos-muted: #64748b;
    --pos-border: #e5eaf1;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }
body { color: var(--pos-text); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
.app-body { background: var(--pos-bg); }
.login-body { background: radial-gradient(circle at top left, #dbeafe 0, #f8fafc 42%, #eef2ff 100%); }
.login-card, .panel-card, .stat-card { border: 1px solid var(--pos-border) !important; border-radius: 1rem; }
.login-card { overflow: hidden; }
.brand-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--pos-primary); color: #fff; font-size: 1.75rem; box-shadow: 0 12px 24px rgba(37, 99, 235, .22); }
.brand-mark-sm { width: 42px; height: 42px; border-radius: 13px; font-size: 1.15rem; box-shadow: none; flex: 0 0 auto; }
.btn-primary { background: var(--pos-primary); border-color: var(--pos-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--pos-primary-dark); border-color: var(--pos-primary-dark); }
.form-control:focus, .form-check-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 .25rem rgba(37,99,235,.12); }

.sidebar { width: var(--sidebar-width); flex: 0 0 var(--sidebar-width); background: #111827; color: #fff; position: sticky; top: 0; height: 100vh; }
.sidebar-mobile { width: min(86vw, 310px) !important; }
.sidebar-mobile .sidebar-nav { background: #111827; }
.sidebar-mobile .sidebar-footer { background: #111827; }
.sidebar-brand { height: 81px; padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand span { color: #94a3b8; font-size: .75rem; }
.sidebar-nav { overflow-y: auto; }
.menu-label { padding: .5rem .75rem; color: #64748b; font-size: .68rem; font-weight: 800; letter-spacing: .1em; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .8rem; color: #cbd5e1; border-radius: .7rem; padding: .75rem; margin: .2rem 0; font-weight: 500; }
.sidebar-nav .nav-link i { font-size: 1.12rem; width: 22px; text-align: center; }
.sidebar-nav .nav-link small { margin-left: auto; color: #64748b; font-size: .68rem; }
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-nav .nav-link.active { color: #fff; background: var(--pos-primary); }
.sidebar-nav .nav-link.disabled { opacity: .55; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); }
.role-card { display: flex; align-items: center; gap: .75rem; color: #fff; }
.role-card span:not(.avatar) { color: #94a3b8; font-size: .75rem; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #dbeafe; color: var(--pos-primary); font-weight: 800; flex: 0 0 auto; }
.topbar { min-height: 81px; }
.main-wrapper { min-width: 0; }
.content-area { max-width: 1500px; margin: 0 auto; }
.role-label { font-size: .68rem; }
.eyebrow { color: var(--pos-primary); font-size: .72rem; font-weight: 800; letter-spacing: .11em; }
.stat-card { box-shadow: 0 2px 8px rgba(15,23,42,.035); transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,23,42,.07); }
.stat-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; font-size: 1.3rem; flex: 0 0 auto; }
.tone-primary { background: #dbeafe; color: #2563eb; }
.tone-success { background: #dcfce7; color: #16a34a; }
.tone-warning { background: #fef3c7; color: #d97706; }
.tone-info { background: #cffafe; color: #0891b2; }
.tone-danger { background: #fee2e2; color: #dc2626; }
.tone-purple { background: #ede9fe; color: #7c3aed; }
.panel-card { box-shadow: 0 2px 8px rgba(15,23,42,.035); }
.chart-placeholder { height: 210px; display: flex; align-items: end; gap: clamp(.5rem, 3vw, 1.25rem); padding-top: 1rem; border-bottom: 1px solid var(--pos-border); background: repeating-linear-gradient(to bottom, transparent 0, transparent 51px, #eef2f7 52px); }
.chart-column { flex: 1; height: 100%; display: flex; align-items: end; justify-content: center; }
.chart-column span { display: block; width: min(100%, 38px); background: linear-gradient(180deg, #60a5fa, #2563eb); border-radius: .45rem .45rem 0 0; }
.empty-icon { width: 58px; height: 58px; display: inline-grid; place-items: center; border-radius: 18px; background: #eff6ff; color: var(--pos-primary); font-size: 1.45rem; }
.empty-icon.large { width: 78px; height: 78px; font-size: 2rem; border-radius: 24px; }
.open-pos-card { display: flex; align-items: center; justify-content: space-between; color: #fff; padding: 1.5rem; border-radius: 1.2rem; background: linear-gradient(120deg, #1d4ed8, #3b82f6); box-shadow: 0 12px 28px rgba(37,99,235,.22); }
.open-pos-card:hover { color: #fff; background: linear-gradient(120deg, #1e40af, #2563eb); }
.open-pos-card > i { font-size: 2rem; }
.open-pos-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; background: rgba(255,255,255,.16); border-radius: 14px; margin-bottom: .8rem; font-size: 1.3rem; }
.open-pos-card p { color: #dbeafe; }
.open-pos-card h2 { font-size: clamp(1.3rem, 4vw, 1.8rem); font-weight: 800; letter-spacing: .03em; }
.module-description { max-width: 540px; }
.min-w-0 { min-width: 0; }
.report-switch .nav-link { color: var(--pos-muted); font-weight: 600; }
.report-switch .nav-link.active { color: #fff; background: var(--pos-primary); }

.product-card { border: 1px solid var(--pos-border); border-radius: 1rem; transition: transform .15s ease, box-shadow .15s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.product-card.out-of-stock { opacity: .62; }
.product-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #eff6ff; color: var(--pos-primary); font-size: 1.15rem; }
.product-name { min-height: 2.4em; }
.pos-cart-card { position: sticky; top: 98px; overflow: hidden; }
.cart-items { max-height: 46vh; overflow-y: auto; }
.cart-qty { width: 68px; }
.change-box { background: #ecfdf5; color: #047857; }
.receipt-paper { width: min(100%, 460px); background: #fff; border: 1px solid var(--pos-border); border-radius: 1rem; padding: 2rem; box-shadow: 0 8px 30px rgba(15,23,42,.08); }
.table > :not(caption) > * > * { padding: .9rem 1rem; }
.table thead th { color: var(--pos-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; white-space: nowrap; }

.mobile-bottom-nav { position: fixed; z-index: 1025; left: 0; right: 0; bottom: 0; height: 68px; display: flex; justify-content: space-around; align-items: stretch; background: #fff; border-top: 1px solid var(--pos-border); padding-bottom: env(safe-area-inset-bottom); }
.mobile-bottom-nav a, .mobile-bottom-nav button { flex: 1; border: 0; background: transparent; color: #64748b; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; font-size: .68rem; }
.mobile-bottom-nav i { font-size: 1.2rem; }
.mobile-bottom-nav .active { color: var(--pos-primary); font-weight: 700; }
.pb-mobile-nav { padding-bottom: 88px !important; }

@media (min-width: 992px) {
    .pb-mobile-nav { padding-bottom: 1.5rem !important; }
}

@media (max-width: 575.98px) {
    .topbar { min-height: 64px; }
    .content-area { padding-left: .85rem !important; padding-right: .85rem !important; }
    .page-heading h1 { font-size: 1.45rem; }
    .stat-card .card-body { padding: .9rem; }
    .stat-icon { width: 46px; height: 46px; border-radius: 13px; }
    .open-pos-card { padding: 1.2rem; }
    .product-card .card-body { padding: .85rem; }
    .product-name { font-size: .9rem; }
    .receipt-paper { padding: 1.25rem; }
}

@media print {
    .sidebar, .topbar, .mobile-bottom-nav { display: none !important; }
    .content-area { padding: 0 !important; }
    .receipt-actions, .alert { display: none !important; }
    .receipt-paper { box-shadow: none; border: 0; width: 80mm; padding: 0; }
    body, .app-body { background: #fff !important; }
}
