:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #1e293b;
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: "Segoe UI", "Segoe UI Emoji", "Noto Sans Bengali", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }

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

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0; bottom: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.2s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand .logo {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
    flex-shrink: 0;
}
.brand .name { color: #fff; font-weight: 700; font-size: 13px; line-height: 1.3; word-break: break-word; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.invoice-logo { width: 56px; height: 56px; object-fit: contain; display: block; margin-bottom: 7px; }

.logo-preview {
    width: 64px; height: 64px; border-radius: 12px;
    background: var(--primary); display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 30px; overflow: hidden; flex-shrink: 0;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav .section {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 20px 5px;
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: #7dd3fc;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: 8px;
}
.nav .section:first-child { border-top: none; margin-top: 0; }
.nav .section::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(125,211,252,0.35), transparent);
}
.nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 20px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.nav a:hover { color: #fff; background: var(--sidebar-active); }
.nav a.active { color: #fff; background: var(--sidebar-active); border-left-color: var(--primary); }
.nav .icon { width: 20px; text-align: center; font-size: 15px; }

/* ---------- Sidebar accordion ---------- */
.nav a.nav-direct {
    margin: 12px 12px 6px; border-left: none; border-radius: 10px;
    padding: 10px 14px; font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
}
.nav a.nav-direct:hover { background: var(--sidebar-active); color: #fff; }
.nav a.nav-direct.active {
    background: linear-gradient(135deg, var(--primary), #0891b2);
    color: #fff; box-shadow: 0 8px 18px -8px rgba(13, 110, 253, 0.9);
}
.nav-group { margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.nav-sec {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 13px 20px 8px;
    background: none; border: none; cursor: pointer;
    font-family: inherit; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: #7dd3fc; text-align: left;
    transition: color 0.15s;
}
.nav-sec:hover { color: #fff; }
.nav-sec .chev {
    margin-left: auto; font-size: 10px;
    color: #475569; transition: transform 0.25s ease;
}
.nav-sec.open .chev { transform: rotate(180deg); color: #7dd3fc; }
.nav-links { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.28s ease; }
.nav-links-inner { overflow: hidden; min-height: 0; }
.nav-links.open { grid-template-rows: 1fr; }

.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 12px; color: #475569; }

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

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 90;
}
.topbar .hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }
.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.topbar-jar { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; color: #075985; background: #e0f2fe; border: 1px solid #bae6fd; font-size: 12px; font-weight: 800; }
.topbar-jar:hover { color: #0c4a6e; background: #bae6fd; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user-chip .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.user-chip .role { color: var(--text-muted); font-size: 11.5px; }
.btn-logout {
    background: #fee2e2; color: var(--danger);
    border: none; padding: 6px 14px; border-radius: 7px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.btn-logout:hover { background: #fecaca; }

.content { flex: 1; padding: 24px; max-width: 1280px; width: 100%; }
.system-credit { padding: 13px 24px 18px; color: #94a3b8; text-align: center; font-size: 11px; letter-spacing: .2px; }
.system-credit strong { color: #0e7490; font-weight: 800; }
.auth-credit { position: fixed; right: 0; bottom: 12px; left: 0; }

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 18px; }

/* ---------- Stat cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
}
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-card .stat-value { font-size: 21px; font-weight: 800; line-height: 1.2; }
.stat-card .stat-label { color: var(--text-muted); font-size: 12.5px; }
.dashboard-stat-link { color: inherit; position: relative; transition: transform .15s ease, box-shadow .15s ease; }
.dashboard-stat-link:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 23, 42, .1); }
.dashboard-stat-arrow { margin-left: auto; color: #b45309; font-size: 18px; font-weight: 700; }

.bg-blue { background: #dbeafe; color: #1d4ed8; }
.bg-green { background: #dcfce7; color: #15803d; }
.bg-red { background: #fee2e2; color: #b91c1c; }
.bg-amber { background: #fef3c7; color: #b45309; }
.bg-cyan { background: #cffafe; color: #0e7490; }
.bg-purple { background: #ede9fe; color: #6d28d9; }

/* ---------- Dashboard hero ---------- */
.dash-hero {
    position: relative; overflow: hidden;
    display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    background: linear-gradient(120deg, #0f172a 0%, #1d4ed8 60%, #0891b2 120%);
    border-radius: 16px; padding: 26px 28px; margin-bottom: 20px;
    color: #fff;
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.35; pointer-events: none; }
.hero-glow.glow-1 { width: 220px; height: 220px; background: #38bdf8; top: -70px; right: -40px; }
.hero-glow.glow-2 { width: 160px; height: 160px; background: #818cf8; bottom: -60px; left: 30%; }
.hero-glow.glow-3 { width: 120px; height: 120px; background: #22d3ee; top: 40%; right: 35%; }
.hero-drop {
    position: absolute; right: -14px; bottom: -30px;
    font-size: 170px; opacity: 0.08; line-height: 1; pointer-events: none;
    transform: rotate(-12deg);
}
.hero-wave {
    position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
    background: radial-gradient(circle at 12px -6px, transparent 12px, rgba(255,255,255,0.05) 13px) repeat-x;
    background-size: 24px 26px; opacity: 0.7; pointer-events: none;
}
.dash-hero-left { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dash-hello { display: flex; align-items: center; gap: 14px; }
.dash-avatar {
    width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    border: 3px solid rgba(255,255,255,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 800; color: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.dash-eyebrow { font-size: 10.5px; letter-spacing: 2px; font-weight: 700; color: #93c5fd; text-transform: uppercase; margin-bottom: 2px; }
.dash-greet { font-size: 20px; font-weight: 800; line-height: 1.3; word-break: break-word; }
.dash-name { color: #7dd3fc; }
.dash-date { font-size: 13px; color: #bfdbfe; display: flex; align-items: center; gap: 6px; }
.dash-time {
    background: rgba(255,255,255,0.14); padding: 1px 8px; border-radius: 20px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
}
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
    color: #fff; padding: 9px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 600; text-decoration: none;
    transition: all 0.15s; backdrop-filter: blur(4px);
}
.hero-btn:hover { background: rgba(255,255,255,0.22); color: #fff; transform: translateY(-1px); }
.hero-btn-solid { background: #fff; border-color: #fff; color: #1e3a8a; }
.hero-btn-solid:hover { background: #e0f2fe; color: #1e3a8a; }
.dash-pos {
    position: relative; z-index: 1; margin: auto;
    display: flex; align-items: center; gap: 14px;
    padding: 16px 26px; border-radius: 18px; text-decoration: none; color: #fff;
    background: linear-gradient(135deg, #22d3ee, #2563eb);
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 14px 30px -10px rgba(34,211,238,0.7), inset 0 1px 0 rgba(255,255,255,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}
.dash-pos:hover { transform: translateY(-3px) scale(1.02); color: #fff; box-shadow: 0 22px 42px -12px rgba(34,211,238,0.85); }
.pos-icon {
    width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
    background: rgba(255,255,255,0.22); border: 1px solid rgba(255,255,255,0.35);
    display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.pos-text { display: flex; flex-direction: column; }
.pos-title { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: 1px; }
.pos-sub { font-size: 12px; opacity: 0.9; margin-top: 3px; }
.pos-go { font-size: 24px; margin-left: 4px; opacity: 0.95; }
@media (max-width: 900px) { .dash-pos { width: 100%; justify-content: center; } }
.dash-net {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px; padding: 18px 20px; min-width: 270px;
    display: flex; flex-direction: column; justify-content: center;
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.dash-net-head { display: flex; align-items: center; gap: 8px; }
.dash-net-ico {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    background: rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.dash-net-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: #bfdbfe; font-weight: 700; }
.dash-net-value { font-size: 28px; font-weight: 800; line-height: 1.2; margin: 4px 0; }
.dash-net-sub { font-size: 12px; color: #dbeafe; opacity: 0.95; }

.stat-card .stat-meta { min-width: 0; }
.stat-card .stat-value { white-space: nowrap; }

/* ---------- Dashboard list rows ---------- */
.list-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row .fw-bold { word-break: break-word; }

/* ---------- Dashboard chart ---------- */
.chart {
    display: flex; align-items: flex-end; gap: 10px;
    height: 190px; padding: 10px 4px 0;
}
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-width: 0; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar {
    width: 100%; max-width: 44px; border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, var(--primary) 0%, #38bdf8 100%);
    position: relative; min-height: 6px;
    transition: height 0.3s ease;
}
.chart-val {
    position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
    font-size: 10.5px; font-weight: 700; color: var(--text-muted); white-space: nowrap;
}
.chart-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }

/* ---------- Dashboard overview ---------- */
.overview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.overview-item {
    display: flex; align-items: center; gap: 12px;
    background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
    padding: 14px; min-width: 0;
}
.overview-icon {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.overview-value { font-size: 17px; font-weight: 800; line-height: 1.2; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px;
    font-size: 13.5px; font-weight: 600;
    border: 1px solid transparent; cursor: pointer;
    transition: all 0.15s; text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: var(--warning); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #0e7490; color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table {
    width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.table thead th {
    text-align: left; padding: 11px 14px;
    background: #f8fafc; border-bottom: 1px solid var(--border);
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
    white-space: nowrap;
}
.table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table .num { text-align: right; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 11.5px; font-weight: 700;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.form-control {
    padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text);
    width: 100%;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,0.12); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 18px;
    font-size: 13.5px; font-weight: 500;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

/* ---------- Invoice ---------- */
.invoice-box {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px; max-width: 800px; margin: 0 auto;
}
.invoice-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.invoice-title { font-size: 26px; font-weight: 800; color: var(--primary); }
.meta-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.meta-row .k { color: var(--text-muted); }
.invoice-total-row { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--border); font-weight: 700; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; font-weight: 800; }
.page-head .sub { color: var(--text-muted); font-size: 13px; }
.report-tabs {
    display: flex; gap: 8px; flex-wrap: wrap;
    background: var(--sidebar, #0f172a); padding: 6px; border-radius: 10px;
    margin-bottom: 20px; width: fit-content; max-width: 100%;
}
.report-tabs a {
    padding: 8px 16px; border-radius: 7px;
    color: #cbd5e1; font-size: 13px; font-weight: 600;
    transition: all 0.15s;
}
.report-tabs a:hover { color: #fff; }
.report-tabs a.active { background: var(--primary); color: #fff; }

/* ---------- Grid & misc ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-bottom: 24px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 10px; }
.gap-1 { gap: 6px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 22px; }
.mt-3 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.small { font-size: 12px; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.filters .form-group { min-width: 180px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty .icon { font-size: 42px; margin-bottom: 10px; }

/* ---------- Print ---------- */
.pagination { display: flex; gap: 6px; list-style: none; flex-wrap: wrap; }
.pagination .page-item span, .pagination .page-item a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 7px;
    font-size: 13px; font-weight: 600; color: var(--text);
    background: #fff;
}
.pagination .page-item a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-item.active span { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .page-item.disabled span { opacity: 0.5; cursor: not-allowed; }
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0; max-width: none; }
    .invoice-box { border: none; padding: 0; }
}

/* ---------- Sidebar overlay ---------- */
.overlay { display: none; }
.sidebar-close {
    display: none; position: absolute; top: 14px; right: 12px;
    background: none; border: none; color: var(--sidebar-text);
    font-size: 16px; cursor: pointer; z-index: 2;
    width: 30px; height: 30px; border-radius: 8px;
    align-items: center; justify-content: center;
}
.sidebar-close:hover { background: var(--sidebar-active); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .grid-2-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.45); }
    .sidebar-close { display: flex; }
    .main { margin-left: 0; }
    .topbar .hamburger { display: block; }
    .content { padding: 16px; }
    .overlay {
        display: block; position: fixed; inset: 0;
        background: rgba(15,23,42,0.55); z-index: 99;
        opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
    }
    .overlay.show { opacity: 1; pointer-events: auto; }
    .dash-hero { padding: 18px; }
    .dash-greet { font-size: 16px; }
    .hero-btn { flex: 1; justify-content: center; }
    .dash-hero-left { gap: 14px; }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
    .stat-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
    .stat-card .stat-icon { width: 38px; height: 38px; font-size: 18px; border-radius: 10px; }
    .stat-card .stat-value { font-size: 17px; white-space: normal; }
    .content { padding: 12px; }
    .topbar { padding: 0 12px; height: 54px; }
    .topbar .page-title { font-size: 15px; }
    .user-chip .user-meta { display: none; }
    .user-chip .avatar { width: 30px; height: 30px; font-size: 13px; }
    .btn-logout { padding: 6px 10px; }
    .card-header { padding: 12px 14px; }
    .card-body { padding: 14px; }
    .table thead th { padding: 9px 10px; font-size: 11px; }
    .table tbody td { padding: 9px 10px; font-size: 12.5px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-actions { flex-wrap: wrap; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .page-head h2 { font-size: 18px; }
    .filters { flex-direction: column; align-items: stretch; }
    .filters .form-group { min-width: 100%; }
    .overview-grid { gap: 10px; }
    .overview-item { padding: 12px; }
    .overview-value { font-size: 15px; }
    .chart { height: 150px; gap: 6px; }
    .chart-val { display: none; }
    .dash-net { min-width: 100%; }
    .dash-net-value { font-size: 22px; }
    .dash-actions { width: 100%; }
    .dash-avatar { width: 44px; height: 44px; font-size: 19px; }
    .hero-drop { font-size: 110px; right: -8px; bottom: -20px; }
    .grid-2 { grid-template-columns: 1fr; }
    .invoice-box { padding: 18px; }
    .invoice-title { font-size: 22px; }
}

/* ---------- Reference dashboard ---------- */
.sidebar { background:#071a2d !important; }
.brand { border-bottom-color:rgba(255,255,255,.12); }
.brand .logo { background:#087f5b; }
.nav a.nav-direct { background:rgba(255,255,255,.06); }
.nav a.nav-direct.active { background:#12a86f; box-shadow:0 8px 18px -8px rgba(0,0,0,.5); }
.nav-group { margin:8px 10px 0; border:1px solid rgba(148,183,220,.18); border-radius:9px; background:#0b1f35 !important; overflow:hidden; }
.nav-sec { color:#c4d5e8; }.nav-sec.open .chev { color:#8db5df; }
.nav-sec { padding-left:12px; padding-right:12px; }
.nav a:hover { background:#142f4d; }.nav a.active { background:#1d4f80; border-left-color:#b9d8f7; }
.sidebar-footer { border-top-color:rgba(255,255,255,.12); color:#9cc4b5; }
.dashboard-heading { position:relative; display:flex; align-items:center; justify-content:space-between; gap:28px; min-height:145px; margin-bottom:22px; padding:27px 30px; border-radius:18px; background:linear-gradient(120deg,#071a2d 0%,#0b3b55 58%,#087f6a 120%); color:#fff; box-shadow:0 12px 28px rgba(7,37,52,.18); overflow:hidden; }
.dashboard-heading::before { content:''; position:absolute; width:260px; height:260px; right:120px; top:-160px; border:34px solid rgba(109,232,201,.12); border-radius:50%; pointer-events:none; }
.dashboard-heading::after { content:''; position:absolute; width:180px; height:180px; right:-48px; bottom:-105px; border:26px solid rgba(117,211,255,.13); border-radius:50%; pointer-events:none; }
.dashboard-heading > div:first-child { position:relative; z-index:1; }
.dashboard-heading h1 { font-size:30px; line-height:1.15; margin:4px 0 8px; letter-spacing:-.7px; color:#fff; }
.eyebrow { color:#83e8c6; font-size:11px; font-weight:800; letter-spacing:1.6px; text-transform:uppercase; }
.dashboard-heading .muted { color:rgba(231,247,244,.72); font-size:12px; }
.dashboard-action { background:#087f5b; border-radius:8px; color:#fff; font-weight:700; padding:10px 16px; white-space:nowrap; box-shadow:0 5px 12px rgba(8,127,91,.2); }
.dashboard-action:hover { background:#056b4d; color:#fff; }
.dashboard-actions { position:absolute; z-index:2; left:calc(56% + 2in); top:50%; display:flex; align-items:center; gap:10px; margin:0; transform:translate(-50%, -50%); }
.new-sale-action { display:flex; align-items:center; gap:9px; padding:9px 14px; background:linear-gradient(135deg,#10a875,#087f5b); }
.new-sale-action:hover { background:linear-gradient(135deg,#0b9165,#056b4d); }
.new-sale-icon { width:28px; height:28px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.5); border-radius:50%; font-size:22px; font-weight:300; line-height:1; }
.new-sale-action span:last-child { display:flex; flex-direction:column; text-align:left; line-height:1.15; }
.new-sale-action b { font-size:12px; }.new-sale-action small { color:#c8f2df; font-size:9px; margin-top:3px; }
.dashboard-pos-action { position:relative; left:auto; bottom:auto; transform:none; display:flex; flex-direction:column; align-items:center; line-height:1.15; font-size:21px; padding:16px 32px; background:linear-gradient(135deg,#18c58b,#087f5b); border:1px solid rgba(255,255,255,.45); border-radius:14px; box-shadow:0 12px 24px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.3); backdrop-filter:blur(8px); }
.dashboard-pos-action span { color:#c3eee1; font-size:10px; font-weight:400; margin-top:4px; }
.dashboard-pos-action:hover { background:linear-gradient(135deg,#20d99b,#09936a); color:#fff; transform:translateY(-2px); }
.dashboard-stats { grid-template-columns:repeat(4, 1fr); gap:16px; margin-bottom:20px; }
.dashboard-stat { position:relative; min-height:145px; flex-direction:column; align-items:flex-start; gap:0; border:0; border-radius:16px; padding:18px 19px; color:#fff; background:var(--metric-bg); box-shadow:0 8px 18px rgba(15,35,52,.12), inset 0 1px 0 rgba(255,255,255,.2); overflow:hidden; transform:translateY(0); transition:transform .2s ease, box-shadow .2s ease; }
.dashboard-stat:hover { transform:translateY(-5px); box-shadow:0 14px 25px rgba(15,35,52,.2), inset 0 1px 0 rgba(255,255,255,.25); }
.dashboard-stat::before { content:''; position:absolute; width:150px; height:150px; right:-58px; top:-74px; border:22px solid rgba(255,255,255,.1); border-radius:50%; pointer-events:none; }
.dashboard-stat::after { content:''; position:absolute; width:80px; height:80px; right:-28px; bottom:-42px; border:14px solid rgba(255,255,255,.08); border-radius:50%; pointer-events:none; }
.dashboard-stat .stat-icon { position:relative; z-index:1; width:42px; height:42px; border-radius:12px; color:#fff !important; background:rgba(255,255,255,.18) !important; border:1px solid rgba(255,255,255,.2); font-size:18px; box-shadow:none; }
.dashboard-stat .stat-meta { position:relative; z-index:1; width:100%; display:flex; flex-direction:column; gap:3px; }
.dashboard-stat .stat-value { margin-top:15px; color:#fff; font-size:25px; letter-spacing:-.7px; }
.dashboard-stat .stat-label { order:-1; color:rgba(255,255,255,.76); white-space:nowrap; font-size:10px; font-weight:700; letter-spacing:.55px; text-transform:uppercase; }
.metric-sales { --metric:#07875e; --metric-bg:linear-gradient(135deg,#087c59,#11a777); }.metric-today { --metric:#087f9b; --metric-bg:linear-gradient(135deg,#075985,#0891b2); }.metric-due { --metric:#c17a00; --metric-bg:linear-gradient(135deg,#9a5b00,#d89211); }.metric-expense { --metric:#d13e2c; --metric-bg:linear-gradient(135deg,#a5241a,#df5843); }.metric-jar { --metric:#7252bb; --metric-bg:linear-gradient(135deg,#5936a0,#8265d1); }.metric-return { --metric:#2563a6; --metric-bg:linear-gradient(135deg,#1d4f80,#3478b5); }.metric-return-total { --metric:#d97706; --metric-bg:linear-gradient(135deg,#a34700,#e18718); }.metric-delivery { --metric:#0f766e; --metric-bg:linear-gradient(135deg,#075e59,#0f9b8f); }
.dashboard-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.dashboard-daily-area { align-items:stretch; }
.live-badge { background:#dcfce7; color:#15803d; border-radius:20px; padding:3px 9px; font-size:9px; font-weight:800; letter-spacing:1px; }
.daily-summary-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:13px 18px 18px; }
.daily-summary-item { display:flex; align-items:center; gap:10px; border-radius:10px; padding:12px; background:#f8faf9; border:1px solid #edf1ef; }.daily-summary-item div { display:flex; flex-direction:column; }.daily-summary-item strong { font-size:17px; line-height:1.15; }.daily-summary-item small { color:#7c8985; font-size:10px; margin-top:3px; }.daily-icon { width:31px; height:31px; border-radius:9px; display:grid; place-items:center; font-weight:800; }.daily-green { background:#d9f5e8; color:#07875e; }.daily-orange { background:#fff0c7; color:#be7900; }.daily-blue { background:#dcecff; color:#2563a6; }.daily-purple { background:#eee9ff; color:#7655c7; }
.due-list { padding:3px 18px 10px; }.due-row { display:flex; align-items:center; gap:9px; padding:8px 0; border-bottom:1px solid #f0f2f1; color:inherit; }.due-row:last-child { border-bottom:0; }.due-row:hover { color:inherit; }.due-row > b { color:#d33b28; font-size:12px; }
.customer-detail-grid { margin-bottom:16px; }.customer-info-list { padding:5px 18px 16px; }.customer-info-list div { display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid #f0f2f1; font-size:12px; }.customer-info-list span { color:#7c8985; }.customer-info-list b { text-align:right; }.payment-accept-panel .card-body { padding-top:8px; }.customer-history-card { border:1px solid #edf0ee; border-radius:12px; overflow:hidden; }
.dashboard-panel { border:1px solid #edf0ee; border-radius:12px; box-shadow:0 4px 14px rgba(25,50,40,.045); overflow:hidden; }
.panel-heading { display:flex; align-items:center; justify-content:space-between; padding:17px 18px 8px; }
.panel-heading h2 { font-size:15px; margin:0; }
.panel-heading a { color:#087f5b; font-size:12px; font-weight:600; }
.overview-content { display:flex; align-items:center; gap:25px; padding:13px 22px 21px; min-height:175px; }
.donut { width:135px; height:135px; flex:none; border-radius:50%; display:grid; place-items:center; background:conic-gradient(#079669 var(--value), #f0a511 0); position:relative; }
.donut:after { content:''; position:absolute; inset:14px; background:#fff; border-radius:50%; }
.donut div { position:relative; z-index:1; text-align:center; display:flex; flex-direction:column; line-height:1.25; }
.donut strong { font-size:21px; color:#1d2926; }
.donut span { color:#7a8785; font-size:11px; }
.donut-cash { background:conic-gradient(#079669 var(--value), #ed3b1b 0); }
.legend-list { flex:1; display:grid; gap:17px; }
.legend-list div { display:grid; grid-template-columns:10px 1fr auto; align-items:center; gap:8px; font-size:12px; }
.legend-list b { color:#26332f; font-size:12px; }
.dot { width:10px; height:10px; border-radius:50%; display:block; }
.dot-green { background:#079669; }.dot-orange { background:#f0a511; }.dot-red { background:#ed3b1b; }
.dashboard-bottom { grid-template-columns:1.03fr .97fr; }
.recent-list { padding:4px 18px 12px; }
.recent-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid #f0f2f1; color:inherit; }
.recent-row:last-child { border-bottom:0; }.recent-row:hover { color:inherit; }
.recent-avatar { width:35px; height:35px; display:grid; place-items:center; border-radius:50%; background:#d8f2e8; color:#087f5b; font-size:13px; font-weight:800; }
.recent-info { flex:1; min-width:0; display:flex; flex-direction:column; }.recent-info strong { font-size:12px; }.recent-info small { color:#84908f; font-size:10px; }.recent-row > b { font-size:12px; color:#087f5b; }
.payroll-panel { padding-bottom:12px; }.summary-value { padding:8px 18px 0; font-size:23px; font-weight:800; }.payroll-panel > .muted { padding:0 18px; }
.bar-chart { height:118px; display:flex; align-items:flex-end; gap:18px; padding:10px 24px 0; border-bottom:1px solid #eef1ef; margin:8px 18px 0; }
.bar-column { flex:1; height:100%; display:flex; align-items:center; flex-direction:column; justify-content:flex-end; gap:6px; }.bar { width:100%; max-width:30px; min-height:9px; background:#079669; border-radius:3px 3px 0 0; }.bar:nth-child(even) { background:#42b893; }.bar-column small { color:#89928f; font-size:10px; }
.dashboard-footer-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; }.mini-stat { display:flex; align-items:center; gap:12px; padding:13px 15px; border-radius:12px; border:1px solid #edf0ee; box-shadow:0 4px 14px rgba(25,50,40,.045); }.mini-stat .stat-icon { width:36px; height:36px; border-radius:50%; display:grid; place-items:center; }.mini-stat div { flex:1; display:flex; flex-direction:column; }.mini-stat strong { font-size:18px; line-height:1.2; }.mini-stat small { color:#7c8885; font-size:11px; }.mini-stat a { color:#087f5b; font-size:20px; }

@media (max-width: 900px) { .dashboard-stats { grid-template-columns:repeat(2, 1fr); } }
@media (max-width: 650px) { .dashboard-heading { align-items:flex-start; flex-direction:column; gap:12px; }.dashboard-pos-action { position:static; transform:none; font-size:17px; padding:12px 20px; }.dashboard-actions { position:static; width:100%; transform:none; margin-left:0; }.dashboard-actions .dashboard-action { flex:1; text-align:center; }.dashboard-grid, .dashboard-footer-grid { grid-template-columns:1fr; }.overview-content { justify-content:center; }.content { padding:18px 14px; } }

@media (max-width: 380px) {
    .stat-card .stat-value { font-size: 15px; }
    .stat-card .stat-label { font-size: 11.5px; }
    .dash-actions { flex-direction: column; }
    .hero-btn { width: 100%; }
    .dash-net { padding: 14px 16px; }
}

/* Keep dashboard and data panels usable on tablets and narrow phones. */
@media (max-width: 1100px) {
    .dashboard-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
    .dashboard-actions { position: static; width: 100%; transform: none; margin: 0; justify-content: flex-start; flex-wrap: wrap; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .topbar .right { gap: 7px; }
    .topbar-jar { display: none; }
    .btn-logout { padding-inline: 8px; }
    .dashboard-heading { padding: 20px; }
    .dashboard-heading h1 { font-size: 24px; }
    .dashboard-actions { display: grid; grid-template-columns: 1fr; }
    .dashboard-actions .dashboard-action { width: 100%; text-align: center; }
    .dashboard-footer-grid { grid-template-columns: 1fr; }
    .overview-content { flex-wrap: wrap; }
    .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 620px; }
}

@media (max-width: 380px) {
    .topbar .page-title { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .content { padding-inline: 10px; }
}

/* ---------- Auth pages ---------- */
.auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.auth-card {
    background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%; max-width: 400px; padding: 36px;
}
.auth-card .auth-brand { text-align: center; margin-bottom: 24px; }
.auth-card .auth-brand .logo {
    width: 52px; height: 52px; background: var(--primary); border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff; margin-bottom: 10px; overflow: hidden;
}
.auth-card .auth-brand .logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-card h1 { font-size: 20px; font-weight: 800; }
.auth-card .subtitle { color: var(--text-muted); font-size: 13px; }
.login-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 18px; }
.login-role {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 9px 4px; border: 1px solid #dbe3ef; border-radius: 9px;
    background: #f8fafc; color: #475569; cursor: pointer; font-size: 11px; font-weight: 700;
    transition: all .15s;
}
.login-role:hover { border-color: #2563eb; color: #2563eb; }
.login-role.active { background: #eff6ff; border-color: #2563eb; color: #1d4ed8; box-shadow: 0 0 0 2px rgba(37,99,235,.1); }
.login-role-icon { font-size: 18px; line-height: 1; }
.auth-card .form-group { margin-bottom: 14px; }
.auth-card .btn { width: 100%; justify-content: center; padding: 11px; }
.auth-card .alt { text-align: center; margin-top: 16px; font-size: 13px; }
.error-box { background: #fee2e2; color: #b91c1c; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* ---------- Categories (premium) ---------- */
.cat-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-stat {
    flex: 1; min-width: 170px; display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    padding: 14px 16px; box-shadow: var(--shadow);
}
.cat-stat .ico {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
}
.cat-stat .val { font-size: 20px; font-weight: 800; line-height: 1.1; }
.cat-stat .lbl { font-size: 12px; color: var(--text-muted); }

.cat-search {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 11px 15px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.cat-search .ico { font-size: 16px; color: var(--text-muted); }
.cat-search input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; color: var(--text); }
.cat-search input::placeholder { color: var(--text-muted); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat-card {
    background: #fff; border: 1px solid var(--border); border-radius: 16px;
    padding: 18px; position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 12px;
    transition: all 0.2s ease; box-shadow: var(--shadow);
}
.cat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--cat-from), var(--cat-to));
}
.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    border-color: rgba(0, 0, 0, 0.08);
}
.cat-top { display: flex; align-items: center; justify-content: space-between; }
.cat-avatar {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
    background: linear-gradient(135deg, var(--cat-from), var(--cat-to));
    box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.45);
}
.cat-count {
    background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
    padding: 3px 12px; font-size: 12px; font-weight: 700; color: var(--text);
}
.cat-name { font-size: 16.5px; font-weight: 800; letter-spacing: -0.2px; }
.cat-desc {
    color: var(--text-muted); font-size: 12.5px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 38px;
}
.cat-actions { display: flex; gap: 8px; margin-top: auto; }
.btn-edit-soft { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.btn-edit-soft:hover { background: #dbeafe; color: #1d4ed8; }
.btn-danger-soft { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.btn-danger-soft:hover { background: #fee2e2; color: #b91c1c; }

@media (max-width: 640px) {
    .cat-grid { grid-template-columns: 1fr; }
    .cat-stat { min-width: 100%; }
}

dialog.modal-dialog {
    border: none; border-radius: 16px; padding: 0;
    width: min(480px, 95vw);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}
dialog.modal-dialog::backdrop { background: rgba(15, 23, 42, 0.5); }
.modal-card { background: #fff; border-radius: 16px; overflow: hidden; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
}
.modal-head h3 { color: #fff; font-size: 15px; font-weight: 700; }
.modal-close {
    background: rgba(255, 255, 255, 0.12); border: none; color: #fff;
    width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.25); }
.modal-body { padding: 20px; }

/* ---------- Branded print documents ---------- */
.print-brand { display: none; }
.dsr-brand { display: flex; align-items: center; gap: 12px; }
.dsr-brand img { width: 48px; height: 48px; object-fit: contain; }

@media print {
    @page { margin: 13mm 12mm; size: A4; }
    html, body { background: #fff !important; color: #111827 !important; font-size: 11px; }
    .sidebar, .topbar, .no-print, .overlay { display: none !important; }
    .main { margin-left: 0 !important; min-height: 0 !important; }
    .content { max-width: none !important; padding: 0 !important; }
    .print-brand { display: flex; align-items: center; gap: 12px; padding: 0 0 13px; margin-bottom: 15px; border-bottom: 2px solid #0e7490; }
    .print-brand img { width: 48px; height: 48px; object-fit: contain; }
    .print-brand-company { display: flex; flex-direction: column; gap: 1px; flex: 1; }
    .print-brand-company strong { color: #0f172a; font-size: 17px; letter-spacing: .2px; }
    .print-brand-company span, .print-brand-title span { color: #64748b; font-size: 10px; }
    .print-brand-title { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
    .print-brand-title strong { color: #0e7490; font-size: 14px; text-transform: uppercase; letter-spacing: .8px; }
    .print-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 8px; border-top: 1px solid #cbd5e1; color: #64748b; font-size: 9px; }
    .card, .stat-card, .invoice-box, .dsr-report-sheet { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; }
    .card-header { padding: 9px 0 6px !important; border-bottom: 1px solid #cbd5e1 !important; background: transparent !important; }
    .card-body { padding: 8px 0 !important; }
    .stats-grid { gap: 0; grid-template-columns: repeat(4, 1fr) !important; margin: 0 0 13px !important; }
    .stat-card { padding: 8px 10px !important; border-right: 1px solid #e2e8f0 !important; }
    .stat-card:last-child { border-right: 0 !important; }
    .stat-icon { display: none !important; }
    .stat-value { font-size: 15px !important; }
    .stat-label { font-size: 9px !important; text-transform: uppercase; letter-spacing: .25px; }
    .grid-2, .dashboard-grid { gap: 16px !important; }
    .table-wrap { overflow: visible !important; }
    .table { width: 100% !important; border-collapse: collapse !important; }
    .table th { background: #e6f4f7 !important; color: #164e63 !important; font-size: 9px !important; text-transform: uppercase; letter-spacing: .35px; }
    .table th, .table td { padding: 6px 7px !important; border-bottom: 1px solid #e2e8f0 !important; }
    .table tbody tr:nth-child(even) td { background: #f8fafc !important; }
    .card, .grid-2, .dashboard-grid, .dsr-report-columns { break-inside: avoid; }
    .badge { border: 0 !important; background: transparent !important; padding: 0 !important; }
    .invoice-head { border-bottom: 2px solid #0e7490 !important; padding-bottom: 12px !important; }
    .invoice-logo { width: 48px !important; height: 48px !important; }
    .invoice-title { font-size: 17px !important; }
    .invoice-total-row { padding: 6px 0 !important; border-bottom: 1px solid #e2e8f0 !important; }
    .invoice-total-row:last-child { background: #e6f4f7 !important; padding: 9px 8px !important; border-bottom: 2px solid #0e7490 !important; font-weight: 800; }
}

/* ============ POS ============ */
.pos-page-head { padding: 18px 22px; margin-bottom: 22px; border-radius: 16px; color: #fff; background: linear-gradient(120deg, #0f172a 0%, #164e63 58%, #0e7490 100%); box-shadow: 0 14px 28px -18px rgba(8, 47, 73, .8); position: relative; overflow: hidden; }
.pos-page-head::after { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: 8%; top: -100px; background: rgba(103, 232, 249, .16); filter: blur(2px); }
.pos-page-head h2 { color: #fff; font-size: 25px; letter-spacing: -.3px; }
.pos-page-head .sub { color: #bae6fd; }
.pos-eyebrow { position: relative; z-index: 1; color: #67e8f9; text-transform: uppercase; letter-spacing: 1.4px; font-size: 10px; font-weight: 800; margin-bottom: 5px; }
.pos-live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #34d399; margin-right: 5px; box-shadow: 0 0 0 4px rgba(52,211,153,.14); }
.pos-eyebrow-sep { opacity: .45; margin: 0 6px; }
.pos-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pos-date-chip {
    background: rgba(255,255,255,.1); color: #e0f2fe; border: 1px solid rgba(186,230,253,.3);
    padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
}
.pos-layout { display: grid; grid-template-columns: 1fr 400px; gap: 18px; align-items: start; }
.pos-panel { min-width: 0; }
.pos-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pos-section-title { display: flex; align-items: center; gap: 10px; }
.pos-section-title small { display: block; color: var(--text-muted); font-size: 11px; font-weight: 400; margin-top: 1px; }
.pos-section-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #0e7490; background: #cffafe; font-size: 20px; }
.pos-section-icon.cart-icon { color: #166534; background: #dcfce7; }
.pos-search { max-width: 260px; }
.pos-cats { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 14px; }
.pos-chip {
    border: 1px solid #dbe3ef; background: #fff; color: #475569;
    padding: 7px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: all 0.15s;
}
.pos-chip:hover { border-color: #2563eb; color: #2563eb; }
.pos-chip.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.pos-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px; padding: 0 20px 20px;
}
.pos-card {
    text-align: left; padding: 15px; border-radius: 14px; cursor: pointer;
    background: #f8fafc; border: 1px solid #e2e8f0;
    display: flex; flex-direction: column; gap: 5px; transition: all 0.15s; position: relative; overflow: hidden;
}
.pos-card::after { content: '+'; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: #0891b2; background: #ecfeff; font-size: 16px; font-weight: 700; }
.pos-card:hover { border-color: #2563eb; box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.35); transform: translateY(-2px); }
.pos-card:disabled { opacity: 0.45; cursor: not-allowed; }
.pos-card:disabled:hover { transform: none; box-shadow: none; border-color: #e2e8f0; }
.pos-card.in-cart { background: #eff6ff; border-color: #2563eb; box-shadow: inset 0 0 0 1px #2563eb; }
.pos-card.in-cart::after { content: '✓'; color: #fff; background: #2563eb; }
.pos-card-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #e0f2fe, #cffafe); color: #0e7490; font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.pos-card-name { font-size: 13.5px; font-weight: 700; color: #0f172a; }
.pos-card-price { font-size: 15px; font-weight: 800; color: #2563eb; }
.pos-card-stock { font-size: 11.5px; color: #64748b; }
.pos-stock-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; margin: 0 3px 1px 0; }
.pos-card-stock.o { color: #dc2626; font-weight: 700; }
.pos-cart { position: sticky; top: 18px; }
.pos-count {
    background: #e0f2fe; color: #0369a1; border-radius: 20px;
    padding: 3px 12px; font-size: 12px; font-weight: 700;
}
.pos-cust-row { display: flex; gap: 8px; }
.pos-cust-row select { flex: 1; }
.pos-assigned-dsr { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #a7f3d0; border-radius: 9px; color: #065f46; background: #ecfdf5; font-weight: 700; }
.pos-assigned-dsr small { margin-left: auto; color: #059669; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }
.pos-dsr-avatar { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: #fff; background: #10b981; font-size: 12px; }
.pos-new-btn { flex-shrink: 0; }
.pos-new-cust {
    margin-top: 10px; padding: 12px; border: 1px dashed #93c5fd;
    border-radius: 10px; background: #f0f9ff;
}
.pos-items-wrap { margin: 14px 0; max-height: 280px; overflow-y: auto; }
.pos-empty {
    display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; color: #94a3b8; font-size: 12px;
    padding: 28px 0; border: 1px dashed #dbe3ef; border-radius: 12px; background: #fbfdff;
}
.pos-empty strong { color: #475569; font-size: 13px; margin-top: 3px; }
.pos-empty-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: #0891b2; background: #ecfeff; font-size: 21px; margin-bottom: 4px; }
.pos-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 8px;
    background: #f8fafc;
}
.pos-item-info { flex: 1; min-width: 0; }
.pos-item-name { font-size: 13px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-item-price { font-size: 12px; color: #64748b; }
.pos-item-ctrls { display: flex; align-items: center; gap: 6px; }
.pos-qty-btn {
    width: 26px; height: 26px; border-radius: 7px; border: 1px solid #cbd5e1;
    background: #fff; color: #2563eb; font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1;
}
.pos-qty-btn:hover { background: #dbeafe; }
.pos-qty { min-width: 20px; text-align: center; font-weight: 700; font-size: 13px; }
.pos-item-total { font-weight: 700; font-size: 13px; min-width: 64px; text-align: right; }
.pos-item-del {
    border: none; background: transparent; color: #dc2626; cursor: pointer; font-size: 13px;
    width: 24px; height: 24px; border-radius: 6px;
}
.pos-item-del:hover { background: #fee2e2; }
.pos-totals { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px dashed #e2e8f0; }
.pos-num-in { width: 110px; text-align: right; }
.pos-totals .meta-row { align-items: center; }
.pos-total-row { margin: 4px -10px 0; padding: 11px 10px; border-radius: 10px; background: #f0fdfa; color: #065f46; font-size: 15px; }
.pos-total-row .k { color: #047857; font-weight: 700; }
.pos-total-row span:last-child { font-size: 18px; }
.pos-due-row .k { color: #64748b; }
.pos-checkout { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.pos-error {
    margin-top: 10px; padding: 10px 14px; border-radius: 10px;
    background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; font-size: 13px;
}
.customer-history-stats { margin: 18px 0; }
.customer-history-card { margin-top: 18px; }
.customer-profile-name { color: #0e7490; font-size: 16px; }
.customer-dsr-name { color: #047857; }
.customer-buy-table th, .customer-buy-table td { white-space: nowrap; }
.customer-code { display: block; color: #0891b2; font-size: 10px; font-weight: 800; letter-spacing: .7px; margin-bottom: 2px; }
.customer-page-code { color: #0891b2; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.customer-code-large { color: #0891b2; letter-spacing: 1.5px; }
.customer-code-inline { color: #0891b2; letter-spacing: .8px; }
.report-total-line { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 0 24px; }
.report-total-line > div { display: flex; flex-direction: column; gap: 3px; min-height: 94px; padding: 16px 18px; border-right: 1px solid var(--border); }
.report-total-line > div:last-child { border-right: 0; }
.report-total-line span { color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .45px; }
.report-total-line strong { color: var(--text); font-size: 20px; line-height: 1.2; }
.report-total-line small { color: var(--text-muted); font-size: 11px; }
.report-total-line .due-value { color: #b45309; }.report-total-line .expense-value { color: #b91c1c; }
.report-total-line .net-collect { background: #ecfdf5; }.report-total-line .net-collect strong { color: #047857; }
.report-flat-page .card { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.report-flat-page > .stats-grid { display: none; }
.report-flat-page .card-header { padding-left: 0; padding-right: 0; }
.report-flat-page .card-body { padding-left: 0; padding-right: 0; }
@media (max-width: 900px) { .report-total-line { grid-template-columns: repeat(3, 1fr); }.report-total-line > div:nth-child(3) { border-right: 0; }.report-total-line > div:nth-child(n+4) { border-top: 1px solid var(--border); } }
@media (max-width: 560px) { .report-total-line { grid-template-columns: repeat(2, 1fr); }.report-total-line > div { padding: 12px; }.report-total-line > div:nth-child(3) { border-right: 1px solid var(--border); }.report-total-line > div:nth-child(even) { border-right: 0; }.report-total-line > div:nth-child(n+3) { border-top: 1px solid var(--border); }.report-total-line strong { font-size: 16px; } }
@media (max-width: 1000px) {
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart { position: static; }
}
@media (max-width: 560px) {
    .pos-page-head { padding: 16px; }
    .pos-page-head h2 { font-size: 22px; }
    .pos-date-chip { width: 100%; text-align: center; }
    .pos-head-actions { width: 100%; }
    .pos-head-actions .btn { flex: 1; justify-content: center; }
    .pos-toolbar { align-items: stretch; }
    .pos-search { max-width: none; width: 100%; }
    .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 12px 14px; }
    .pos-cats { padding: 0 12px 12px; overflow-x: auto; flex-wrap: nowrap; }
    .pos-chip { white-space: nowrap; }
}

.website-orders-nav { color: #67e8f9 !important; }
.website-orders-nav.active { background: linear-gradient(90deg, #164e63, #155e75) !important; color: #fff !important; }
.website-order-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 16px 20px; color: #164e63; background: linear-gradient(110deg, #cffafe, #ecfeff); border: 1px solid #a5f3fc; border-radius: 12px; }
.website-order-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: #0891b2; border-radius: 10px; font-size: 18px; }
.website-order-banner strong, .website-order-banner span { display: block; }
.website-order-banner strong { font-size: 14px; }
.website-order-banner span { margin-top: 3px; color: #0e7490; font-size: 12px; }
.website-orders-table td small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.website-status { display: inline-block; padding: 5px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.status-pending { color: #92400e; background: #fef3c7; }.status-accepted { color: #166534; background: #dcfce7; }.status-declined { color: #991b1b; background: #fee2e2; }
.order-actions { display: flex; flex-wrap: wrap; gap: 6px; }.order-actions form { display: inline-flex; }.order-actions .btn:disabled { cursor: not-allowed; opacity: .45; }
.empty-state { padding: 55px !important; text-align: center; }.empty-state div { margin-bottom: 10px; color: #0891b2; font-size: 28px; }.empty-state strong, .empty-state small { display: block; }.empty-state small { margin-top: 5px; color: var(--text-muted); }
@media (max-width: 760px) { .website-order-banner { align-items: flex-start; }.website-orders-table { min-width: 850px; } }
