/* =========================================================================
   The Sleep Center of Nevada — Design System v2 (Light)
   White sidebar · Slim radius · Balanced palette · Action green for CTAs
   ------------------------------------------------------------------------- */

:root {
    /* Brand navy — used sparingly, mostly for headings/strong accents */
    --sc-primary-50:  #F4F3FA;
    --sc-primary-100: #E0DEEE;
    --sc-primary-200: #C2BEDD;
    --sc-primary-300: #8B83BD;
    --sc-primary-400: #524998;
    --sc-primary-500: #262262;
    --sc-primary-600: #1F1C52;
    --sc-primary-700: #181641;

    /* Action green — primary CTA + active sidebar item */
    --sc-action-50:  #ECFDF5;
    --sc-action-100: #D1FAE5;
    --sc-action-200: #A7F3D0;
    --sc-action-400: #34D399;
    --sc-action-500: #10B981;
    --sc-action-600: #059669;
    --sc-action-700: #047857;

    /* Stat-icon palette — used in rotation across cards/menu items */
    --sc-c-purple-50:  #F5F3FF;
    --sc-c-purple-500: #8B5CF6;
    --sc-c-purple-600: #7C3AED;

    --sc-c-cyan-50:    #ECFEFF;
    --sc-c-cyan-500:   #06B6D4;
    --sc-c-cyan-600:   #0891B2;

    --sc-c-amber-50:   #FFFBEB;
    --sc-c-amber-500:  #F59E0B;
    --sc-c-amber-600:  #D97706;

    --sc-c-blue-50:    #EFF6FF;
    --sc-c-blue-500:   #3B82F6;
    --sc-c-blue-600:   #2563EB;

    --sc-c-pink-50:    #FDF2F8;
    --sc-c-pink-500:   #EC4899;
    --sc-c-pink-600:   #DB2777;

    --sc-c-green-50:   #F0FDF4;
    --sc-c-green-500:  #22C55E;

    /* Semantic */
    --sc-success:    #10B981;
    --sc-success-bg: #ECFDF5;
    --sc-warning:    #F59E0B;
    --sc-warning-bg: #FFFBEB;
    --sc-danger:     #EF4444;
    --sc-danger-bg:  #FEF2F2;
    --sc-info:       #3B82F6;
    --sc-info-bg:    #EFF6FF;

    /* Neutrals — flat-white app shell */
    --sc-bg:            #F7F7FB;
    --sc-bg-card:       #FFFFFF;
    --sc-bg-sidebar:    #FFFFFF;
    --sc-bg-hover:      #F4F4F8;
    --sc-border:        #ECECEF;
    --sc-border-strong: #DDDFE5;
    --sc-text:          #15172B;
    --sc-text-muted:    #6E7191;
    --sc-text-soft:     #A0A3BD;

    /* Slim corners — Vuexy / themeforest standard */
    --sc-radius-xs: 4px;
    --sc-radius-sm: 6px;
    --sc-radius:    8px;
    --sc-radius-lg: 12px;
    --sc-radius-xl: 16px;

    /* Soft, neutral shadows (no heavy purple cast) */
    --sc-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --sc-shadow:    0 4px 12px rgba(15, 23, 42, .06);
    --sc-shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
    --sc-shadow-lg: 0 20px 48px rgba(15, 23, 42, .14);

    /* Subtle gradients — used for hero strips, not as the dominant page bg */
    --sc-gradient-primary: linear-gradient(135deg, #262262 0%, #4F46E5 100%);
    --sc-gradient-action:  linear-gradient(135deg, #10B981 0%, #34D399 100%);

    --sc-font-body: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   Base resets — keep these specific so they don't fight Tailwind
   ============================================================ */
html, body {
    font-family: var(--sc-font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.app, body.login {
    background: var(--sc-bg);
    color: var(--sc-text);
}

/* ============================================================
   Vuexy-style Cards
   ============================================================ */
.sc-card {
    background: var(--sc-bg-card);
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow-sm);
    border: 1px solid var(--sc-border);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.sc-card:hover {
    box-shadow: var(--sc-shadow);
}
.sc-card__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--sc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.sc-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sc-text);
    margin: 0;
}
.sc-card__subtitle {
    font-size: .85rem;
    color: var(--sc-text-muted);
    margin-top: 2px;
}
.sc-card__body {
    padding: 24px;
}
.sc-card__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--sc-border);
    background: #FAFAFC;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================================
   Stat Cards (for dashboards) — slim radius, varied icon colors
   ============================================================ */
.sc-stat {
    background: var(--sc-bg-card);
    border-radius: var(--sc-radius-lg);
    padding: 20px 22px;
    box-shadow: var(--sc-shadow-sm);
    border: 1px solid var(--sc-border);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    position: relative;
    overflow: hidden;
}
.sc-stat::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
    background: var(--sc-action-500); opacity: 0;
    transition: opacity .2s ease;
}
.sc-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--sc-shadow);
    border-color: var(--sc-border-strong);
}
.sc-stat:hover::after { opacity: 1; }

.sc-stat__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--sc-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sc-stat__icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

/* Color variants — cycled across cards in a row */
.sc-stat__icon--primary { background: var(--sc-c-purple-50); color: var(--sc-c-purple-600); }
.sc-stat__icon--accent  { background: var(--sc-action-50);   color: var(--sc-action-600); }
.sc-stat__icon--violet  { background: var(--sc-c-purple-50); color: var(--sc-c-purple-600); }
.sc-stat__icon--success { background: var(--sc-action-50);   color: var(--sc-action-600); }
.sc-stat__icon--warning { background: var(--sc-c-amber-50);  color: var(--sc-c-amber-600); }
.sc-stat__icon--danger  { background: var(--sc-danger-bg);   color: var(--sc-danger); }
.sc-stat__icon--cyan    { background: var(--sc-c-cyan-50);   color: var(--sc-c-cyan-600); }
.sc-stat__icon--amber   { background: var(--sc-c-amber-50);  color: var(--sc-c-amber-600); }
.sc-stat__icon--blue    { background: var(--sc-c-blue-50);   color: var(--sc-c-blue-600); }
.sc-stat__icon--pink    { background: var(--sc-c-pink-50);   color: var(--sc-c-pink-600); }
.sc-stat__icon--green   { background: var(--sc-c-green-50);  color: var(--sc-action-600); }
.sc-stat__body { flex: 1; min-width: 0; }
.sc-stat__label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sc-text-muted);
    font-weight: 600;
}
.sc-stat__value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--sc-text);
    line-height: 1.1;
    margin-top: 4px;
}
.sc-stat__delta {
    font-size: .8rem;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sc-stat__delta--up   { color: var(--sc-success); }
.sc-stat__delta--down { color: var(--sc-danger); }

/* ============================================================
   Buttons
   ============================================================ */
.sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: .88rem;
    font-weight: 600;
    border-radius: var(--sc-radius-sm);   /* slim 6px */
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease, border-color .15s ease;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: .005em;
}
.sc-btn:disabled, .sc-btn.is-disabled { opacity: .5; cursor: not-allowed; }
.sc-btn--lg { padding: 11px 22px; font-size: .95rem; }
.sc-btn--sm { padding: 6px 12px; font-size: .78rem; border-radius: var(--sc-radius-xs); }
.sc-btn--block { display: flex; width: 100%; }

/* Default primary CTA — action green (the dominant action color) */
.sc-btn--primary {
    background: var(--sc-action-500);
    color: #fff;
    box-shadow: 0 1px 2px rgba(16, 185, 129, .25);
}
.sc-btn--primary:hover {
    background: var(--sc-action-600);
    box-shadow: 0 4px 10px rgba(16, 185, 129, .35);
}

/* Accent — kept for variety where needed */
.sc-btn--accent {
    background: var(--sc-c-blue-500);
    color: #fff;
    box-shadow: 0 1px 2px rgba(59, 130, 246, .2);
}
.sc-btn--accent:hover { background: var(--sc-c-blue-600); }

/* Gradient — used only for the highest-value CTA (e.g. main login button) */
.sc-btn--gradient {
    background: var(--sc-gradient-action);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, .30);
}
.sc-btn--gradient:hover {
    box-shadow: 0 6px 18px rgba(16, 185, 129, .40);
    transform: translateY(-1px);
}

/* Brand navy button — only for branded contexts (rare) */
.sc-btn--brand {
    background: var(--sc-primary-500);
    color: #fff;
}
.sc-btn--brand:hover { background: var(--sc-primary-600); }

.sc-btn--outline {
    background: #fff;
    color: var(--sc-text);
    border-color: var(--sc-border-strong);
}
.sc-btn--outline:hover { background: var(--sc-bg-hover); border-color: var(--sc-text-muted); }

.sc-btn--ghost {
    background: transparent;
    color: var(--sc-text-muted);
}
.sc-btn--ghost:hover { background: var(--sc-bg-hover); color: var(--sc-text); }

.sc-btn--danger { background: var(--sc-danger); color: #fff; }
.sc-btn--danger:hover { background: #DC2626; }

.sc-btn--success { background: var(--sc-action-500); color: #fff; }
.sc-btn--success:hover { background: var(--sc-action-600); }

/* Icon-only square button (slim radius, not circle) */
.sc-btn-icon {
    width: 38px; height: 38px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--sc-radius-sm);
    cursor: pointer; border: 1px solid var(--sc-border);
    background: #fff; color: var(--sc-text-muted);
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.sc-btn-icon:hover {
    background: var(--sc-bg-hover);
    color: var(--sc-text);
    border-color: var(--sc-border-strong);
}

/* ============================================================
   Form controls
   ============================================================ */
.sc-field { margin-bottom: 20px; }
.sc-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--sc-text);
    margin-bottom: 8px;
}
.sc-label .sc-req { color: var(--sc-danger); }
.sc-input,
.sc-select,
.sc-textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: .95rem;
    line-height: 1.4;
    color: var(--sc-text);
    background: #fff;
    border: 1px solid var(--sc-border-strong);
    border-radius: var(--sc-radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
}
.sc-input::placeholder, .sc-textarea::placeholder { color: var(--sc-text-soft); }
.sc-input:focus,
.sc-select:focus,
.sc-textarea:focus {
    outline: none;
    border-color: var(--sc-primary-500);
    box-shadow: 0 0 0 3px rgba(38, 34, 98, .12);
}
.sc-input.is-invalid { border-color: var(--sc-danger); }
.sc-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); }
.sc-help { font-size: .8rem; color: var(--sc-text-muted); margin-top: 6px; }
.sc-help--error { color: var(--sc-danger); }
.sc-field--icon { position: relative; }
.sc-field--icon .sc-input { padding-left: 42px; }
.sc-field--icon .sc-field__icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--sc-text-soft); width: 18px; height: 18px;
}

/* Password strength meter */
.sc-pwd-meter { margin-top: 8px; }
.sc-pwd-meter__bar { height: 4px; border-radius: 2px; background: var(--sc-border); overflow: hidden; }
.sc-pwd-meter__fill { height: 100%; width: 0; transition: width .25s ease, background .25s ease; }
.sc-pwd-meter__fill.is-weak   { width: 25%; background: var(--sc-danger); }
.sc-pwd-meter__fill.is-fair   { width: 50%; background: var(--sc-warning); }
.sc-pwd-meter__fill.is-good   { width: 75%; background: var(--sc-accent-500); }
.sc-pwd-meter__fill.is-strong { width: 100%; background: var(--sc-success); }
.sc-pwd-meter__label { font-size: .75rem; margin-top: 4px; color: var(--sc-text-muted); }

/* ============================================================
   Pills / Badges
   ============================================================ */
.sc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}
.sc-pill--primary { background: var(--sc-primary-50); color: var(--sc-primary-500); }
.sc-pill--accent  { background: var(--sc-accent-50);  color: var(--sc-accent-600); }
.sc-pill--success { background: var(--sc-success-bg); color: var(--sc-success); }
.sc-pill--warning { background: var(--sc-warning-bg); color: var(--sc-warning); }
.sc-pill--danger  { background: var(--sc-danger-bg);  color: var(--sc-danger); }
.sc-pill--muted   { background: #F3F4F6; color: var(--sc-text-muted); }

/* ============================================================
   Side Navigation (Vuexy-style)
   ============================================================ */
/* ----- White sidebar (v2) ----- */
.sc-sidenav {
    width: 252px;
    flex-shrink: 0;
    background: var(--sc-bg-sidebar);
    color: var(--sc-text);
    height: 100vh;
    position: sticky;
    top: 0; left: 0;
    overflow-y: auto;
    z-index: 40;
    border-right: 1px solid var(--sc-border);
    display: flex;
    flex-direction: column;
    align-self: flex-start;
    scrollbar-width: thin;
    scrollbar-color: var(--sc-border-strong) transparent;
}
.sc-sidenav::-webkit-scrollbar { width: 6px; }
.sc-sidenav::-webkit-scrollbar-track { background: transparent; }
.sc-sidenav::-webkit-scrollbar-thumb { background: var(--sc-border-strong); border-radius: 3px; }

.sc-sidenav__brand {
    padding: 18px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border-bottom: 1px solid var(--sc-border);
}
.sc-sidenav__brand img,
.mobile-menu-bar img {
    width: 138px; height: auto;
    max-width: 70%;
    filter: none !important;
    object-fit: contain;
}
/* Phones: shrink the logo so the hamburger/close button never gets pushed off-screen */
@media (max-width: 480px) {
    .sc-sidenav__brand img,
    .mobile-menu-bar img {
        width: 110px !important;
    }
    .sc-sidenav__brand { padding: 14px 16px; }
}
@media (max-width: 360px) {
    .sc-sidenav__brand img,
    .mobile-menu-bar img {
        width: 92px !important;
    }
}

/* ----- Theme-aware logo swapping -----
   Markup pattern (used by sidebars + mobile bars):
       <img class="sc-logo sc-logo--light" src=".../logo.png">
       <img class="sc-logo sc-logo--dark"  src=".../logo1.png">
   logo.png  = dark text on transparent → readable on light bg
   logo1.png = white text on transparent → readable on dark bg
*/
.sc-logo--dark { display: none !important; }
html[data-theme="dark"] .sc-logo--light { display: none !important; }
html[data-theme="dark"] .sc-logo--dark  { display: inline-block !important; }
/* Mobile bar background goes dark on dark theme; on light theme it stays white */
.mobile-menu { background: var(--sc-bg-card) !important; color: var(--sc-text); }
.mobile-menu-bar img { width: 130px !important; }
.sc-sidenav__brand-toggle {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--sc-radius-sm);
    color: var(--sc-text-muted);
    cursor: pointer; border: 0; background: transparent;
    transition: all .15s ease;
}
.sc-sidenav__brand-toggle:hover { background: var(--sc-bg-hover); color: var(--sc-text); }

.sc-sidenav__menu { padding: 8px 12px 24px; flex: 1; }
.sc-sidenav__menu ul { list-style: none; padding: 0; margin: 0; }

.sc-sidenav__divider {
    height: 1px;
    background: var(--sc-border);
    margin: 14px 12px;
}

.sc-sidenav__section-label {
    padding: 14px 12px 6px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--sc-text-soft);
}

/* ----- Menu items (white-sidebar variant) ----- */
.sc-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    margin: 2px 0;
    border-radius: var(--sc-radius);
    color: var(--sc-text-muted);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: background-color .18s ease, color .18s ease;
}

/* Colored icon chip — small rounded box behind the icon */
.sc-menu__icon {
    width: 32px; height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--sc-bg-hover);
    color: var(--sc-text-muted);
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.sc-menu__icon svg {
    width: 18px; height: 18px;
    stroke-width: 1.8;
}

.sc-menu__title { flex: 1; }
.sc-menu__caret {
    width: 14px; height: 14px;
    transition: transform .25s ease;
    color: var(--sc-text-soft);
}
.sc-menu--open > .sc-menu__caret { transform: rotate(180deg); }

.sc-menu:hover {
    background: var(--sc-bg-hover);
    color: var(--sc-text);
}

.sc-menu:focus-visible {
    outline: 2px solid var(--sc-action-500);
    outline-offset: 1px;
}

/* Active item — soft tinted bg + bold dark text + green icon chip */
.sc-menu--active,
.sc-menu--active:hover {
    background: var(--sc-action-50);
    color: var(--sc-text);
    font-weight: 600;
}
.sc-menu--active .sc-menu__icon {
    background: var(--sc-gradient-action);
    color: #fff;
    box-shadow: 0 4px 10px rgba(16, 185, 129, .35);
}

/* Per-item icon-chip color variants — applied via .sc-menu__icon--<color> */
.sc-menu__icon--purple { background: var(--sc-c-purple-50);  color: var(--sc-c-purple-600); }
.sc-menu__icon--pink   { background: var(--sc-c-pink-50);    color: var(--sc-c-pink-600); }
.sc-menu__icon--cyan   { background: var(--sc-c-cyan-50);    color: var(--sc-c-cyan-600); }
.sc-menu__icon--amber  { background: var(--sc-c-amber-50);   color: var(--sc-c-amber-600); }
.sc-menu__icon--blue   { background: var(--sc-c-blue-50);    color: var(--sc-c-blue-600); }
.sc-menu__icon--green  { background: var(--sc-c-green-50);   color: var(--sc-action-600); }

/* Hover preserves the chip color (no transform) */
.sc-menu:hover .sc-menu__icon { transform: none; }

/* Submenu */
.sc-menu__sub {
    padding-left: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s cubic-bezier(.4, 0, .2, 1);
    margin-left: 22px;
    border-left: 1px dashed var(--sc-border-strong);
}
.sc-menu--open + .sc-menu__sub { max-height: 600px; }
.sc-menu__sub .sc-menu {
    padding: 7px 12px;
    font-size: .85rem;
    margin: 1px 0;
}
.sc-menu__sub .sc-menu__icon {
    width: 8px; height: 8px;
    background: var(--sc-text-soft);
    border-radius: 50%;
}
.sc-menu__sub .sc-menu__icon svg { display: none; }
.sc-menu__sub .sc-menu--active .sc-menu__icon { background: var(--sc-action-500); box-shadow: none; }

/* Logout/danger menu item */
.sc-menu--danger { color: var(--sc-danger); }
.sc-menu--danger:hover { background: var(--sc-danger-bg); color: var(--sc-danger); }
.sc-menu--danger .sc-menu__icon {
    background: var(--sc-danger-bg);
    color: var(--sc-danger);
}

/* ============================================================
   Top Bar
   ============================================================ */
.sc-content {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 100vh;
    background: var(--sc-bg);
}
.sc-topbar {
    height: 60px;
    background: var(--sc-bg-card);
    border-bottom: 1px solid var(--sc-border);
    padding: 0 24px;
    display: flex; align-items: center; gap: 12px;
    justify-content: flex-end;
    position: sticky;
    top: 0;
    /* Must beat .intro-y / .intro-x transform-created stacking contexts and any
       legacy z-index in the page body. */
    z-index: 1000;
    isolation: isolate;
}
/* Hamburger anchored to the far left (mobile only) */
.sc-topbar #sc-mobile-toggle { margin-right: auto; }

/* Search lives on the right next to the action buttons */
.sc-topbar__search {
    position: relative;
    flex: 0 0 280px;
    max-width: 280px;
}
@media (max-width: 767px) {
    .sc-topbar__search { flex: 0 0 auto; max-width: 0; overflow: hidden; padding: 0; }
    .sc-topbar__search input { width: 0; padding: 0; border: 0; }
}
.sc-topbar__search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    font-size: .85rem;
    border: 1px solid var(--sc-border);
    background: var(--sc-bg-hover);
    border-radius: var(--sc-radius);
    color: var(--sc-text);
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.sc-topbar__search input::placeholder { color: var(--sc-text-soft); }
.sc-topbar__search input:focus {
    outline: none;
    background: #fff;
    border-color: var(--sc-action-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}
.sc-topbar__search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--sc-text-soft);
    pointer-events: none;
}
.sc-topbar__search-results {
    position: absolute; top: 44px; left: 0; right: 0;
    background: var(--sc-bg-card);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow-md);
    z-index: 60;
    max-height: 360px;
    overflow-y: auto;
    display: none;
}
.sc-topbar__search-results.is-open { display: block; }
.sc-topbar__search-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    color: var(--sc-text);
    text-decoration: none;
    font-size: .85rem;
    border-bottom: 1px solid var(--sc-border);
    transition: background-color .12s ease;
}
.sc-topbar__search-item:last-child { border-bottom: 0; }
.sc-topbar__search-item:hover, .sc-topbar__search-item.is-active { background: var(--sc-bg-hover); }
.sc-topbar__search-item small { color: var(--sc-text-soft); }
.sc-topbar__search-empty { padding: 16px; text-align: center; color: var(--sc-text-muted); font-size: .85rem; }
.sc-topbar__crumbs {
    display: flex; align-items: center; gap: 6px;
    font-size: .85rem; color: var(--sc-text-muted);
    margin-left: auto;
}
.sc-topbar__crumbs a { color: var(--sc-text-muted); text-decoration: none; transition: color .15s ease; }
.sc-topbar__crumbs a:hover { color: var(--sc-action-600); }
.sc-topbar__crumbs .sc-topbar__active { color: var(--sc-action-600); font-weight: 600; }
.sc-topbar__crumbs svg { color: var(--sc-text-soft); }

.sc-topbar__actions { display: flex; align-items: center; gap: 10px; }

/* Notification bell */
.sc-bell { position: relative; }
.sc-bell__badge {
    position: absolute; top: -2px; right: -2px;
    min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--sc-danger); color: #fff;
    border-radius: 999px;
    font-size: .62rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}

/* User dropdown trigger */
.sc-user {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: var(--sc-radius);
    background: transparent;
    cursor: pointer; border: 1px solid transparent;
    transition: background-color .15s ease, border-color .15s ease;
}
.sc-user:hover { background: var(--sc-bg-hover); border-color: var(--sc-border); }
.sc-user__avatar {
    width: 32px; height: 32px; border-radius: var(--sc-radius-sm);
    background: var(--sc-gradient-action);
    color: #fff; font-weight: 700; font-size: .8rem;
    display: flex; align-items: center; justify-content: center;
}
.sc-user__name { font-size: .85rem; font-weight: 600; color: var(--sc-text); line-height: 1.2; }
.sc-user__role { font-size: .7rem; color: var(--sc-text-muted); line-height: 1; margin-top: 2px; }
.sc-user__name-wrap { display: flex; flex-direction: column; align-items: flex-start; }

/* Page header strip — single clean title row with breadcrumb on the right. */
.sc-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 28px 18px;
    flex-wrap: wrap;
}
.sc-page-header__title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--sc-text);
    margin: 0;
    letter-spacing: -.01em;
    line-height: 1.2;
}
.sc-page-header__crumbs {
    display: flex; align-items: center; gap: 8px;
    font-size: .85rem;
    color: var(--sc-text-muted);
}
.sc-page-header__crumbs a {
    color: var(--sc-text-muted);
    display: inline-flex; align-items: center;
    text-decoration: none;
    transition: color .12s ease;
}
.sc-page-header__crumbs a:hover { color: var(--sc-action-600); }
.sc-page-header__crumbs span { color: var(--sc-text-soft); }
.sc-page-header__crumbs .sc-topbar__active { color: var(--sc-action-600); font-weight: 600; }

@media (max-width: 991px) {
    .sc-page-header { padding: 16px 16px 12px; }
    .sc-page-header__title h1 { font-size: 1.1rem; }
}

/* Dashboard / app footer — sticks at the bottom of the content column */
.sc-footer {
    margin-top: auto;
    padding: 16px 28px;
    border-top: 1px solid var(--sc-border);
    background: var(--sc-bg-card);
    color: var(--sc-text-muted);
    font-size: .8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.sc-footer a { color: var(--sc-action-600); text-decoration: none; font-weight: 600; }
.sc-footer a:hover { text-decoration: underline; }
@media (max-width: 991px) {
    .sc-footer { padding: 14px 16px; font-size: .75rem; flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Dark mode — toggled by adding [data-theme="dark"] to <html>.
   Persisted in localStorage by the topbar theme switcher.
   ============================================================ */
html[data-theme="dark"] {
    --sc-bg:            #0F1117;
    --sc-bg-card:       #181B25;
    --sc-bg-sidebar:    #181B25;
    --sc-bg-hover:      #232634;
    --sc-border:        #2A2E3D;
    --sc-border-strong: #353A4D;
    --sc-text:          #E5E7EB;
    --sc-text-muted:    #9CA3AF;
    --sc-text-soft:     #6B7280;
    --sc-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --sc-shadow:    0 4px 12px rgba(0, 0, 0, .5);
    --sc-shadow-md: 0 8px 24px rgba(0, 0, 0, .6);
}
html[data-theme="dark"] body.app { background: var(--sc-bg) !important; color: var(--sc-text); }
html[data-theme="dark"] .sc-sidenav { background: var(--sc-bg-sidebar); border-right-color: var(--sc-border); }
html[data-theme="dark"] .sc-topbar { background: var(--sc-bg-card); border-bottom-color: var(--sc-border); }
html[data-theme="dark"] .sc-footer { background: var(--sc-bg-card); border-top-color: var(--sc-border); }
html[data-theme="dark"] .sc-stat,
html[data-theme="dark"] .sc-card,
html[data-theme="dark"] .box,
html[data-theme="dark"] .report-box {
    background: var(--sc-bg-card) !important;
    border-color: var(--sc-border) !important;
    color: var(--sc-text);
}
html[data-theme="dark"] .table thead th { background: var(--sc-bg-hover) !important; color: var(--sc-text-muted) !important; }
html[data-theme="dark"] .table tbody td { background: var(--sc-bg-card) !important; color: var(--sc-text) !important; border-color: var(--sc-border) !important; }
html[data-theme="dark"] .table tbody tr:hover td { background: var(--sc-bg-hover) !important; }
html[data-theme="dark"] .input,
html[data-theme="dark"] .sc-input,
html[data-theme="dark"] .sc-topbar__search input {
    background: var(--sc-bg-hover) !important;
    color: var(--sc-text) !important;
    border-color: var(--sc-border-strong) !important;
}
html[data-theme="dark"] .sc-btn-icon { background: transparent; border-color: var(--sc-border); color: var(--sc-text-muted); }
html[data-theme="dark"] .sc-btn-icon:hover { background: var(--sc-bg-hover); color: var(--sc-text); }
html[data-theme="dark"] .sc-user:hover { background: var(--sc-bg-hover); border-color: var(--sc-border); }

/* Page wrapper */
.sc-page { padding: 28px 32px; }
.sc-page__header {
    margin-bottom: 24px;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.sc-page__title { font-size: 1.5rem; font-weight: 700; color: var(--sc-text); margin: 0; }
.sc-page__subtitle { color: var(--sc-text-muted); font-size: .95rem; margin-top: 4px; }

/* ============================================================
   Tables
   ============================================================ */
.sc-table-wrap {
    background: #fff;
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow-sm);
    border: 1px solid var(--sc-border);
    overflow: hidden;
}
.sc-table-wrap__head {
    padding: 18px 24px;
    border-bottom: 1px solid var(--sc-border);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.sc-table { width: 100%; border-collapse: collapse; }
.sc-table thead th {
    padding: 12px 24px;
    background: #FAFAFC;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--sc-text-muted);
    text-align: left;
    border-bottom: 1px solid var(--sc-border);
}
.sc-table tbody td {
    padding: 14px 24px;
    font-size: .9rem;
    color: var(--sc-text);
    border-bottom: 1px solid var(--sc-border);
    vertical-align: middle;
}
.sc-table tbody tr:last-child td { border-bottom: none; }
.sc-table tbody tr:hover { background: var(--sc-primary-50); }

/* ============================================================
   KILL legacy Midone .login background bleed-through
   The old app.css applies a navy gradient + a bg-login-page.png
   decoration via .login:before. We zero them out here.
   ============================================================ */
body.login {
    background: var(--sc-bg) !important;
}
body.login::before,
.login::before,
.login:before {
    display: none !important;
    content: none !important;
    background: none !important;
}
/* Suppress Midone's min-width on .login__input — we don't use it but kept defensive. */
.login .login__input {
    min-width: 0 !important;
    box-shadow: none !important;
}
/* Also clobber browser autofill yellow/blue tint on our auth form inputs. */
.sc-auth__form input:-webkit-autofill,
.sc-auth__form input:-webkit-autofill:hover,
.sc-auth__form input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--sc-text) !important;
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--sc-text);
}

/* ============================================================
   Login layout v3 — split: brand panel left, form right.
   Centered card on small screens. Real color logo (no inversion).
   ============================================================ */
/* Login truly edge-to-edge: zero body margins, full-bleed grid. */
html, body.login {
    margin: 0 !important;
    padding: 0 !important;
}
.sc-auth-v2 {
    min-height: 100vh;
    width: 100%;
    background: var(--sc-bg);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(440px, 5fr) 7fr;
    margin: 0;
}
@media (max-width: 991px) {
    .sc-auth-v2 { grid-template-columns: 1fr; }
}

/* Brand panel — left side */
.sc-auth-v2__brand-panel {
    background: linear-gradient(160deg, #1F1B4A 0%, #2C2778 45%, #4338CA 100%);
    color: #fff;
    padding: 56px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}
.sc-auth-v2__brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(700px 320px at 0% 0%, rgba(124, 58, 237, .35), transparent 60%),
        radial-gradient(600px 480px at 100% 100%, rgba(16, 185, 129, .22), transparent 60%),
        radial-gradient(400px 240px at 50% 60%, rgba(255, 255, 255, .04), transparent 70%);
    pointer-events: none;
}
.sc-auth-v2__brand-inner { position: relative; z-index: 1; }
.sc-auth-v2__logomark {
    width: 220px;
    margin-bottom: 36px;
    display: inline-flex;
}
.sc-auth-v2__logomark img {
    width: 100%; height: auto;
    display: block;
}
.sc-auth-v2__hero-eyebrow {
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .65;
}
.sc-auth-v2__hero {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 12px 0 16px;
    letter-spacing: -.02em;
    background: linear-gradient(90deg, #fff 0%, #C7D2FE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sc-auth-v2__hero-sub {
    font-size: 1rem;
    line-height: 1.55;
    opacity: .8;
    max-width: 460px;
    margin: 0;
}
.sc-auth-v2__bullets {
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 460px;
}
.sc-auth-v2__bullet {
    display: flex; gap: 12px; align-items: flex-start;
    font-size: .92rem;
    line-height: 1.5;
    opacity: .92;
}
.sc-auth-v2__bullet-icon {
    width: 22px; height: 22px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--sc-action-500);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}
.sc-auth-v2__bullet-icon svg { width: 12px; height: 12px; }
.sc-auth-v2__brand-footer {
    position: relative; z-index: 1;
    font-size: .78rem;
    opacity: .55;
}

/* Form panel — right side */
.sc-auth-v2__form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 32px;
}
.sc-auth-v2__form-panel-inner {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Mobile: brand becomes a slim header */
@media (max-width: 991px) {
    .sc-auth-v2__brand-panel { padding: 32px 24px; }
    .sc-auth-v2__logomark { width: 64px; height: 64px; margin-bottom: 16px; }
    .sc-auth-v2__hero { font-size: 1.6rem; }
    .sc-auth-v2__hero-sub { font-size: .9rem; }
    .sc-auth-v2__bullets { display: none; }
    .sc-auth-v2__brand-footer { display: none; }
    .sc-auth-v2__form-panel { padding: 32px 16px; }
}

/* The form card itself */
.sc-auth__form {
    width: 100%;
    background: var(--sc-bg-card);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-lg);
    box-shadow: var(--sc-shadow);
    padding: 32px 28px;
}
.sc-auth__title { font-size: 1.5rem; font-weight: 700; color: var(--sc-text); margin: 0 0 4px; letter-spacing: -.015em; }
.sc-auth__subtitle { color: var(--sc-text-muted); font-size: .9rem; margin-bottom: 24px; }
.sc-auth__footer { text-align: center; font-size: .85rem; color: var(--sc-text-muted); margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--sc-border); }
.sc-auth__footer a { color: var(--sc-action-600); font-weight: 600; text-decoration: none; }
.sc-auth__footer a:hover { text-decoration: underline; }

/* Password input wrapper for the eye toggle (auto-injected by sleep-theme.js) */
.sc-pwd-wrap {
    position: relative;
    display: block;
}
.sc-pwd-wrap > input {
    padding-right: 44px !important;
}
.sc-pwd-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: transparent;
    border: 0;
    border-radius: var(--sc-radius-sm);
    color: var(--sc-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}
.sc-pwd-eye:hover { background: var(--sc-bg-hover); color: var(--sc-text); }
.sc-pwd-eye:focus-visible { outline: 2px solid var(--sc-action-500); outline-offset: 1px; }

/* ============================================================
   Mobile sidebar toggle
   ============================================================ */
/* Sidebar collapsed state on desktop (toggled by header brand-toggle btn) */
body.sc-sidebar-collapsed .sc-sidenav { width: 72px; overflow: hidden; }
body.sc-sidebar-collapsed .sc-sidenav .sc-menu__title,
body.sc-sidebar-collapsed .sc-sidenav .sc-menu__caret,
body.sc-sidebar-collapsed .sc-sidenav .sc-sidenav__section-label,
body.sc-sidebar-collapsed .sc-sidenav .sc-sidenav__brand img { display: none; }
body.sc-sidebar-collapsed .sc-sidenav .sc-menu { justify-content: center; padding: 9px 0; }

/* Mobile slide-in sidebar with backdrop */
.sc-sidenav-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 17, 23, .45);
    z-index: 39;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: scFadeIn .2s ease;
}
.sc-sidenav-backdrop.is-open { display: block; }
@keyframes scFadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 991px) {
    .sc-sidenav {
        position: fixed; top: 0; left: 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 4px 0 24px rgba(15, 17, 23, .14);
        height: 100vh;
    }
    .sc-sidenav.is-open { transform: translateX(0); }
    .sc-topbar { padding: 0 16px; }
    .sc-page { padding: 20px 16px; }
}

/* ============================================================
   Utilities
   ============================================================ */
.sc-grid { display: grid; gap: 20px; }
.sc-grid--2 { grid-template-columns: repeat(2, 1fr); }
.sc-grid--3 { grid-template-columns: repeat(3, 1fr); }
.sc-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1199px) { .sc-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .sc-grid--2, .sc-grid--3, .sc-grid--4 { grid-template-columns: 1fr; } }

.sc-flex { display: flex; }
.sc-flex--center { align-items: center; justify-content: center; }
.sc-gap { gap: 12px; }
.sc-mt-2 { margin-top: 8px; }
.sc-mt-4 { margin-top: 16px; }
.sc-mt-6 { margin-top: 24px; }


/* =========================================================================
   FIXES batch — dropdown z-index, submit-button-out-of-card, validation
   ========================================================================= */

/* (a) Topbar popovers (notifications + user) must clear page content
       no matter what z-index legacy components use. */
#sc-bell-panel,
#sc-user-panel,
#sc-topbar-search-results,
[data-sc-pop="1"] {
    z-index: 9999 !important;
}

/* (a2) Stacking-context leak fix.
   Legacy .intro-y / .intro-x animations use `transform: translateY/X(...)` in
   their keyframes. CSS transforms create a new stacking context, which lets
   transformed children paint OVER sticky/fixed siblings (like our topbar)
   regardless of z-index numbers. We pin them down so the topbar always wins. */
.intro-y, .intro-x, .-intro-y, .-intro-x {
    z-index: 1 !important;
    position: relative;
}

/* (b) The submit button at the bottom of legacy form-cards used `pull-right`
       (float) + sat after all inputs. With padding on the parent `.box` it
       visually leaks outside the card. Convert to a slim flex-end footer. */
form.box,
.box form,
.intro-y.box {
    display: flex;
    flex-direction: column;
}
form.box > .button,
.box form > .button,
.intro-y.box > .button {
    align-self: flex-end !important;
    float: none !important;
    width: auto !important;
    margin-top: 24px !important;
}
form.box > .button.pull-right,
.box form > .button.pull-right,
.intro-y.box > .button.pull-right { float: none !important; }

/* When the form has multiple buttons at the end, group them into a row */
form.box > .button + .button,
.intro-y.box > .button + .button { margin-left: 8px !important; }

/* (c) Invalid input visual feedback — applied by the JS validator OR by
       the browser when :invalid + has been-touched. */
.input.is-invalid,
.sc-input.is-invalid,
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
    border-color: var(--sc-danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}
.sc-field-error {
    display: block;
    margin-top: 6px;
    font-size: .76rem;
    color: var(--sc-danger);
}

/* (d) Password helper widget — strength meter + checklist + generate btn */
.sc-pwd-helper {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--sc-bg-hover);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    font-size: .8rem;
}
.sc-pwd-helper__bar {
    height: 4px;
    background: var(--sc-border-strong);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}
.sc-pwd-helper__fill {
    height: 100%; width: 0;
    background: var(--sc-danger);
    transition: width .25s ease, background-color .25s ease;
    border-radius: 2px;
}
.sc-pwd-helper__fill.is-fair   { background: var(--sc-warning); }
.sc-pwd-helper__fill.is-good   { background: var(--sc-c-blue-500); }
.sc-pwd-helper__fill.is-strong { background: var(--sc-action-500); }

.sc-pwd-helper__row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 8px;
}
.sc-pwd-helper__strength {
    color: var(--sc-text-muted); font-weight: 600; letter-spacing: .02em;
}
.sc-pwd-helper__strength.is-fair   { color: var(--sc-warning); }
.sc-pwd-helper__strength.is-good   { color: var(--sc-c-blue-600); }
.sc-pwd-helper__strength.is-strong { color: var(--sc-action-600); }

.sc-pwd-helper__gen {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    font-size: .75rem; font-weight: 600;
    background: #fff; color: var(--sc-text);
    border: 1px solid var(--sc-border-strong);
    border-radius: var(--sc-radius-sm);
    cursor: pointer;
    transition: all .12s ease;
}
.sc-pwd-helper__gen:hover { background: var(--sc-bg-hover); border-color: var(--sc-text-muted); }
.sc-pwd-helper__gen svg { width: 12px; height: 12px; }

.sc-pwd-helper__rules {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
}
@media (max-width: 540px) { .sc-pwd-helper__rules { grid-template-columns: 1fr; } }
.sc-pwd-helper__rule {
    display: flex; align-items: center; gap: 6px;
    color: var(--sc-text-muted); font-size: .75rem;
    line-height: 1.3;
}
.sc-pwd-helper__rule::before {
    content: ""; flex-shrink: 0;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--sc-border-strong);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7l3 3 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center;
    transition: background-color .15s ease;
}
.sc-pwd-helper__rule.is-met { color: var(--sc-action-600); font-weight: 500; }
.sc-pwd-helper__rule.is-met::before { background-color: var(--sc-action-500); }

/* Generated-password reveal dialog */
.sc-pwd-helper__generated {
    margin-top: 8px; padding: 8px 10px;
    background: #fff;
    border: 1px dashed var(--sc-border-strong);
    border-radius: var(--sc-radius-sm);
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: .82rem;
    color: var(--sc-text);
    word-break: break-all;
    display: none;
}
.sc-pwd-helper__generated.is-shown { display: block; }
.sc-pwd-helper__copy {
    margin-top: 6px; font-size: .72rem;
    background: transparent; border: 0; padding: 0;
    color: var(--sc-action-600); font-weight: 600; cursor: pointer;
}


/* ====================================================================
   LEGACY OVERRIDES — retrofit Midone Tailwind 1.x classes to modern look.
   These selectors target the OLD class names used on legacy admin/list/
   form pages, so the visual upgrade is global without editing 100+ blade
   files. Specificity is bumped where needed so we win against app.css.
   ==================================================================== */

/* --- Body / shell / page wrapper --- */
body.app {
    background: var(--sc-bg) !important;
    color: var(--sc-text);
    font-family: var(--sc-font-body) !important;
    -webkit-font-smoothing: antialiased;
}

/* The legacy <div class="content"> sits next to .sc-sidenav inside <div class="flex">.
   Strip the old 30px rounded card look. Zero padding so the topbar/page-header
   sit edge-to-edge; inner content gets its own padding. */
body.app, body.app html { margin: 0 !important; padding: 0 !important; }
body.app .content,
body.app .content.sc-content {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.app .content::before,
body.app .content::after { display: none !important; }

/* Inner container that holds page body content (cards, tables, forms).
   This is what gets the breathing room — not the topbar/footer. */
body.app .content > .intro-y,
body.app .content > .grid,
body.app .content > main,
body.app .content > section {
    padding-left: 28px;
    padding-right: 28px;
}
body.app .content > .grid { padding-top: 0; padding-bottom: 28px; }
body.app .content main.sc-page { padding: 0 28px 28px !important; }

@media (max-width: 991px) {
    body.app .content > .intro-y,
    body.app .content > .grid,
    body.app .content > main,
    body.app .content > section { padding-left: 16px; padding-right: 16px; }
    body.app .content main.sc-page { padding: 0 16px 24px !important; }
}

/* When a new dashboard wraps content in <main class="sc-page">, its own
   padding doubles up with the .content padding above. Strip it. */
body.app .content main.sc-page,
body.app .content > .sc-page { padding: 0 !important; }

/* The legacy `<div class="intro-y flex items-center"><h2>Title</h2><button>...</button></div>`
   pattern duplicated the topbar's <h1>. Hide the in-page h2; reflow the
   action buttons to the right. Same for "intro-y flex justify-between". */
body.app .content .intro-y.flex h2.text-lg,
body.app .content .intro-y.flex h2.text-xl,
body.app .content .intro-y.flex h2.text-2xl,
body.app .content .intro-y.flex h2.font-medium {
    display: none !important;
}
body.app .content > .intro-y.flex.items-center,
body.app .content > .intro-y.flex.justify-between {
    justify-content: flex-end !important;
    margin: 0 0 18px !important;
    padding: 0 !important;
    border: 0 !important;
    gap: 8px;
}
/* Some legacy heading rows wrap the row in another container — also flatten
   those when they only contain a hidden h2. */
body.app .content .intro-y.flex.items-center:has(> h2.text-lg + a),
body.app .content .intro-y.flex.items-center:has(> h2.text-lg + button) {
    justify-content: flex-end !important;
}

/* --- Cards (.box / .report-box) --- */
.box,
.report-box {
    background: var(--sc-bg-card) !important;
    border-radius: var(--sc-radius-lg) !important;
    border: 1px solid var(--sc-border) !important;
    box-shadow: var(--sc-shadow-sm) !important;
    transition: box-shadow .2s ease, transform .2s ease;
}
.box {
    padding: 24px !important;
}
.box.p-5 { padding: 24px !important; }
.box.p-3 { padding: 18px !important; }
.box.p-7 { padding: 28px !important; }
.box:hover { box-shadow: var(--sc-shadow) !important; }

.report-box,
.report-box .box {
    border-radius: var(--sc-radius) !important;
    overflow: hidden;
}
.report-box .box {
    padding: 22px 24px !important;
    position: relative;
}
.report-box.zoom-in:hover { transform: translateY(-2px); }

/* The big number in a report-box */
.report-box .text-3xl,
.report-box .text-2xl {
    font-size: 1.875rem !important;
    font-weight: 700 !important;
    color: var(--sc-text) !important;
    letter-spacing: -.02em;
    line-height: 1.1 !important;
    margin-top: 12px !important;
}
.report-box .text-base.text-gray-600,
.report-box .text-gray-600 {
    font-size: .8rem !important;
    color: var(--sc-text-muted) !important;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    margin-top: 4px !important;
}

/* report-box icon — make it a proper rounded badge */
.report-box .report-box__icon,
.report-box [data-feather] {
    width: 44px !important; height: 44px !important;
    background: var(--sc-primary-50);
    color: var(--sc-primary-500) !important;
    border-radius: 12px;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.report-box .text-theme-9  [data-feather], .report-box .text-theme-9.report-box__icon  { background: var(--sc-violet-100);  color: var(--sc-violet-500) !important; }
.report-box .text-theme-10 [data-feather], .report-box .text-theme-10.report-box__icon { background: var(--sc-primary-50);  color: var(--sc-primary-500) !important; }
.report-box .text-theme-11 [data-feather], .report-box .text-theme-11.report-box__icon { background: var(--sc-accent-50);   color: var(--sc-accent-600) !important; }
.report-box .text-theme-12 [data-feather], .report-box .text-theme-12.report-box__icon { background: var(--sc-success-bg);  color: var(--sc-success) !important; }
.report-box .text-theme-13 [data-feather], .report-box .text-theme-13.report-box__icon { background: var(--sc-warning-bg);  color: var(--sc-warning) !important; }
.report-box .text-theme-14 [data-feather], .report-box .text-theme-14.report-box__icon { background: var(--sc-danger-bg);   color: var(--sc-danger) !important; }

/* --- Buttons (.button + variants) --- */
.button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px !important;
    font-size: .9rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    border-radius: var(--sc-radius-sm) !important;
    border: 1px solid transparent !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: all .15s ease !important;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(38,34,98,.06);
    -webkit-appearance: none;
    appearance: none;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(38,34,98,.18); }
.button:active { transform: translateY(0); }
.button:focus-visible { outline: 2px solid var(--sc-accent-400); outline-offset: 2px; }

.button--lg { padding: 12px 26px !important; font-size: 1rem !important; }
.button--sm, .button.button--sm { padding: 6px 14px !important; font-size: .8rem !important; }

/* Primary — solid action green, slim radius (no gradient) */
.button.bg-theme-1,
.button.bg-blue-500,
.button.bg-primary {
    background: var(--sc-action-500) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 1px 2px rgba(16,185,129,.25) !important;
}
.button.bg-theme-1:hover { background: var(--sc-action-600) !important; box-shadow: 0 4px 10px rgba(16,185,129,.35) !important; color: #fff !important; }

.button.bg-theme-9  { background: var(--sc-success) !important; color: #fff !important; }
.button.bg-theme-9:hover  { background: #047857 !important; color: #fff !important; box-shadow: 0 4px 10px rgba(4,120,87,.35) !important; }
.button.bg-theme-12 { background: var(--sc-success) !important; color: #fff !important; }
.button.bg-theme-12:hover { background: #047857 !important; color: #fff !important; box-shadow: 0 4px 10px rgba(4,120,87,.35) !important; }
.button.bg-theme-6  { background: var(--sc-danger)  !important; color: #fff !important; }
.button.bg-theme-6:hover  { background: #b91c1c !important; color: #fff !important; box-shadow: 0 4px 10px rgba(185,28,28,.35) !important; }
.button.bg-theme-21 { background: var(--sc-warning) !important; color: #fff !important; }
.button.bg-theme-21:hover { background: #b45309 !important; color: #fff !important; box-shadow: 0 4px 10px rgba(180,83,9,.35) !important; }
.button.bg-gray-200, .button.bg-gray-300 {
    background: #fff !important;
    color: var(--sc-text) !important;
    border-color: var(--sc-border-strong) !important;
    box-shadow: none !important;
}
.button.bg-gray-200:hover, .button.bg-gray-300:hover {
    background: var(--sc-primary-50) !important;
    border-color: var(--sc-primary-500) !important;
    color: var(--sc-primary-500) !important;
}

/* Plain .button (no theme color) — give it a primary-tinted hover instead of */
/* the default browser grey. */
.button:not([class*="bg-"]):hover,
.button.bg-white:hover {
    background: var(--sc-primary-50) !important;
    color: var(--sc-primary-500) !important;
    border-color: var(--sc-primary-500) !important;
}

/* --- jquery-confirm dialog buttons --- */
/* The vendor defaults render destructive actions as washed-out greys. */
/* Lock them to brand-aligned, clearly-readable color blocks so the user */
/* always sees what action they're about to confirm. */
.jconfirm .jconfirm-buttons button.btn {
    text-transform: none !important;
    font-weight: 600 !important;
    padding: 9px 18px !important;
    border-radius: var(--sc-radius-sm) !important;
    border: 1px solid transparent !important;
    transition: background-color .15s ease, box-shadow .15s ease, color .15s ease !important;
    box-shadow: none !important;
}

.jconfirm .jconfirm-buttons .btn-default,
.jconfirm .jconfirm-buttons .sc-btn-cancel {
    background: #fff !important;
    color: var(--sc-text) !important;
    border: 1px solid var(--sc-border-strong) !important;
}
.jconfirm .jconfirm-buttons .btn-default:hover,
.jconfirm .jconfirm-buttons .sc-btn-cancel:hover {
    background: var(--sc-primary-50) !important;
    color: var(--sc-primary-500) !important;
    border-color: var(--sc-primary-500) !important;
}

.jconfirm .jconfirm-buttons .btn-red,
.jconfirm .jconfirm-buttons .sc-btn-danger {
    background: var(--sc-danger) !important;
    color: #fff !important;
    border-color: var(--sc-danger) !important;
}
.jconfirm .jconfirm-buttons .btn-red:hover,
.jconfirm .jconfirm-buttons .sc-btn-danger:hover {
    background: #b91c1c !important;
    color: #fff !important;
    border-color: #b91c1c !important;
    box-shadow: 0 4px 10px rgba(185,28,28,.35) !important;
}

.jconfirm .jconfirm-buttons .btn-blue {
    background: var(--sc-primary-500) !important;
    color: #fff !important;
    border-color: var(--sc-primary-500) !important;
}
.jconfirm .jconfirm-buttons .btn-blue:hover {
    background: var(--sc-primary-600) !important;
    color: #fff !important;
}

.jconfirm .jconfirm-buttons .btn-green {
    background: var(--sc-action-500) !important;
    color: #fff !important;
    border-color: var(--sc-action-500) !important;
}
.jconfirm .jconfirm-buttons .btn-green:hover {
    background: var(--sc-action-600) !important;
}

/* Slim radius even when legacy markup uses .rounded-full — no more pills */
.button.rounded-full { border-radius: var(--sc-radius-sm) !important; }

/* --- Form inputs (.input + variants) --- */
.input,
input.input,
textarea.input,
select.input,
.sc-input {
    width: 100%;
    padding: 10px 14px !important;
    font-size: .9rem !important;
    line-height: 1.4 !important;
    color: var(--sc-text) !important;
    background: #fff !important;
    border: 1px solid var(--sc-border-strong) !important;
    border-radius: var(--sc-radius-sm) !important;
    transition: border-color .15s ease, box-shadow .15s ease !important;
    box-shadow: none !important;
    font-family: inherit !important;
    -webkit-appearance: none;
    appearance: none;
}
.input:focus,
input.input:focus,
textarea.input:focus,
select.input:focus,
.sc-input:focus {
    outline: none !important;
    border-color: var(--sc-action-500) !important;
    box-shadow: 0 0 0 3px rgba(16,185,129,.15) !important;
}
.input::placeholder { color: var(--sc-text-soft) !important; }
.input--lg, .input.input--lg { padding: 13px 16px !important; font-size: 1rem !important; }
.input--sm, .input.input--sm { padding: 7px 10px !important; font-size: .85rem !important; }
.input.border, .input { border: 1px solid var(--sc-border-strong) !important; }

/* Native checkbox / radio — restore browser rendering that .input strips */
input[type="checkbox"],
input[type="radio"],
input[type="checkbox"].input,
input[type="radio"].input {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    padding: 0 !important;
    margin: 0 8px 0 0 !important;
    background: transparent !important;
    border: 1px solid var(--sc-border-strong) !important;
    border-radius: 3px !important;
    accent-color: var(--sc-primary-500);
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
    box-shadow: none !important;
}
input[type="radio"],
input[type="radio"].input { border-radius: 50% !important; }

/* Form labels (the bare <label>Clinic Name</label> pattern) */
form label,
.form-label {
    display: block;
    font-size: .85rem !important;
    font-weight: 600 !important;
    color: var(--sc-text) !important;
    margin-bottom: 8px;
    letter-spacing: .01em;
}
form > div > label + .input,
form .mt-3 > label + .input,
.mt-2 { margin-top: 6px !important; }
form .mt-3 { margin-top: 18px !important; }

/* Helper text under inputs (like .pass_label) */
.pass_label,
form small,
.form-help {
    display: block;
    font-size: .75rem;
    color: var(--sc-text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

/* --- Tables (.table .table-report) --- */
.table {
    width: 100%;
    background: var(--sc-bg-card);
    border-radius: var(--sc-radius);
    border: 1px solid var(--sc-border);
    box-shadow: var(--sc-shadow-sm);
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden;
}
.table thead th {
    padding: 13px 18px !important;
    background: #FAFAFC !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
    color: var(--sc-text-muted) !important;
    text-align: left !important;
    border-bottom: 1px solid var(--sc-border) !important;
    border-top: 0 !important;
    white-space: nowrap;
}
.table tbody td {
    padding: 14px 18px !important;
    font-size: .9rem !important;
    color: var(--sc-text);
    border-top: 1px solid var(--sc-border) !important;
    vertical-align: middle !important;
    background: #fff;
}
.table tbody tr:first-child td { border-top: 0 !important; }
.table tbody tr:hover td { background: var(--sc-primary-50) !important; }

/* Report tables that wrap each row in a "card" — flatten to clean rows */
.table.table-report tbody tr {
    box-shadow: none !important;
    border-radius: 0 !important;
}
.table.table-report tbody td {
    box-shadow: none !important;
}

/* Action icons in last cell — give them subtle hover */
.table tbody td a {
    color: var(--sc-primary-500);
    transition: color .15s ease;
}
.table tbody td a:hover { color: var(--sc-accent-600); }
.table tbody td a [data-feather] { vertical-align: middle; }

/* --- DataTables wrapper (.dataTables_wrapper) --- */
.dataTables_wrapper {
    background: var(--sc-bg-card);
    border-radius: var(--sc-radius);
    border: 1px solid var(--sc-border);
    box-shadow: var(--sc-shadow-sm);
    padding: 16px 20px;
    overflow: hidden;
}
.dataTables_wrapper > .table,
.dataTables_wrapper > div > .table,
.dataTables_wrapper table.dataTable {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 8px 0 !important;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 12px;
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: var(--sc-text-muted);
    font-weight: 500;
}
.dataTables_wrapper .dataTables_filter input {
    padding: 8px 12px !important;
    font-size: .9rem !important;
    border: 1px solid var(--sc-border-strong) !important;
    border-radius: var(--sc-radius-sm) !important;
    min-width: 220px;
    margin-left: 8px !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.dataTables_wrapper .dataTables_filter input:focus {
    outline: none !important;
    border-color: var(--sc-primary-500) !important;
    box-shadow: 0 0 0 3px rgba(38,34,98,.12) !important;
}
.dataTables_wrapper .dataTables_length select {
    padding: 6px 28px 6px 10px !important;
    font-size: .85rem !important;
    border: 1px solid var(--sc-border-strong) !important;
    border-radius: var(--sc-radius-sm) !important;
    background: #fff;
    cursor: pointer;
}

/* DT pagination */
.dataTables_wrapper .dataTables_paginate {
    margin-top: 16px;
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 36px; height: 36px;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 1px solid var(--sc-border) !important;
    border-radius: var(--sc-radius-sm) !important;
    background: #fff !important;
    color: var(--sc-text) !important;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    box-shadow: none !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--sc-primary-50) !important;
    color: var(--sc-primary-500) !important;
    border-color: var(--sc-primary-500) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--sc-primary-500) !important;
    color: #fff !important;
    border-color: var(--sc-primary-500) !important;
    box-shadow: 0 4px 10px rgba(38,34,98,.25) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    opacity: .4;
    cursor: not-allowed;
    background: #fff !important;
    color: var(--sc-text-soft) !important;
    border-color: var(--sc-border) !important;
}
.dataTables_wrapper .dataTables_info {
    margin-top: 16px;
    font-size: .8rem;
    color: var(--sc-text-muted);
    padding-top: 8px;
}
.dataTables_wrapper .dataTables_processing {
    background: rgba(255,255,255,.85) !important;
    backdrop-filter: blur(4px);
    border: 1px solid var(--sc-border) !important;
    border-radius: var(--sc-radius) !important;
    box-shadow: var(--sc-shadow) !important;
    color: var(--sc-primary-500) !important;
    font-weight: 600;
    padding: 16px 24px !important;
}

/* DataTables sort indicators */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    cursor: pointer;
    position: relative;
}
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    opacity: .35;
    margin-left: 6px;
    font-size: .9em;
}

/* --- Select2 modernization --- */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--sc-border-strong) !important;
    border-radius: var(--sc-radius-sm) !important;
    height: auto !important;
    min-height: 42px !important;
    padding: 5px 8px !important;
    background: #fff !important;
    transition: border-color .15s ease, box-shadow .15s ease !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 30px !important;
    color: var(--sc-text) !important;
    padding-left: 6px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 6px !important;
}
.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection {
    border-color: var(--sc-primary-500) !important;
    box-shadow: 0 0 0 3px rgba(38,34,98,.12) !important;
}
.select2-dropdown {
    border: 1px solid var(--sc-border-strong) !important;
    border-radius: var(--sc-radius-sm) !important;
    box-shadow: var(--sc-shadow-md) !important;
    overflow: hidden;
}
.select2-results__option {
    padding: 9px 14px !important;
    font-size: .9rem !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted {
    background: var(--sc-primary-500) !important;
    color: #fff !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--sc-border-strong) !important;
    border-radius: var(--sc-radius-sm) !important;
    padding: 8px 10px !important;
}

/* --- Old dropdown panels (.dropdown-box) --- */
.dropdown-box .dropdown-box__content,
.dropdown-box .box {
    background: var(--sc-bg-card) !important;
    color: var(--sc-text) !important;
    border-radius: var(--sc-radius) !important;
    box-shadow: var(--sc-shadow-md) !important;
    border: 1px solid var(--sc-border) !important;
    overflow: hidden;
    padding: 0 !important;
}
.dropdown-box .dropdown-box__content > div,
.dropdown-box .box > div {
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--sc-border) !important;
    color: var(--sc-text) !important;
    font-size: .85rem;
    background: transparent !important;
}
.dropdown-box .dropdown-box__content > div:last-child,
.dropdown-box .box > div:last-child { border-bottom: 0 !important; }
.dropdown-box .dropdown-box__content a,
.dropdown-box .box a {
    color: var(--sc-text) !important;
    background: transparent !important;
    transition: background .15s ease, color .15s ease;
    border-radius: 8px;
    padding: 8px 10px !important;
    margin: 2px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dropdown-box .dropdown-box__content a:hover,
.dropdown-box .box a:hover {
    background: var(--sc-primary-50) !important;
    color: var(--sc-primary-500) !important;
}
.dropdown-box .text-white,
.dropdown-box .dark\:text-gray-300,
.dropdown-box .border-theme-40,
.dropdown-box .dark\:border-dark-3 {
    color: var(--sc-text) !important;
    border-color: var(--sc-border) !important;
}

/* --- Old tab/topbar account avatar leftover --- */
.dropdown-toggle.zoom-in {
    transition: transform .15s ease;
}
.dropdown-toggle.zoom-in:hover { transform: scale(1.05); }

/* --- Notifications dropdown badge (legacy badge-danger) --- */
.badge-danger {
    background: var(--sc-danger) !important;
    color: #fff !important;
    border-radius: 999px !important;
    font-size: .65rem !important;
    padding: 2px 6px !important;
    font-weight: 700 !important;
    border: 2px solid #fff !important;
}

/* --- Alerts / errors --- */
.alert,
.text-danger,
.text-red-500 { color: var(--sc-danger) !important; }
.text-success,
.text-green-500 { color: var(--sc-success) !important; }
.text-warning,
.text-yellow-500 { color: var(--sc-warning) !important; }

.alert-success {
    background: var(--sc-success-bg) !important;
    border-left: 3px solid var(--sc-success) !important;
    color: #065f46 !important;
    padding: 12px 16px !important;
    border-radius: var(--sc-radius-sm) !important;
}
.alert-danger {
    background: var(--sc-danger-bg) !important;
    border-left: 3px solid var(--sc-danger) !important;
    color: #991b1b !important;
    padding: 12px 16px !important;
    border-radius: var(--sc-radius-sm) !important;
}

/* --- intro-x / intro-y animation polish (preserve fade-in but ensure no
       residual transforms remain stuck) --- */
.intro-x, .intro-y {
    animation-fill-mode: forwards !important;
}

/* Mobile bar — light theme uses white bg + light logo; dark theme handled
   by the theme-aware logo swap above. */
.mobile-menu {
    background: var(--sc-bg-card) !important;
    color: var(--sc-text) !important;
    padding: 0 16px !important;
    border-bottom: 1px solid var(--sc-border);
}
.mobile-menu-bar {
    height: 56px;
    display: flex;
    align-items: center;
}
.mobile-menu-bar img {
    filter: none;
    width: 130px !important;
    height: auto;
}

/* --- Tata.js notifications restyle --- */
.tata-class {
    border-radius: var(--sc-radius) !important;
    box-shadow: var(--sc-shadow-md) !important;
    font-family: var(--sc-font-body) !important;
    border: 0 !important;
    overflow: hidden;
}

/* --- jquery-confirm modal restyle --- */
.jconfirm .jconfirm-box {
    border-radius: var(--sc-radius) !important;
    box-shadow: var(--sc-shadow-lg) !important;
    border: 0 !important;
    font-family: var(--sc-font-body) !important;
    overflow: hidden;
}
.jconfirm .jconfirm-title-c { padding: 18px 24px !important; }
.jconfirm .jconfirm-content { padding: 0 24px 18px !important; color: var(--sc-text-muted); }
.jconfirm .jconfirm-buttons {
    padding: 12px 24px !important;
    background: #FAFAFC;
    border-top: 1px solid var(--sc-border);
    display: flex !important;
    gap: 8px;
    justify-content: flex-end;
}
.jconfirm .btn {
    padding: 8px 18px !important;
    border-radius: var(--sc-radius-sm) !important;
    font-weight: 600 !important;
    font-size: .85rem !important;
    border: 1px solid var(--sc-border-strong) !important;
    background: #fff !important;
    color: var(--sc-text) !important;
    transition: all .15s ease !important;
}
.jconfirm .btn:hover { background: var(--sc-primary-50) !important; }
.jconfirm .btn-blue,
.jconfirm .btn-default,
.jconfirm .btn.text-danger {
    background: var(--sc-gradient-primary) !important;
    color: #fff !important;
    border: 0 !important;
}
.jconfirm .btn.text-danger {
    background: var(--sc-danger) !important;
}

/* --- Additional polish: focus rings on every interactive element --- */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--sc-accent-400);
    outline-offset: 2px;
    border-radius: var(--sc-radius-sm);
}

/* --- Empty state styling for tables with no data --- */
.dataTables_empty {
    text-align: center !important;
    padding: 48px 16px !important;
    color: var(--sc-text-muted) !important;
    font-style: italic;
}

/* --- Page-level container margin consistency --- */
body.app .content > .grid {
    gap: 20px !important;
}
body.app .content > .grid.grid-cols-12 > div.intro-y {
    margin-bottom: 0 !important;
}

/* --- Hide the legacy "passtrength" tooltip that fights our new strength meter --- */
.passtrength_tooltip { font-family: var(--sc-font-body) !important; font-size: .75rem !important; }

/* --- Custom scrollbars across the app --- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--sc-primary-200) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--sc-primary-200);
    border-radius: 5px;
    border: 2px solid var(--sc-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--sc-primary-400); }

/* --- Modal/Backdrop polish if any modal uses these legacy classes --- */
.modal {
    border-radius: var(--sc-radius) !important;
    box-shadow: var(--sc-shadow-lg) !important;
    border: 0 !important;
}
.modal-header { padding: 18px 24px !important; border-bottom: 1px solid var(--sc-border) !important; }
.modal-body { padding: 24px !important; }
.modal-footer { padding: 14px 24px !important; border-top: 1px solid var(--sc-border) !important; background: #FAFAFC; }

/* --- Pull-right legacy class fixed alignment --- */
.pull-right { float: right; }
.pull-left { float: left; }

/* --- Section titles inside boxes (forms with no card title use h3-ish) --- */
form > .intro-y > h2, form > .intro-y > h3 {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sc-border);
}

/* --- Loading shimmer for any async area --- */
@keyframes scShimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
.sc-shimmer {
    background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
    background-size: 1000px 100%;
    animation: scShimmer 1.5s infinite linear;
    border-radius: var(--sc-radius-sm);
    color: transparent;
}

/* --- Print-friendly --- */
@media print {
    .sc-sidenav, .mobile-menu, .sc-topbar { display: none !important; }
    .sc-content, body.app .content { margin: 0 !important; padding: 0 !important; }
}
