/* ==========================================================================
   VyaparBooks Premium - Enterprise Styling (Zoho Books Inspired)
   ========================================================================== */

:root {
    /* Color Palette */
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #EFF6FF;
    --secondary: #64748B;
    --success: #059669;
    --success-light: #ECFDF5;
    --warning: #D97706;
    --warning-light: #FFFBEB;
    --danger: #DC2626;
    --danger-light: #FEF2F2;
    --info: #0284C7;
    --info-light: #F0F9FF;
    --purple: #7C3AED;
    --purple-light: #F5F3FF;
    --excel-green: #16A34A;

    /* Base Colors */
    --bg-app: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-sidebar: #0F172A;
    --bg-sidebar-hover: #1E293B;
    --bg-sidebar-active: #2563EB;

    /* Text Colors */
    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --text-white: #FFFFFF;

    /* Border & Shadow */
    --border-color: #E2E8F0;
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);

    /* Fonts */
    --font-main: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography Helpers */
.fw-bold { font-weight: 700 !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-purple { color: var(--purple) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-excel { color: var(--excel-green) !important; }

/* App Layout Grid */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

/* SIDEBAR STYLING */
.app-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: block;
}

.brand-badge {
    background: var(--primary);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 11px;
    color: var(--text-light);
    display: block;
}

/* Navigation Links */
.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748B;
    padding: 0 12px 8px 12px;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: #94A3B8;
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.nav-item:hover {
    background-color: var(--bg-sidebar-hover);
    color: var(--text-white);
}

.nav-item.active {
    background-color: var(--bg-sidebar-active);
    color: var(--text-white);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.highlight-icon {
    color: #60A5FA;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.company-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.company-avatar {
    width: 36px;
    height: 36px;
    background: #1E293B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.company-info {
    overflow: hidden;
}

.company-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-gst {
    font-size: 10px;
    color: var(--text-light);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MAIN CONTENT AREA */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

/* TOP HEADER */
.app-header {
    height: 70px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
}

.view-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.view-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 550px;
    margin: 0 24px;
}

.quick-period-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-app);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
}

.period-select-dropdown {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    outline: none;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-app);
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: var(--bg-app);
    border-color: var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: #E2E8F0;
}

.btn-warning {
    background-color: var(--warning);
    color: #fff;
}
.btn-warning:hover {
    background-color: #B45309;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-app);
    color: var(--primary);
}

/* APP CONTENT CONTAINER */
.app-content {
    flex: 1;
    padding: 24px 28px;
}

.view-panel {
    display: none;
}

.view-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* DASHBOARD STYLING */
.dashboard-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
}

.filter-pills {
    display: flex;
    gap: 6px;
    background: var(--bg-app);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.pill-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-btn.active {
    background: var(--bg-surface);
    color: var(--primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

/* Metrics Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-surface);
    border-radius: var(--border-radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.metric-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.metric-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.card-sales .metric-icon { background: var(--success-light); color: var(--success); }
.card-purchases .metric-icon { background: var(--warning-light); color: var(--warning); }
.card-receivables .metric-icon { background: var(--info-light); color: var(--info); }
.card-payables .metric-icon { background: var(--danger-light); color: var(--danger); }

.metric-value {
    font-size: 26px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-main);
    margin-bottom: 8px;
}

.metric-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}

.metric-subtitle {
    color: var(--text-muted);
}

.metric-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-surface);
    border-radius: var(--border-radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 15px;
    font-weight: 700;
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.chart-body {
    height: 280px;
    position: relative;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CARDS & TABLES */
.card {
    background: var(--bg-surface);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 20px;
    font-weight: 800;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.select-group select {
    min-width: 160px;
}

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

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

.data-table th {
    background: var(--bg-app);
    padding: 12px 14px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.data-table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.02);
}

.data-table .fw-bold {
    font-family: var(--font-mono);
}

/* BILLING INVOICE FORM STYLING */
.billing-container {
    max-width: 1100px;
    margin: 0 auto;
}

.billing-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.billing-options-switches {
    display: flex;
    gap: 16px;
}

.switch-card {
    background: var(--bg-surface);
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
}

/* Switch Slider */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #CBD5E1;
    transition: .3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.form-card {
    margin-bottom: 20px;
}

.card-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-title-bar h3 {
    font-size: 15px;
    font-weight: 700;
}

.quick-tip {
    font-size: 11px;
    color: var(--warning);
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.grid-span-2 { grid-column: span 2; }
.grid-span-3 { grid-column: span 3; }
.grid-span-4 { grid-column: span 4; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.form-label.required::after {
    content: " *";
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-with-icon input {
    padding-left: 36px;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown, .search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.autocomplete-item:hover {
    background-color: var(--primary-light);
}

.autocomplete-item .title { font-weight: 700; font-size: 13px; }
.autocomplete-item .sub { font-size: 11px; color: var(--text-muted); }

/* Billing Table Inputs */
.billing-items-table input, .billing-items-table select {
    padding: 6px 8px;
    font-size: 12px;
}

/* Summary Grid */
.billing-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.payment-mode-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.pay-mode-btn {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-app);
}

.pay-mode-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.pay-mode-btn input {
    display: none;
}

.summary-card {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
}

.summary-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.grand-total-row {
    border-top: 2px solid var(--border-color);
    padding-top: 10px;
    margin-top: 6px;
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-mono);
}

.billing-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 20px;
}

/* LEDGER STYLING */
.ledger-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ledger-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ledger-summary-box {
    background: var(--bg-surface);
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.ledger-summary-box .label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.ledger-summary-box .val {
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-mono);
    margin-top: 4px;
}

.credit-box .val { color: var(--success); }
.debit-box .val { color: var(--danger); }
.net-box .val { color: var(--primary); }

/* REPORTS GRID */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.report-card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.report-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-app);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.report-card h3 { font-size: 16px; font-weight: 700; }
.report-card p { font-size: 12px; color: var(--text-muted); flex: 1; }

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-dialog {
    background: var(--bg-surface);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-lg { max-width: 900px; }

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

.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-actions { display: flex; gap: 10px; align-items: center; }

.modal-body { padding: 24px; }

/* PRINTABLE INVOICE STYLING */
.printable-invoice {
    background: #fff;
    padding: 30px;
    color: #000;
    font-family: 'Inter', sans-serif;
}

.inv-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #000;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.inv-brand h1 { font-size: 22px; font-weight: 800; text-transform: uppercase; color: #1E293B; }
.inv-brand p { font-size: 11px; margin: 2px 0; color: #475569; }

.inv-meta { text-align: right; }
.inv-badge-title { background: var(--primary); color: #fff; font-weight: 800; padding: 4px 12px; font-size: 14px; display: inline-block; margin-bottom: 8px; }
.inv-meta table { font-size: 12px; margin-left: auto; }
.inv-meta td { padding: 2px 6px; }

.inv-party-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.inv-party-box {
    border: 1px solid #CBD5E1;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
}

.inv-party-box h4 { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }

.inv-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 12px;
}

.inv-items-table th {
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    padding: 8px;
    font-weight: 700;
}

.inv-items-table td {
    border: 1px solid #CBD5E1;
    padding: 8px;
}

.inv-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.inv-payment-qr-section h4 { font-size: 11px; margin-bottom: 8px; }
.qr-box { width: 110px; height: 110px; border: 1px solid #DDD; padding: 5px; margin-bottom: 4px; }
.qr-text { font-size: 10px; color: var(--text-muted); }

.bank-details-box {
    margin-top: 10px;
    font-size: 11px;
    background: #F8FAFC;
    padding: 8px;
    border-radius: 4px;
}

.inv-totals-table {
    width: 100%;
    font-size: 12px;
}

.inv-totals-table td { padding: 4px 8px; }
.inv-totals-table .total-row { font-weight: 800; font-size: 15px; border-top: 2px solid #000; border-bottom: 2px solid #000; }
.inv-totals-table .due-row { color: var(--danger); font-weight: 700; }

.inv-terms-signature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid #CBD5E1;
    font-size: 11px;
}

.sig-box { text-align: right; }
.sig-space { height: 40px; }

/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-sidebar);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--primary); }

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* PRINT MEDIA QUERY */
@media print {
    body * { visibility: hidden; }
    #printableInvoiceArea, #printableInvoiceArea * { visibility: visible; }
    #printableInvoiceArea {
        position: absolute;
        left: 0; top: 0;
        width: 100%;
        padding: 0;
    }
    .modal-overlay { background: transparent; backdrop-filter: none; }
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .app-sidebar { position: fixed; left: -260px; height: 100vh; }
    .app-sidebar.active { left: 0; }
    .sidebar-toggle { display: flex; }
    .charts-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .billing-footer-grid { grid-template-columns: 1fr; }
    .ledger-filter-grid, .ledger-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
