/* =====================================================
   DELUXE FILLING STATION — Credit Management System
   Professional POS-style CSS
   ===================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #06b6d4;
    --info-light: #cffafe;

    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 260px;

    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --border: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
    --shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);

    --radius: 8px;
    --radius-lg: 12px;
    --transition: all .2s ease;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

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

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform .3s ease;
}

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

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.2;
    letter-spacing: -.02em;
}
.brand-text span {
    font-size: .75rem;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 14px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 4px;
    color: var(--sidebar-text);
    font-size: .9rem;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 10px;
    border: none;
}
.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--text-white);
}
.nav-link.active {
    color: var(--text-white);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
}
.nav-link i {
    width: 22px;
    text-align: center;
    font-size: .95rem;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,.06);
    margin: 8px 4px;
}

.nav-section-title {
    display: block;
    padding: 6px 16px 4px;
    font-size: .65rem;
    font-weight: 700;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: .1em;
}

.sidebar-footer {
    padding: 16px 22px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-footer small {
    color: var(--sidebar-text);
    font-size: .7rem;
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.top-bar .page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.current-date {
    font-size: .85rem;
    color: var(--text-secondary);
}
.current-date i { margin-right: 6px; color: var(--primary); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.content-area {
    flex: 1;
    padding: 24px 28px;
    overflow: hidden;
    max-width: 100%;
}

/* ---------- Dashboard Stat Cards ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-fuel  { border-left-color: var(--accent); }
.stat-fuel .stat-icon { background: var(--warning-light); color: var(--accent-dark); }

.stat-payment { border-left-color: var(--success); }
.stat-payment .stat-icon { background: var(--success-light); color: var(--success); }

.stat-deposit { border-left-color: var(--info); }
.stat-deposit .stat-icon { background: var(--info-light); color: var(--info); }

.stat-outstanding { border-left-color: var(--danger); }
.stat-outstanding .stat-icon { background: var(--danger-light); color: var(--danger); }

.stat-credit { border-left-color: var(--primary); }
.stat-credit .stat-icon { background: var(--primary-light); color: var(--primary); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.stat-label {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ---------- Quick Actions ---------- */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ---------- Summary Row ---------- */
.summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.summary-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.summary-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.summary-number { font-size: 2rem; font-weight: 800; color: var(--primary); }
.summary-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
    max-width: 100%;
}
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.card-header h3 i { margin-right: 8px; color: var(--primary); }
.card-body {
    padding: 18px 22px;
}

/* ---------- Tables ---------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    font-size: .88rem;
}
.data-table thead th {
    background: var(--bg-body);
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid var(--border);
}
.data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.data-table td.text-right,
.data-table th.text-right,
.data-table tfoot td.text-right { text-align: right !important; }
.data-table td.text-center,
.data-table th.text-center,
.data-table tfoot td.text-center { text-align: center !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-warning { color: var(--warning) !important; }

.actions-cell {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 50px;
    letter-spacing: .02em;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--accent-dark); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-dark    { background: var(--sidebar-bg);    color: var(--text-white); }
.badge-secondary { background: var(--bg-body); color: var(--text-secondary); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.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: #059669; color: #fff; }

.btn-danger    { background: var(--danger);    color: #fff; }
.btn-danger:hover  { background: #dc2626; color: #fff; }

.btn-secondary { background: var(--text-secondary); color: #fff; }
.btn-secondary:hover { background: #374151; color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--bg-body);
    border-color: var(--text-secondary);
}

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-control::placeholder { color: var(--text-muted); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

textarea.form-control { resize: vertical; min-height: 60px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}
.form-grid .full-width { grid-column: 1 / -1; }

.form-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.form-inline .form-group { margin-bottom: 0; }

.switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 400;
    color: var(--text-primary);
}

/* ---------- Filter Bar ---------- */
.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-bar .form-group { flex: 1; min-width: 180px; margin-bottom: 0; }
.filter-bar .btn { align-self: flex-end; }

/* ---------- Page Actions ---------- */
.page-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ---------- Modals ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn .25s ease;
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 600; }
.modal-header h3 i { margin-right: 8px; color: var(--primary); }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 20px 22px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
}

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: .9rem;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}
.alert i { font-size: 1.1rem; flex-shrink: 0; }
.alert-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: .6;
    color: inherit;
}
.alert-close:hover { opacity: 1; }

.alert-success { background: var(--success-light); color: #065f46; border-left: 4px solid var(--success); }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: var(--info-light);    color: #155e75; border-left: 4px solid var(--info); }

/* ---------- POS Form ---------- */
.pos-form {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.pos-form-header {
    background: linear-gradient(135deg, var(--sidebar-bg), #1e293b);
    color: #fff;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.pos-form-header i { font-size: 1.8rem; color: var(--accent); }
.pos-form-header h3 { font-size: 1.15rem; font-weight: 700; }
.pos-form-header p { font-size: .82rem; color: var(--sidebar-text); margin-top: 2px; }

.pos-form-body {
    padding: 24px 26px;
}

.credit-info-bar {
    display: flex;
    gap: 20px;
    background: var(--bg-body);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.credit-info-item {
    flex: 1;
    min-width: 140px;
    text-align: center;
}
.credit-info-item .label {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.credit-info-item .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.amount-display {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    border-radius: var(--radius);
    padding: 18px 24px;
    text-align: center;
    margin: 18px 0;
}
.amount-display .label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.7);
    margin-bottom: 4px;
}
.amount-display .amount {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
}

/* ---------- Receipt (Printable) ---------- */
.receipt-wrapper {
    max-width: 480px;
    margin: 0 auto;
}
.receipt {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.receipt-header {
    background: linear-gradient(135deg, var(--sidebar-bg), #1e293b);
    color: var(--text-white);
    text-align: center;
    padding: 24px 20px;
}
.receipt-header h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: .02em; }
.receipt-header p { font-size: .82rem; color: var(--sidebar-text); margin-top: 4px; }
.receipt-header .receipt-number {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 700;
    margin-top: 12px;
    letter-spacing: .05em;
}

.receipt-body { padding: 22px 24px; }

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: .9rem;
}
.receipt-row:last-child { border-bottom: none; }
.receipt-row .label { color: var(--text-secondary); }
.receipt-row .value { font-weight: 600; color: var(--text-primary); }

.receipt-total {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    margin-top: 10px;
    border-top: 2px solid var(--text-primary);
    font-size: 1.2rem;
    font-weight: 800;
}

.receipt-footer {
    text-align: center;
    padding: 16px 24px 24px;
    border-top: 1px dashed var(--border);
}
.receipt-footer p {
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.print-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

/* ---------- Report Specific ---------- */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 0;
}
.report-summary-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 18px;
    text-align: center;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}
.report-summary-card .label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.report-summary-card .value { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); margin-top: 6px; }

/* ---------- Responsive: Tablet (≤ 1024px) ---------- */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .report-summary { grid-template-columns: repeat(2, 1fr); }
    .summary-row { grid-template-columns: repeat(2, 1fr); }
    .content-area { padding: 20px 20px; }
    .top-bar { padding: 14px 20px; }
    .pos-form-body { padding: 20px; }
    .stat-value { font-size: 1.15rem; }
    .amount-display .amount { font-size: 1.6rem; }
}

/* ---------- Responsive: Mobile (≤ 768px) ---------- */
@media (max-width: 768px) {
    /* Sidebar: off-canvas */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,.35);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle { display: block; }

    /* Top bar */
    .top-bar { padding: 12px 16px; gap: 10px; }
    .top-bar .page-title { font-size: 1.05rem; }
    .top-bar-right { display: none; } /* Hide date on mobile */

    /* Content area */
    .content-area { padding: 14px 14px; }

    /* Dashboard */
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; gap: 12px; }
    .stat-icon { width: 42px; height: 42px; font-size: 1.1rem; }
    .stat-value { font-size: 1.1rem; }
    .stat-label { font-size: .72rem; }

    /* Forms */
    .form-grid { grid-template-columns: 1fr; gap: 0; }

    /* POS Form */
    .pos-form-header { padding: 16px 18px; gap: 10px; }
    .pos-form-header i { font-size: 1.4rem; }
    .pos-form-header h3 { font-size: 1rem; }
    .pos-form-body { padding: 16px; }

    /* Transaction Tabs */
    .txn-tabs { border-radius: 8px; }
    .txn-tab { padding: 10px 8px; font-size: .8rem; gap: 5px; }
    .txn-tab i { font-size: .75rem; }

    /* Credit info bar */
    .credit-info-bar { flex-direction: column; gap: 10px; padding: 12px 14px; }
    .credit-info-item { min-width: unset; display: flex; justify-content: space-between; text-align: left; }
    .credit-info-item .label { margin-bottom: 0; }
    .credit-info-item .value { font-size: .95rem; }

    /* Amount display */
    .amount-display { padding: 14px 18px; margin: 14px 0; }
    .amount-display .amount { font-size: 1.5rem; }

    /* Buttons row */
    .pos-form .btn-lg { padding: 10px 20px; font-size: .9rem; }

    /* Cards */
    .card-header { padding: 14px 16px; }
    .card-header h3 { font-size: .92rem; }
    .card-body { padding: 14px 16px; }

    /* Tables */
    .table-responsive { margin: 0 -16px; padding: 0 0; }
    .data-table { font-size: .82rem; min-width: 700px; }
    .data-table thead th { padding: 9px 10px; font-size: .72rem; }
    .data-table tbody td { padding: 10px 10px; }

    /* Filter bar */
    .filter-bar { flex-direction: column; padding: 14px 16px; gap: 10px; }
    .filter-bar .form-group { width: 100%; min-width: unset; flex: unset; }
    .filter-bar .btn { width: 100%; justify-content: center; }

    /* Report summary */
    .report-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
    .report-summary-card { padding: 14px 12px; min-height: 70px; }
    .report-summary-card .value { font-size: 1.1rem; }

    /* Summary row */
    .summary-row { grid-template-columns: 1fr 1fr; gap: 10px; }
    .summary-number { font-size: 1.5rem; }

    /* Quick actions */
    .quick-actions { flex-direction: column; }
    .quick-actions .btn { width: 100%; justify-content: center; }

    /* Page actions */
    .page-actions { flex-direction: column; }
    .page-actions .btn { width: 100%; justify-content: center; }

    /* Modals */
    .modal { max-width: 95vw; max-height: 85vh; }
    .modal-header { padding: 14px 18px; }
    .modal-body { padding: 16px 18px; }
    .modal-footer { padding: 12px 18px; flex-wrap: wrap; }
    .modal-footer .btn { flex: 1; min-width: 100px; justify-content: center; }

    /* Receipt */
    .receipt-wrapper { max-width: 100%; }
    .receipt-header { padding: 18px 16px; }
    .receipt-header h2 { font-size: 1.1rem; }
    .receipt-body { padding: 16px 18px; }
    .receipt-row { font-size: .84rem; padding: 7px 0; }
    .receipt-total { font-size: 1.05rem; }
    .receipt-footer { padding: 14px 18px 18px; }
    .print-actions { flex-direction: column; align-items: stretch; }
    .print-actions .btn { justify-content: center; }
}

/* ---------- Responsive: Small Mobile (≤ 480px) ---------- */
@media (max-width: 480px) {
    html { font-size: 13px; }

    /* Dashboard */
    .dashboard-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { padding: 14px; }

    /* Summary */
    .summary-row { grid-template-columns: 1fr; }
    .summary-number { font-size: 1.3rem; }

    /* Report summary */
    .report-summary { grid-template-columns: 1fr; }

    /* Transaction Tabs */
    .txn-tab { padding: 10px 6px; font-size: .75rem; gap: 4px; }
    .txn-tab i { display: none; } /* Hide icons on very small screens */

    /* Credit info bar */
    .credit-info-bar { gap: 8px; }

    /* Amount display */
    .amount-display .amount { font-size: 1.3rem; }

    /* Forms */
    .content-area { padding: 10px 10px; }
    .pos-form-header { padding: 14px; }
    .pos-form-header h3 { font-size: .92rem; }
    .pos-form-body { padding: 12px; }

    /* Buttons */
    .btn { padding: 8px 14px; font-size: .82rem; }
    .btn-lg { padding: 10px 18px; font-size: .88rem; }

    /* Cards */
    .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
    .card-body { padding: 12px 14px; }

    /* Tables: allow scroll with min-width */
    .data-table { min-width: 600px; font-size: .78rem; }

    /* Filter bar */
    .filter-bar { padding: 12px; }

    /* Modal */
    .modal { max-width: 100vw; border-radius: 12px 12px 0 0; max-height: 90vh; }
    .modal-overlay { align-items: flex-end; padding: 0; }

    /* Receipt */
    .receipt-header h2 { font-size: 1rem; }
    .receipt-row { font-size: .8rem; }
    .receipt-total { font-size: .95rem; padding: 12px 0; }
}

/* ---------- Print Styles ---------- */
@media print {
    /* Remove browser-generated header/footer (URL, title, date/time) */
    @page { margin: 10mm 10mm; }

    /* Reset page */
    * { box-shadow: none !important; }
    body { background: #fff !important; color: #000 !important; font-size: 12px; }

    /* Hide everything that isn't content */
    .sidebar,
    .top-bar,
    .menu-toggle,
    .print-actions,
    .quick-actions,
    .page-actions,
    .no-print,
    .filter-bar,
    .pos-form,
    .nav-link,
    .btn { display: none !important; }

    /* Reset layout — remove sidebar margin, flex, etc */
    .app-wrapper { display: block !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .content-area { padding: 0 !important; }

    /* ── Receipt-specific ── */
    .receipt-wrapper { max-width: 100% !important; margin: 0 !important; }
    .receipt { border: 1px solid #ddd !important; border-radius: 12px !important; overflow: hidden !important; }
    .receipt-header {
        background: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .receipt-header .receipt-number {
        background: #333 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .receipt-body { padding: 16px 24px !important; }
    .receipt-row .label { color: #555 !important; }
    .receipt-row .value { color: #000 !important; }
    .receipt-total { border-top: 2px solid #000 !important; }
    .receipt-footer { border-top: 1px dashed #999 !important; padding: 16px 24px !important; }

    /* ── Report tables ── */
    .card { border: none !important; border-radius: 0 !important; }
    .card-header { border-bottom: 2px solid #000 !important; padding: 8px 0 !important; }
    .card-body { padding: 0 !important; }
    .data-table { font-size: 11px; }
    .data-table thead th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border-bottom: 2px solid #000 !important;
    }
    .data-table tbody td { border-bottom: 1px solid #ddd !important; }

    /* ── Report summary cards ── */
    .report-summary { gap: 8px !important; }
    .report-summary-card { border: 1px solid #ddd !important; border-radius: 4px !important; padding: 10px !important; }
    .report-summary-card .value { color: #000 !important; }

    /* ── Badge visibility in print ── */
    .badge {
        border: 1px solid #999 !important;
        background: transparent !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ── Text color overrides for print ── */
    .text-danger { color: #000 !important; }
    .text-success { color: #000 !important; }
    .text-warning { color: #000 !important; }
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stat-card, .card, .summary-card {
    animation: fadeIn .4s ease backwards;
}
.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: .06s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .18s; }
.stat-card:nth-child(5) { animation-delay: .24s; }
