/* 
   ==========================================================================
   Premium CRM Design System - Global Styles
   Theme: "Nebula" (Deep Slate & Vibrant Indigo)
   ========================================================================== 
*/

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

:root {
    /* --- Palette --- */
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --secondary: #8b5cf6;
    /* Violet 500 */

    --bg-body: #f1f5f9;
    /* Slate 100 */
    --bg-card: #ffffff;

    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */

    --border: #e2e8f0;
    /* Slate 200 */

    /* --- Sidebar Specific --- */
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 70px;
    --sidebar-bg: #0f172a;
    /* Slate 900 */
    --sidebar-hover: #1e293b;
    /* Slate 800 */
    --sidebar-text: #cbd5e1;
    /* Slate 300 */
    --sidebar-active: #334155;
    /* Slate 700 */

    /* --- Premium Gradients & Effects --- */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    /* Indigo to Purple */
    --gradient-success: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    /* Emerald */
    --gradient-info: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    /* Blue */
    --gradient-warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    /* Amber */
    --gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    /* Red */

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    /* --- Transitions --- */
    --trans-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Base Reset */
* {
    box-sizing: border-box;
    outline: none;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 0.925rem;
    line-height: 1.5;
    transition: background-color var(--trans-smooth);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--trans-fast);
}

ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-main);
}

img {
    max-width: 100%;
    display: block;
}

/* 
   ==========================================================================
   Layout Structure 
   ========================================================================== 
*/
#app {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transition: width var(--trans-smooth);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Hide text overflow when collapsing */
    box-shadow: var(--shadow-xl);
}

/* Sidebar Header / Logo */
/* Sidebar Header / Logo */
.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center horizontally */
    padding: 0 10px;
    /* Slight padding */
    background: transparent;
    /* Transparent as requested */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.sidebar-logo-img {
    max-width: 90%;
    max-height: 60px;
    /* Prevent vertical overflow */
    height: auto;
    width: auto;
    display: block;
    object-fit: contain;
}


.logo-icon {
    min-width: 32px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    margin-right: 12px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    opacity: 1;
    transition: opacity var(--trans-fast);
}

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

.nav-label {
    padding: 0 12px;
    margin-bottom: 8px;
    margin-top: 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--trans-fast);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--sidebar-text);
    position: relative;
    cursor: pointer;
    transition: all var(--trans-fast);
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: var(--primary);
    /* Solid highlight or use rgba */
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-icon {
    min-width: 22px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.nav-text {
    font-weight: 500;
    opacity: 1;
    transition: opacity var(--trans-fast);
}

/* Sidebar Footer (Collapse Toggle) */
.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    /* Align right */
}

.collapse-btn {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background var(--trans-fast);
}

.collapse-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}


/* Submenu (Optional) */
.submenu {
    padding-left: 44px;
    /* Align with text */
    display: none;
}

.submenu.open {
    display: block;
}

.submenu-link {
    display: block;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #94a3b8;
    transition: color 0.2s;
}

.submenu-link:hover {
    color: #fff;
}

/* 
   --- COLLAPSED STATES --- 
   This class '.collapsed' will be applied to the BODY or the sidebar wrapper
*/
.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .submenu-toggle-icon {
    opacity: 0;
    pointer-events: none;
    display: none;
    /* remove from flow layout */
}

.sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
}

.sidebar.collapsed .logo-icon {
    margin-right: 0;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-footer {
    justify-content: center;
}

.sidebar.collapsed .submenu {
    display: none !important;
    /* Force hide submenus in collapsed mode for simplicity */
}


/* CONTENT AREA */
.content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 30px;
    transition: margin-left var(--trans-smooth), width var(--trans-smooth);
}

/* Adjust content when sidebar is collapsed */
.content.expanded {
    margin-left: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
}


/* 
   ==========================================================================
   Components
   ========================================================================== 
*/

/* Topbar */
.topbar {
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Cards */
.card,
.section-card,
.kpi-card,
.invoice-wrapper {
    background: var(--bg-card);
    /* Fallback */
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    /* Softer rounded corners */
    padding: 24px;
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0, 0, 0, 0.03);
    /* Subtle border ring */
    border: 1px solid white;
    /* For glass morphism feel */
    margin-bottom: 24px;
    transition: transform var(--trans-spring), box-shadow var(--trans-smooth);
    position: relative;
    overflow: hidden;
    /* For shine effects */
}

.card:hover,
.section-card:hover,
.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    /* Deep elegant shadow */
}

/* Glassmorphism Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Card Header/Title Area */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
button,
.btn-primary,
.btn-secondary,
.btn-logout {
    cursor: pointer;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all var(--trans-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-logout {
    background: #fee2e2;
    color: var(--danger);
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-logout:hover {
    background: #fecaca;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

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

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-info {
    background: #e0e7ff;
    color: #3730a3;
}

/* Form Elements */
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* KPI Cards redesign */
.kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.kpi-card .kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    /* Standard property */
    -webkit-text-fill-color: transparent;
    /* Gradient text */
    color: var(--text-main);
    /* Fallback */
}

.kpi-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

/* KPI Color Variations */
.kpi-card.purple .kpi-icon {
    background: var(--gradient-primary);
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}

.kpi-card.blue .kpi-icon {
    background: var(--gradient-info);
    box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.4);
}

.kpi-card.green .kpi-icon {
    background: var(--gradient-success);
    box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.4);
}

.kpi-card.orange .kpi-icon {
    background: var(--gradient-warning);
    box-shadow: 0 8px 20px -4px rgba(245, 158, 11, 0.4);
}

.kpi-card.red .kpi-icon {
    background: var(--gradient-danger);
    box-shadow: 0 8px 20px -4px rgba(239, 68, 68, 0.4);
}

/* Remove old borders */
.kpi-card.purple,
.kpi-card.blue,
.kpi-card.green,
.kpi-card.orange {
    border-top: none;
}

/* --- Grid Layout Utilities --- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

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

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

.span-full {
    grid-column: 1 / -1;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

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

    .content,
    .content.expanded {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Stack grids on mobile */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .span-2,
    .span-3 {
        grid-column: auto;
    }
}

/* 
   ==========================================================================
   Invoice Specific Styles (Migrated from edit-invoice.php)
   ========================================================================== 
*/

.invoice-container {
    background: var(--bg-card);
    border-radius: 12px;
    max-width: 980px;
    margin: 0 auto 60px;
    padding: 30px 36px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--border);
}

.invoice-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #6B21A8;
    /* Purple theme color */
    margin-top: 10px;
    margin-bottom: 20px;
}

.invoice-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.invoice-left {
    width: 38%;
}

.info-field {
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

.info-field label {
    font-weight: 600;
    width: 90px;
    color: var(--text-main);
}

.bill-section {
    display: flex;
    gap: 22px;
    margin-top: 18px;
    margin-bottom: 10px;
}

.bill-box {
    flex: 1;
    background: #f8fafc;
    /* var(--muted) fallback */
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    min-height: 160px;
}

.bill-box h3 {
    margin: 0 0 10px 0;
    color: var(--primary);
    /* var(--accent) fallback */
    font-size: 15px;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.bill-box select,
.bill-box input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
    margin-bottom: 12px;
}

/* Invoice Table */
.invoice-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border);
    table-layout: fixed;
}

.invoice-table thead th {
    background: var(--primary);
    /* var(--accent) fallback */
    color: #fff;
    font-weight: 600;
    padding: 12px 14px;
    font-size: 14px;
    text-align: left;
}

.invoice-table tbody td {
    background: #fff;
    padding: 10px 12px;
    font-size: 14px;
    vertical-align: middle;
    border-top: 1px solid var(--border);
    word-wrap: break-word;
}

.invoice-table input[type="text"],
.invoice-table input[type="number"],
.invoice-table textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

/* Remove spinner arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Buttons */
.btn-del {
    background: #ef4444;
    color: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

.btn-add {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-submit {
    background: #0f172a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

/* Detailed Row */
.desc-image-row td {
    background: #faf9ff;
    padding: 12px;
}

.desc-image-row .desc-left {
    flex: 1;
    margin-right: 18px;
}

.desc-image-row .desc-right {
    width: 220px;
}

/* Totals */
.total-box {
    text-align: right;
    margin-top: 18px;
    font-size: 15px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.total-box h3 {
    font-size: 18px;
    margin: 8px 0;
    font-weight: 800;
    color: var(--text-main);
}

.company-preview {
    display: block;
    margin-top: 6px;
    color: var(--text-main);
}

.company-preview p {
    margin: 4px 0;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Modal */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.3);
    justify-content: center;
    align-items: center;
}

.modal {
    width: 360px;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid var(--border);
}

/* TinyMCE overrides */
.tox,
.tox .tox-editor-container {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
}

.tox .tox-statusbar {
    display: none !important;
}

/* Responsive */
@media (max-width: 1100px) {
    .invoice-container {
        padding: 20px;
        margin: 20px;
        max-width: 100%;
    }

    .bill-section {
        flex-direction: column;
    }

    .invoice-left {
        width: 100%;
    }
}

/* 
   ==========================================================================
   Responsive / Mobile Styles
   ========================================================================== 
*/

/* Default State (Hidden on Desktop) */
/* Default State (Hidden on Desktop) */

/* Default State (Hidden on Desktop) */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 15px !important;
    right: 15px !important;
    /* Force Right */
    left: auto !important;
    z-index: 49;
    /* Below sidebar (50) but above content */
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    color: var(--text-muted);
}


.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    /* Slate 900 / 60% */
    backdrop-filter: blur(2px);
    z-index: 48;
    /* Below sidebar (50) */
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--trans-smooth);
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Controls Organization */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .action-buttons {
        gap: 8px;
        justify-content: flex-start;
    }

    .action-buttons>* {
        flex-grow: 1;
        /* Make buttons grow to fill space */
        justify-content: center;
        white-space: nowrap;
    }

    /* Force full width for some buttons if needed */
    .btn-block-mobile {
        width: 100%;
    }
}


/* Mobile Breakpoint */
@media (max-width: 768px) {

    /* 1. Sidebar hidden by default */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        width: 260px !important;
        /* Force full width when opening */
    }

    /* 2. Sidebar Active (Open) */
    .sidebar.mobile-active {
        transform: translateX(0);
        box-shadow: 20px 0 25px -5px rgba(0, 0, 0, 0.3);
        /* Strong shadow */
    }

    /* 3. Content Area - Remove Margin */
    .content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 20px 15px;
        /* Adjust padding for mobile */
    }

    /* 4. Show Toggles */
    .sidebar-toggle-btn {
        display: block;
    }

    .sidebar-close-btn {
        display: block;
        margin-left: auto;
    }

    /* 5. Adjust Header for Close Button */
    .sidebar-header {
        justify-content: space-between;
        padding-right: 15px;
    }

    /* 6. Hide footer items if needed */
    .sidebar-footer {
        padding: 10px;
    }

    /* 7. Topbar Adjustments */
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-top: 40px;
        /* Space for toggle button */
    }

    .topbar>div {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    /* 8. Table Responsive Fix */
    table {
        /* Removed display: block; to allow container to handle scroll */
        width: 100%;
        border-collapse: collapse;
    }

    .glass-table-container,
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
    }

    /* 9. Grid Adjustments */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* 10. Modal Adjustments */
    #importModal>div {
        width: 90% !important;
        margin: 20% auto !important;
    }
}
/* Global Notification & Confirm Modal Styles */
.payment-status-msg {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    background: white;
    color: #1e293b;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 10000;
    min-width: 300px;
    max-width: 450px;
    border-left: 6px solid #6366f1;
    animation: slideInRight 0.3s ease-out;
    font-weight: 500;
}
.payment-status-msg.success { border-left-color: #10b981; }
.payment-status-msg.error { border-left-color: #ef4444; }
.msg-close {
    float: right;
    margin-left: 15px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #94a3b8;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
#confirmModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#confirmModal .modal-box {
    background: white;
    padding: 32px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
