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

:root {
    --bg-dark: #090a0f;
    --bg-panel: rgba(17, 19, 28, 0.75);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-focus: rgba(147, 51, 234, 0.5);
    
    --primary: #9333ea;
    --primary-glow: rgba(147, 51, 234, 0.3);
    --primary-hover: #a855f7;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14.5px !important;

    /* Theme-specific background gradients */
    --bg-gradient-1: rgba(147, 51, 234, 0.06);
    --bg-gradient-2: rgba(59, 130, 246, 0.06);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

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

body {
    background-color: var(--bg-dark) !important;
    color: var(--text-main) !important;
    font-family: var(--font-sans) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    overflow-x: hidden !important;
    background-image: 
        radial-gradient(circle at 10% 20%, var(--bg-gradient-1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, var(--bg-gradient-2) 0%, transparent 40%) !important;
    background-attachment: fixed !important;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Smooth Fade In Animation */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Auth Layout */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #9333ea, #3b82f6);
}

.auth-logo {
    font-size: 2.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    display: inline-block;
}

.auth-logo span {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Main Dashboard Grid Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(10, 11, 17, 0.9);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 40px;
}

.sidebar-brand span {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%) !important;
    border: 1px solid rgba(147, 51, 234, 0.25);
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.1);
    font-weight: 600;
    position: relative;
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 4px;
    background: var(--primary);
    border-radius: 4px;
}

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

.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 40px;
    max-width: 1650px;
    width: calc(100% - 260px);
    display: flex;
    flex-direction: column;
}

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

.page-title {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Glassmorphic Components */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25), 0 0 1px 1px var(--primary-glow);
    border-color: rgba(147, 51, 234, 0.3);
}


.stat-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
    letter-spacing: -0.01em;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control, select, textarea {
    width: 100% !important;
    padding: 12px 16px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
}

.form-control:focus, select:focus, textarea:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

select option {
    background-color: #12141c !important;
    color: #fff !important;
}

/* Buttons */
.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-family: inherit !important;
    gap: 8px !important;
}

.btn-primary {
    background: linear-gradient(135deg, #9333ea 0%, #6366f1 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(147, 51, 234, 0.3) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a855f7 0%, #4f46e5 100%) !important;
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.45) !important;
    transform: translateY(-1.5px) scale(1.01) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25) !important;
}

.btn-danger:hover {
    opacity: 0.95 !important;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35) !important;
    transform: translateY(-1.5px) scale(1.01) !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
    border: 1px solid var(--border-color) !important;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-1px) !important;
}

/* Tables */
table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-top: 10px;
}

table, thead, tbody, tr, th, td {
    border-color: var(--border-color) !important;
}

th {
    text-align: left;
    padding: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color) !important;
    background-color: transparent !important;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color) !important;
    font-size: 0.92rem;
    vertical-align: middle;
    background-color: transparent !important;
}

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

tr {
    transition: background-color 0.2s ease;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.05);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.05);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.05);
}

/* Log view box */
.log-box {
    background: #040507;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.875rem;
    color: #10b981;
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 500px;
}

/* Responsive Grid layouts */
.panel-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

@media (max-width: 992px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
}

/* Smooth transitions for theme toggle */
*, *::before, *::after {
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                border-top-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-bottom-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-left-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-right-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


#theme-toggle-btn:hover {
    transform: rotate(15deg) scale(1.15);
}

/* ---------------------------------------------------- */
/* LIGHT MODE STYLING OVERRIDES                         */
/* ---------------------------------------------------- */

body.light-mode {
    --bg-dark: #f5f7fa;
    --bg-panel: #ffffff;
    --border-color: rgba(139, 92, 246, 0.08);
    --border-focus: rgba(139, 92, 246, 0.4);
    
    --primary: #7c3aed;
    --primary-glow: rgba(124, 58, 237, 0.15);
    --primary-hover: #6d28d9;
    
    --text-main: #0f172a;
    --text-muted: #64748b;

    /* Theme-specific background gradients */
    --bg-gradient-1: rgba(124, 58, 237, 0.03);
    --bg-gradient-2: rgba(59, 130, 246, 0.03);
}

/* Scrollbar in Light Mode */
body.light-mode ::-webkit-scrollbar-track {
    background: #f1f5f9;
}
body.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}
body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Dynamic text correction for inline white colors */
body.light-mode [style*="color: #fff"]:not(.btn):not(.badge):not(i):not([class*="badge"]):not([class*="btn"]):not([style*="background"]),
body.light-mode [style*="color: #ffffff"]:not(.btn):not(.badge):not(i):not([class*="badge"]):not([class*="btn"]):not([style*="background"]),
body.light-mode [style*="color: white"]:not(.btn):not(.badge):not(i):not([class*="badge"]):not([class*="btn"]):not([style*="background"]) {
    color: var(--text-main) !important;
}

body.light-mode [style*="color: var(--text-muted)"] {
    color: var(--text-muted) !important;
}

body.light-mode .auth-logo {
    color: #0f172a !important;
}

/* Headings */
body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode .page-title,
body.light-mode .panel-title {
    color: #0f172a !important;
}

/* Tables in Light Mode */
body.light-mode th {
    border-bottom: 1px solid var(--border-color) !important;
    color: #475569 !important;
}

body.light-mode td {
    border-bottom: 1px solid var(--border-color) !important;
    color: #334155 !important;
}

body.light-mode tr:hover td {
    background: #f8fafc;
}

/* Panels and Cards in Light Mode */
body.light-mode .panel {
    background-color: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 10px -6px rgba(15, 23, 42, 0.03) !important;
}

body.light-mode .stat-card {
    background-color: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 10px -6px rgba(15, 23, 42, 0.03) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}


body.light-mode .stat-card:hover {
    box-shadow: 0 20px 35px -5px rgba(124, 58, 237, 0.1), 0 10px 15px -5px rgba(124, 58, 237, 0.05) !important;
    border-color: rgba(124, 58, 237, 0.2) !important;
}

/* Stat Cards Accents in Light Mode */
body.light-mode .stat-card:nth-child(1) {
    border-left: 4px solid var(--primary) !important;
}
body.light-mode .stat-card:nth-child(2) {
    border-left: 4px solid #3b82f6 !important;
}
body.light-mode .stat-card:nth-child(3) {
    border-left: 4px solid #10b981 !important;
}
body.light-mode .stat-card:nth-child(4) {
    border-left: 4px solid #f59e0b !important;
}

body.light-mode .stat-card div[style*="border-top"] {
    border-top-color: #f1f5f9 !important;
    color: #64748b !important;
}

body.light-mode .stat-card div[style*="border-top"] strong {
    color: #334155 !important;
}

/* Soft Pastel Plates for Stat Icons in Light Mode */
body.light-mode .stat-card div[style*="background: var(--primary)"] {
    background: rgba(147, 51, 234, 0.06) !important;
    color: #9333ea !important;
    border: 1px solid rgba(147, 51, 234, 0.1);
}
body.light-mode .stat-card div[style*="background: #3b82f6"] {
    background: rgba(59, 130, 246, 0.06) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.1);
}
body.light-mode .stat-card div[style*="background: #10b981"] {
    background: rgba(16, 185, 129, 0.06) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.1);
}
body.light-mode .stat-card div[style*="background: #f59e0b"] {
    background: rgba(245, 158, 11, 0.06) !important;
    color: #b45309 !important;
    border: 1px solid rgba(245, 158, 11, 0.1);
}

/* Sidebar in Light Mode */
body.light-mode .sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border-color) !important;
}

body.light-mode .sidebar-brand a {
    color: #0f172a;
}

body.light-mode .sidebar-link {
    color: #475569;
}

body.light-mode .sidebar-link:hover {
    color: var(--primary);
    background: rgba(124, 58, 237, 0.03);
}

body.light-mode .sidebar-link.active {
    background: rgba(124, 58, 237, 0.06) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow: none !important;
}

body.light-mode .sidebar-footer {
    border-top: 1px solid var(--border-color) !important;
}

body.light-mode .sidebar-footer div,
body.light-mode .sidebar-footer strong {
    color: #475569 !important;
}

body.light-mode .sidebar-footer strong[style*="color: var(--primary)"] {
    color: var(--primary) !important;
}

/* Theme Toggle Button in Light Mode */
body.light-mode #theme-toggle-btn {
    background: #f1f5f9 !important;
    color: #eab308 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 50%;
}

/* Form inputs in Light Mode */
body.light-mode .form-control,
body.light-mode select,
body.light-mode textarea {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    color: #0f172a !important;
}

body.light-mode .form-control:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
}

body.light-mode select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

body.light-mode .form-label {
    color: #475569;
}

/* Secondary Buttons in Light Mode */
body.light-mode .btn-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid var(--border-color) !important;
}

body.light-mode .btn-secondary:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: var(--border-focus) !important;
}

/* Exclusions chips in Light Mode */
body.light-mode .exclude-chip {
    background: rgba(239, 68, 68, 0.06) !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

/* Badges in Light Mode */
body.light-mode .badge-success {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}
body.light-mode .badge-warning {
    background: #fffbeb !important;
    color: #b45309 !important;
    border: 1px solid #fef3c7 !important;
}
body.light-mode .badge-danger {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fee2e2 !important;
}

/* Modal Styling in Light Mode */
body.light-mode #download_modal > div {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    color: #0f172a !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08) !important;
}

body.light-mode #download_modal h3,
body.light-mode #download_modal p,
body.light-mode #download_modal div {
    color: #0f172a !important;
}

body.light-mode #download_modal p[style*="color: var(--text-muted)"] {
    color: #64748b !important;
}

.storage-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.storage-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(147, 51, 234, 0.4);
}

body.light-mode .storage-row {
    background: #f8fafc !important;
    border: 1px solid var(--border-color) !important;
}
body.light-mode .storage-row:hover {
    background: #f1f5f9 !important;
    border-color: var(--primary) !important;
}

/* Premium Header Banner */
.header-banner {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.12) 0%, rgba(99, 102, 241, 0.04) 100%);
    border: 1px solid rgba(147, 51, 234, 0.15);
    border-left: 4px solid var(--primary);
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}


.banner-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.banner-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.015em;
}

/* Light Mode Overrides for Header Banner */
body.light-mode .header-banner {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.04) 0%, rgba(99, 102, 241, 0.01) 100%) !important;
    border: 1px solid rgba(124, 58, 237, 0.1) !important;
    border-left: 4px solid var(--primary) !important;
    box-shadow: 0 4px 15px -3px rgba(124, 58, 237, 0.03) !important;
}

body.light-mode .banner-subtitle {
    color: #64748b !important;
}

body.light-mode .banner-title {
    color: #0f172a !important;
}

/* File Browser Container & Box Alignment */
.file-browser-box {
    border-top: 1px solid var(--border-color) !important;
    padding: 18px 0 0 0 !important;
    background: transparent !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    flex-grow: 1;
}

/* Path breadcrumb bar */
.file-browser-path {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
    font-family: monospace;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    margin-bottom: 15px !important;
    word-break: break-all !important;
}
body.light-mode .file-browser-path {
    background: #f1f5f9 !important;
    border-color: var(--border-color) !important;
    color: #475569 !important;
}

/* File Browser List Item */
.file-browser-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px !important;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.file-browser-item:hover {
    background: rgba(147, 51, 234, 0.08) !important;
    border-color: rgba(147, 51, 234, 0.15) !important;
}
body.light-mode .file-browser-item:hover {
    background: rgba(124, 58, 237, 0.05) !important;
    border-color: rgba(124, 58, 237, 0.1) !important;
}

/* ---------------------------------------------------- */
/* MOBILE RESPONSIVE STYLING                            */
/* ---------------------------------------------------- */

/* Mobile Header Bar */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(10, 11, 17, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 101;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.mobile-brand {
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.mobile-brand span {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.45rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.mobile-menu-btn:active {
    transform: scale(0.92);
}

/* Sidebar Overlay Backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99;
    animation: fadeInOverlay 0.2s ease forwards;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsiveness Media Queries */
@media (max-width: 992px) {
    .mobile-header {
        display: flex;
    }
    
    .app-container {
        padding-top: 62px; /* Offset for fixed mobile header */
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px; /* Slide off-screen left by default */
        width: 260px;
        height: 100vh;
        z-index: 103;
        background: #0d0f16;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 15px 0 35px rgba(0, 0, 0, 0.6);
        border-right: 1px solid var(--border-color);
        padding-top: 40px;
    }
    
    .sidebar.open {
        left: 0; /* Slide sidebar in */
    }
    
    .sidebar-overlay {
        z-index: 102;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 30px 16px;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        text-align: left;
    }
    
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .card-grid {
        grid-template-columns: 1fr !important; /* Stack stats cards vertically */
        gap: 16px;
    }
    
    .panel {
        padding: 24px 16px;
    }
    
    /* Responsive details for form actions */
    .form-group {
        margin-bottom: 16px;
    }
    
    /* Make tables fit cleanly and scroll horizontally instead of breaking */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 576px) {
    .panel-title {
        font-size: 1.15rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .btn {
        padding: 7px 14px !important;
        font-size: 0.82rem !important;
    }
}

/* Light Mode Overrides for Mobile Elements */
body.light-mode .mobile-header {
    background: #ffffff !important;
    border-bottom-color: var(--border-color) !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode .mobile-brand {
    color: #0f172a !important;
}

body.light-mode .mobile-menu-btn {
    color: #0f172a !important;
}

body.light-mode .sidebar {
    background: #ffffff !important;
    border-right-color: var(--border-color) !important;
    box-shadow: 15px 0 35px rgba(15, 23, 42, 0.05) !important;
}

/* Dashboard Footer styling */
.app-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: border-color 0.25s ease, color 0.25s ease;
}

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

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-links a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links .divider {
    color: rgba(255, 255, 255, 0.1);
}

body.light-mode .footer-links .divider {
    color: rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
    .app-footer {
        margin-top: 40px;
    }
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}


/* Global Toggle Switch Styling */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-container .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 34px;
    transition: .3s;
}
.switch-container .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}
.switch-container input:checked + .slider {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.switch-container input:checked + .slider:before {
    transform: translateX(20px);
}

/* Light mode support for disabled/off toggles (matching the purple theme) */
body.light-mode .switch-container input:not(:checked) + .slider {
    background-color: #f3f0ff !important;
    border: 1px solid #e9d5ff !important;
}
body.light-mode .switch-container input:not(:checked) + .slider:before {
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(147, 51, 234, 0.15) !important;
}

/* Light mode support for active/on toggles */
body.light-mode .switch-container input:checked + .slider {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Explicit input/textarea placeholder color overrides to ensure high contrast in both themes */
.form-control::placeholder,
textarea::placeholder,
select::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}

body.light-mode .form-control::placeholder,
body.light-mode textarea::placeholder,
body.light-mode select::placeholder {
    color: rgba(15, 23, 42, 0.45) !important;
}

/* Active selected subscription plan card highlight */
body.light-mode .stat-card.selected,
.stat-card.selected {
    border: 1px solid var(--primary) !important;
    background-color: var(--primary-glow) !important;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15) !important;
}
