/* ==========================================================================
   Milgater Bill - Ultra-Futuristic Glassmorphism & Cyber-SaaS Design System
   ========================================================================== */

:root {
    /* Cyber Dark / Neo-Brutalist Glow Palette */
    --bg-base: #090d16;
    --bg-surface: #0f172a;
    --bg-glass: rgba(15, 23, 42, 0.75);
    --bg-glass-card: rgba(30, 41, 59, 0.65);
    --bg-glass-hover: rgba(51, 65, 85, 0.55);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-glow: rgba(99, 102, 241, 0.35);

    /* Vibrant Neon Gradients */
    --neon-indigo: #6366f1;
    --neon-cyan: #06b6d4;
    --neon-violet: #8b5cf6;
    --neon-emerald: #10b981;
    --neon-rose: #f43f5e;
    --neon-amber: #f59e0b;

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --gradient-violet: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-emerald: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);

    /* Typography & Text */
    --text-pure: #ffffff;
    --text-title: #f1f5f9;
    --text-body: #cbd5e1;
    --text-dim: #94a3b8;

    /* Glows & Shadows */
    --glow-indigo: 0 0 25px rgba(99, 102, 241, 0.35);
    --glow-cyan: 0 0 25px rgba(6, 182, 212, 0.35);
    --glow-emerald: 0 0 25px rgba(16, 185, 129, 0.35);
    --glow-rose: 0 0 25px rgba(244, 63, 94, 0.35);
    --shadow-deep: 0 20px 40px -15px rgba(0, 0, 0, 0.7);

    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --radius-pill: 9999px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Cyber Lighting Orbs in Background */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
}

body::before {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, #4f46e5 0%, rgba(99, 102, 241, 0) 70%);
    top: -200px;
    left: -150px;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

body::after {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
    bottom: -150px;
    right: -100px;
    animation: orbFloat 22s ease-in-out infinite alternate-reverse;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.1); }
    100% { transform: translate(-40px, 60px) scale(0.95); }
}

/* Base Layout */
.app-container {
    display: flex;
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Floating Glass Sidebar */
.sidebar {
    width: 275px;
    margin: 14px 0 14px 14px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-deep);
    z-index: 100;
    flex-shrink: 0;
}

.brand-section {
    padding: 1.5rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border-glass);
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    box-shadow: var(--glow-indigo);
    position: relative;
    overflow: hidden;
}

.brand-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shineSweep 4s infinite;
}

@keyframes shineSweep {
    0%, 70% { left: -100%; }
    100% { left: 100%; }
}

.brand-title {
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(6, 182, 212, 0.15);
    color: var(--neon-cyan);
    border: 1px solid rgba(6, 182, 212, 0.4);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

/* Sleek Profile Pill */
.biz-status-card {
    margin: 1.1rem 1.25rem;
    padding: 0.85rem 1rem;
    background: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.biz-status-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-glow);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.biz-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--gradient-violet);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.biz-meta-wrap {
    overflow: hidden;
}

.biz-name-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-title);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.biz-gst-label {
    font-size: 0.72rem;
    color: var(--neon-cyan);
}

/* Navigation Links */
.nav-links {
    list-style: none;
    padding: 0.5rem 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius-lg);
    color: var(--text-dim);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    user-select: none;
    position: relative;
}

.nav-item i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    transition: transform 0.25s ease;
}

.nav-item:hover {
    color: var(--text-title);
    background: var(--bg-glass-card);
    transform: translateX(4px);
}

.nav-item:hover i {
    transform: scale(1.15);
    color: var(--neon-cyan);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(6, 182, 212, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.nav-item.active i {
    color: var(--neon-cyan);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--gradient-primary);
    box-shadow: var(--glow-cyan);
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Main Dashboard Canvas */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding: 14px 14px 14px 0;
}

/* Floating Glass Topbar */
.topbar {
    height: 72px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    margin-bottom: 14px;
    flex-shrink: 0;
    box-shadow: var(--shadow-deep);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-pure);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.65rem 1.35rem;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    text-decoration: none;
    outline: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--glow-indigo);
    border: 1px solid rgba(255,255,255,0.15);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gradient-emerald);
    color: #fff;
    box-shadow: var(--glow-emerald);
    border: 1px solid rgba(255,255,255,0.15);
}

.btn-secondary:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
    transform: translateY(-2px);
}

.btn-outline {
    background: var(--bg-glass-card);
    border-color: var(--border-glass);
    color: var(--text-title);
    backdrop-filter: blur(12px);
}

.btn-outline:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-glow);
    color: #fff;
}

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

.btn-icon:hover {
    background: var(--bg-glass-hover);
    color: var(--neon-cyan);
    border-color: var(--border-glass-glow);
}

/* Scrollable Content Workspace */
.content-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Custom modern scrollbar */
.content-body::-webkit-scrollbar,
.nav-links::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.content-body::-webkit-scrollbar-thumb,
.nav-links::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}
.content-body::-webkit-scrollbar-thumb:hover {
    background: var(--neon-indigo);
}

.view-section {
    display: none;
    animation: viewFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-section.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@keyframes viewFade {
    from { opacity: 0; transform: translateY(8px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Metric Cards with Glowing Border and Dynamic Backdrops */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
}

.metric-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow-deep);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glass-glow);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.card-sales::before { background: var(--gradient-primary); box-shadow: var(--glow-indigo); }
.card-receive::before { background: var(--gradient-emerald); box-shadow: var(--glow-emerald); }
.card-pay::before { background: linear-gradient(135deg, #f43f5e, #fb923c); box-shadow: var(--glow-rose); }
.card-stock::before { background: linear-gradient(135deg, #8b5cf6, #06b6d4); box-shadow: var(--glow-cyan); }

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.metric-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.card-sales .metric-icon-wrap { background: rgba(99, 102, 241, 0.18); color: var(--neon-indigo); }
.card-receive .metric-icon-wrap { background: rgba(16, 185, 129, 0.18); color: var(--neon-emerald); }
.card-pay .metric-icon-wrap { background: rgba(244, 63, 94, 0.18); color: var(--neon-rose); }
.card-stock .metric-icon-wrap { background: rgba(139, 92, 246, 0.18); color: var(--neon-violet); }

.metric-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-pure);
}

.metric-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Modern Quick Action Glass Dock */
.quick-action-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    padding: 1rem 1.4rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-deep);
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    color: var(--text-title);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.quick-action-btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-glow);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Glass Surface Table Card */
.table-card {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-deep);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-header-toolbar {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-pure);
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap i {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.search-input {
    padding: 0.6rem 1rem 0.6rem 2.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: var(--bg-glass-card);
    color: var(--text-pure);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: all 0.25s ease;
}

.search-input:focus {
    border-color: var(--neon-indigo);
    box-shadow: var(--glow-indigo);
    background: var(--bg-surface);
}

.filter-select {
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: var(--bg-glass-card);
    color: var(--text-title);
    font-size: 0.88rem;
    outline: none;
    font-family: inherit;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--neon-indigo);
}

/* Futuristic Data Table */
.data-table-wrap {
    overflow-x: auto;
    width: 100%;
}

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

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem 1.5rem;
    font-weight: 700;
    color: var(--text-dim);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}

.data-table td {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    vertical-align: middle;
    color: var(--text-body);
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
}

/* Cyber Neon Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-paid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--neon-emerald);
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.status-partially-paid {
    background: rgba(245, 158, 11, 0.15);
    color: var(--neon-amber);
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.status-unpaid {
    background: rgba(244, 63, 94, 0.15);
    color: var(--neon-rose);
    border: 1px solid rgba(244, 63, 94, 0.4);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.15);
}

.badge-low-stock {
    background: rgba(245, 158, 11, 0.15);
    color: var(--neon-amber);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

/* Glass Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass-glow);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 40px rgba(99, 102, 241, 0.2);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 1.4rem 2rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-pure);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    color: var(--text-dim);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--neon-rose);
}

.modal-body {
    padding: 1.75rem 2rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-footer {
    padding: 1.2rem 2rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.015);
}

/* Forms */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.1rem; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: var(--bg-glass-card);
    color: var(--text-pure);
    font-size: 0.92rem;
    outline: none;
    font-family: inherit;
    transition: all 0.25s ease;
}

.form-control:focus {
    border-color: var(--neon-indigo);
    box-shadow: var(--glow-indigo);
    background: var(--bg-base);
}

/* Invoice Bill Items Table inside Modal */
.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.invoice-items-table th {
    background: rgba(255, 255, 255, 0.04);
    padding: 0.8rem 1rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: left;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-glass);
    text-transform: uppercase;
}

.invoice-items-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-glass);
}

.invoice-summary-box {
    margin-top: 1rem;
    padding: 1.4rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
}

.invoice-summary-table {
    width: 340px;
    font-size: 0.92rem;
}

.invoice-summary-table td {
    padding: 0.45rem 0;
}

.invoice-summary-table .highlight-total {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--neon-cyan);
    border-top: 2px solid var(--border-glass);
    border-bottom: 2px solid var(--border-glass);
    padding: 0.75rem 0;
}

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

.toast {
    background: var(--bg-surface);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-deep);
    border: 1px solid var(--border-glass-glow);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-success { border-color: rgba(16, 185, 129, 0.6); box-shadow: var(--glow-emerald); }
.toast-error { border-color: rgba(244, 63, 94, 0.6); box-shadow: var(--glow-rose); }

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

/* ==========================================================================
   Printable Invoice Sheet Styles (Premium White Document for Printing)
   ========================================================================== */
.custom-bill-sheet {
    background: #ffffff;
    color: #0f172a;
    padding: 2.5rem;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    line-height: 1.4;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
}

.bill-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
}

.biz-name {
    font-size: 1.7rem;
    font-weight: 800;
    color: #2563eb;
    margin-bottom: 2px;
}

.biz-tagline {
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
}

.biz-meta {
    font-size: 0.82rem;
    color: #475569;
}

.bill-title-box {
    text-align: right;
}

.bill-badge {
    background: #2563eb;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.bill-prop {
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.bill-divider {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 1.25rem 0;
}

.bill-party-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    background: #f8fafc;
    padding: 1.1rem 1.4rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.88rem;
}

.party-heading {
    font-weight: 800;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.party-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 3px;
}

.bill-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: 0.88rem;
}

.bill-items-table th {
    background: #f1f5f9;
    color: #334155;
    padding: 0.75rem 0.9rem;
    font-weight: 800;
    border: 1px solid #cbd5e1;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.bill-items-table td {
    padding: 0.75rem 0.9rem;
    border: 1px solid #e2e8f0;
}

.bill-summary-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.amount-in-words-box {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.words-text {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1e293b;
    margin-top: 4px;
}

.qr-upi-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    padding: 0.85rem;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    margin-top: 1rem;
}

.totals-table-box {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.1rem;
}

.totals-table {
    width: 100%;
    font-size: 0.88rem;
}

.totals-table td {
    padding: 0.4rem 0;
}

.grand-total-row {
    font-size: 1.25rem;
    border-top: 2px solid #cbd5e1;
    border-bottom: 2px solid #cbd5e1;
    color: #2563eb;
    font-weight: 800;
}

.bill-footer-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    margin-top: 1.75rem;
    padding-top: 1rem;
}

.terms-box {
    font-size: 0.8rem;
    color: #475569;
}

.terms-title {
    font-weight: 800;
    margin-bottom: 4px;
}

.terms-content {
    white-space: pre-line;
    font-family: inherit;
}

.signature-box {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
}

.for-biz {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 40px;
}

.sign-line {
    width: 170px;
    border-top: 1.5px solid #333;
    margin-bottom: 4px;
}

.sign-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

/* Print Overrides */
@media print {
    body * {
        visibility: hidden;
    }
    .modal-overlay.active,
    .modal-container,
    .custom-bill-sheet,
    .custom-bill-sheet * {
        visibility: visible !important;
    }
    .modal-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: transparent !important;
        padding: 0;
    }
    .modal-container {
        box-shadow: none !important;
        max-width: 100% !important;
        transform: none !important;
        border: none !important;
    }
    .modal-header,
    .modal-footer {
        display: none !important;
    }
    .custom-bill-sheet {
        border: none !important;
        padding: 0 !important;
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        bottom: 0;
        margin: 0;
        height: 100vh;
        transition: left 0.3s ease;
    }
    .sidebar.open {
        left: 0;
    }
    .main-wrapper {
        padding: 10px;
    }
    .topbar {
        padding: 0 1rem;
    }
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}
