@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* Logo Wrapper & Popup Animation */
.logo-wrapper {
    text-decoration: none;
    display: flex;
    align-items: center;
    height: var(--logo-height, 48px);
    animation: logoPopup 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.logo-img-popup {
    height: 100%;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    border-radius: 6px;
    filter: drop-shadow(0 0 10px rgba(255,179,0,0.4)) drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
@keyframes logoPopup {
    0% { opacity: 0; transform: scale(0.3) translateY(-20px); }
    50% { transform: scale(1.08) translateY(3px); }
    70% { transform: scale(0.97) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@media (max-width: 479px) {
    .logo-wrapper {
        --logo-height: 36px;
    }
    .logo-img-popup {
        max-width: 120px;
    }
}
/* Premium Summary Card */
.premium-summary-card {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 24px;
    background: linear-gradient(135deg, #f8fafc 60%, #e0e7ef 100%);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(11,19,41,0.07);
    padding: 28px 32px;
    margin-bottom: 28px;
    border: 1.5px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}
.premium-summary-card .summary-block {
    flex: 1;
    text-align: center;
}
.premium-summary-card .summary-label {
    font-size: 15px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.premium-summary-card .summary-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: -0.02em;
    margin-bottom: 0;
    margin-top: 2px;
}
.premium-summary-card .summary-icon {
    font-size: 1.5em;
    margin-right: 4px;
}

/* Glassmorphism Filter Bar */
.glass-filter-bar {
    background: rgba(255,255,255,0.85);
    box-shadow: 0 2px 12px rgba(11,19,41,0.04);
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    margin-bottom: 22px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Input with Icon */
.input-icon-group {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-right: 10px;
    min-width: 140px;
}
.input-icon-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2px;
}
.input-icon-group .input-icon {
    position: absolute;
    left: 10px;
    top: 34px;
    font-size: 1.1em;
    color: var(--accent-color);
    pointer-events: none;
    z-index: 2;
}
.input-icon-group input,
.input-icon-group select {
    padding-left: 32px !important;
}

/* Table Premium Enhancements */
.premium-table {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(11,19,41,0.04);
}
.premium-table th, .premium-table td {
    font-size: 15px;
    transition: background 0.2s;
}
.premium-row-hover:hover {
    background: #f1f5f9 !important;
    box-shadow: 0 2px 8px rgba(11,19,41,0.04);
    z-index: 1;
}
.section-header {
    font-size: 1.1em;
    font-weight: 700;
    text-align: left !important;
    background: linear-gradient(90deg, #f3f4f6 80%, #e0e7ef 100%) !important;
    color: var(--primary-color) !important;
    border-top: 2px solid var(--primary-color);
    border-bottom: 1.5px solid #e2e8f0;
    letter-spacing: 0.01em;
}
.section-header.sales-section .section-icon {
    color: var(--success-color);
}
.section-header.exp-section .section-icon {
    color: var(--danger-color);
}
.section-icon {
    font-size: 1.2em;
    margin-right: 6px;
    vertical-align: middle;
}

/* Fade-in Animation */
.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Report Switcher */
.report-switcher {
    display: flex !important;
}

@media (max-width: 900px) {
    .premium-summary-card {
        flex-direction: column;
        gap: 12px;
        padding: 18px 10px;
    }
}
400;500;600;700;800&display=swap');

/* Background Slider Styles */
.bg-slider {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}
.bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.bg-slide.active {
    opacity: 1;
    z-index: 1;
}
/* Background Slider Styles */
.bg-slider {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}
.bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.bg-slide.active {
    opacity: 1;
    z-index: 1;
}
/* c:/xampp/htdocs/yarahman/assets/css/style.css */
:root {
    --primary-color: #0b1329; /* Deep royal blue-black */
    --accent-color: #fb3640;  /* Imperial Red */
    --success-color: #10b981; /* Emerald green */
    --danger-color: #ef4444;  /* Vibrant red */
    --bg-color: #f8fafc;      /* Smooth premium slate background */
    --card-bg: #ffffff;
    --text-color: #1e293b;    /* Premium slate text */
    --border-color: #e2e8f0;  /* Delicate slate border */
    --btn-text: #ffffff;      /* Button text color */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Color Themes */
body.theme-night-kiwi {
    --primary-color: #222222;
    --accent-color: #89E900;
    --btn-text: #fff;
}
body.theme-sand-cyprus {
    --primary-color: #004643;
    --accent-color: #F0EDE5;
    --btn-text: #000;
}
body.theme-ghost-persian {
    --primary-color: #27187E;
    --accent-color: #F7F7FF;
    --btn-text: #000;
}
body.theme-imperial-night {
    --primary-color: #000F08;
    --accent-color: #FB3640;
    --btn-text: #fff;
}
body.theme-milk-plum {
    --primary-color: #381932;
    --accent-color: #FFF3E6;
    --btn-text: #000;
}
body.theme-lemon-midnight {
    --primary-color: #101820;
    --accent-color: #FEE715;
    --btn-text: #000;
}
body.theme-oat-olive {
    --primary-color: #415B06;
    --accent-color: #F0E6DA;
    --btn-text: #000;
}
body.theme-butter-cherry {
    --primary-color: #75070C;
    --accent-color: #FFEDAB;
    --btn-text: #000;
}
body.theme-amber-cobalt {
    --primary-color: #003566;
    --accent-color: #FFC300;
    --btn-text: #000;
}
body.theme-tangerine-charcoal {
    --primary-color: #252422;
    --accent-color: #FFC300;
    --btn-text: #000;
}


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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-bottom: 70px; /* Space for bottom nav on mobile */
    -webkit-font-smoothing: antialiased;
}

/* Header */
.top-header {
    background: var(--primary-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
    gap: 8px;
}
.top-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}
.top-header h1 {
    font-size: clamp(16px, 2.2vw, 22px);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.03em;
    white-space: nowrap;
}
.top-header .branch-name {
    font-size: clamp(12px, 1.4vw, 14px);
    color: var(--accent-color);
    font-weight: 600;
    white-space: nowrap;
}
.branch-selector {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 8px 36px 8px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    font-family: var(--font-family);
    margin-top: 4px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    letter-spacing: 0.02em;
}
.branch-selector:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.06) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}
.branch-selector:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(251, 54, 64, 0.25), 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}
.branch-selector option {
    background-color: #0f172a; /* Slate 900 for dark mode dropdown */
    color: #ffffff;
    padding: 12px;
    font-weight: 500;
}
.logout-btn {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    background: rgba(255,255,255,0.2);
    padding: 8px 14px;
    border-radius: 6px;
    white-space: nowrap;
    font-weight: 600;
    transition: all 0.2s ease;
}
.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}
.desktop-nav {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 20px;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
}
@media (max-width: 900px) {
    .desktop-nav {
        gap: 4px;
        margin-left: 8px;
    }
}
.desktop-nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
}
.desktop-nav-link:hover, .desktop-nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

/* Container */
.container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0,0,0,0.04);
}

/* Inputs and Buttons */
input, select, button {
    font-family: var(--font-family);
    font-size: 16px; /* Prevents iOS zoom */
}
input[type="number"], input[type="text"], input[type="password"], input[type="date"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 5px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
}
button {
    cursor: pointer;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 700;
    min-height: 44px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
    font-size: 14px;
}
.btn-primary {
    background: var(--primary-color);
    color: var(--btn-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(11, 19, 41, 0.25);
    filter: brightness(1.1);
}
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
    filter: brightness(1.05);
}
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
    filter: brightness(1.05);
}
.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover {
    background-color: rgba(11, 19, 41, 0.05);
    transform: translateY(-1px);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    display: flex;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}
.nav-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    color: var(--text-color);
    text-decoration: none;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.nav-item.active {
    color: var(--accent-color);
    font-weight: bold;
}
.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* Desktop Overrides */
@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
    .desktop-nav {
        display: flex !important;
        visibility: visible !important;
    }
    body {
        padding-bottom: 0;
    }
    body.has-floating-summary {
        padding-bottom: 60px;
    }
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    #items-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 20px;
    }
    .entry-card {
        margin-bottom: 0;
    }
    .charts-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mb-1 { margin-bottom: 10px; }
.mt-2 { margin-top: 20px; }
.mb-2 { margin-bottom: 20px; }

/* Dashboard Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
.kpi-card {
    background: #FFFFFF;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0,0,0,0.04);
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}
.kpi-title {
    font-size: 13px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    font-weight: 600;
}
.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}
.kpi-value.profit { color: var(--success-color); }
.kpi-value.loss { color: var(--danger-color); }

.premium-net-card {
    background: var(--primary-color);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 15, 8, 0.2);
    margin-bottom: 20px;
}
.premium-net-card .kpi-title { color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.premium-net-card .kpi-value { color: #fff !important; font-size: 36px; }

/* Daily Entry Card Layout (Mobile) */
.entry-card {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    margin-bottom: 18px;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.015);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.entry-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.04);
    border-color: #cbd5e1;
}
.entry-card.filled {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.05);
}
.entry-header {
    font-weight: 700;
    margin-bottom: 14px;
    font-size: 17px;
    color: var(--primary-color);
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.entry-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 5px;
}
.entry-inputs > div {
    flex: 1;
}
.entry-inputs label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
    display: block !important;
}
.entry-inputs input {
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    color: #1e293b !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
    margin-top: 2px !important;
}
.entry-inputs input:focus {
    background: #ffffff !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(251, 54, 64, 0.12) !important;
}
.payment-toggles {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.pay-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: #f5f5f5;
    cursor: pointer;
    font-weight: bold;
    border: none;
    border-radius: 0;
}
.pay-btn.cash.active {
    background: var(--primary-color);
    color: #fff;
}
.pay-btn.gpay.active {
    background: var(--accent-color);
    color: #fff;
}

/* Spinner Overlay */
#loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Toasts */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}
.toast {
    background: var(--success-color);
    color: #fff;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.3s;
}
.toast.error { background: var(--danger-color); }
.toast.show { opacity: 1; }

/* Table */
.table-responsive {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
}
th, td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}
th {
    background-color: var(--primary-color);
    color: #fff;
    position: sticky;
    top: 0;
}
/* Floating summary */
.floating-summary {
    position: fixed;
    bottom: 68px;
    left: 15px;
    width: calc(100% - 30px);
    background: rgba(11, 19, 41, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 900;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.floating-summary div {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.02em;
}
.floating-summary span {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-left: 4px;
}
body.has-floating-summary {
    padding-bottom: 150px;
}
@media (min-width: 768px) {
    .floating-summary {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 600px;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* MOBILE VIEW FIXES - Comprehensive mobile responsiveness             */
/* ═══════════════════════════════════════════════════════════════════ */

/* Extra small devices (< 480px) */
@media (max-width: 479px) {
    /* Header adjustments */
    .top-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .desktop-nav {
        display: none !important;
        visibility: hidden !important;
    }
    
    .top-header h1 {
        font-size: 18px;
        flex: 1;
        min-width: 100%;
    }
    
    .top-header > div:last-child {
        display: flex;
        gap: 8px;
        width: 100%;
        justify-content: space-between;
    }
    
    .branch-selector {
        flex: 1;
        min-width: 120px;
        padding: 6px 24px 6px 10px;
        font-size: 12px;
    }
    
    .logout-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    /* Glass filter bar */
    .glass-filter-bar {
        margin-bottom: 16px;
        padding: 12px;
    }
    
    /* Input groups */
    .input-icon-group {
        margin-right: 0;
        min-width: 100%;
        margin-bottom: 8px;
    }
    
    .input-icon-group input,
    .input-icon-group select {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Premium summary card */
    .premium-summary-card {
        padding: 16px;
        gap: 8px;
        margin-bottom: 16px;
        flex-direction: column;
    }
    
    .premium-summary-card .summary-value {
        font-size: 1.8rem;
    }
    
    /* Container and cards */
    .container {
        padding: 12px;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    /* Entry cards */
    .entry-card {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    .entry-header {
        font-size: 15px;
        margin-bottom: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .entry-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .entry-inputs > div {
        width: 100%;
    }
    
    .entry-inputs input {
        font-size: 16px !important;
        padding: 10px !important;
    }
    
    /* Buttons */
    button {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .btn-outline {
        margin-bottom: 8px;
    }
    
    /* Payment toggles */
    .payment-toggles {
        flex-direction: column;
    }
    
    .pay-btn {
        width: 100%;
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 6px;
    }
    
    /* Table responsive */
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 8px;
    }
    
    /* KPI cards */
    .kpi-card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .kpi-value {
        font-size: 24px;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Bottom nav adjustments */
    .bottom-nav {
        gap: 0;
    }
    
    .nav-item {
        padding: 10px 0;
        font-size: 11px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    body {
        padding-bottom: 60px;
    }
    
    /* Dashboard adjustments */
    .dash-wrapper {
        padding: 12px 12px 80px;
    }
    
    .quick-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .quick-links a {
        padding: 12px 8px;
        font-size: 12px;
        border-radius: 10px;
    }
    
    .quick-links a .ql-icon {
        font-size: 20px;
    }
    
    /* Section labels */
    .section-label {
        font-size: 10px;
        margin: 20px 0 10px;
    }
    
    /* Floating summary */
    .floating-summary {
        bottom: 60px;
        left: 10px;
        width: calc(100% - 20px);
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .floating-summary div {
        font-size: 12px;
    }
    
    .floating-summary span {
        font-size: 14px;
    }
    
    /* Toast notifications */
    #toast-container {
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    .toast {
        padding: 12px 16px;
        font-size: 13px;
        border-radius: 6px;
    }
}

/* Small devices (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    /* Header */
    .top-header {
        padding: 14px 20px;
    }
    
    .desktop-nav {
        display: none !important;
        visibility: hidden !important;
    }
    
    .top-header h1 {
        font-size: 20px;
    }
    
    .branch-selector {
        font-size: 13px;
        padding: 6px 28px 6px 12px;
    }
    
    /* Container */
    .container {
        padding: 16px;
    }
    
    /* Cards */
    .card {
        padding: 18px;
        margin-bottom: 18px;
    }
    
    /* Entry cards */
    .entry-card {
        padding: 18px;
        margin-bottom: 14px;
    }
    
    .entry-header {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .entry-inputs {
        flex-direction: row;
        gap: 10px;
    }
    
    .entry-inputs > div {
        flex: 1;
    }
    
    .entry-inputs input {
        font-size: 16px !important;
    }
    
    /* Buttons */
    button {
        width: 100%;
        padding: 12px 20px;
    }
    
    /* Payment toggles */
    .payment-toggles {
        flex-direction: row;
    }
    
    .pay-btn {
        padding: 12px;
        width: auto;
        margin-bottom: 0;
    }
    
    /* KPI grid */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    .kpi-card {
        padding: 18px;
    }
    
    .kpi-value {
        font-size: 26px;
    }
    
    /* Quick links */
    .quick-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .quick-links a {
        padding: 14px 10px;
        font-size: 13px;
    }
    
    /* Premium summary */
    .premium-summary-card {
        padding: 18px;
        gap: 12px;
    }
    
    .premium-summary-card .summary-value {
        font-size: 2rem;
    }
    
    /* Table */
    th, td {
        padding: 10px;
        font-size: 14px;
    }
    
    /* Dashboard */
    .dash-wrapper {
        padding: 16px 16px 100px;
    }
    
    /* Floating summary */
    .floating-summary {
        width: calc(100% - 30px);
    }
}

/* Medium devices and above already covered by existing media queries */

/* Universal mobile improvements */
@media (max-width: 767px) {
    /* Ensure text inputs don't trigger zoom on iOS */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Fix overflow issues */
    body {
        overflow-x: hidden;
    }
    
    .container,
    .dash-wrapper {
        overflow-x: hidden;
    }
    
    /* Improve touch targets */
    button,
    .nav-item,
    .quick-links a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Fix table overflow */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }
    
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Improve readability */
    .section-header {
        font-size: 1em;
    }
    
    /* Fix header overflow */
    .top-header {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* Dashboard mobile optimizations */
    .net-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 16px;
        gap: 16px;
    }
    
    .net-hero-left .amount {
        font-size: 32px;
    }
    
    .net-hero-right {
        width: 100%;
        gap: 10px;
    }
    
    .net-hero-stat {
        flex: 1;
        min-width: auto;
        padding: 10px 12px;
    }
    
    .net-hero-stat .s-val {
        font-size: 16px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr !important;
    }
    
    .chart-container {
        height: 220px;
    }
    
    .pie-chart-container {
        height: 200px;
    }
    
    .online-mini-grid {
        grid-template-columns: 1fr;
    }
}

.brand-logo { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.brand-logo i { font-size: 24px; }

