:root {
    /* Set Open Sans as the primary sans-serif font */
    --bs-font-sans-serif: 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* Base Layout Styles */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}
body .text-body {
    color: var(--bs-body-color) !important;
}

body .text-body-secondary {
    color: var(--bs-body-color-secondary) !important;
}

/* Ensure card headers also follow the theme */
.card-header .text-body {
    color: var(--bs-emphasis-color) !important;
}

body {
 
    margin-bottom: 60px;
}

/* Bootstrap Overrides */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* --- FORM FLOATING FIXES (Fixes Overlapping Labels) --- */
.form-floating > label {
    padding: 1rem 0.75rem;
    height: auto;
}

.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-control {
    /*padding: 1rem 0.75rem;*/
    font-size: 1rem;
}

.bg-green {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.bg-red{
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.bg-cyan{
    background-color: #17a2b8 !important;
    color: #ffffff !important;
}

.bg-blue {
    background-color: #13265C !important;
    color: #ffffff !important;
}

.border-green {
    border-color: #1cc88a !important;
}

.text-green {
    color: #1cc88a;
}

/* --- SMARTIEWORKS CUSTOM IDENTITY STYLES --- */
:root {
    --bs-font-sans-serif: 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Light Theme Defaults */
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --brand-bg: #e9ecef;
    --btn-primary: #0d6efd;
    --border-shadow: rgba(0,0,0,0.1);
    /* List Group Light Specifics */
    --list-group-bg: #ffffff;
    --list-group-color: #333333;
    --list-group-border: rgba(0, 0, 0, 0.125);
    --bg-green: #28a745;
    --bg-red: #dc3545;
    --bg-cyan: #17a2b8;
    --bg-blue: #007bff;
}

[data-theme="dark"] {
    /* Dark Theme Defaults */
    --bg-main: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --brand-bg: #2a2a2a;
    --btn-primary: #3d8bfd;
    --border-shadow: rgba(0,0,0,0.5);
    /* List Group Dark Specifics */
    --list-group-bg: #1e1e1e; /* Matches your card bg */
    --list-group-color: #e0e0e0;
    --list-group-border: rgba(255, 255, 255, 0.15);
}

/* Force Navbar to respond to theme */
.theme-navbar {
    background-color: var(--bg-card) !important;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

/* --- Theme-Aware Components --- */
[data-theme="dark"] .card,
[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .card-header {
    background-color: var(--brand-bg) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-main) !important;
}

    [data-theme="dark"] .dropdown-item:hover {
        background-color: var(--brand-bg) !important;
    }

[data-theme="dark"] .nav-link i,
[data-theme="dark"] .text-gray-600 {
    color: var(--text-main) !important;
}

/* Reset Bootstrap overrides */
[data-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
}

/* Ensure the table text uses your variable */
[data-theme="dark"] #userTable {
    color: var(--text-main) !important;
}

/* Ensure the Edit buttons are visible in dark mode */
[data-theme="dark"] .btn-outline-primary {
    color: var(--btn-primary);
    border-color: var(--btn-primary);
}

    [data-theme="dark"] .btn-outline-primary:hover {
        background-color: var(--btn-primary);
        color: white;
    }

/* 1. Global Table override for Dark Mode */
[data-theme="dark"] table {
    color: var(--text-main) !important;
    background-color: var(--bg-card) !important;
}

/* 2. Target specific DataTables elements */
[data-theme="dark"] .table {
    color: var(--text-main) !important;
}

    [data-theme="dark"] .table td,
    [data-theme="dark"] .table th {
        color: var(--text-main) !important;
        border-color: var(--border-shadow);
    }
[data-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}
/* 3. Ensure hover effect looks right */
[data-theme="dark"] .table-hover tbody tr:hover {
    color: var(--text-main) !important;
    background-color: var(--brand-bg) !important;
}

/* 4. Fix for DataTables internal wrappers */
[data-theme="dark"] .dataTables_wrapper {
    color: var(--text-main) !important;
}
/* Light mode */
.bg-theme-dropdown {
    background-color: #ffffff !important;
}

/* Dark mode */
[data-theme="dark"] .bg-theme-dropdown {
    background-color: var(--bg-card) !important;
}
/* --- Apply variables to your classes --- */
.smart-light-theme {
    background-color: var(--bg-main) !important;
}
/* --- Theme-Aware List Group Override --- */
.list-group-item {
    position: relative;
    display: block;
    padding: 0.5rem 1rem; /* Standard Bootstrap padding fallback if needed */
    color: var(--list-group-color) !important;
    background-color: var(--list-group-bg) !important;
    border: 1px solid var(--list-group-border) !important;
}

/* Ensure hover or active items play nice in dark mode */
[data-theme="dark"] .list-group-item-action:hover,
[data-theme="dark"] .list-group-item-action:focus {
    background-color: var(--brand-bg) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .list-group-item.active {
    background-color: var(--btn-primary) !important;
    border-color: var(--btn-primary) !important;
    color: #ffffff !important;
}
/* Base: Hide the dark logo, show the light logo (sizing lives solely in
   .sidebar .sidebar-brand img below so the two never fight over aspect ratio) */
.logo-light {
    display: block !important;
}

.logo-dark {
    display: none !important;
}

/* Dark Mode: Switch (Using [data-theme="dark"] based on your CSS variables) */
[data-theme="dark"] .logo-light {
    display: none !important;
}

[data-theme="dark"] .logo-dark {
    display: block !important;
}

/* Tenant topbar brand (sidebar-less _layoutUser.cshtml) - .logo-light/.logo-dark carry no
   sizing of their own (that's scoped to the admin sidebar below), so without this the logo
   renders at its full natural size and overflows the topbar. */
.navbar-brand .logo-light,
.navbar-brand .logo-dark {
    max-height: 3.5rem;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* --- SIDEBAR BRAND FIX --- */
.sidebar .sidebar-brand {
    height: auto !important;
    min-height: 4.375rem;
    padding: 10px;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

    .sidebar .sidebar-brand img {
        max-height: 3rem;
        max-width: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block; /* Ensure they render as blocks */
    }

/* Collapsed rail (.sidebar.toggled) is too narrow for the wide wordmark, so show
   the square icon mark there instead and save the wordmark for the expanded state.
   Named admin-sidebar-collapsed-icon (not sidebar-brand-icon) to avoid colliding with
   the unrelated .sidebar-brand-icon wrapper div already used in _layoutUser.cshtml's
   sidebar-less tenant topbar. */
.admin-sidebar-collapsed-icon {
    display: none;
}

.sidebar.toggled .admin-sidebar-collapsed-icon {
    display: block;
}

.sidebar.toggled .sidebar-brand-full {
    display: none !important;
}

/* ==========================================================================
   Theme Variable Registration
   ========================================================================== */
[data-bs-theme="light"] {
    --theme-badge-txt: #212529;
    --theme-badge-bg: #f8f9fa;
    --theme-badge-border: #dee2e6;
}

[data-bs-theme="dark"] {
    --theme-badge-txt: #ffffff;
    --theme-badge-bg: #2b3035;
    --theme-badge-border: #495057;
}

/* ==========================================================================
   Global Badge Base Styles
   ========================================================================== */
.badge {
    /* Set the Bootstrap variable to look at our custom theme variables dynamically */
    --bs-badge-color: var(--theme-badge-txt);
    --bs-badge-padding-x: 0.65em;
    --bs-badge-padding-y: 0.35em;
    --bs-badge-font-size: 0.75em;
    --bs-badge-font-weight: 700;
    --bs-badge-border-radius: var(--bs-border-radius);
    display: inline-block;
    padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
    font-size: var(--bs-badge-font-size);
    font-weight: var(--bs-badge-font-weight);
    line-height: 1;
    color: var(--bs-badge-color); /* Correctly evaluates the dynamic variable here */
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--bs-badge-border-radius);
}

    .badge:empty {
        display: none;
    }

.btn .badge {
    position: relative;
    top: -1px;
}

/* ==========================================================================
   Custom Utility Badges (Optional)
   ========================================================================== */
.badge-custom {
    background-color: var(--theme-badge-bg);
    border: 1px solid var(--theme-badge-border);
}
/* 3. Logic: Dark Mode (Use your exact selector from the F12 Elements tab) */
/* If your body gets a class 'dark', use: body.dark .logo-dark { ... } */
/* If your body gets an attribute, use the below: */
[data-theme="dark"] .logo-dark {
    display: block !important;
}

[data-theme="dark"] .logo-light {
    display: none !important;
}
.theme-navbar {
    background-color: #ffffff !important; /* Force white for light mode */
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* 2. Dark Mode Toggle */
[data-theme="dark"] .theme-navbar {
    background-color: var(--bg-card) !important; /* Uses your defined dark variable */
    border-bottom: 1px solid var(--border-shadow);
}
.brand-section {
    background-color: var(--brand-bg);
    color: var(--text-main);
}

.shadow-financial {
    background-color: var(--bg-card);
    box-shadow: 0 4px 12px var(--border-shadow);
}

.text-muted {
    color: var(--text-muted) !important;
}
#layoutSidenav .text-body,
.sb-nav-fixed .text-body {
    color: var(--bs-body-color) !important;
}

#layoutSidenav .text-body-secondary,
.sb-nav-fixed .text-body-secondary {
    color: var(--bs-body-color-secondary) !important;
}

/* Ensure background utilities also override SB Admin card/bg defaults */
#layoutSidenav .bg-body-tertiary {
    background-color: var(--bs-tertiary-bg) !important;
}
/* Custom override for SmartI&E financial buttons */
.btn-smart-financial {
    background-color: var(--btn-primary) !important;
    border-color: var(--btn-primary) !important;
    /* This ensures text is readable; adjust variable name if you have a specific text-on-primary var */
    color: #ffffff !important;
}

    .btn-smart-financial:hover,
    .btn-smart-financial:focus,
    .btn-smart-financial:active {
        /* Slightly darken or lighten based on theme for interaction feedback */
        filter: brightness(90%);
        background-color: var(--btn-primary) !important;
        border-color: var(--btn-primary) !important;
        color: #ffffff !important;
        box-shadow: 0 0 0 0.25rem rgba(var(--btn-primary-rgb), 0.25);
    }

/* Light/Dark mode logic using your theme classes */
.smart-light-theme .btn-smart-financial {
    /* Specific light mode adjustments if needed */
}

.smart-dark-theme .btn-smart-financial {
    /* Specific dark mode adjustments if needed */
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .text-muted {
    color: #a0a0a0 !important; /* Lighter grey for dark mode */
}

[data-theme="dark"] .text-dark {
    color: #f8f9fa !important; /* Light color for titles in dark mode */
}

/* .text-dark is meant to read as light-on-dark for headings floating on the page's own dark
   background, but Bootstrap's "fixed light regardless of theme" containers (bg-light, btn-light)
   never got the same treatment - so .text-dark inside one of those goes near-white-on-white
   instead. Re-darken it specifically in that context rather than patching every occurrence by hand.
   Scoped to .bg-light specifically (not a bare .badge) - .bg-white badges already correctly invert
   to a dark background via the .bg-white dark-mode rule below, so a bare ".badge.text-dark" rule
   here would re-darken their text onto a background that's already gone dark, giving dark-on-dark. */
[data-theme="dark"] .bg-light .text-dark,
[data-theme="dark"] .btn-light .text-dark,
[data-theme="dark"] .badge.bg-light.text-dark {
    color: #212529 !important;
}

/* Specific fix for your floating labels and input text */
[data-theme="dark"] .form-floating > label {
    color: #ced4da;
}

[data-theme="dark"] .form-control {
    background-color: #2b3035;
    color: #ffffff;
    border-color: #495057;
}

/* .bg-light on a form-control (used across several forms for a flat/borderless input look) forces
   the background back to fixed light regardless of theme - same !important collision as
   badges/buttons above, just here the text stays the dark-mode white from the rule above, on a
   background that never left light. Re-darken the text specifically in that combination. */
[data-theme="dark"] .form-control.bg-light {
    color: #212529 !important;
}

/* Bootstrap uses a separate class for <select> (.form-select) from <input>/<textarea>
   (.form-control) - the dark-mode rules above never covered it, so every dropdown using the same
   bg-light flat-input convention (e.g. phone Type, address Type) was left with default/native
   select rendering against a page that's now dark, reading as washed-out and undersized. */
[data-theme="dark"] .form-select {
    background-color: #2b3035;
    color: #ffffff;
    border-color: #495057;
}

[data-theme="dark"] .form-select.bg-light {
    color: #212529 !important;
}
.forgot-password {
    color: #0d6efd; /* Your primary brand color */
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

    .forgot-password:hover {
        text-decoration: underline;
        color: #0a58ca;
    }
/* --- Light Theme Variables (Default) --- */
:root {
    --theme-footer-bg: #ffffff;
    --theme-footer-text: #5a5c69;
    --theme-footer-border: #e3e6f0;
}

/* --- Dark Theme Variables --- */
[data-theme="dark"] {
    --theme-footer-bg: #1a202c; /* Or matching your sb-admin dark color */
    --theme-footer-text: #a0aec0;
    --theme-footer-border: #2d3748;
}

/* --- Map your custom utility class to the active variable state --- */
.bg-theme-main {
    background-color: var(--theme-footer-bg) !important;
    color: var(--theme-footer-text) !important;
    border-top: 1px solid var(--theme-footer-border);
}
/* --- MOBILE-FIRST RESPONSIVE FIXES --- */

.identity.section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 10px;
}

@media (max-width: 768px) {
    .brand-section {
        padding: 20px !important;
    }

        .brand-section img {
            max-width: 150px !important;
        }

        .brand-section h3 {
            font-size: 1.25rem;
        }

        /* Hide long descriptions on mobile to save space */
        .brand-section p {
            display: none;
        }



    .sidebar-brand img {
        width: 90%;
    }

    .bg-gradient-primary {
        background: none !important;
    }

    aside {
        background-color: white;
        /*background-image: linear-gradient(180deg, rgba(222, 28, 51, 0.8) 10%, rgba(222, 28, 51, 1) 100%);*/
        background-size: cover;
    }



    .topbar .dropdown-list .dropdown-header {
        background-color: #de1c33;
        border: 1px solid #de1c33;
    }

    .bg-primary {
        background-color: #de1c33 !important;
    }

    .bg-success {
        background-color: #112445 !important;
    }

    .bg-warning {
        background-color: #f5643a !important;
    }
 
    #askButton .spinner-border {
        display: none !important;
    }

 
    .btn-loading .btn-text {
        display: none !important; /* Hides the "Ask" text when button is in loading state */
    }

 
    #askButton.btn-loading .spinner-border {
        display: inline-block !important; /* Forces the SPINNER SPAN to be visible */
    }

    /* Define the custom animation for the spinner */
    @keyframes spinner-spin {
        to {
            transform: rotate(360deg);
        }
    }
}
