/* Petrol Pump Credit Ledger & ERP — styles.css */
:root {
    /* Claymorphic Color Palette */
    --primary: #1e293b;           /* Deep Clay Slate */
    --primary-light: #3b82f6;     /* Candy Blue */
    --primary-lighter: #f0f4f8;   /* Soft Studio Light */
    --accent: #f97316;            /* Vibrant Clay Orange */
    --accent-hover: #ea580c;      
    --success: #10b981;           /* Minty Clay Green */
    --success-bg: #ecfdf5;        
    --danger: #ef4444;            /* Gum Red */
    --danger-bg: #fef2f2;         
    --warning: #f59e0b;           /* Honey Yellow */
    --warning-bg: #fef9c3;        
    --info: #0ea5e9;              /* Bubble Sky Blue */
    --info-bg: #f0f9ff;
    
    --surface: #ffffff;
    --background: #eef2f6;        /* Soft Clay Gray-Blue */
    --text: #0f172a;              
    --text-muted: #64748b;        
    --border: #cbd5e1;            
    --border-light: #e2e8f0;      
    
    /* Typography Tokens */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-family-heading: 'Outfit', sans-serif;
    
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */

    /* Spacing Tokens */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Bubbly Claymorphic Radius Tokens */
    --radius-sm: 14px;
    --radius-md: 22px;
    --radius-lg: 32px;
    --radius-full: 9999px;
    
    /* Claymorphic 3D Depth & Shadow Tokens */
    --shadow-sm: 4px 4px 10px rgba(166, 180, 200, 0.35), -4px -4px 10px rgba(255, 255, 255, 0.9);
    --shadow-md: 8px 8px 18px rgba(166, 180, 200, 0.4), -8px -8px 18px rgba(255, 255, 255, 0.9), inset 2px 2px 4px rgba(255, 255, 255, 0.95);
    --shadow-lg: 14px 14px 28px rgba(166, 180, 200, 0.45), -10px -10px 24px rgba(255, 255, 255, 0.95), inset 3px 3px 6px rgba(255, 255, 255, 0.9);
    --shadow-focus: 0 0 0 4px rgba(59, 130, 246, 0.35);
    --shadow-focus-danger: 0 0 0 4px rgba(239, 68, 68, 0.35);
    
    /* Clay Input Pressed Inner Shadow */
    --clay-inset: inset 3px 3px 7px rgba(166, 180, 200, 0.4), inset -3px -3px 7px rgba(255, 255, 255, 0.9);
    
    /* Animation & Transitions */
    --transition-fast: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 250ms cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Layout Tokens */
    --sidebar-width: 270px;
    --header-height: 70px;
}

[data-theme="dark"] {
    --primary: #f8fafc;
    --primary-light: #60a5fa;
    --primary-lighter: #1e293b;
    --accent: #fb923c;
    --accent-hover: #f97316;
    
    --success: #34d399;
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #fbbf24;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info: #38bdf8;
    --info-bg: rgba(59, 130, 246, 0.15);
    
    --surface: #1e293b;           
    --background: #0f172a;        
    --text: #f8fafc;              
    --text-muted: #94a3b8;        
    --border: #334155;            
    --border-light: #253346;      
    
    --shadow-sm: 4px 4px 10px rgba(0, 0, 0, 0.4), -2px -2px 8px rgba(255, 255, 255, 0.04);
    --shadow-md: 8px 8px 18px rgba(0, 0, 0, 0.5), -4px -4px 12px rgba(255, 255, 255, 0.05), inset 1px 1px 2px rgba(255, 255, 255, 0.1);
    --shadow-lg: 14px 14px 28px rgba(0, 0, 0, 0.6), -6px -6px 18px rgba(255, 255, 255, 0.06), inset 2px 2px 4px rgba(255, 255, 255, 0.12);
    --clay-inset: inset 3px 3px 7px rgba(0, 0, 0, 0.5), inset -3px -3px 7px rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .login-brand h1, .sidebar-title h2, .page-title h1, .section-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

body {
    background-color: var(--background);
    color: var(--text);
    overflow-x: hidden;
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Claymorphic Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-weight: 700;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: var(--transition-bounce);
    user-select: none;
    letter-spacing: 0.3px;
}
.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none !important;
    transform: none !important;
}
.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 6px 6px 14px rgba(249, 115, 22, 0.35), inset -3px -3px 6px rgba(0, 0, 0, 0.2), inset 3px 3px 6px rgba(255, 255, 255, 0.45);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 8px 8px 18px rgba(249, 115, 22, 0.45), inset -3px -3px 6px rgba(0, 0, 0, 0.2), inset 3px 3px 6px rgba(255, 255, 255, 0.55);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
    box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.25), inset -2px -2px 4px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--primary-light);
    box-shadow: 5px 5px 12px rgba(166, 180, 200, 0.3), -4px -4px 10px rgba(255, 255, 255, 0.9), inset -2px -2px 5px rgba(0,0,0,0.04), inset 2px 2px 5px rgba(255,255,255,0.9);
}
.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    color: #1d4ed8;
    box-shadow: 7px 7px 15px rgba(166, 180, 200, 0.38), -5px -5px 12px rgba(255, 255, 255, 0.95), inset -2px -2px 5px rgba(0,0,0,0.04), inset 2px 2px 5px rgba(255,255,255,0.9);
}
.btn-secondary:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
    box-shadow: var(--clay-inset);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border);
    color: var(--text);
    box-shadow: none;
}
.btn-outline:hover:not(:disabled) {
    background-color: var(--surface);
    border-color: transparent;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 6px 6px 14px rgba(239, 68, 68, 0.35), inset -3px -3px 6px rgba(0, 0, 0, 0.2), inset 3px 3px 6px rgba(255, 255, 255, 0.45);
}
.btn-danger:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 8px 8px 18px rgba(239, 68, 68, 0.45), inset -3px -3px 6px rgba(0, 0, 0, 0.2), inset 3px 3px 6px rgba(255, 255, 255, 0.55);
}
.btn-danger:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
    box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.25), inset -2px -2px 4px rgba(255, 255, 255, 0.4);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 6px 6px 14px rgba(16, 185, 129, 0.35), inset -3px -3px 6px rgba(0, 0, 0, 0.2), inset 3px 3px 6px rgba(255, 255, 255, 0.45);
}
.btn-success:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 8px 8px 18px rgba(16, 185, 129, 0.45), inset -3px -3px 6px rgba(0, 0, 0, 0.2), inset 3px 3px 6px rgba(255, 255, 255, 0.55);
}
.btn-success:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
    box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.25), inset -2px -2px 4px rgba(255, 255, 255, 0.4);
}

.btn-block {
    display: flex;
    width: 100%;
}
.btn-xs {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-full);
}

/* Login Page Revamp */
.login-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 10% 20%, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}
.login-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 45px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(243, 112, 33, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: var(--transition-bounce);
}
.login-brand {
    text-align: center;
    margin-bottom: 35px;
}
.login-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 18px;
    box-shadow: 0 8px 20px rgba(243, 112, 33, 0.3);
    animation: pulseGlow 3s infinite ease-in-out;
}
@keyframes pulseGlow {
    0% { box-shadow: 0 8px 20px rgba(243, 112, 33, 0.3); }
    50% { box-shadow: 0 8px 30px rgba(243, 112, 33, 0.5), 0 0 10px rgba(243, 112, 33, 0.2); }
    100% { box-shadow: 0 8px 20px rgba(243, 112, 33, 0.3); }
}
.login-brand h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.5px;
}
.login-brand p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
    font-weight: 500;
}

/* Forms & Spacing Revamp */
.form-group {
    margin-bottom: var(--space-6);
}
.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-2);
    letter-spacing: 0.2px;
}
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 15px;
    transition: var(--transition-smooth);
}
.input-icon-wrapper input,
.input-icon-wrapper select,
.form-group textarea,
.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(203, 213, 225, 0.6);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    outline: none;
    color: var(--text);
    background: #f8fafc;
    transition: var(--transition-smooth);
    box-shadow: inset 3px 3px 6px rgba(166, 180, 200, 0.35), inset -3px -3px 6px rgba(255, 255, 255, 0.9);
}
.input-icon-wrapper input {
    padding-left: 44px;
}
.input-icon-wrapper select {
    padding-left: 44px;
}
.form-group textarea:focus-visible,
.form-group input:focus-visible,
.form-group select:focus-visible,
.input-icon-wrapper input:focus-visible,
.input-icon-wrapper select:focus-visible {
    border-color: var(--primary-light);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), inset 1px 1px 3px rgba(166, 180, 200, 0.2);
    transform: translateY(-1px);
}
.form-group textarea:focus-visible + i,
.input-icon-wrapper input:focus-visible + i,
.input-icon-wrapper select:focus-visible + i {
    color: var(--primary-light);
}

/* App Layout & Shell Revamp */
.app-shell {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
}
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    display: none; /* Desktop hides mobile header */
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.sidebar {
    width: var(--sidebar-width);
    background: #1e293b;
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 99;
    box-shadow: 10px 0 25px rgba(15, 23, 42, 0.15);
    border-right: 2px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand {
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
}
.sidebar-logo {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 4px 4px 10px rgba(249, 115, 22, 0.4), inset -2px -2px 4px rgba(0,0,0,0.25), inset 2px 2px 4px rgba(255,255,255,0.45);
}
.sidebar-title h2 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
}
.sidebar-title p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    margin-top: 2px;
}
.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-full);
    transition: var(--transition-bounce);
}
.nav-item i {
    font-size: 17px;
    width: 22px;
    text-align: center;
}
.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    box-shadow: inset 1px 1px 3px rgba(255,255,255,0.1);
}
.nav-item.active {
    color: white;
    background: var(--accent);
    box-shadow: 5px 5px 14px rgba(249, 115, 22, 0.4), inset -2px -2px 5px rgba(0,0,0,0.2), inset 2px 2px 5px rgba(255,255,255,0.45);
    transform: translateX(4px) scale(1.02);
}
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(243, 112, 33, 0.2);
}
.sidebar-user-info {
    display: flex;
    flex-direction: column;
}
.sidebar-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}
.sidebar-user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    margin-top: 2px;
}
.sidebar-footer-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.sidebar-logout-btn {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.65);
    background: transparent;
}
.sidebar-logout-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
    border-color: rgba(255,255,255,0.3);
}

.main-content {
    flex: 1;
    padding: 35px 40px;
    overflow-y: auto;
    background-color: var(--background);
}

/* Page Architecture */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 20px;
}
.page-title h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}
.page-title p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 500;
}
.page-actions {
    display: flex;
    gap: 12px;
}

/* Grids */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 28px;
    margin-bottom: 30px;
}

/* Claymorphic Cards */
.card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    border: 3px solid rgba(255, 255, 255, 0.85);
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

/* KPI Card details */
.kpi-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kpi-info h3 {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.kpi-info p {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
}
.kpi-icon {
    width: 54px;
    height: 54px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 4px 4px 10px rgba(166, 180, 200, 0.35), inset -2px -2px 5px rgba(0,0,0,0.08), inset 2px 2px 5px rgba(255,255,255,0.9);
}
.kpi-icon.primary { background: #dbeafe; color: var(--primary-light); }
.kpi-icon.success { background: #d1fae5; color: var(--success); }
.kpi-icon.danger { background: #fee2e2; color: var(--danger); }
.kpi-icon.warning { background: #fef3c7; color: var(--warning); }

/* Table Elements Revamp */
.table-container {
    overflow-y: auto;
    max-height: 65vh;
    border-radius: var(--radius-md);
    border: 3px solid rgba(255, 255, 255, 0.85);
    background: var(--surface);
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 14px;
}
.table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8fafc;
    padding: 14px 18px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 12px;
}
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text);
    transition: var(--transition-smooth);
}
.table tr:last-child td {
    border-bottom: none;
}
.table tr:hover td {
    background-color: #f8fafc;
}
.table-footer {
    font-weight: 700;
    background-color: #f8fafc;
}
.table-footer td {
    border-top: 2px solid var(--border);
    color: var(--primary);
}

.amount-debit { color: var(--danger); font-family: 'Outfit', monospace; font-weight: 700; }
.amount-credit { color: var(--success); font-family: 'Outfit', monospace; font-weight: 700; }
.amount-neutral { color: var(--text); font-family: 'Outfit', monospace; font-weight: 700; }

/* Claymorphic Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: var(--font-size-xs);
    font-weight: 800;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1;
    box-shadow: 2px 2px 5px rgba(166, 180, 200, 0.3), inset -1px -1px 3px rgba(0,0,0,0.06), inset 1px 1px 3px rgba(255,255,255,0.9);
}
.badge-success { background: #d1fae5; color: #065f46; border: none; }
.badge-danger { background: #fee2e2; color: #991b1b; border: none; }
.badge-warning { background: #fef3c7; color: #92400e; border: none; }
.badge-info { background: #e0f2fe; color: #075985; border: none; }

/* Claymorphic Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 92%;
    max-width: 580px;
    box-shadow: 20px 20px 40px rgba(15, 23, 42, 0.25), -12px -12px 30px rgba(255, 255, 255, 0.9), inset 3px 3px 6px rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    border: 4px solid rgba(255, 255, 255, 0.9);
    overflow: hidden;
    animation: modalRise 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalRise {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
    padding: 22px 28px;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}
.modal-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}
.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text);
}
.modal-body {
    padding: 28px;
    overflow-y: auto;
}
.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
    background: #f8fafc;
}

/* Confirmation Dialog */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.confirm-dialog {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    animation: modalRise 0.25s ease-out;
}
.confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--danger-bg);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 20px;
}
.confirm-dialog h3 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 8px;
}
.confirm-dialog p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}
.confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-top: 24px;
}

/* Toast Alerts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.toast {
    background: var(--primary);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    animation: slideIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 5px solid var(--primary-light);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--accent); }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Search and Filters Revamp */
.filter-bar {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}
.search-input {
    flex: 1;
    min-width: 220px;
    position: relative;
}
.search-input input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}
.search-input input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(243, 112, 33, 0.15);
}
.search-input i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    transition: var(--transition-smooth);
}
.search-input input:focus + i {
    color: var(--accent);
}
.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    transition: var(--transition-smooth);
}
.filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(243, 112, 33, 0.15);
}

/* Responsive Mobile Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    z-index: 99;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.03);
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    gap: 4px;
    transition: var(--transition-smooth);
}
.bottom-nav-item i { font-size: 20px; transition: var(--transition-smooth); }
.bottom-nav-item:hover { color: var(--primary); }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item.active i { transform: scale(1.1); }

/* Floating Action Button (FAB) */
.fab-container {
    position: fixed;
    bottom: 84px;
    right: 24px;
    z-index: 98;
}
.fab {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    background: var(--accent);
    color: white;
    border: none;
    box-shadow: 8px 8px 18px rgba(249, 115, 22, 0.45), inset -3px -3px 6px rgba(0,0,0,0.25), inset 3px 3px 6px rgba(255,255,255,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition-bounce);
}
.fab:hover {
    transform: scale(1.08) rotate(90deg) translateY(-4px);
    box-shadow: 10px 10px 22px rgba(249, 115, 22, 0.55), inset -3px -3px 6px rgba(0,0,0,0.25), inset 3px 3px 6px rgba(255,255,255,0.55);
}
.fab:active {
    transform: scale(0.96) rotate(90deg);
    box-shadow: inset 4px 4px 8px rgba(0,0,0,0.3);
}
.fab-actions {
    position: absolute;
    bottom: 74px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-end;
}
.fab-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition-smooth);
}
.fab-action:hover {
    transform: scale(1.05) translateX(-4px);
    background: var(--primary-lighter);
}
.fab-action i { font-size: 14px; }
#fab-sale { color: var(--danger); border-left: 3px solid var(--danger); }
#fab-payment { color: var(--success); border-left: 3px solid var(--success); }

/* Skeleton Loader */
.skeleton-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 50px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    animation: pulse 1.6s infinite ease-in-out;
}
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.stat-card {
    text-align: center;
    transition: var(--transition-bounce);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.stat-card h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.bg-primary-light {
    background-color: rgba(37, 99, 235, 0.05) !important;
    border: 1px solid rgba(37, 99, 235, 0.15) !important;
    color: var(--primary-light) !important;
}

/* Daily Daybook Tab Navigation Styles */
.daybook-tab-btn {
    border-bottom: 2px solid transparent !important;
    color: var(--text-muted) !important;
    font-weight: 700 !important;
    border-radius: 0 !important;
    transition: var(--transition-smooth) !important;
}
.daybook-tab-btn:hover {
    color: var(--primary-light) !important;
    background: rgba(37, 99, 235, 0.03) !important;
}
.daybook-tab-btn.active {
    color: var(--primary-light) !important;
    background: transparent !important;
    border-bottom: 3px solid var(--primary-light) !important;
}

/* Responsive adjustments */
@media(max-width: 992px) {
    .app-header { display: flex; }
    .sidebar {
        position: fixed;
        left: -270px;
        top: 0; bottom: 0;
        transition: var(--transition-smooth);
    }
    .sidebar.active { left: 0; }
    .sidebar-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: 90;
        display: none;
        backdrop-filter: blur(4px);
    }
    .sidebar-overlay.active { display: block; }
    .main-content {
        padding: 24px;
        padding-top: calc(var(--header-height) + 24px);
        padding-bottom: 84px;
    }
    .bottom-nav { display: flex; }
}

@media(max-width: 600px) {
    .grid-2 { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 14px; }
    .page-actions { width: 100%; justify-content: flex-end; }
    .filter-bar { flex-direction: column; width: 100%; align-items: stretch; }
    .filter-select, .search-input { width: 100%; }
    .modal { height: 100%; max-height: 100%; border-radius: 0; }
}

/* Print Optimization */
@media print {
    .sidebar, .bottom-nav, .fab-container, .app-header, .page-actions, .filter-bar, .no-print {
        display: none !important;
    }
    .main-content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    
    /* Fix for printing multiple pages */
    body, html, .main-content, .card, .table-container, #report-viewport, div {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }
    table { page-break-inside: auto; width: 100% !important; }
    tr { page-break-inside: avoid; page-break-after: auto; }
    th, td { padding: 4px !important; font-size: 10px !important; }
}
