/* ================================================================
   Mykerene Gas Limited — Professional UI Theme
   ================================================================ */

:root {
    /* Mykerene brand palette — slate-grey (wall) + golden yellow (pillar) */
    --brand-1: #1f2937;
    --brand-2: #374151;
    --brand-3: #4b5563;
    --accent: #eab308;
    --accent-2: #facc15;
    --accent-soft: #fef9c3;

    --green: #16a34a;
    --green-soft: #dcfce7;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --orange: #ea580c;
    --orange-soft: #ffedd5;
    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --purple: #7c3aed;
    --purple-soft: #ede9fe;

    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --bg: #f5f7fb;
    --bg-soft: #f8fafc;
    --white: #ffffff;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.18);

    --t-fast: 120ms ease;
    --t: 200ms ease;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { color: var(--text); margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.05rem; } h4 { font-size: 0.95rem; }
p  { margin: 0 0 8px; }
a  { color: var(--brand-3); text-decoration: none; }
a:hover { color: var(--accent); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background:
        radial-gradient(1200px 600px at -10% -10%, rgba(234, 179, 8, 0.20), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(75, 85, 99, 0.22), transparent 60%),
        linear-gradient(135deg, #eef2f7 0%, #f8fafc 100%);
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 1080px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 620px;
}

/* Brand panel (left) */
.login-brand {
    position: relative;
    padding: 48px 44px;
    color: #fff;
    background:
        radial-gradient(700px 300px at 10% 0%, rgba(234, 179, 8, 0.35), transparent 60%),
        linear-gradient(160deg, var(--brand-3) 0%, var(--brand-2) 45%, var(--brand-1) 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand-glow {
    position: absolute;
    width: 480px;
    height: 480px;
    right: -160px;
    bottom: -160px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(250, 204, 21, 0.40), transparent 70%);
    filter: blur(2px);
    pointer-events: none;
}

.brand-content { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 24px; height: 100%; }

.brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 24px rgba(234, 179, 8, 0.45);
}

.login-brand h1 {
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.brand-tagline {
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
    margin-bottom: 4px;
}

.brand-features {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
}

.brand-features i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    backdrop-filter: blur(6px);
}

.brand-footer {
    margin-top: auto;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 16px;
}

/* Form panel (right) */
.login-panel {
    display: grid;
    place-items: center;
    padding: 48px 44px;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-card-head { margin-bottom: 24px; text-align: left; }

.login-mini-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.login-card-head h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.login-card-head p { color: var(--text-muted); font-size: 0.92rem; }

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 20px;
    font-size: 0.85rem;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.checkbox input { accent-color: var(--brand-3); width: 16px; height: 16px; }

.muted-link {
    color: var(--brand-3);
    font-weight: 600;
    cursor: pointer;
}
.muted-link:hover { color: var(--accent); }

.login-help {
    text-align: center;
    margin-top: 22px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Hint line under panel header / above form */
.hint-line {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--blue-soft);
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin: 0 0 16px;
}
.hint-line i { font-size: 0.95rem; }

/* Label row holds label + auto-tag side-by-side */
.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 22px;
}

/* Auto-calculated field indicator (hidden by default, shown only when active) */
.auto-tag {
    display: none;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 999px;
    line-height: 1;
    border: 1px solid #fde0c2;
    animation: tagPop 220ms ease;
}
.auto-tag.show { display: inline-block; }

@keyframes tagPop {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.form-input.calculated {
    background: #fffbf2;
    border-color: #fde68a;
    color: var(--text);
}
.form-input.calculated:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.20);
    background: #fff;
}

/* Helper hint under each input */
.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Customer type pills */
.customer-type-row {
    margin-bottom: 18px;
}
.ct-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.ct-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ct-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    transition: border-color var(--t), background var(--t), box-shadow var(--t), transform var(--t-fast);
    font-family: inherit;
    color: var(--text);
}
.ct-pill:hover { border-color: var(--border-strong); background: var(--bg-soft); }
.ct-pill:active { transform: translateY(1px); }
.ct-pill i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-muted);
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    margin-bottom: 4px;
    transition: background var(--t), color var(--t);
}
.ct-pill .ct-title { font-weight: 700; font-size: 0.95rem; }
.ct-pill .ct-sub   { font-size: 0.75rem; color: var(--text-muted); }
.ct-pill.active {
    border-color: var(--brand-3);
    background: linear-gradient(180deg, #ffffff 0%, #f0f6ff 100%);
    box-shadow: 0 4px 12px rgba(75, 85, 99, 0.18);
}
.ct-pill.active i { background: var(--brand-3); color: #fff; }
.ct-pill[data-type="Bulk"].active {
    border-color: var(--accent);
    background: linear-gradient(180deg, #ffffff 0%, #fff4e6 100%);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.22);
}
.ct-pill[data-type="Bulk"].active i { background: var(--accent); color: #fff; }

/* Customer type badges in tables */
.ct-badge {
    background: var(--blue-soft);
    color: #1e3a8a;
}
.ct-badge.bulk {
    background: var(--orange-soft);
    color: #7c2d12;
}
.ct-badge.retail {
    background: var(--blue-soft);
    color: #1e3a8a;
}

/* Report summary cards (top of sales page) */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.rs-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--brand-3);
}
.rs-card.success { border-left-color: var(--green); }
.rs-card.blue    { border-left-color: var(--blue); }
.rs-card.orange  { border-left-color: var(--accent); }
.rs-card .rs-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}
.rs-card .rs-value {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 4px 0 2px;
}
.rs-card .rs-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Panel actions (right side of panel header) */
.panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.ct-filter {
    width: auto;
    padding: 7px 28px 7px 12px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

/* Print report header (hidden on screen, shown only on print) */
.print-header { display: none; }

/* Worked example block */
.example-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 4px 0 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.example-box strong { color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.example-box i { color: var(--accent); }

label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--t), box-shadow var(--t), background var(--t);
    outline: none;
}
.form-input::placeholder { color: var(--text-light); }
.form-input:hover { border-color: var(--border-strong); }
.form-input:focus {
    border-color: var(--brand-3);
    box-shadow: 0 0 0 4px rgba(75, 85, 99, 0.18);
    background: #fff;
}
textarea.form-input { resize: vertical; min-height: 88px; line-height: 1.5; }
select.form-input { cursor: pointer; }

.input-wrap { position: relative; }
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.95rem;
    pointer-events: none;
}
.form-input.has-icon { padding-left: 42px; }
.form-input.has-action { padding-right: 42px; }

.input-action {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    transition: color var(--t), background var(--t);
}
.input-action:hover { color: var(--brand-3); background: var(--bg); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--t-fast), background var(--t), border-color var(--t), box-shadow var(--t), color var(--t);
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn i { font-size: 0.92em; }

.btn-block { width: 100%; }
.btn-lg    { padding: 14px 22px; font-size: 1rem; }
.btn-sm    { padding: 7px 12px; font-size: 0.82rem; gap: 6px; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-3) 0%, var(--brand-2) 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(31, 41, 55, 0.30);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 22px rgba(31, 41, 55, 0.40);
    filter: brightness(1.05);
}

.btn-green {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}
.btn-green:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4); }

.btn-dark {
    background: var(--brand-1);
    color: #fff;
}
.btn-dark:hover:not(:disabled) { background: var(--brand-2); }

.btn-danger {
    background: var(--red);
    color: #fff;
}
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }

.btn-outline {
    background: #fff;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-outline:hover:not(:disabled) {
    background: var(--bg);
    border-color: var(--brand-3);
    color: var(--brand-3);
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    animation: alertIn 220ms ease;
}
.alert i { font-size: 1rem; }
.alert-success { background: var(--green-soft); color: #14532d; border-color: #bbf7d0; }
.alert-danger  { background: var(--red-soft);   color: #7f1d1d; border-color: #fecaca; }
.alert-info    { background: var(--blue-soft);  color: #1e3a8a; border-color: #bfdbfe; }
.alert-warning { background: #fef3c7;            color: #78350f; border-color: #fde68a; }

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   DASHBOARD LAYOUT (Admin / Cashier)
   ============================================================ */
.dashboard {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-header h2 {
    color: #fff;
    font-size: 1.08rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-header h2 i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    box-shadow: 0 6px 14px rgba(234, 179, 8, 0.45);
}

.role-badge {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.role-badge.admin   { background: rgba(234, 179, 8, 0.28); color: var(--accent-2); }
.role-badge.manager { background: rgba(37, 99, 235, 0.25);  color: #93c5fd; }
.role-badge.cashier { background: rgba(34, 197, 94, 0.18);  color: #86efac; }

.sidebar-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.92rem;
    transition: background var(--t), color var(--t);
    user-select: none;
}
.nav-item i { width: 20px; text-align: center; font-size: 0.95rem; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-info {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}
.user-info strong { color: #fff; font-size: 0.95rem; font-weight: 700; }

.sidebar-footer .btn-outline {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.18);
}
.sidebar-footer .btn-outline:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.main-content {
    padding: 28px 32px;
    max-width: 100%;
    overflow-x: hidden;
}

/* Mobile toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--brand-1);
    color: #fff;
    border: 0;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 1rem;
}

/* Tabs */
.tab-content { display: none; animation: fadeIn 200ms ease; }
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 18px;
}
.tab-btn {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background var(--t), color var(--t);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    background: #fff;
    color: var(--brand-3);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t), box-shadow var(--t);
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--brand-3);
}
.stat-card.blue::before   { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.stat-card.green::before  { background: linear-gradient(90deg, #16a34a, #4ade80); }
.stat-card.orange::before { background: linear-gradient(90deg, #ea580c, #fb923c); }
.stat-card.red::before    { background: linear-gradient(90deg, #dc2626, #f87171); }
.stat-card.purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.stat-card.dark::before   { background: linear-gradient(90deg, #0f172a, #475569); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    margin-bottom: 12px;
}
.stat-card.blue   .stat-icon { background: var(--blue-soft);   color: var(--blue); }
.stat-card.green  .stat-icon { background: var(--green-soft);  color: var(--green); }
.stat-card.orange .stat-icon { background: var(--orange-soft); color: var(--orange); }
.stat-card.red    .stat-icon { background: var(--red-soft);    color: var(--red); }
.stat-card.purple .stat-icon { background: var(--purple-soft); color: var(--purple); }
.stat-card.dark   .stat-icon { background: #e2e8f0;            color: #0f172a; }

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   PANELS
   ============================================================ */
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.98rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}
.panel-header h3 i { color: var(--brand-3); }
.panel-body { padding: 20px; }

/* Sell form (cashier) */
.sell-form { max-width: 640px; }

.total-display {
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    margin: 8px 0 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    box-shadow: 0 8px 24px rgba(31, 41, 55, 0.28);
}
.total-display .label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}
.total-display .amount {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.total-display .total-sub {
    width: 100%;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 8px;
    margin-top: 4px;
}
.total-display .total-sub span { color: #fff; font-weight: 600; }

.optional-tag {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
    vertical-align: middle;
}

.readonly-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.readonly-banner i { font-size: 1.1rem; color: var(--blue); margin-top: 2px; }
.readonly-banner strong { font-weight: 700; }

/* ============================================================
   TANK GAUGE (Manager Overview — capacity + level + % + bar)
   ============================================================ */
.tank-gauge-panel { background: linear-gradient(180deg, #ffffff 0%, var(--bg-soft) 100%); }

.tank-gauge {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tank-gauge-numbers {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 14px;
}
.tank-gauge-current {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    letter-spacing: -0.02em;
}
.tank-gauge-current .tg-unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 6px;
}
.tank-gauge-of {
    color: var(--text-muted);
    font-size: 0.95rem;
}
.tank-gauge-of span {
    color: var(--text);
    font-weight: 700;
}
.tank-gauge-pct {
    margin-left: auto;
    background: var(--brand-1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(31, 41, 55, 0.18);
}

/* The progress bar itself — Bootstrap-style classes the user mentioned */
.progress {
    height: 22px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
.progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #16a34a, #4ade80);
    transition: width 0.6s ease;
    background-size: 200% 100%;
    animation: progressShift 6s linear infinite;
}
.progress-bar.ok   { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress-bar.warn { background: linear-gradient(90deg, #d97706, #fbbf24); }
.progress-bar.bad  { background: linear-gradient(90deg, #b91c1c, #ef4444); }
@keyframes progressShift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.tank-gauge-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.tank-gauge-meta .tg-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.gauge-dot { font-size: 0.55rem; }
.gauge-dot.ok   { color: #16a34a; }
.gauge-dot.warn { color: #d97706; }
.gauge-dot.bad  { color: #b91c1c; }

.refill-prediction {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid;
}
.refill-prediction i { font-size: 1.1rem; flex-shrink: 0; }
.refill-prediction.ok   { background: #f0fdf4; color: #166534; border-color: #86efac; }
.refill-prediction.warn { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.refill-prediction.bad  { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.refill-prediction.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* Cashier activity table — compact row layout */
.cashier-activity-table th,
.cashier-activity-table td { padding: 10px 12px; vertical-align: middle; }
.cashier-activity-table tbody tr:hover { background: var(--bg-soft); }
.text-right { text-align: right; }

/* "Today at a glance" subheading */
.section-subtitle {
    margin: 8px 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-subtitle i { color: var(--brand-1); }

/* Warning button (used by Close Day quick action) */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: 0;
}
.btn-warning:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* ============================================================
   TANK CONTROL CENTER
   ============================================================ */
.tank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.tank-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: transform var(--t), box-shadow var(--t);
    position: relative;
    overflow: hidden;
}
.tank-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tank-card.big {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    border: 0;
}
.tank-card.big .tank-label { color: rgba(255,255,255,0.75); }
.tank-card.big .tank-sub   { color: rgba(255,255,255,0.6); }
.tank-card.big .tank-value { color: #fff; font-size: 2.2rem; }
.tank-card.big .tank-icon  { background: rgba(255,255,255,0.15); color: #fff; }

.tank-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    margin-bottom: 12px;
}
.tank-icon.blue   { background: var(--blue-soft);   color: var(--blue); }
.tank-icon.green  { background: var(--green-soft);  color: var(--green); }
.tank-icon.orange { background: var(--orange-soft); color: var(--orange); }
.tank-icon.purple { background: var(--purple-soft); color: var(--purple); }
.tank-icon.red    { background: var(--red-soft);    color: var(--red); }

.tank-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 4px;
}
.tank-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 4px;
}
.tank-sub { font-size: 0.78rem; color: var(--text-light); }

.tank-card.var-ok     { border-color: #86efac;  background: #f0fdf4; }
.tank-card.var-loss   { border-color: #fca5a5;  background: #fef2f2; }
.tank-card.var-excess { border-color: #fdba74;  background: #fff7ed; }

.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red) !important; }
.text-orange { color: var(--orange) !important; }

.tank-formula {
    background: var(--bg-soft);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 0.83rem;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.55;
}
.tank-formula i { color: var(--blue); margin-top: 3px; }
.tank-formula code {
    background: #fff;
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.close-preview {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 14px 0 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px 18px;
    font-size: 0.9rem;
}
.close-preview > div {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}
.close-preview .lbl { color: var(--text-muted); font-weight: 500; }
.close-preview .val { font-weight: 800; color: var(--text); }
.close-preview .cp-divider {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    margin: 4px 0;
    padding: 0 !important;
}

/* ============================================================
   DATA TABLES
   ============================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background: #fff;
}
.data-table thead th {
    text-align: left;
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .kg     { font-weight: 700; color: var(--brand-3); }
.data-table .amount { font-weight: 700; color: var(--green); }

/* Empty state */
.empty-state {
    padding: 36px 18px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state i { font-size: 2rem; color: var(--text-light); margin-bottom: 8px; }
.empty-state p { margin: 0; font-size: 0.9rem; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-active   { background: var(--green-soft);  color: #14532d; }
.badge-inactive { background: var(--red-soft);    color: #7f1d1d; }
.badge-orange   { background: var(--orange-soft); color: #7c2d12; }

.badge.role-admin   { background: rgba(234, 179, 8, 0.18); color: #854d0e; }
.badge.role-manager { background: var(--blue-soft);          color: #1e3a8a; }
.badge.role-cashier { background: var(--green-soft);         color: #14532d; }

/* Low stock banner */
.low-stock-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #fde68a;
}
.low-stock-banner i { color: #b45309; font-size: 1.2rem; flex-shrink: 0; }
.low-stock-banner div { line-height: 1.45; font-weight: 500; }
.low-stock-banner strong { font-weight: 700; }

.low-stock-banner.empty-stock {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #7f1d1d;
    border-color: #fca5a5;
}
.low-stock-banner.empty-stock i { color: #b91c1c; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 180ms ease;
}
.modal-overlay.active { display: flex; }

.modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 220ms ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}
.modal-header h3 i { color: var(--brand-3); }
.modal-close {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: background var(--t), color var(--t);
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 22px; }

/* Permission overrides panel (Add User modal) */
.perm-override-panel {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.perm-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .perm-grid { grid-template-columns: 1fr 1fr; } }
.perm-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1.35;
}
.perm-row input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
.perm-row strong { color: var(--text); }

/* Receipt */
.receipt {
    background: var(--bg-soft);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 20px;
    font-family: 'Courier New', monospace;
}
.receipt-header { text-align: center; margin-bottom: 16px; }
.receipt-header h4 {
    font-family: 'Inter', sans-serif;
    margin-bottom: 4px;
    font-size: 1rem;
    letter-spacing: 0.02em;
}
.receipt-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dotted var(--border-strong);
    font-size: 0.88rem;
}
.receipt-line:last-of-type { border-bottom: 0; }
.receipt-total {
    margin-top: 8px;
    padding-top: 12px !important;
    border-top: 2px solid var(--text);
    font-size: 1.05rem;
}
.receipt-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dotted var(--border-strong);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
    .login-shell { grid-template-columns: 1fr; min-height: auto; }
    .login-brand { padding: 36px 28px; }
    .login-brand h1 { font-size: 1.7rem; }
    .brand-features { display: none; }
    .login-panel { padding: 36px 28px; }
}

@media (max-width: 768px) {
    .dashboard { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        width: 260px;
        height: 100vh;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 240ms ease;
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .mobile-toggle { display: grid; place-items: center; }
    .main-content { padding: 70px 18px 24px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stat-value { font-size: 1.4rem; }
}

@media (max-width: 520px) {
    .login-page { padding: 14px; }
    .login-brand, .login-panel { padding: 28px 22px; }
    .panel-header { padding: 14px 16px; }
    .panel-body { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 14px; }
}

/* ============================================================
   PRINT STYLES — clean sales report
   ============================================================ */
@media print {
    @page { size: A4 landscape; margin: 14mm; }

    body { background: #fff !important; color: #000 !important; font-size: 11pt; }

    .sidebar, .mobile-toggle, .no-print, .panel-header .panel-actions,
    .tab-bar, .modal-overlay, #lowStockBanner {
        display: none !important;
    }

    .dashboard { display: block !important; }
    .main-content { padding: 0 !important; max-width: 100% !important; overflow: visible !important; }

    .panel {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    .panel-header {
        border-bottom: 2px solid #000 !important;
        padding: 0 0 8px !important;
    }

    /* Show & style the print header */
    .print-header {
        display: block;
        margin-bottom: 16px;
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }
    .print-header h2 {
        font-size: 16pt;
        margin: 0 0 6px;
        letter-spacing: 0.02em;
    }
    .print-meta {
        font-size: 10pt;
        color: #333;
    }

    /* Compact summary cards for print */
    .report-summary {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 6px !important;
        margin-bottom: 12px !important;
    }
    .rs-card {
        border: 1px solid #999 !important;
        box-shadow: none !important;
        border-left-width: 4px !important;
        padding: 8px 10px !important;
    }
    .rs-card .rs-value { font-size: 12pt !important; }
    .rs-card .rs-label, .rs-card .rs-sub { font-size: 8pt !important; }

    /* Tables */
    .data-table {
        font-size: 9pt !important;
        border: 1px solid #999;
    }
    .data-table thead th {
        background: #f3f4f6 !important;
        color: #000 !important;
        border-bottom: 1.5px solid #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .data-table tbody td { padding: 6px 8px !important; }

    .badge { border: 1px solid #999; }

    /* Receipt modal printing (existing flow) */
    .modal-overlay.active { position: static !important; background: transparent !important; backdrop-filter: none !important; display: block !important; }
    .modal-box { box-shadow: none !important; max-width: 100% !important; }

    a[href]:after { content: "" !important; }
}

/* When admin clicks "Print Report" we add this class so other tabs are hidden */
body.printing-sales .tab-content:not(#tab-sales) { display: none !important; }
@media print {
    body.printing-sales .tab-content:not(#tab-sales) { display: none !important; }
    body.printing-sales .sidebar-header,
    body.printing-sales .sidebar-footer { display: none !important; }
}

/* ============================================================
   TWO-COLUMN LAYOUT (overview pages)
   ============================================================ */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 980px) {
    .two-col { grid-template-columns: 1fr; }
}

/* ============================================================
   LIVE ACTIVITY FEED
   ============================================================ */
.activity-body { max-height: 460px; overflow-y: auto; padding-right: 4px; }
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px dashed var(--border);
    align-items: flex-start;
}
.activity-item:last-child { border-bottom: 0; }
.activity-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    flex-shrink: 0;
    font-size: 0.78rem;
    color: #fff;
}
.activity-item.in  .activity-dot { background: var(--green); }
.activity-item.out .activity-dot { background: var(--orange); }
.activity-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}
.activity-item.in  .activity-line strong { color: var(--green); }
.activity-item.out .activity-line strong { color: var(--orange); }
.activity-by   { font-size: 0.78rem; color: var(--text-muted); }
.activity-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.activity-time { font-size: 0.72rem; color: var(--text-light); margin-top: 4px; }

/* ============================================================
   LAST 5 TRANSACTIONS (CASHIER)
   ============================================================ */
.last-txn-list { list-style: none; padding: 0; margin: 0; }
.last-txn-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px dashed var(--border);
}
.last-txn-item:last-child { border-bottom: 0; }
.ltx-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--brand-3);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.ltx-body { flex: 1; min-width: 0; }
.ltx-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}
.ltx-top strong { color: var(--brand-3); }
.ltx-amount {
    margin-left: auto;
    font-weight: 800;
    color: var(--green);
}
.ltx-bottom {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.ltx-receipt { font-family: 'Courier New', monospace; }

/* ============================================================
   KEYBOARD HINT
   ============================================================ */
.kbd-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--bg-soft);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.kbd-hint i { color: var(--blue); }
.kbd-hint kbd {
    display: inline-block;
    padding: 1px 8px;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
}

.empty-state.mini { padding: 20px 12px; }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-wrap {
    position: relative;
    width: 100%;
    height: 360px;
}
.chart-wrap.small {
    height: 220px;
}
.chart-legend-note {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.55;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}

/* ============================================================
   PRINT-ONLY HIDDEN AREAS (used by Daily Report / Closing Report / Receipt)
   ============================================================ */
.print-only { display: none; }

/* Closing report top summary (cashier) */
.closing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}
.closing-summary .cs-line { display: flex; justify-content: space-between; gap: 12px; }
.closing-summary .lbl { color: var(--text-muted); }
.closing-summary .val { color: var(--text); font-weight: 700; }

/* ============================================================
   PRINTABLE REPORT DOCUMENT (used inside .print-only block)
   ============================================================ */
.report-doc {
    color: #000;
    background: #fff;
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.5;
}
.report-doc h1 { font-size: 1.6rem; margin: 16px 0 8px; }
.report-doc h2 { font-size: 1.05rem; margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1.5px solid #000; }

.report-cover {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 14px;
    margin-bottom: 18px;
}
.report-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}
.report-logo {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--accent) 100%);
    color: #fff;
    display: grid; place-items: center;
    font-size: 1.2rem;
}
.report-company { font-size: 1.1rem; font-weight: 800; letter-spacing: 0.04em; }
.report-tagline { font-size: 0.78rem; color: #555; }

.report-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 16px;
    margin-top: 10px;
    font-size: 0.88rem;
}
.report-meta > div { display: flex; justify-content: space-between; gap: 8px; }
.report-meta .lbl { color: #555; }
.report-meta .val { font-weight: 700; }

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-bottom: 12px;
}
.report-table th, .report-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #d4d4d8;
}
.report-table th {
    background: #f4f4f5;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
}
.report-table .r { text-align: right; }
.report-table.compact th, .report-table.compact td {
    padding: 6px 8px;
    font-size: 0.82rem;
}
.report-table .row-strong td {
    background: #f4f4f5;
    font-weight: 800;
    border-top: 2px solid #000;
}
.report-table .row-loss td   { background: #fef2f2 !important; }
.report-table .row-excess td { background: #fff7ed !important; }
.report-table .row-ok td     { background: #f0fdf4 !important; }

.badge.badge-tiny {
    font-size: 0.6rem;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}

.report-alert {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #7f1d1d;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin: 8px 0 12px;
}
.report-notes {
    background: #f8fafc;
    border-left: 3px solid var(--brand-3);
    padding: 8px 12px;
    font-size: 0.85rem;
    margin: 8px 0 12px;
}
.report-closed-by { font-size: 0.85rem; color: #444; margin: 8px 0; }

.report-footer {
    margin-top: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.report-footer .sig { text-align: center; font-size: 0.85rem; }
.report-footer .sig-line { margin-bottom: 6px; letter-spacing: 0.05em; }
.report-footer .sig-label { color: #555; }

.report-disclaimer {
    margin-top: 18px;
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    border-top: 1px dashed #999;
    padding-top: 10px;
}

.print-receipt-card {
    max-width: 380px;
    margin: 24px auto;
}

/* ============================================================
   PRINT MODES
   ============================================================ */

/* "Daily Report" mode — print only the .print-only block. Hide everything else. */
body.printing-doc { background: #fff !important; }
body.printing-doc .print-only { display: block !important; }
body.printing-doc .dashboard,
body.printing-doc > .modal-overlay { display: none !important; }
@media print {
    body.printing-doc { background: #fff !important; }
    body.printing-doc .dashboard { display: none !important; }
    body.printing-doc .print-only {
        display: block !important;
        position: absolute; top: 0; left: 0;
        width: 100%; padding: 0;
    }
    @page { size: A4 portrait; margin: 14mm; }
}

/* "Receipt" mode — print only the receipt block. */
body.printing-receipt { background: #fff !important; }
body.printing-receipt .print-only#receiptPrintArea { display: block !important; }
body.printing-receipt .dashboard,
body.printing-receipt > .modal-overlay { display: none !important; }
@media print {
    body.printing-receipt .dashboard { display: none !important; }
    body.printing-receipt .print-only#receiptPrintArea {
        display: block !important;
        position: absolute; top: 0; left: 0;
        width: 100%;
    }
    body.printing-receipt .print-only:not(#receiptPrintArea) { display: none !important; }
    @page { size: 80mm auto; margin: 4mm; }
}

/* During regular @media print without printing-doc/receipt classes:
   keep the existing report behaviour but hide our hidden print blocks. */
@media print {
    body:not(.printing-doc):not(.printing-receipt) .print-only { display: none !important; }
    /* Charts and big banners shouldn't appear in regular sales report prints */
    .chart-wrap, .tank-formula, .chart-legend-note { display: none !important; }
}

/* ════════════════════════════════════════════════════════════
   MOBILE-FIRST IMPROVEMENTS
   Real topbar, slide-in sidebar with backdrop, tap-friendly
   inputs, scrollable tables/tabs, and PWA-friendly polish.
   ════════════════════════════════════════════════════════════ */

/* ───── Mobile topbar (hidden on desktop, fixed at top on phones) ───── */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 58px;
    z-index: 200;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    box-shadow: var(--shadow);
    padding-top: env(safe-area-inset-top);
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
}
.mt-burger {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 0;
    display: grid; place-items: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 160ms ease;
}
.mt-burger:active { background: rgba(255,255,255,0.22); }
.mt-logo {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: #fff;
    padding: 4px;
    object-fit: contain;
    flex: 0 0 auto;
}
.mt-title {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.01em;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mt-action {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    display: grid; place-items: center;
    text-decoration: none;
    transition: background 160ms ease;
}
.mt-action:active { background: rgba(255,255,255,0.22); }

/* ───── Sidebar backdrop (dim + tap-to-close on mobile) ───── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 31, 58, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 140;
    opacity: 0;
    transition: opacity 220ms ease;
}
.sidebar-backdrop.open { opacity: 1; }
body.sidebar-open { overflow: hidden; }

/* ───── Phone tweaks (≤ 768px) ───── */
@media (max-width: 768px) {
    /* Show the new topbar; hide the old floating round button (it's now part of the bar). */
    .mobile-topbar { display: flex; }
    .mobile-toggle { display: none !important; }

    /* Backdrop appears whenever DOM has it. */
    .sidebar-backdrop { display: block; }
    .sidebar-backdrop:not(.open) { pointer-events: none; }

    /* Sidebar starts beneath the topbar so closing/opening is clear. */
    .sidebar { top: 0; padding-top: env(safe-area-inset-top); }

    /* Push the main content below the fixed topbar. */
    .main-content {
        padding: calc(58px + env(safe-area-inset-top) + 14px) 16px 28px !important;
    }

    /* Stop iOS from auto-zooming on focused inputs. */
    .form-input,
    input.form-input,
    select.form-input,
    textarea.form-input,
    input[type="number"],
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Bigger tap targets on mobile. */
    .btn { min-height: 44px; padding: 11px 18px; }
    .btn-sm { min-height: 38px; padding: 8px 14px; }
    .btn-block { width: 100%; }

    /* Crowded tab bars become a horizontal scroller instead of wrapping into 3 lines. */
    .tab-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tab-bar::-webkit-scrollbar { display: none; }
    .tab-btn { flex: 0 0 auto; white-space: nowrap; }

    /* Panel header actions stack instead of crowding. */
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .panel-actions {
        flex-wrap: wrap;
        width: 100%;
    }
    .panel-actions .btn,
    .panel-actions .form-input,
    .panel-actions select { flex: 1 1 auto; min-width: 0; }

    /* Any data table dropped directly into a panel-body becomes scrollable. */
    .panel-body > .data-table,
    .panel-body > table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Momentum-scroll on iOS for the existing inline-styled wrappers. */
    .panel-body div[style*="overflow-x:auto"],
    .panel-body div[style*="overflow-x: auto"] {
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* The big sell button: full-width, comfy thumb target. */
    #sellBtn { font-size: 1.05rem; padding: 16px; }

    /* Customer-type pills stack into one column on tiny phones. */
    .ct-pills { grid-template-columns: 1fr; }

    /* User-info block in sidebar footer. */
    .sidebar-footer { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* ───── Tiny phones (≤ 480px) ───── */
@media (max-width: 480px) {
    .mt-title { font-size: 0.95rem; }

    /* Modals fill the screen for easier tap-to-close + reading. */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-box {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 18px 18px 0 0;
        max-height: 92vh;
    }
    .modal-body { padding: 18px; }

    /* Stat grid: still 2 columns but slightly tighter. */
    .stats-grid { gap: 10px; }
    .stat-card { padding: 12px; }
    .stat-icon { width: 38px; height: 38px; font-size: 0.9rem; }
    .stat-value { font-size: 1.25rem; }

    /* Sidebar covers most of the viewport on very narrow screens. */
    .sidebar { width: 86vw; max-width: 320px; }

    /* Make the cashier total display very legible on small screens. */
    .total-display .amount { font-size: 1.6rem; }
}

/* ───── Larger phones / phablets (≤ 600px tweaks) ───── */
@media (max-width: 600px) {
    /* Wrap the multi-column form rows into a single column on phones. */
    .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr !important; }
    /* Tank cards stack. */
    .tank-grid { grid-template-columns: 1fr !important; }
    /* Two-column dashboard panels stack. */
    .two-col { grid-template-columns: 1fr !important; }
}

/* ───── Print: hide topbar + backdrop ───── */
@media print {
    .mobile-topbar, .sidebar-backdrop { display: none !important; }
}

/* ───── Auto-print toggle / printer config rows ───── */
.auto-print-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    margin-top: 12px;
    font-size: 0.92rem;
    color: var(--text);
}
.auto-print-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex: 0 0 auto;
}
.auto-print-row span i { color: var(--brand-3); margin-right: 4px; }
.auto-print-row:hover { border-color: var(--border-strong); }

/* ═══════════════════════════════════════════════════════
   COMPANY LOGO (mky.png) — used across the site
   ═══════════════════════════════════════════════════════ */

img { object-fit: contain; }

/* Login / Register big brand panel logo */
.brand-logo.brand-logo-img {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    background: #fff;
    padding: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    display: grid;
    place-items: center;
}
.brand-logo.brand-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Login / Register card mini logo */
.login-mini-logo.login-mini-logo-img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 6px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
}
.login-mini-logo.login-mini-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Sidebar brand block (Admin / Manager / Cashier) */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-brand > div { display: flex; flex-direction: column; gap: 6px; }
.sidebar-brand h2 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.01em;
}
.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    padding: 5px;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    flex: 0 0 auto;
}

/* Receipt logo (in modal + thermal print) */
.receipt-logo {
    height: 56px;
    width: auto;
    max-width: 80%;
    object-fit: contain;
    display: block;
    margin: 0 auto 6px;
}

/* Printable report cover (Manager Daily Report, Cashier Closing Report) */
.report-logo-img {
    height: 64px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* When the thermal receipt prints, make the logo a touch smaller */
@media print {
    body.printing-receipt .receipt-logo { height: 44px; margin-bottom: 4px; }
}

/* ───── Global alert strip (all dashboards) ───── */
.global-alert-strip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(254, 243, 199, 0.95), rgba(255, 251, 235, 0.98));
    border-bottom: 1px solid var(--border);
}
.sys-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
}
.sys-alert i { margin-top: 3px; opacity: 0.85; }
.sys-alert p { margin: 4px 0 0; font-size: 0.88rem; opacity: 0.95; }
.sys-alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.sys-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.sys-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.sell-form-hidden { display: none !important; }

.offline-queue-banner {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0c4a6e;
    font-size: 0.92rem;
}

.receipt-qr-wrap {
    text-align: center;
    margin: 12px 0;
    padding: 8px 0;
    border-top: 1px dashed #ddd;
    border-bottom: 1px dashed #ddd;
}
.receipt-qr-wrap .qr-hint {
    font-size: 0.72rem;
    color: #64748b;
    margin: 6px 0 0;
}
