:root {
    /* --- Light Mode Palette (Glass & Modern) --- */
    --primary-color: #059669;
    /* Emerald 600 */
    --primary-hover: #047857;
    --secondary-color: #64748b;
    /* Slate 500 */
    --accent-color: #0ea5e9;
    /* Sky 500 */

    /* Glass Backgrounds */
    --bg-body: #f1f5f9;
    /* Slate 100 fallback */
    --bg-gradient: radial-gradient(circle at 10% 20%, rgb(239, 246, 255) 0%, rgb(219, 234, 254) 90%);

    /* Surface (Glass) */
    --bg-surface: rgba(255, 255, 255, 0.65);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --backdrop-blur: blur(12px);

    --bg-sidebar: rgba(15, 23, 42, 0.85);
    /* Slate 900 Glass */

    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #475569;
    /* Slate 600 */
    --border-color: rgba(226, 232, 240, 0.8);
    /* Slate 200 */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);

    --radius-md: 0.75rem;
    --radius-lg: 1rem;

    --sidebar-width: 260px;
    --header-height: 70px;

    --primary-rgb: 5, 150, 105;
}

[data-bs-theme="dark"] {
    /* --- Dark Mode Palette (Neon & Deep Glass) --- */
    --primary-color: #34d399;
    /* Emerald 400 */
    --primary-hover: #10b981;
    --secondary-color: #94a3b8;
    /* Slate 400 */

    --bg-body: #020617;
    /* Slate 950 */
    /* Deep mesh gradient for dark mode */
    --bg-gradient: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);

    --bg-surface: rgba(30, 41, 59, 0.6);
    /* Slate 800 Glass */
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --bg-sidebar: rgba(15, 23, 42, 0.85);

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #cbd5e1;
    /* Slate 300 */
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Global Reset & Typography */
body {
    background-color: var(--bg-body);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Glassmorphism Cards */
.card {
    background: var(--bg-surface);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

[data-bs-theme="dark"] .card:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.form-control,
.form-select {
    background-color: rgba(255, 255, 255, 0.5);
    /* Semi-transparent inputs */
    border-color: var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.8rem;
    backdrop-filter: blur(5px);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: rgba(0, 0, 0, 0.2);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25) !important;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: rgba(0, 0, 0, 0.4);
}

.input-group-text {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: var(--border-color);
    color: var(--text-muted);
}

[data-bs-theme="dark"] .input-group-text {
    background-color: rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 6px 12px rgba(5, 150, 105, 0.4);
    transform: translateY(-1px);
}

.table {
    --bs-table-color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    --bs-table-striped-bg: rgba(var(--primary-rgb), 0.03);
    --bs-table-hover-bg: rgba(var(--primary-rgb), 0.08);
    /* Greenish hover */
}

[data-bs-theme="dark"] .table {
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

/* Nav Tabs Overrides */
.nav-tabs {
    border-bottom-color: var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-color: transparent;
    isolation: isolate;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-color: transparent;
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Login Page Styles */
.login-body {
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    background: var(--primary-gradient);
    z-index: -1;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}


/* --- Layout Structure --- */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

/* --- Neo-Glass Sidebar (Floating) --- */
/* --- Neo-Glass Sidebar (Floating) --- */
:root {
    --sidebar-width: 280px;

    /* Gradient Sidebar Theme (Always Colorful) */
    --sidebar-bg: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    --sidebar-text: #ffffff;
    --sidebar-muted: rgba(255, 255, 255, 0.7);
    --sidebar-border: rgba(255, 255, 255, 0.2);
    --sidebar-shadow: 0 20px 40px -4px rgba(5, 150, 105, 0.3);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.15);
    --sidebar-badge-bg: rgba(255, 255, 255, 0.2);
    --sidebar-badge-text: #ffffff;
    --sidebar-footer-bg: rgba(0, 0, 0, 0.2);
}

.glass-sidebar {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    bottom: 1.25rem;
    width: var(--sidebar-width);

    /* Variable Theming */
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid var(--sidebar-border);
    box-shadow: var(--sidebar-shadow);
    border-radius: 1.75rem;

    padding: 2rem 1.5rem;
    z-index: 1040;
    overflow-y: auto;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Decoration */

}

[data-bs-theme="dark"] .glass-sidebar {
    background: rgba(5, 5, 5, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Scrollbar Hide */
.glass-sidebar::-webkit-scrollbar {
    width: 0px;
}

/* Brand Area */
.sidebar-brand-text {
    color: var(--sidebar-text);
    font-weight: 800;
    letter-spacing: -0.05em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-badge {
    background: var(--sidebar-badge-bg);
    color: var(--sidebar-badge-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-footer-text {
    color: var(--sidebar-text);
    font-weight: 500;
}

.sidebar-brand .brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Menu Labels */
.menu-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    letter-spacing: 1.5px;
    color: var(--sidebar-muted);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

/* Custom Links */
.custom-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    /* Reduced height */
    color: var(--sidebar-muted);
    border-radius: 0.75rem;
    /* Slightly smaller radius */
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.custom-link .icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: inherit;
    transition: transform 0.2s;
}

.custom-link .link-text {
    font-weight: 500;
    font-size: 0.95rem;
}

.custom-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.custom-link:hover .icon-box {
    transform: scale(1.1);
}

.custom-link.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Adjust Main Wrapper for Floating Sidebar */
@media (min-width: 992px) {
    .main-wrapper {
        margin-left: calc(var(--sidebar-width) + 2.5rem);
        /* Extra gap for floating */
        padding-right: 1.25rem;
        transition: margin-left 0.4s ease;
    }

    .top-navbar {
        margin-top: 1.25rem;
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(12px);
        border: 1px solid white;
        border-radius: 1.25rem;
        padding: 0 1.5rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    }

    [data-bs-theme="dark"] .top-navbar {
        background: rgba(30, 30, 35, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* Mobile */
@media (max-width: 991.98px) {
    .glass-sidebar {
        width: 280px;
        left: 0;
        top: 0;
        bottom: 0;
        border-radius: 0 1.5rem 1.5rem 0;
        transform: translateX(-110%);
        margin: 0;
    }

    .glass-sidebar.show {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
        padding: 0;
    }

    .top-navbar {
        border-radius: 0;
        margin-top: 0;
    }
}

/* Submenu Tweaks */
.sidebar .collapse .nav-link {
    padding-left: 2.5rem;
    /* Indent submenus */
    font-size: 0.95rem;
}

.top-navbar {
    height: var(--header-height);
    /* Glassmorphism for Header */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: background-color 0.3s;
}

[data-bs-theme="dark"] .top-navbar {
    background: rgba(30, 41, 59, 0.7);
    /* Dark surface transparent */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.content-body {
    padding: 2rem;
    flex: 1;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        /* Hide sidebar by default */
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* Overlay for mobile sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
        display: none;
        backdrop-filter: blur(2px);
    }

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

    .content-body {
        padding: 1rem;
    }
}

/* Utility / Extras */
.text-justify {
    text-align: justify;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
    opacity: 0.5;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* --- New Landing Page Navbar (Large & Shrinking) --- */
/* --- Premium SaaS Navbar (Transparent -> White) --- */
.landing-navbar {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1.25rem 0;
    /* Spacious initial padding */
    background: transparent;
    border-bottom: 1px solid transparent;
}

.landing-navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.75rem 0;
    /* Compact on scroll */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Brand Text Transition */
.landing-navbar .brand-text {
    color: white;
    /* Initial White */
    transition: color 0.3s ease;
}

.landing-navbar.scrolled .brand-text {
    color: var(--text-main);
    /* Dark on scroll */
}

/* Navigation Links */
.landing-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.landing-navbar .nav-link:hover,
.landing-navbar .nav-link.active,
.landing-navbar .nav-link.show {
    color: white;
}

.landing-navbar.scrolled .nav-link {
    color: var(--secondary-color);
    /* Grey on white */
}

.landing-navbar.scrolled .nav-link:hover {
    color: var(--primary-color);
    /* Green hover */
}

/* Custom Buttons */
.btn-white {
    background: white;
    color: var(--primary-color);
    border: 1px solid white;
    transition: all 0.2s;
}

.btn-white:hover {
    background: transparent;
    color: white;
}

/* Header Action Buttons */
.btn-header-login {
    background: transparent;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-weight: 600;
    transition: all 0.3s;
}

.btn-header-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white !important;
}

.btn-header-register {
    background: white;
    color: var(--primary-color) !important;
    border: 1px solid white;
    font-weight: 700;
    transition: all 0.3s;
}

.btn-header-register:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Scrolled State for Buttons */
.landing-navbar.scrolled .btn-header-login {
    color: var(--primary-color) !important;
    border-color: var(--primary-color);
}

.landing-navbar.scrolled .btn-header-login:hover {
    background: var(--primary-color);
    color: white !important;
}

.landing-navbar.scrolled .btn-header-register {
    background: var(--primary-color);
    color: white !important;
    border-color: var(--primary-color);
}

.landing-navbar.scrolled .btn-header-register:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Adjust buttons on scroll if needed */
.landing-navbar.scrolled .btn-white {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.landing-navbar.scrolled .btn-white:hover {
    background: var(--primary-hover);
}

/* Mobile Toggler */
.landing-navbar .navbar-toggler:focus {
    box-shadow: none;
}

/* Hero Padding Adjustment for Fixed Header */
.hero-section {
    padding-top: 160px !important;
    /* Compensate for fixed header */
    padding-bottom: 100px;
}

/* Mobile Menu Adjustment */
@media (max-width: 991.98px) {
    .landing-navbar .navbar-collapse {
        background: white;
        margin-top: 1rem;
        padding: 1.5rem;
        border-radius: 1rem;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    }

    .landing-navbar .nav-link {
        color: var(--text-main) !important;
        /* Always dark text in mobile menu */
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
}

/* --- Professional Footer --- */
footer a.text-white-50:hover {
    color: var(--primary-color) !important;
    padding-left: 5px;
    transition: all 0.2s ease;
}

footer .social-icon {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.2s;
}

footer .social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}