/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* Color & Styling Tokens */
:root {
    --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Premium Light Theme */
    --bg-app: #ebf0f5;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-sidebar: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.7);
    --border-color: rgba(206, 214, 224, 0.8);
    --border-hover: rgba(186, 196, 208, 0.9);
    
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --text-muted: #95a5a6;
    
    --primary: #46688f;
    --primary-hover: #355375;
    --primary-light: rgba(70, 104, 143, 0.08);
    --primary-glow: rgba(70, 104, 143, 0.15);
    
    --success: #498a6a;
    --success-light: rgba(73, 138, 106, 0.1);
    --danger: #c25f5f;
    --danger-light: rgba(194, 95, 95, 0.1);
    --warning: #b38d39;
    --warning-light: rgba(179, 141, 57, 0.1);
    --info: #4a91ad;
    --info-light: rgba(74, 145, 173, 0.1);

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px -2px rgba(148, 163, 184, 0.12), 0 4px 6px -1px rgba(148, 163, 184, 0.08);
    --shadow-lg: 0 10px 30px -3px rgba(79, 70, 229, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 40px -4px rgba(15, 23, 42, 0.05), 0 10px 20px -5px rgba(15, 23, 42, 0.03);
    
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-blur: 20px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 88px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

[data-theme="dark"] {
    /* Premium Dark Theme - Zinc & Azure */
    --bg-app: #09090b;
    --bg-card: #141415;
    --bg-sidebar: #0f0f11;
    --bg-header: rgba(9, 9, 11, 0.8);
    --border-color: #27272a;
    --border-hover: #3f3f46;
    
    --text-primary: #ededed;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.12);
    --primary-glow: rgba(59, 130, 246, 0.25);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --info: #06b6d4;
    --info-light: rgba(6, 182, 212, 0.12);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 20px 0 rgba(0, 0, 0, 0.4), 0 2px 4px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 4px 12px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.6);

    --glass-bg: rgba(20, 20, 21, 0.65);
    --glass-border: rgba(255, 255, 255, 0.06);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    
    /* Mesh Background Gradients for Depth */
    background-image: 
        radial-gradient(circle at 0% 0%, var(--primary-glow) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, var(--info-light) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 99px;
    transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Heading Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Page Frame Layout */
#app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styling (Floating Glassmorphism Card Style) */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 24px);
    margin: 12px;
    border-radius: var(--radius-lg);
    z-index: 100;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 12px;
    flex-shrink: 0;
    transition: width var(--transition-normal), background var(--transition-normal), border var(--transition-normal);
}

#sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    overflow: hidden;
}

.brand-icon {
    color: var(--primary);
    filter: drop-shadow(0 2px 8px var(--primary-glow));
    transition: transform var(--transition-normal);
}
.brand:hover .brand-icon {
    transform: rotate(5deg) scale(1.05);
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

#sidebar.collapsed .brand-text {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.sidebar-toggle:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.sidebar-menu {
    list-style: none;
    padding: 24px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.15rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.menu-item a svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.menu-item.active a {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 8px 16px -4px var(--primary-glow);
}
.menu-item.active a svg {
    color: #ffffff;
}

.menu-item:not(.active) a:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}
.menu-item:not(.active) a:hover svg {
    color: var(--primary);
}

#sidebar.collapsed .menu-item a span {
    display: none;
}
#sidebar.collapsed .menu-item a {
    justify-content: center;
    padding: 14px 0;
}

.sidebar-profile {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
    flex-shrink: 0;
}

.profile-info {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.profile-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: capitalize;
}

#sidebar.collapsed .sidebar-profile {
    justify-content: center;
    padding: 16px 0;
}
#sidebar.collapsed .profile-info {
    display: none;
}

/* Main Content Wrapper */
#main-content {
    flex-grow: 1;
    min-width: 0; /* Prevents wide children like tables from stretching the page width */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 12px 24px 24px 12px;
    transition: all var(--transition-normal);
}

/* Header Navbar Styling (Clean and Glassmorphic) */
#navbar {
    height: 76px;
    background: var(--bg-header);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    z-index: 99;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 800;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Glowing Theme / Tool Buttons */
.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    transform: translateY(-2px);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Dashboard Metrics Viewport */
.dashboard-viewport {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* KPI Cards Layout (Volumetric Floating Panels) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal);
}

.kpi-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.kpi-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kpi-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-family: var(--font-heading);
}

.kpi-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.kpi-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.kpi-card.sales-kpi .kpi-icon-wrapper {
    background-color: var(--primary-light);
    color: var(--primary);
}
.kpi-card.receivable-kpi .kpi-icon-wrapper {
    background-color: var(--danger-light);
    color: var(--danger);
}
.kpi-card.tax-kpi .kpi-icon-wrapper {
    background-color: var(--success-light);
    color: var(--success);
}
.kpi-card.pending-kpi .kpi-icon-wrapper {
    background-color: var(--warning-light);
    color: var(--warning);
}

.kpi-icon-wrapper svg {
    width: 26px;
    height: 26px;
}

/* Charts Panels Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

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

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

.chart-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 320px;
}

/* Panels and Tables */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.panel-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Premium Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
}
.btn-primary:hover {
    box-shadow: 0 6px 16px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #047857);
    color: #ffffff;
}
.btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: #ffffff;
}
.btn-danger:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.82rem;
    border-radius: var(--radius-md);
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* Premium Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 65vh;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.9rem;
}

.table-custom th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--border-color);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 16px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table-custom td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
    transition: background-color var(--transition-fast);
    white-space: nowrap;
}

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

.table-custom tbody tr {
    transition: background-color var(--transition-fast);
}

.table-custom tbody tr:hover {
    background-color: var(--primary-light);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 9999px;
    letter-spacing: 0.04em;
    box-shadow: var(--shadow-sm);
}

.badge-paid {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-pending {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge-admin {
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-user {
    background-color: var(--info-light);
    color: var(--info);
    border: 1px solid rgba(34, 211, 238, 0.2);
}

/* Search Filters Bar */
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Modernized Login Page UI */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at 10% 20%, var(--primary-light) 0%, var(--bg-app) 90%);
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--info));
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    filter: drop-shadow(0 2px 6px var(--primary-glow));
}

.login-logo svg {
    width: 36px;
    height: 36px;
}

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

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.login-footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(0, 0, 0, 0.02);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .login-footer {
    background: rgba(255, 255, 255, 0.01);
}

.login-footer p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.demo-account-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.btn-demo {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-demo:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

/* Modals styling (Clean blur sheets) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-height: 90vh;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.96);
    transition: transform var(--transition-normal);
}

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

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .modal-footer {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Invoice details table alignment */
.invoice-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Ledger Summary Cards */
.ledger-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .ledger-meta {
        grid-template-columns: 1fr;
    }
}

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

.meta-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: block;
}

.meta-value {
    font-size: 1.4rem;
    font-weight: 800;
}

.meta-value.debit {
    color: var(--info);
}

.meta-value.credit {
    color: var(--success);
}

/* Toast Alerts (Slide In, Elegant Blurs) */
.toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    min-width: 320px;
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border-left: 5px solid var(--primary);
    border-right: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transform: translateY(20px);
    opacity: 0;
    animation: toast-fade-in 0.35s forwards cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all var(--transition-fast);
}

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

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.toast-message {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}
.toast-close:hover {
    color: var(--text-primary);
}

@keyframes toast-fade-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Print CSS */
@media print {
    #sidebar, #navbar, .panel-actions, .filter-bar, .toast-container, .btn, .no-print {
        display: none !important;
    }
    
    #main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    body, html {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
    }

    .panel {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .table-responsive {
        border: none !important;
    }

    .table-custom {
        width: 100% !important;
        border: 1px solid #000000 !important;
    }

    .table-custom th, .table-custom td {
        border: 1px solid #000000 !important;
        padding: 8px !important;
    }

    .print-only {
        display: block !important;
    }
}

.print-only {
    display: none;
}

/* Responsive queries */
@media (max-width: 768px) {
    #app-layout {
        flex-direction: column;
    }

    #sidebar {
        width: calc(100% - 24px);
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        margin: 12px;
    }
    
    #sidebar.collapsed {
        display: none;
    }

    #main-content {
        margin-left: 12px !important;
        padding: 0 12px 12px 12px !important;
    }
    
    #navbar {
        padding: 0 16px;
    }

    .dashboard-viewport {
        padding: 0;
        gap: 16px;
    }

    .invoice-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Pagination Controls */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pagination-info {
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast) ease;
    user-select: none;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--border-hover);
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.pagination-select {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    font-size: 0.85rem;
}
