/* Cash Book - Custom CSS Design System */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #ccfbf1;
    --primary-hover: #134e4a;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #0f766e;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --info: #0284c7;
    --info-bg: #f0f9ff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --sidebar-width: 250px;
    --header-height: 64px;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: var(--font);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid #1e293b;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-item:hover {
    color: #ffffff;
    background-color: #1e293b;
}

.nav-item.active {
    color: #ffffff;
    background-color: var(--primary);
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid #1e293b;
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: #ef4444;
    background: transparent;
    border: none;
    font-size: 0.925rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Main Content Layout */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-navbar {
    height: var(--header-height);
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.toggle-sidebar-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 0.5rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.content-body {
    padding: 2rem;
    flex: 1;
}

/* Cards & Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon.primary { background-color: var(--primary); }
.stat-icon.success { background-color: var(--success); }
.stat-icon.warning { background-color: var(--warning); }
.stat-icon.danger { background-color: var(--danger); }
.stat-icon.info { background-color: var(--info); }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.stat-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Companies Cards Grid */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.company-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.company-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.company-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.company-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.company-code {
    font-size: 0.75rem;
    background-color: var(--background);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.company-balance-box {
    background-color: var(--background);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
}

.balance-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.balance-amount {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
}

.company-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.badge-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(2, 132, 199, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.2;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--background);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius);
}

/* Financial Toolbar & Registers Page */
.financial-banner {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.banner-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    background-color: var(--background);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    font-family: var(--font);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    color: var(--text);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* Register Summary Metrics Strip */
.metrics-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.metric-box {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-value {
    font-size: 1.35rem;
    font-weight: 700;
}

.metric-value.debit { color: var(--success); }
.metric-value.credit { color: var(--danger); }
.metric-value.closing { color: var(--primary); }

/* Table Styling */
.table-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background-color: #f1f5f9;
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: var(--background);
}

.debit-amount {
    color: var(--success);
    font-weight: 700;
}

.credit-amount {
    color: var(--danger);
    font-weight: 700;
}

.balance-amount-cell {
    font-weight: 700;
    color: var(--text);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(-20px);
    transition: var(--transition);
}

.modal-backdrop.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background-color: var(--background);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.25rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background-color: var(--surface);
    color: var(--text);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid var(--primary);
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }

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

/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background-color: var(--background);
    color: var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem auto;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Traditional Two-Sided Day Book Ledger Styling */
.daybook-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.daybook-page {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #ffffff;
}

.daybook-page.receipts-page {
    border-right: 2px solid var(--border);
    background-color: #fcfdfe;
}

.daybook-page.payments-page {
    background-color: #ffffff;
}

.daybook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--text);
}

.daybook-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.75px;
    color: var(--text);
    text-transform: uppercase;
}

.daybook-subtitle {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.receipts-page .daybook-title {
    color: var(--primary-dark);
}

.payments-page .daybook-title {
    color: #991b1b;
}

.daybook-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: auto;
}

.daybook-table th {
    padding: 0.65rem 0.5rem;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1.5px solid var(--text);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-align: left;
    background-color: transparent;
}

.daybook-table th.col-amount {
    text-align: right;
}

.daybook-table td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px dashed #cbd5e1;
    vertical-align: middle;
    font-size: 0.875rem;
}

.daybook-table .col-date {
    width: 22%;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.daybook-table .col-particulars {
    width: 50%;
    font-weight: 600;
    color: var(--text);
}

.daybook-table .col-amount {
    width: 28%;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text);
}

.cash-in-hand-row {
    background-color: #f0fdf4 !important;
}

.cash-in-hand-row td {
    font-weight: 700 !important;
}

.cash-in-hand-row .col-particulars {
    color: var(--success) !important;
}

.cash-in-hand-row.payments {
    background-color: #fef2f2 !important;
}

.cash-in-hand-row.payments .col-particulars {
    color: var(--danger) !important;
}

.daybook-total-row td {
    font-weight: 800;
    border-top: 2px solid var(--text) !important;
    border-bottom: 3px double var(--text) !important;
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
    background-color: #f8fafc;
    font-size: 0.925rem;
}

.daybook-total-row .col-amount {
    color: var(--text) !important;
    font-size: 0.95rem;
}

/* Login Page Styling */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #0f766e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Printable Layout */
@media print {
    @page {
        size: A4 landscape;
        margin: 8mm;
    }

    html, body {
        background-color: white !important;
        color: black !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .sidebar,
    .top-navbar,
    .filter-bar,
    .company-actions,
    .btn,
    .no-print,
    .metrics-strip {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .content-body {
        padding: 0 !important;
        margin: 0 !important;
    }

    .financial-banner,
    .table-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .daybook-wrapper {
        grid-template-columns: 1fr 1fr !important;
        border: 2px solid #000 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid-page !important;
        margin-bottom: 1.5rem !important;
        display: grid !important;
        background-color: white !important;
    }

    .daybook-page {
        page-break-inside: avoid !important;
        break-inside: avoid-page !important;
        background-color: white !important;
    }

    .daybook-page.receipts-page {
        border-right: 2px solid #000 !important;
        border-bottom: none !important;
    }

    .daybook-header, 
    .daybook-table th, 
    .daybook-total-row td {
        border-color: #000 !important;
        color: #000 !important;
    }

    .daybook-title, .daybook-subtitle {
        color: #000 !important;
    }

    tr {
        page-break-inside: avoid !important;
        break-inside: avoid-page !important;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 995;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Authentic Paper Ledger Notebook Theme */
.paper-ledger-mode {
    background-color: #fdfbf7 !important;
}

.paper-ledger-mode .daybook-wrapper {
    background-color: #fffdf9;
    border-color: #a82020;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.paper-ledger-mode .daybook-table td {
    border-bottom: 1px solid #e5dfd5;
    font-family: "Courier New", Courier, monospace, var(--font);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (TABLET & MOBILE BREAKPOINTS)
   ========================================================================== */

/* Large Tablets & Small Laptops (max-width: 992px) */
@media (max-width: 992px) {
    .daybook-wrapper {
        grid-template-columns: 1fr;
    }

    .daybook-page.receipts-page {
        border-right: none;
        border-bottom: 3px double #b91c1c;
        margin-bottom: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .companies-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .metrics-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Mobile & Tablet Devices (max-width: 768px) */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 260px;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .top-navbar {
        padding: 0 1rem;
    }

    .toggle-sidebar-btn {
        display: block;
    }

    .page-title {
        font-size: 1.05rem;
    }

    .user-info .user-email {
        display: none;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .content-body {
        padding: 1rem 0.75rem;
    }

    .financial-banner {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .banner-top {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .banner-top > div {
        width: 100%;
    }

    .banner-top button,
    .banner-top a {
        flex: 1;
        justify-content: center;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .filter-group {
        width: 100%;
        min-width: 0 !important;
    }

    .form-control {
        width: 100%;
    }

    .modal {
        max-width: calc(100vw - 1.5rem);
        margin: 0.75rem;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(85vh - 120px);
        overflow-y: auto;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}

/* Small Mobile Screens (max-width: 576px) */
@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .companies-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .metrics-strip {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .metric-box {
        padding: 0.5rem;
        background-color: var(--background);
        border-radius: var(--radius-sm);
    }

    .metric-label {
        font-size: 0.7rem;
    }

    .metric-value {
        font-size: 1rem;
    }

    .daybook-page {
        padding: 0.65rem 0.4rem;
    }

    .daybook-header {
        padding-bottom: 0.35rem;
        margin-bottom: 0.5rem;
    }

    .daybook-title {
        font-size: 0.95rem;
    }

    .daybook-subtitle {
        font-size: 0.75rem;
    }

    .daybook-table {
        font-size: 0.775rem;
    }

    .daybook-table th {
        padding: 0.35rem 0.25rem;
        font-size: 0.675rem;
    }

    .daybook-table td {
        padding: 0.35rem 0.25rem;
    }

    .daybook-table .col-date {
        width: 20%;
    }

    .daybook-table .col-particulars {
        width: 52%;
        word-break: break-word;
    }

    .daybook-table .col-amount {
        width: 28%;
    }

    .login-card {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }
}

