/* ============================================================
   HISAB PRO - Complete Design System
   Neumorphic + Glassmorphism | Dark Mode | Responsive
   ============================================================ */

/* ── CSS Variables (Light Mode) ── */
:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --primary-glow: rgba(79, 70, 229, 0.3);
    --secondary: #10B981;
    --secondary-light: #34D399;
    --accent: #F43F5E;
    --accent-light: #FB7185;
    --warning: #F59E0B;
    --warning-light: #FBBF24;
    --info: #06B6D4;

    --bg-color: #E0E5EC;
    --bg-sidebar: #E8ECF1;
    --surface: #E0E5EC;
    --surface-2: #F1F5F9;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border-color: rgba(0,0,0,0.06);

    --shadow-light: #ffffff;
    --shadow-dark: #a3b1c6;
    --neu-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    --neu-shadow-sm: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    --neu-inner: inset 5px 5px 10px rgba(163,177,198,0.5), inset -5px -5px 10px rgba(255,255,255,0.8);

    --glass-bg: rgba(255,255,255,0.45);
    --glass-border: rgba(255,255,255,0.6);
    --glass-shadow: 0 8px 32px rgba(31,38,135,0.1);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.25,0.8,0.25,1);
    --sidebar-width: 260px;
}

/* ── Dark Mode ── */
[data-theme="dark"] {
    --bg-color: #0F172A;
    --bg-sidebar: #1E293B;
    --surface: #1E293B;
    --surface-2: #334155;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --text-light: #64748B;
    --border-color: rgba(255,255,255,0.08);
    --shadow-light: rgba(255,255,255,0.03);
    --shadow-dark: rgba(0,0,0,0.4);
    --neu-shadow: 6px 6px 14px rgba(0,0,0,0.5), -6px -6px 14px rgba(255,255,255,0.02);
    --neu-shadow-sm: 3px 3px 6px rgba(0,0,0,0.4), -3px -3px 6px rgba(255,255,255,0.02);
    --neu-inner: inset 4px 4px 8px rgba(0,0,0,0.4), inset -4px -4px 8px rgba(255,255,255,0.03);
    --glass-bg: rgba(30,41,59,0.85);
    --glass-border: rgba(255,255,255,0.1);
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.3s ease;
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================================
   LAYOUT: Sidebar + Main Content
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    box-shadow: var(--neu-shadow-sm);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}
.sidebar-header .brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-header .brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.nav-item:hover {
    background: var(--primary-glow);
    color: var(--primary);
    transform: translateX(4px);
    text-decoration: none;
}
.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
    font-weight: 600;
}
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 8px;
}

.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid var(--border-color);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 28px;
    min-height: 100vh;
    max-width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.35s ease;
}

/* ── Mobile Sidebar Toggle ── */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 6px 20px var(--primary-glow);
    transition: var(--transition);
}
.sidebar-toggle:hover { transform: scale(1.1); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; max-width: 100%; padding: 16px; }
}

/* ============================================================
   NEUMORPHIC COMPONENTS
   ============================================================ */
.neu-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--neu-shadow);
    padding: 24px;
    transition: var(--transition);
}
.neu-card:hover { transform: translateY(-1px); }
.neu-card.flat { box-shadow: none; border: 1px solid var(--border-color); }
.neu-card.flat:hover { transform: none; }

.neu-btn {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--neu-shadow-sm);
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 22px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.neu-btn:hover { transform: translateY(-1px); }
.neu-btn:active { box-shadow: var(--neu-inner); transform: translateY(1px); }
.neu-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.neu-btn.primary { background: var(--primary); color: white; box-shadow: 0 4px 15px var(--primary-glow); }
.neu-btn.primary:hover { background: var(--primary-dark); }
.neu-btn.primary:active { box-shadow: inset 0 2px 6px rgba(0,0,0,0.3); }

.neu-btn.success { background: var(--secondary); color: white; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.neu-btn.danger { background: var(--accent); color: white; box-shadow: 0 4px 12px rgba(244,63,94,0.3); }
.neu-btn.sm { padding: 8px 14px; font-size: 0.85rem; border-radius: var(--radius-xs); }
.neu-btn.xs { padding: 5px 10px; font-size: 0.8rem; border-radius: var(--radius-xs); }

.neu-input, .neu-select, .neu-textarea {
    width: 100%;
    padding: 13px 16px;
    border: none;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--neu-inner);
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}
.neu-input:focus, .neu-select:focus, .neu-textarea:focus {
    box-shadow: var(--neu-inner), 0 0 0 2px var(--primary-light);
}
.neu-input::placeholder { color: var(--text-light); }
.neu-textarea { resize: vertical; min-height: 80px; }
.neu-select { cursor: pointer; appearance: auto; }

/* ── Input Group ── */
.input-group { margin-bottom: 18px; }
.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Form Grid ── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ============================================================
   GLASSMORPHISM
   ============================================================ */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    padding: 24px;
}

.glass-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 16px;
}
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px var(--primary-glow);
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}
.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}
.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    position: relative;
    overflow: hidden;
}
.stat-card .stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 2.2rem;
    opacity: 0.12;
    color: var(--primary);
}
.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}
.stat-card .stat-sub {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 700px;
}
.data-table thead {
    background: var(--surface-2);
}
.data-table thead th {
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}
.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.data-table tbody tr:hover {
    background: var(--primary-glow);
}
.data-table tbody td {
    padding: 14px 16px;
    font-size: 0.92rem;
    vertical-align: middle;
}
.data-table .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.data-table .empty-row td {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-success { background: rgba(16,185,129,0.15); color: var(--secondary); }
.badge-danger { background: rgba(244,63,94,0.15); color: var(--accent); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-info { background: rgba(6,182,212,0.15); color: var(--info); }
.badge-primary { background: rgba(79,70,229,0.15); color: var(--primary); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}
.modal-close:hover { background: var(--border-color); color: var(--accent); }

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

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    animation: toastIn 0.4s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    color: white;
}
.toast.toast-success { background: linear-gradient(135deg, #10B981, #059669); }
.toast.toast-error { background: linear-gradient(135deg, #F43F5E, #E11D48); }
.toast.toast-warning { background: linear-gradient(135deg, #F59E0B, #D97706); }
.toast.toast-info { background: linear-gradient(135deg, #06B6D4, #0891B2); }
.toast.removing { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }

/* ============================================================
   AUTH PAGES (Login, Register, Forgot)
   ============================================================ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg-color);
}
.auth-card {
    max-width: 440px;
    width: 100%;
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
}
.auth-icon {
    text-align: center;
    margin-bottom: 16px;
}
.auth-icon i {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}
.security-section {
    border-top: 1px dashed var(--shadow-dark);
    margin: 24px 0;
    padding-top: 20px;
}
.security-block {
    background: var(--bg-color);
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}
.security-block label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================================
   INVOICE BUILDER
   ============================================================ */
.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.invoice-items-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--surface-2);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}
.invoice-items-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}
.invoice-items-table input, .invoice-items-table select {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--surface);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    width: 100%;
}
.invoice-items-table input:focus, .invoice-items-table select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
.invoice-summary {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}
.invoice-summary table {
    border-collapse: collapse;
    min-width: 280px;
}
.invoice-summary td {
    padding: 8px 14px;
    font-size: 0.95rem;
}
.invoice-summary .total-row td {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--primary);
    padding-top: 12px;
}

/* ============================================================
   INVOICE PRINT VIEW
   ============================================================ */
.invoice-print {
    background: white;
    color: #1a1a1a;
    padding: 32px;
    border-radius: var(--radius);
    max-width: 800px;
    margin: 0 auto;
}
.invoice-print .inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid #4F46E5;
}
.invoice-print .inv-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.invoice-print table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.invoice-print table th {
    background: #f8fafc;
    padding: 10px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.invoice-print table td {
    padding: 10px;
    border: 1px solid #e2e8f0;
}
@media print {
    body * { visibility: hidden; }
    .invoice-print, .invoice-print * { visibility: visible; }
    .invoice-print { 
        position: absolute; 
        left: 0; 
        top: 0; 
        width: 100%; 
        max-width: 100%;
        margin: 0;
        padding: 10px;
        box-shadow: none;
        border: none;
        transform: scale(0.95);
        transform-origin: top left;
    }
    .no-print { display: none !important; }
    @page { margin: 1cm; size: A4 portrait; }
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.filter-bar input, .filter-bar select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--surface);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
}
.filter-bar input:focus, .filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================================
   DASHBOARD SPECIFIC
   ============================================================ */
.recent-list { list-style: none; }
.recent-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.recent-list li:last-child { border-bottom: none; }

/* ============================================================
   REPORTS
   ============================================================ */
.report-card {
    border-left: 4px solid var(--primary);
}
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.report-summary .item {
    text-align: center;
    padding: 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.report-summary .item .val {
    font-size: 1.5rem;
    font-weight: 700;
}
.report-summary .item .lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--secondary) !important; }
.text-danger { color: var(--accent) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.gap-1 { gap: 8px; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.hidden { display: none !important; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s ease forwards; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* ============================================================
   RESPONSIVE GRID HELPERS
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

/* ============================================================
   PRODUCT SEARCH DROPDOWN (Billing)
   ============================================================ */
.product-search-wrapper {
    position: relative;
    width: 100%;
}
.product-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--surface);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
}
.product-search-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
.product-search-input::placeholder {
    color: var(--text-light);
}
.product-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-xs) var(--radius-xs);
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    z-index: 500;
}
.product-search-option {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}
.product-search-option:hover {
    background: var(--primary-glow) !important;
}
.product-search-option:last-child {
    border-bottom: none;
}

/* ============================================================
   INVOICE ITEM SUMMARY (List View)
   ============================================================ */
.inv-item-summary {
    display: inline-block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.84rem;
    color: var(--text-muted);
    background: var(--surface-2);
    padding: 2px 8px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-light);
}

/* ============================================================
   ENHANCED RECENT LIST (Dashboard)
   ============================================================ */
.recent-list li {
    transition: background 0.2s ease, transform 0.15s ease;
    border-radius: var(--radius-xs);
    padding: 14px 8px !important;
    margin-bottom: 2px;
}
.recent-list li:hover {
    background: var(--primary-glow);
    transform: translateX(3px);
}

/* ============================================================
   PAYMENT HISTORY (Invoice Detail)
   ============================================================ */
.payment-history-section {
    margin-top: 16px;
    padding: 14px;
    background: var(--surface-2) !important;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.payment-history-section table {
    margin-bottom: 0;
}
.payment-history-section table th {
    background: transparent !important;
    border: none !important;
    font-size: 0.78rem;
    padding: 4px 8px;
    color: var(--text-light) !important;
}
.payment-history-section table td {
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 6px 8px;
}

/* ============================================================
   MODAL ENHANCEMENTS
   ============================================================ */
.modal-content {
    max-width: 720px;
}
@media (max-width: 600px) {
    .modal-content {
        max-height: 95vh;
        margin: 8px;
    }
    .invoice-print {
        padding: 16px !important;
    }
    .invoice-print .inv-header {
        flex-direction: column;
        gap: 12px;
    }
    .invoice-print .inv-info-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   INLINE BADGE INFO
   ============================================================ */
.badge-info {
    padding: 2px 6px;
    font-size: 0.7rem;
}
.neu-btn.info {
    background: var(--info);
    color: white;
    box-shadow: 0 4px 12px rgba(6,182,212,0.3);
}
.neu-btn.info:hover {
    background: #0891B2;
}

/* ============================================================
   MOBILE-FRIENDLY INVOICE FORM
   ============================================================ */
@media (max-width: 600px) {
    .invoice-items-table th:nth-child(4),
    .invoice-items-table td:nth-child(4),
    .invoice-items-table th:nth-child(5),
    .invoice-items-table td:nth-child(5) {
        display: none;
    }
    .invoice-items-table input,
    .invoice-items-table select {
        min-width: 60px;
        font-size: 0.82rem;
        padding: 6px;
    }
    .product-search-input {
        font-size: 0.85rem !important;
        padding: 10px 12px !important;
    }
    .product-search-dropdown {
        max-height: 200px;
    }
    .filter-bar {
        flex-direction: column;
    }
    .filter-bar input,
    .filter-bar select {
        width: 100%;
    }
}

/* ============================================================
   ALERTS SECTION (Dashboard)
   ============================================================ */
#dash-alerts > div {
    animation: fadeInUp 0.3s ease forwards;
}
#dash-alerts > div:nth-child(2) {
    animation-delay: 0.1s;
}
#dash-alerts > div:nth-child(3) {
    animation-delay: 0.2s;
}

/* ============================================================
   TEXT INFO BADGE (for item count)
   ============================================================ */
.text-info {
    color: var(--info) !important;
}
