/* ============================================================
   Budget Manager – Site Styles
   ============================================================ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --footer-height: 48px;
    --transition-speed: 0.3s;
    --border-color: #e5e7eb;
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    /* Default Theme (Indigo) */
    --theme-primary: #4f46e5;
    --theme-primary-hover: #4338ca;
    --theme-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --sidebar-accent: #6366f1;
    --sidebar-accent-light: #a5b4fc;
    --sidebar-active: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --sidebar-bg: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, #090d16 0%, #0f172a 45%, #080c14 100%);
    --sidebar-bg-darker: rgba(6, 9, 15, 0.95);
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-border: rgba(255, 255, 255, 0.07);
}

/* ── Theme Palettes ─────────────────────────────────────────── */
[data-theme="indigo"] {
    --theme-primary: #4f46e5;
    --theme-primary-hover: #4338ca;
    --theme-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --sidebar-accent: #6366f1;
    --sidebar-accent-light: #a5b4fc;
    --sidebar-active: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --sidebar-bg: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, #090d16 0%, #0f172a 45%, #080c14 100%);
}

[data-theme="emerald"] {
    --theme-primary: #059669;
    --theme-primary-hover: #047857;
    --theme-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --sidebar-accent: #10b981;
    --sidebar-accent-light: #6ee7b7;
    --sidebar-active: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --sidebar-bg: radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(5, 150, 105, 0.12) 0%, transparent 40%),
        linear-gradient(180deg, #04140e 0%, #064e3b 45%, #020f0a 100%);
}

[data-theme="sapphire"] {
    --theme-primary: #2563eb;
    --theme-primary-hover: #1d4ed8;
    --theme-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --sidebar-accent: #3b82f6;
    --sidebar-accent-light: #93c5fd;
    --sidebar-active: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    --sidebar-bg: radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(29, 78, 216, 0.12) 0%, transparent 40%),
        linear-gradient(180deg, #040e1e 0%, #0c2a50 45%, #030a15 100%);
}

[data-theme="amethyst"] {
    --theme-primary: #7c3aed;
    --theme-primary-hover: #6d28d9;
    --theme-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    --sidebar-accent: #8b5cf6;
    --sidebar-accent-light: #c4b5fd;
    --sidebar-active: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
    --sidebar-bg: radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(109, 40, 217, 0.12) 0%, transparent 40%),
        linear-gradient(180deg, #0f071b 0%, #2e1065 45%, #0a0412 100%);
}

[data-theme="rose"] {
    --theme-primary: #e11d48;
    --theme-primary-hover: #be123c;
    --theme-gradient: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    --sidebar-accent: #f43f5e;
    --sidebar-accent-light: #fecdd3;
    --sidebar-active: linear-gradient(135deg, #be123c 0%, #f43f5e 100%);
    --sidebar-bg: radial-gradient(circle at 15% 15%, rgba(244, 63, 94, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(190, 18, 60, 0.12) 0%, transparent 40%),
        linear-gradient(180deg, #18050b 0%, #4c0519 45%, #0f0206 100%);
}

[data-theme="amber"] {
    --theme-primary: #d97706;
    --theme-primary-hover: #b45309;
    --theme-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --sidebar-accent: #f59e0b;
    --sidebar-accent-light: #fde68a;
    --sidebar-active: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
    --sidebar-bg: radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(180, 83, 9, 0.12) 0%, transparent 40%),
        linear-gradient(180deg, #170d02 0%, #451a03 45%, #0e0701 100%);
}

[data-theme="slate"] {
    --theme-primary: #334155;
    --theme-primary-hover: #1e293b;
    --theme-gradient: linear-gradient(135deg, #334155 0%, #475569 100%);
    --sidebar-accent: #64748b;
    --sidebar-accent-light: #cbd5e1;
    --sidebar-active: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --sidebar-bg: radial-gradient(circle at 15% 15%, rgba(148, 163, 184, 0.12) 0%, transparent 45%),
        linear-gradient(180deg, #090c10 0%, #1e293b 45%, #05070a 100%);
}

/* ── Light Sidebar Mode ─────────────────────────────────────── */
[data-sidebar-mode="light"] .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
}

[data-sidebar-mode="light"] .sidebar-header {
    border-bottom: 1px solid #f1f5f9;
}

[data-sidebar-mode="light"] .sidebar-logo-text {
    color: #0f172a !important;
}

[data-sidebar-mode="light"] .sidebar-menu-header {
    color: #475569 !important;
    font-weight: 800 !important;
}

[data-sidebar-mode="light"] .sidebar-menu-header span {
    color: #475569 !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    letter-spacing: 0.8px !important;
}

[data-sidebar-mode="light"] .sidebar-link {
    color: #1e293b !important;
    font-weight: 700 !important;
    font-size: 14.5px !important;
}

[data-sidebar-mode="light"] .sidebar-link .sidebar-link-text {
    color: #1e293b !important;
    font-weight: 700 !important;
}

[data-sidebar-mode="light"] .sidebar-link:hover {
    background: #f1f5f9 !important;
    color: var(--theme-primary, #4f46e5) !important;
    font-weight: 800 !important;
}

[data-sidebar-mode="light"] .sidebar-link:hover .sidebar-link-text {
    color: var(--theme-primary, #4f46e5) !important;
    font-weight: 800 !important;
}

[data-sidebar-mode="light"] .sidebar-link.active,
[data-sidebar-mode="light"] .sidebar-menu-item.active > .sidebar-link {
    background: var(--sidebar-active, #4f46e5) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

[data-sidebar-mode="light"] .sidebar-link.active .sidebar-link-text,
[data-sidebar-mode="light"] .sidebar-menu-item.active > .sidebar-link .sidebar-link-text {
    color: #ffffff !important;
    font-weight: 800 !important;
}

[data-sidebar-mode="light"] .sidebar-link.active i,
[data-sidebar-mode="light"] .sidebar-menu-item.active > .sidebar-link i {
    color: #ffffff !important;
}

[data-sidebar-mode="light"] .sidebar-footer {
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
}

[data-sidebar-mode="light"] .sidebar-user-name {
    color: #0f172a !important;
}

[data-sidebar-mode="light"] .sidebar-toggle {
    color: #64748b;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

/* ── Dynamic Theme Controls ─────────────────────────────────── */
.btn-primary {
    background: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--theme-primary-hover) !important;
    border-color: var(--theme-primary-hover) !important;
    filter: brightness(0.95);
}

.btn-outline-primary {
    color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.btn-outline-primary:hover {
    background: var(--theme-primary) !important;
    color: #ffffff !important;
}

.text-primary {
    color: var(--theme-primary) !important;
}

.border-primary {
    border-color: var(--theme-primary) !important;
}

/* ── Reset & Base ───────────────────────────────────────────── */
/* ── Google Fonts: Battambang (Khmer OS Battambang) & Modern Typography ── */
@import url('https://fonts.googleapis.com/css2?family=Battambang:wght@300;400;700;900&family=Kantumruy+Pro:ital,wght@0,300..700;1,300..700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --font-khmer: 'Battambang', 'Khmer OS Battambang', 'Kantumruy Pro', sans-serif;
    --font-base: 'Battambang', 'Khmer OS Battambang', 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    overflow-x: hidden;
}

/* Ensure Khmer OS Battambang applies to controls & tables */
button,
input,
select,
textarea,
.form-control,
.form-select,
.table,
.modal,
.dropdown-menu,
.nav,
.badge,
.btn {
    font-family: var(--font-base);
}

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

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
        transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.35);
}

/* Sidebar Header (Logo) */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    min-height: var(--header-height);
    border-bottom: 1px solid var(--sidebar-border);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.sidebar-logo i {
    font-size: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
    flex-shrink: 0;
}

.sidebar-custom-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    color: var(--sidebar-text-active);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Light Sidebar Mode Visible Scrollbar */
[data-sidebar-mode="light"] .sidebar-nav {
    scrollbar-color: #cbd5e1 #f8fafc !important;
}

[data-sidebar-mode="light"] .sidebar-nav::-webkit-scrollbar-track {
    background: #f8fafc;
}

[data-sidebar-mode="light"] .sidebar-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 6px;
}

[data-sidebar-mode="light"] .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu-header {
    padding: 14px 18px 5px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-menu-item {
    padding: 2px 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--sidebar-text, #e2e8f0);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-size: 14.5px;
    font-weight: 700;
    position: relative;
    font-family: 'Kantumruy Pro', 'Battambang', 'Plus Jakarta Sans', sans-serif;
}

.sidebar-link-text {
    font-weight: 700;
    letter-spacing: 0.1px;
}

.sidebar-menu-item.ms-3 .sidebar-link {
    font-size: 13.5px;
    font-weight: 700;
}

.sidebar-menu-item.ms-3 .sidebar-link .sidebar-link-text {
    font-weight: 700;
}

.sidebar-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: #cbd5e1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sidebar-link:hover {
    color: #ffffff !important;
    background: var(--sidebar-hover);
    transform: translateX(4px);
    font-weight: 800;
}

.sidebar-link:hover .sidebar-link-text {
    color: #ffffff !important;
    font-weight: 800;
}

.sidebar-link:hover i {
    color: var(--sidebar-accent-light);
    transform: scale(1.15);
}

.sidebar-link.active,
.sidebar-menu-item.active > .sidebar-link {
    color: #ffffff !important;
    background: var(--sidebar-active) !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
}

.sidebar-link.active .sidebar-link-text,
.sidebar-menu-item.active > .sidebar-link .sidebar-link-text {
    color: #ffffff !important;
    font-weight: 800 !important;
}

.sidebar-link.active i,
.sidebar-menu-item.active > .sidebar-link i {
    color: #ffffff !important;
    font-size: 18px;
}

/* Sidebar Footer (User) */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 14px 16px;
    background: var(--sidebar-bg-darker);
    backdrop-filter: blur(12px);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    flex-shrink: 0;
    position: relative;
}

.sidebar-user-avatar i {
    font-size: 32px;
    color: var(--sidebar-accent-light);
    display: block;
}

.sidebar-user-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border: 2px solid #06090f;
    border-radius: 50%;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sidebar-user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: block;
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-actions {
    flex-shrink: 0;
}

.sidebar-logout-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 15px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logout-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    transform: scale(1.08);
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
}

/* ── Collapsed Sidebar (Desktop) ────────────────────────────── */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-logo-text {
    opacity: 1;
    width: auto;
    overflow: visible;
    white-space: nowrap;
    font-size: 12px;
    padding: 0 2px;
}

body.sidebar-collapsed .sidebar-link-text,
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .sidebar-user-actions,
body.sidebar-collapsed .sidebar-menu-header span,
body.sidebar-collapsed .sidebar-warehouse-section .sidebar-link-text {
    opacity: 0;
    width: 0;
    display: none;
    overflow: hidden;
    white-space: nowrap;
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 8px;
    cursor: pointer;
}

body.sidebar-collapsed .sidebar-logo {
    cursor: pointer;
    transition: transform 0.2s ease;
}

body.sidebar-collapsed .sidebar-logo:hover {
    transform: scale(1.1);
}

body.sidebar-collapsed .sidebar-toggle {
    display: none;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 10px;
}

body.sidebar-collapsed .sidebar-menu-header {
    padding: 10px 0;
    text-align: center;
    min-height: 10px;
}

body.sidebar-collapsed .sidebar-menu-header span {
    display: none;
}

body.sidebar-collapsed .sidebar-menu-header::after {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto;
}

body.sidebar-collapsed .sidebar-footer {
    padding: 12px 10px;
    justify-content: center;
}

body.sidebar-collapsed .sidebar-user {
    justify-content: center;
}

body.sidebar-collapsed .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* Tooltip on collapsed sidebar */
body.sidebar-collapsed .sidebar-link {
    position: relative;
}

body.sidebar-collapsed .sidebar-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-collapsed-width) - 6px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    z-index: 1060;
    box-shadow: var(--shadow-md);
    text-transform: capitalize;
}

/* ── Auth Layout (Unauthenticated & Login) ──────────────────── */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 10% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 90% 85%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 60%),
        #f8fafc;
    position: relative;
}

.auth-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    z-index: 10;
}

.auth-main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-main-content .container {
    max-width: 1080px;
}

/* ── World-Class Split Showcase Login Card ─────────────────── */
.auth-split-card {
    background: #ffffff;
    border-radius: 28px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.09),
        0 0 0 1px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    display: flex;
    min-height: 600px;
    width: 100%;
    margin: 0 auto;
    transition: box-shadow 0.3s ease;
}

.auth-split-card:hover {
    box-shadow: 0 30px 70px -15px rgba(15, 23, 42, 0.13),
        0 0 0 1px rgba(99, 102, 241, 0.1);
}

/* ── Hero Left Pane (44% width) ────────────────────────────── */
.auth-hero-pane {
    width: 44%;
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 55%, #111827 100%);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.auth-hero-pane::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
}

.auth-hero-pane::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
    filter: blur(25px);
    pointer-events: none;
}

.auth-hero-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.auth-hero-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #ffffff;
    padding: 4px;
    object-fit: contain;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.auth-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
}

.auth-hero-body {
    position: relative;
    z-index: 2;
    margin: 36px 0;
}

.auth-hero-tagline {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.35;
    color: #f8fafc;
    margin-bottom: 24px;
}

/* Mini Financial Preview Card inside Hero */
.auth-hero-stat-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
}

.auth-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.auth-stat-label {
    font-size: 12.5px;
    font-weight: 500;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-stat-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    display: inline-block;
}

.auth-stat-amount {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
}

.auth-stat-badge {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

/* Feature bullets */
.auth-hero-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-hero-feat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: #e2e8f0;
}

.auth-hero-feat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    font-size: 13px;
    flex-shrink: 0;
}

.auth-hero-footer {
    position: relative;
    z-index: 2;
    font-size: 12px;
    color: #94a3b8;
}

/* ── Form Right Pane (56% width) ───────────────────────────── */
.auth-form-pane {
    width: 56%;
    padding: 48px 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.auth-form-header {
    margin-bottom: 28px;
}

.auth-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--theme-primary, #6366f1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    margin-bottom: 12px;
}

.auth-form-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.auth-form-sub {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Inputs */
.auth-input-group {
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
}

.auth-input-group:focus-within {
    border-color: var(--theme-primary, #6366f1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.auth-input-group .input-group-text {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.15rem;
    padding-left: 18px;
    padding-right: 12px;
    transition: color 0.2s ease;
}

.auth-input-group:focus-within .input-group-text {
    color: var(--theme-primary, #6366f1);
}

.auth-input-group .form-control {
    border: none;
    background: transparent;
    font-size: 15px;
    padding: 13px 16px 13px 0;
    color: #0f172a;
    box-shadow: none !important;
}

.auth-input-group .form-control::placeholder {
    color: #94a3b8;
}

/* Submit button */
.btn-auth-submit {
    background: linear-gradient(135deg, var(--theme-primary, #6366f1) 0%, var(--theme-primary-hover, #4f46e5) 100%);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 24px -4px rgba(99, 102, 241, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    width: 100%;
}

.btn-auth-submit:hover {
    background: linear-gradient(135deg, var(--theme-primary-hover, #4f46e5) 0%, var(--theme-primary, #6366f1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -4px rgba(99, 102, 241, 0.5);
    color: #ffffff;
}

.btn-auth-submit:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.4);
}

.btn-auth-submit i {
    transition: transform 0.2s ease;
}

.btn-auth-submit:hover i {
    transform: translateX(4px);
}

/* Checkbox */
.auth-checkbox .form-check-input {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-checkbox .form-check-input:checked {
    background-color: var(--theme-primary, #6366f1);
    border-color: var(--theme-primary, #6366f1);
}

.auth-checkbox .form-check-label {
    cursor: pointer;
    color: #475569;
    font-size: 14.5px;
    user-select: none;
    margin-left: 6px;
}

/* Security Badge */
.auth-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    padding: 6px 14px;
    background: rgba(241, 245, 249, 0.8);
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

/* Responsive Collapse for Tablet & Mobile */
@media (max-width: 991.98px) {
    .auth-split-card {
        flex-direction: column;
        max-width: 520px;
        min-height: auto;
    }

    .auth-hero-pane {
        width: 100%;
        padding: 32px 28px;
    }

    .auth-hero-stat-card,
    .auth-hero-features,
    .auth-hero-footer {
        display: none;
    }

    .auth-hero-body {
        margin: 16px 0 0 0;
    }

    .auth-hero-tagline {
        font-size: 18px;
        margin-bottom: 0;
    }

    .auth-form-pane {
        width: 100%;
        padding: 32px 28px;
    }
}

/* ── Main Wrapper ───────────────────────────────────────────── */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-speed) ease;
}

/* ── Top Header ─────────────────────────────────────────────── */
.top-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

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

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

/* ── Language Switcher ─────────────────────────────────────── */
.language-switcher {
    background: #f1f5f9;
    padding: 3px 6px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
}

.lang-flag-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-flag-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.lang-flag-btn.active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.lang-flag-img {
    width: 22px;
    height: 15px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.header-sidebar-toggle:hover {
    color: var(--sidebar-accent);
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.header-sidebar-toggle:active {
    transform: translateY(0);
}

.sidebar-toggle-mobile {
    color: var(--text-primary);
    padding: 4px 8px;
    text-decoration: none;
}

.header-avatar i {
    color: var(--sidebar-accent);
}

.notification-dropdown {
    min-width: 280px;
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 24px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.main-footer {
    padding: 12px 24px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

/* ── Dashboard Cards ────────────────────────────────────────── */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card-icon.bg-income {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-card-icon.bg-expense {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-card-icon.bg-balance {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.stat-card-icon.bg-budget {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-card-icon.bg-savings {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 12px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Content Cards ──────────────────────────────────────────── */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.content-card-header h5,
.content-card-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
    color: #0f172a !important;
}

.content-card-body {
    padding: 20px;
}

/* ── Pure White Header Style for All Forms, Tables, Grids & Cards ── */
.card-header,
.card-header.bg-white,
div[class*="card-header"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: #0f172a !important;
    font-weight: 600;
}

/* All Table Headers in All Forms & Grids: Pure White Background */
.table thead,
.table thead tr,
.table thead th,
.table-header-white,
.table-header-white th,
.table-header-white tr,
.table thead.table-dark,
.table thead.table-dark th,
.table thead.table-dark tr,
.table-dark,
.table-dark th,
.table-dark tr,
.table thead.table-light,
.table thead.table-light th,
table.dataTable thead,
table.dataTable thead tr,
table.dataTable thead th,
.dataTables_wrapper table.dataTable thead th,
.dataTables_scrollHead thead th {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-top: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 12px 14px !important;
    vertical-align: middle !important;
    box-shadow: none !important;
}

.table thead th a,
.table thead th span,
table.dataTable thead th a,
table.dataTable thead th span {
    color: #1e293b !important;
}

/* ── DataTables Customization ───────────────────────────────── */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--sidebar-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

table.dataTable tbody td {
    font-size: 13.5px;
    vertical-align: middle;
    padding: 12px 10px !important;
}

table.dataTable tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.03) !important;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--sidebar-accent);
    border-color: var(--sidebar-accent);
}

.btn-primary:hover {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

/* ── Modals: Pure White Header ──────────────────────────────── */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header,
.modal-content .modal-header,
.modal-header.bg-light {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 16px 20px;
}

.modal-header .modal-title,
.modal-header h4,
.modal-header h5,
.modal-header h6 {
    color: #0f172a !important;
    font-weight: 600;
}

/* ── Form & Page Headers: Pure White Background ─────────────── */
.form-header,
.page-header {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
    font-size: 13.5px;
    padding: 8px 12px;
}

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

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* ── Badge & Status ─────────────────────────────────────────── */
.badge-income {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-expense {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge-transfer {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

.badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-inactive {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* ── Progress Bars ──────────────────────────────────────────── */
.progress {
    height: 8px;
    border-radius: 100px;
    background: #f3f4f6;
}

.progress-bar {
    border-radius: 100px;
}

/* ── Toastr Customization ───────────────────────────────────── */
.toast-success {
    background-color: #10b981 !important;
}

.toast-error {
    background-color: #ef4444 !important;
}

.toast-info {
    background-color: var(--sidebar-accent) !important;
}

.toast-warning {
    background-color: #f59e0b !important;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ── Chart Containers ───────────────────────────────────────── */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* ── Amount Colors ──────────────────────────────────────────── */
.text-income,
.amount-positive {
    color: #10b981;
}

.text-expense,
.amount-negative {
    color: #ef4444;
}

.text-transfer {
    color: var(--sidebar-accent);
}

/* ── Utility Classes ────────────────────────────────────────── */
.cursor-pointer {
    cursor: pointer;
}

.fw-600 {
    font-weight: 600;
}

.fs-13 {
    font-size: 13px;
}

.gap-16 {
    gap: 16px;
}

.border-dashed {
    border-style: dashed !important;
}

/* ============================================================
   COMPREHENSIVE MASTER RESPONSIVE SYSTEM
   Breakpoints:
     Desktop: 1920px, 1600px, 1440px, 1366px, 1280px
     Laptop / Small Desktop: 1024px - 1199px
     Tablet: 768px - 1023px
     Mobile: 576px, 430px, 414px, 390px, 375px, 360px
   ============================================================ */

/* Global Anti-Horizontal-Overflow Safeguard */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ─────── 1. Desktop & Large Laptop (>= 992px) ─────── */
@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--sidebar-width);
        transform: translateX(0);
        z-index: 1030;
    }

    .main-wrapper {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        min-height: 100vh;
        transition: margin-left var(--transition-speed) ease, width var(--transition-speed) ease;
    }

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

    body.sidebar-collapsed .main-wrapper {
        margin-left: var(--sidebar-collapsed-width);
        width: calc(100% - var(--sidebar-collapsed-width));
    }

    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        padding: 24px;
    }
}

/* ─────── 2. Tablet (768px - 991.98px) ─────── */
@media (min-width: 768px) and (max-width: 991.98px) {
    :root {
        --sidebar-width: 220px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--sidebar-width);
        transform: translateX(0);
        z-index: 1030;
    }

    .main-wrapper {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        min-height: 100vh;
        transition: margin-left var(--transition-speed) ease, width var(--transition-speed) ease;
    }

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

    body.sidebar-collapsed .main-wrapper {
        margin-left: var(--sidebar-collapsed-width);
        width: calc(100% - var(--sidebar-collapsed-width));
    }

    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        padding: 18px 16px;
    }

    .top-header {
        padding: 0 16px;
    }

    .stat-card {
        padding: 16px;
    }
}

/* ─────── 3. Mobile (< 768px: 576px, 430px, 414px, 390px, 375px, 360px) ─────── */
@media (max-width: 767.98px) {

    /* Sidebar converts into Offcanvas Navigation Drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        box-shadow: none;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
    }

    /* Background Overlay */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        z-index: 1045;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
        display: block !important;
    }

    /* Main wrapper occupies full width */
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0;
    }

    /* Top Header Mobile Layout */
    .top-header {
        height: 56px;
        padding: 0 12px;
    }

    .page-title {
        display: none !important;
    }

    .main-content {
        padding: 12px 10px;
        min-width: 0;
    }

    /* Lock background scrolling when drawer open */
    body.sidebar-mobile-open {
        overflow: hidden !important;
    }
}

/* ─────── 4. Small Mobile (< 576px: 430px, 414px, 390px, 375px, 360px) ─────── */
@media (max-width: 575.98px) {
    body {
        font-size: 13.5px;
    }

    .main-content {
        padding: 10px 8px;
    }

    .top-header {
        padding: 0 10px;
    }

    /* Stat/KPI Card spacing and typography */
    .stat-card {
        padding: 12px;
        border-radius: 10px;
    }

    .stat-card h3 {
        font-size: 1.25rem;
    }

    .stat-card .fs-3 {
        font-size: 1.35rem !important;
    }

    .stat-card .rounded-circle {
        padding: 8px !important;
    }

    /* Modals Responsive Layout */
    .modal-dialog {
        max-width: calc(100% - 16px) !important;
        margin: 8px auto !important;
    }

    .modal-content {
        max-height: 90vh;
        border-radius: 12px;
    }

    .modal-body {
        max-height: calc(90vh - 130px);
        overflow-y: auto;
        padding: 14px;
    }

    .modal-header,
    .modal-footer {
        padding: 10px 14px;
    }

    .modal-title {
        font-size: 1rem;
    }

    /* Compact Buttons on Small Screens */
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.78rem;
    }

    /* Forms Responsive */
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 3px;
    }

    .form-control,
    .form-select {
        font-size: 13.5px;
        padding: 0.4rem 0.65rem;
        min-height: 38px;
    }

    /* DataTables wrapper adjustments */
    .dataTables_wrapper {
        font-size: 0.85rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        margin-bottom: 8px;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 4px;
    }

    .dataTables_wrapper .dataTables_paginate {
        margin-top: 8px;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ─────── 5. Tiny Mobile (360px - 389px) ─────── */
@media (max-width: 389.98px) {
    body {
        font-size: 13px;
    }

    .top-header {
        padding: 0 6px;
    }

    .main-content {
        padding: 8px 6px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-card h3 {
        font-size: 1.15rem;
    }

    .modal-dialog {
        max-width: calc(100% - 10px) !important;
        margin: 5px auto !important;
    }

    .btn {
        font-size: 0.8rem;
    }
}

/* ============================================================
   MODULE-SPECIFIC RESPONSIVE IMPROVEMENTS
   ============================================================ */

/* ── Table & DataTables Responsive Container ───────────────── */
.table-responsive {
    width: 100%;
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Prevent DataTables from breaking outside parent container */
.dataTables_wrapper {
    width: 100%;
    overflow-x: hidden;
}

.table {
    width: 100% !important;
    vertical-align: middle;
}

/* DataTables action column responsiveness */
.table td .btn-group,
.table td .d-flex {
    flex-wrap: nowrap;
}

/* ── Charts Responsiveness (Chart.js) ──────────────────────── */
.chart-container,
.chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 240px;
}

@media (max-width: 767.98px) {

    .chart-container,
    .chart-wrapper {
        min-height: 200px;
        max-height: 280px;
    }
}

/* ── Report Module Responsiveness ──────────────────────────── */
.report-row-hover {
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.report-row-hover:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

.report-icon-box {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .report-icon-box {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .a4-document-page {
        padding: 16px 12px !important;
        min-height: auto;
        border-radius: 6px;
    }
}

/* ── Toastr & Alerts Responsiveness ────────────────────────── */
@media (max-width: 575.98px) {
    #toast-container {
        width: calc(100% - 24px) !important;
        right: 12px !important;
        left: 12px !important;
        top: 12px !important;
    }

    #toast-container>div {
        width: 100% !important;
        margin-bottom: 8px;
    }
}