/* =============================================================================
   Broker House CRM  -  Modern design system (Tailwind-inspired)
   Restyles every legacy Bootstrap class name in place - no HTML changes needed.
   Loaded AFTER Tailwind Play CDN so utility classes still work in markup.
   ============================================================================= */

/* ---------- Design tokens ---------- */
:root {
    --brand-50:  #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;

    --accent-500: #0ea5e9;
    --accent-600: #0284c7;

    --success-50:  #ecfdf5;
    --success-500: #10b981;
    --success-600: #059669;

    --warning-50:  #fffbeb;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --danger-50:  #fef2f2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;

    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --sidebar-bg:     #0b1220;
    --sidebar-fg:     #94a3b8;
    --sidebar-fg-hi:  #f8fafc;
    --sidebar-accent: #6366f1;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, .07), 0 2px 4px -2px rgba(15, 23, 42, .05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, .08), 0 4px 6px -4px rgba(15, 23, 42, .04);
    --shadow-focus: 0 0 0 3px rgba(99, 102, 241, .18);

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--slate-900);
    background: var(--slate-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem 0; color: var(--slate-900); font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
p  { margin: 0 0 .75rem 0; }
a  { color: var(--brand-600); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-700); text-decoration: underline; }
small { font-size: 12px; color: var(--slate-500); }
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', monospace;
    font-size: .875em;
    background: var(--slate-100);
    color: var(--slate-800);
    padding: 2px 6px;
    border-radius: 4px;
}
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: 6px; }
::selection { background: var(--brand-100); color: var(--brand-800); }

/* ---------- Bootstrap-style utility layout (redefined) ---------- */
.container-fluid { width: 100%; padding-inline: 1rem; }
.row { display: flex; flex-wrap: wrap; margin-inline: -.5rem; }
[class*="col-"] { padding-inline: .5rem; box-sizing: border-box; }
.g-1 > * { padding-inline: .125rem; padding-block-end: .25rem; }
.g-2 > * { padding-inline: .25rem;  padding-block-end: .5rem;  }
.g-3 > * { padding-inline: .375rem; padding-block-end: .75rem; }

.col       { flex: 1 0 0%; }
.col-auto  { flex: 0 0 auto; width: auto; }
.col-6     { flex: 0 0 50%;   max-width: 50%; }
.col-4     { flex: 0 0 33.33%; max-width: 33.33%; }
.col-3     { flex: 0 0 25%;   max-width: 25%; }
.col-12    { flex: 0 0 100%;  max-width: 100%; }
@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
}
@media (min-width: 768px) {
    .col-md-2  { flex: 0 0 16.67%; max-width: 16.67%; }
    .col-md-3  { flex: 0 0 25%;    max-width: 25%; }
    .col-md-4  { flex: 0 0 33.33%; max-width: 33.33%; }
    .col-md-5  { flex: 0 0 41.66%; max-width: 41.66%; }
    .col-md-6  { flex: 0 0 50%;    max-width: 50%; }
    .col-md-7  { flex: 0 0 58.33%; max-width: 58.33%; }
    .col-md-8  { flex: 0 0 66.66%; max-width: 66.66%; }
    .col-md-12 { flex: 0 0 100%;   max-width: 100%; }
}
@media (min-width: 992px) {
    .col-lg-4  { flex: 0 0 33.33%; max-width: 33.33%; }
    .col-lg-5  { flex: 0 0 41.66%; max-width: 41.66%; }
    .col-lg-6  { flex: 0 0 50%;    max-width: 50%; }
    .col-lg-7  { flex: 0 0 58.33%; max-width: 58.33%; }
    .col-lg-8  { flex: 0 0 66.66%; max-width: 66.66%; }
    .col-lg-9  { flex: 0 0 75%;    max-width: 75%; }
    .col-lg-3  { flex: 0 0 25%;    max-width: 25%; }
}

/* Utility helpers replicated */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-none { display: none; }
.d-block { display: block; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-start   { justify-content: flex-start; }
.justify-content-center  { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end     { justify-content: flex-end; }
.align-items-start       { align-items: flex-start; }
.align-items-center      { align-items: center; }
.align-items-end         { align-items: flex-end; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: .25rem; }
.mb-2  { margin-bottom: .5rem; }
.mb-3  { margin-bottom: 1rem; }
.mb-4  { margin-bottom: 1.5rem; }
.mt-1  { margin-top: .25rem; }
.mt-2  { margin-top: .5rem; }
.mt-3  { margin-top: 1rem; }
.mt-4  { margin-top: 1.5rem; }
.ms-1  { margin-inline-start: .25rem; }
.ms-2  { margin-inline-start: .5rem; }
.me-1  { margin-inline-end: .25rem; }
.me-2  { margin-inline-end: .5rem; }
.p-0   { padding: 0; }
.p-2   { padding: .5rem; }
.p-3   { padding: 1rem; }
.py-2  { padding-block: .5rem; }
.py-3  { padding-block: 1rem; }
.px-2  { padding-inline: .5rem; }
.px-3  { padding-inline: 1rem; }
.text-center { text-align: center; }
.text-end    { text-align: right; }
.text-start  { text-align: left; }
.text-muted  { color: var(--slate-500); }
.text-danger { color: var(--danger-600); }
.text-success { color: var(--success-600); }
.text-warning { color: var(--warning-600); }
.text-primary { color: var(--brand-600); }
.fw-bold  { font-weight: 600; }
.fw-semibold { font-weight: 600; }
.small { font-size: 12px; }

/* ---------- Auth shell (login / forgot / access denied) ---------- */
.auth-body {
    background:
        radial-gradient(1200px 600px at 100% 0%, rgba(99,102,241,.18), transparent 60%),
        radial-gradient(1000px 500px at 0% 100%, rgba(14,165,233,.15), transparent 60%),
        linear-gradient(180deg, #0b1220 0%, #101a34 100%);
    min-height: 100vh;
    color: var(--slate-100);
}
.auth-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 1.5rem;
}
.auth-card {
    background: rgba(255,255,255,.98);
    color: var(--slate-900);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.35);
    padding: 2.25rem;
    width: 100%;
    max-width: 440px;
    backdrop-filter: blur(6px);
    animation: fadeInUp .35s ease both;
}
.auth-brand {
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    margin-bottom: 1.75rem;
}
.auth-brand h1 {
    color: var(--slate-900);
    font-size: 1.375rem;
    letter-spacing: -.01em;
    font-weight: 700;
    margin: 0;
}
.auth-brand p { color: var(--slate-500); font-size: .875rem; margin: .125rem 0 0 0; }
.auth-title { color: var(--slate-900); font-size: 1.05rem; margin: 0 0 1.25rem 0; font-weight: 600; }
.auth-footer { color: rgba(255,255,255,.6); font-size: 12px; margin-top: 1.25rem; text-align: center; }

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ---------- App shell ---------- */
.app-body { background: var(--slate-50); }
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-content { padding: 1.5rem 2rem 2rem; flex: 1; max-width: 100%; }
.app-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    color: var(--slate-500);
    font-size: 12px;
    border-top: 1px solid var(--slate-200);
    background: #fff;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
    border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: .625rem;
}
.sidebar-brand a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    letter-spacing: -.01em;
}
.sidebar-brand a:hover { text-decoration: none; }
.sidebar-brand i {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.08) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.06); border-radius: 3px; }

.sidebar-section { margin-bottom: 1.25rem; }
.sidebar-section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.35);
    padding: .5rem .75rem .375rem;
    font-weight: 600;
}
.sidebar-nav .nav-item {
    display: flex; align-items: center; gap: .625rem;
    padding: .5rem .75rem;
    margin: 1px 0;
    color: var(--sidebar-fg);
    text-decoration: none;
    font-size: 13.5px;
    border-radius: 8px;
    position: relative;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.sidebar-nav .nav-item i { width: 18px; text-align: center; font-size: 15px; opacity: .85; flex-shrink: 0; }
.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,.05);
    color: var(--sidebar-fg-hi);
    text-decoration: none;
}
.sidebar-nav .nav-item.active {
    background: linear-gradient(90deg, rgba(99,102,241,.22), rgba(99,102,241,.04));
    color: #fff;
    font-weight: 500;
}
.sidebar-nav .nav-item.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--sidebar-accent);
    border-radius: 0 3px 3px 0;
}
.sidebar-nav .nav-item.active i { opacity: 1; color: var(--brand-200); }

/* Collapsed sidebar */
.sidebar-collapsed .app-sidebar { width: 68px; }
.sidebar-collapsed .sidebar-nav .nav-item span,
.sidebar-collapsed .sidebar-brand a span,
.sidebar-collapsed .sidebar-section-title { display: none; }
.sidebar-collapsed .sidebar-nav .nav-item { justify-content: center; padding: .5rem; }

/* ---------- Topbar ---------- */
.app-topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 15;
}
.topbar-left  { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }

.sidebar-toggle {
    background: none;
    border: none;
    padding: .375rem .5rem;
    color: var(--slate-600);
    font-size: 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}
.sidebar-toggle:hover { background: var(--slate-100); color: var(--slate-900); }

.topbar-title { color: var(--slate-500); font-size: 12px; }
.topbar-env-badge {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: 3px 10px;
    background: var(--success-50);
    color: var(--success-600);
    border: 1px solid rgba(16,185,129,.25);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.topbar-env-badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success-500);
}

.breadcrumb {
    display: flex; align-items: center; gap: .5rem;
    font-size: 13px; color: var(--slate-500);
    list-style: none; margin: 0; padding: 0;
}
.breadcrumb a { color: var(--slate-600); font-weight: 500; }
.breadcrumb a:hover { color: var(--brand-600); text-decoration: none; }
.breadcrumb .sep { color: var(--slate-300); }
.breadcrumb .current { color: var(--slate-900); font-weight: 600; }

.user-menu {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .375rem .625rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--slate-800);
    cursor: pointer;
    font-size: 13px;
    transition: background .15s, border-color .15s;
    text-decoration: none;
}
.user-menu:hover { background: var(--slate-100); border-color: var(--slate-200); text-decoration: none; }
.user-menu .avatar {
    width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    color: #fff; font-weight: 600; font-size: 12px;
    display: inline-flex; align-items: center; justify-content: center;
}
.user-menu i.bi-chevron-down { font-size: 12px; color: var(--slate-400); }

/* Sub-navigation (module tabs shown below topbar) */
.app-subnav {
    display: flex;
    gap: .25rem;
    padding: .5rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    overflow-x: auto;
    scrollbar-width: none;
}
.app-subnav::-webkit-scrollbar { display: none; }
.app-subnav a {
    padding: .4rem .75rem;
    font-size: 13px;
    color: var(--slate-600);
    border-radius: 8px;
    white-space: nowrap;
    transition: background .15s, color .15s;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}
.app-subnav a i { font-size: 13px; opacity: .8; }
.app-subnav a:hover { background: var(--slate-100); color: var(--slate-900); text-decoration: none; }
.app-subnav a.active { background: var(--brand-50); color: var(--brand-700); }

/* ---------- Page title ---------- */
.page-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--slate-900);
    margin: 0 0 1.25rem 0;
    letter-spacing: -.01em;
}

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-body { padding: 1.25rem 1.5rem; }
.card-body.p-0 { padding: 0; }
.card-title  { font-size: .95rem; font-weight: 600; color: var(--slate-900); margin: 0 0 .875rem 0; }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--slate-200); background: var(--slate-50); font-weight: 600; }

/* ---------- Stat cards ---------- */
.dashboard-cards .stat-card,
.stat-card {
    background: #fff;
    padding: 1.25rem 1.375rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-label {
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .25rem;
}
.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -.02em;
    line-height: 1.2;
}
.stat-card-warn  { border-top: 3px solid var(--warning-500); }
.stat-card-error { border-top: 3px solid var(--danger-500); }
.stat-card-warn::before,
.stat-card-error::before {
    content: '';
    position: absolute;
    inset: -20% -20% auto auto;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(245,158,11,.06);
    z-index: 0;
}
.stat-card-error::before { background: rgba(239,68,68,.06); }
.stat-card > * { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .5rem 1rem;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.25;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease, color .15s ease, border-color .15s ease;
    background: transparent;
    color: var(--slate-800);
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn i { font-size: .95em; }
.btn-sm { padding: .375rem .75rem; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: .625rem 1.25rem; font-size: 15px; border-radius: 10px; }
.btn-primary   { background: var(--brand-600);   color: #fff; }
.btn-primary:hover   { background: var(--brand-700);   color: #fff; box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--slate-200);   color: var(--slate-800); }
.btn-secondary:hover { background: var(--slate-300);   color: var(--slate-900); }
.btn-success   { background: var(--success-600); color: #fff; }
.btn-success:hover   { background: var(--success-500); color: #fff; box-shadow: var(--shadow-sm); }
.btn-warning   { background: var(--warning-500); color: #fff; }
.btn-warning:hover   { background: var(--warning-600); color: #fff; }
.btn-danger    { background: var(--danger-500);  color: #fff; }
.btn-danger:hover    { background: var(--danger-600);  color: #fff; }
.btn-outline-primary   { border-color: var(--brand-500);  color: var(--brand-600); }
.btn-outline-primary:hover   { background: var(--brand-50);  color: var(--brand-700); }
.btn-outline-secondary { border-color: var(--slate-300); color: var(--slate-700); }
.btn-outline-secondary:hover { background: var(--slate-100); color: var(--slate-900); border-color: var(--slate-400); }
.btn-outline-danger    { border-color: var(--danger-500); color: var(--danger-600); }
.btn-outline-danger:hover    { background: var(--danger-50); color: var(--danger-600); }
.btn-link { color: var(--brand-600); background: transparent; }
.btn-link:hover { color: var(--brand-700); text-decoration: underline; }
.btn-close {
    background: transparent;
    border: none;
    color: var(--slate-500);
    font-size: 1rem;
    cursor: pointer;
    padding: .25rem;
    border-radius: 6px;
    line-height: 1;
}
.btn-close::before { content: '\00d7'; font-size: 1.25rem; }
.btn-close:hover { background: var(--slate-100); color: var(--slate-900); }

.btn-group { display: inline-flex; }
.btn-group-sm .btn { padding: .35rem .625rem; font-size: 12px; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.btn-group .btn:last-child  { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.btn-group .btn + .btn { margin-inline-start: -1px; }

.w-100 { width: 100%; }

/* ---------- Forms ---------- */
.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: .3rem;
    letter-spacing: .01em;
}
.form-control,
.form-select,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
textarea, select {
    width: 100%;
    padding: .5rem .75rem;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--slate-900);
    background: #fff;
    background-clip: padding-box;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}
.form-control:focus,
.form-select:focus,
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: var(--shadow-focus);
}
.form-control::placeholder, input::placeholder, textarea::placeholder { color: var(--slate-400); }
.form-control:disabled, .form-control[readonly] {
    background: var(--slate-100);
    color: var(--slate-600);
    cursor: not-allowed;
}
textarea.form-control { min-height: 80px; resize: vertical; }
.form-control-sm, .form-select-sm { padding: .35rem .625rem; font-size: 12.5px; border-radius: 7px; }

.form-select, select {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22%2364748b%22%3E%3Cpath%20d%3D%22M8%2011.5%201%204.5%202.5%203%208%208.5%2013.5%203%2015%204.5z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right .625rem center;
    background-size: 12px 12px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-left: 0;
    min-height: auto;
    margin-bottom: 0;
}
.form-check-input {
    width: 16px; height: 16px;
    margin: 0;
    appearance: none; -webkit-appearance: none;
    background: #fff;
    border: 1.5px solid var(--slate-300);
    border-radius: 4px;
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}
.form-check-input:hover { border-color: var(--brand-400, var(--brand-500)); }
.form-check-input:checked {
    background: var(--brand-600);
    border-color: var(--brand-600);
}
.form-check-input:checked::before {
    content: '';
    width: 10px; height: 10px;
    background: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22white%22%3E%3Cpath%20d%3D%22M13.5%204.5%206%2012%202.5%208.5%204%207%206%209%2012%203z%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;
}
.form-check-input[type="radio"] { border-radius: 50%; }
.form-check-input[type="radio"]:checked::before { border-radius: 50%; background: #fff; width: 6px; height: 6px; }
.form-check-input:focus { outline: none; box-shadow: var(--shadow-focus); }
.form-check-label { font-size: 13px; color: var(--slate-700); cursor: pointer; }

/* File input */
input[type="file"] {
    padding: .35rem .5rem;
    font-size: 12.5px;
}

/* ---------- Alerts (Toast) ---------- */
.alert {
    padding: .75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: 13.5px;
    box-shadow: var(--shadow-xs);
    animation: fadeInUp .25s ease both;
}
.alert::before {
    font-family: 'bootstrap-icons';
    font-size: 1rem;
    flex-shrink: 0;
}
.alert-success   { background: var(--success-50); color: var(--success-600); border-color: rgba(16,185,129,.25); }
.alert-success::before { content: '\f26a'; }   /* check-circle */
.alert-info      { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.alert-info::before    { content: '\f431'; }   /* info-circle */
.alert-warning   { background: var(--warning-50); color: var(--warning-600); border-color: rgba(245,158,11,.25); }
.alert-warning::before { content: '\f33a'; }   /* exclamation-triangle */
.alert-danger    { background: var(--danger-50); color: var(--danger-600); border-color: rgba(239,68,68,.25); }
.alert-danger::before  { content: '\f624'; }   /* x-circle */
.alert-dismissible { position: relative; padding-right: 3rem; }
.alert-dismissible .btn-close {
    position: absolute; top: 50%; right: .5rem; transform: translateY(-50%);
    color: inherit;
    opacity: .7;
}
.alert-dismissible .btn-close:hover { opacity: 1; background: rgba(0,0,0,.05); }

/* ---------- Tables ---------- */
.table-responsive { overflow-x: auto; border-radius: 0; }
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
    color: var(--slate-800);
    background: #fff;
}
.table thead th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--slate-500);
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
    padding: .75rem 1rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.table tbody td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
}
.table tbody tr { transition: background .12s ease; }
.table-hover tbody tr:hover { background: var(--slate-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table td .btn { padding: .25rem .5rem; font-size: 12px; }
.table td .btn + .btn { margin-inline-start: .25rem; }
.table td a { color: var(--brand-600); font-weight: 500; }
.table td a:hover { text-decoration: underline; }
.table-sm td, .table-sm th { padding: .5rem .75rem; }

/* Empty state */
.table tbody:empty::after,
.table-empty {
    display: block;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--slate-500);
    font-size: 13px;
}

/* Zebra optional (auto for tables with hover) */
.table-hover tbody tr:nth-child(even) { background: rgba(248,250,252,.5); }
.table-hover tbody tr:nth-child(even):hover { background: var(--slate-100); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.4;
    text-transform: uppercase;
    background: var(--slate-100);
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
}
.badge.bg-secondary { background: var(--slate-100); color: var(--slate-700); border-color: var(--slate-200); }
.badge.bg-success   { background: var(--success-50); color: var(--success-600); border-color: rgba(16,185,129,.25); }
.badge.bg-warning   { background: var(--warning-50); color: var(--warning-600); border-color: rgba(245,158,11,.25); }
.badge.bg-danger    { background: var(--danger-50);  color: var(--danger-600);  border-color: rgba(239,68,68,.25); }
.badge.bg-primary   { background: var(--brand-50);   color: var(--brand-700);   border-color: rgba(99,102,241,.25); }

/* ---------- Dropdown (works with Bootstrap JS toggling .show) ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown-toggle::after { display: none; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 40;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: .35rem;
    margin: 0;
    list-style: none;
    animation: fadeInUp .15s ease both;
}
.dropdown-menu.show { display: block; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-item {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .625rem;
    font-size: 13.5px;
    color: var(--slate-700);
    border-radius: 6px;
    text-decoration: none;
    transition: background .1s;
}
.dropdown-item:hover { background: var(--slate-100); color: var(--slate-900); text-decoration: none; }
.dropdown-item i { color: var(--slate-500); font-size: 15px; }
.dropdown-divider { height: 1px; background: var(--slate-200); margin: .3rem 0; border: none; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    gap: .25rem;
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    flex-wrap: wrap;
}
.pagination-sm .page-link { padding: .3rem .55rem; font-size: 12.5px; }
.page-item { display: inline-flex; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px;
    padding: .375rem .625rem;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    color: var(--slate-700);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background .12s, border-color .12s, color .12s;
}
.page-link:hover { background: var(--slate-50); border-color: var(--slate-300); color: var(--slate-900); text-decoration: none; }
.page-item.active .page-link {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}
.page-summary {
    margin-inline-start: .75rem;
    color: var(--slate-500);
    font-size: 12px;
    align-self: center;
    display: flex;
}

/* ---------- Loader ---------- */
.app-loader {
    position: fixed; inset: 0;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.spinner-border {
    display: inline-block;
    width: 32px; height: 32px;
    border: 3px solid var(--brand-100);
    border-top-color: var(--brand-600);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Filter panel ---------- */
.filter-panel { margin-bottom: 1rem; }
.filter-panel .form-label { font-size: 11.5px; color: var(--slate-500); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }

/* ---------- Definition list ---------- */
dl.row { margin: 0; }
dl.row dt {
    color: var(--slate-500);
    font-weight: 500;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding-block: .5rem;
}
dl.row dd { padding-block: .5rem; margin-bottom: 0; color: var(--slate-900); font-weight: 500; }

/* ---------- Empty state helper ---------- */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--slate-500);
}
.empty-state i {
    font-size: 2rem;
    color: var(--slate-300);
    display: block;
    margin-bottom: .5rem;
}
.empty-state-title { font-weight: 600; color: var(--slate-700); margin-bottom: .25rem; }
.empty-state-desc  { font-size: 13px; }

/* ---------- Skeleton loading (utility) ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--slate-100), var(--slate-200), var(--slate-100));
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 1.4s linear infinite;
    min-height: 12px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100vh;
        transition: left .25s ease;
        box-shadow: var(--shadow-lg);
    }
    body:not(.sidebar-collapsed) .app-sidebar { left: 0; }
    body:not(.sidebar-collapsed)::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .4);
        z-index: 19;
    }
    .app-content { padding: 1rem; }
    .app-topbar { padding: 0 1rem; }
    .app-subnav { padding-inline: 1rem; }
    .breadcrumb { display: none; }
}
@media (max-width: 640px) {
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.25rem; }
    .card-body { padding: 1rem; }
    .page-title { font-size: 1.125rem; }
    .table { font-size: 12.5px; }
    .table thead th, .table tbody td { padding: .5rem .625rem; }
    .topbar-env-badge { display: none; }
}

/* ---------- Print ---------- */
@media print {
    .app-sidebar, .app-topbar, .app-subnav, .app-footer, .btn, .pagination { display: none !important; }
    .app-content { padding: 0; }
    .card { box-shadow: none; border: 1px solid var(--slate-300); }
}

/* =============================================================================
   Polish layer  -  additive refinements, no HTML changes required
   ============================================================================= */

/* ---------- Refined primary button (gradient shine + soft focus glow) ---------- */
.btn-primary {
    background-image: linear-gradient(135deg, var(--brand-600) 0%, #7c3aed 100%);
    box-shadow: 0 1px 2px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-primary:hover {
    background-image: linear-gradient(135deg, var(--brand-700) 0%, #6d28d9 100%);
    box-shadow: 0 6px 16px -6px rgba(99,102,241,.55), inset 0 1px 0 rgba(255,255,255,.15);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(15,23,42,.15); }

.btn-success   { background-image: linear-gradient(135deg, var(--success-600) 0%, #047857 100%); }
.btn-danger    { background-image: linear-gradient(135deg, var(--danger-500) 0%, var(--danger-600) 100%); }
.btn-warning   { background-image: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; }

.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ---------- Card polish: border tint on hover + entrance ---------- */
.card { transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease; }
.card:hover { border-color: rgba(99,102,241,.25); box-shadow: var(--shadow-md); }

/* ---------- Stat card refinements: coloured accent strip on the left + entrance stagger ---------- */
.dashboard-cards > [class*="col-"] { animation: statCardIn .45s cubic-bezier(.22,.61,.36,1) both; }
.dashboard-cards > [class*="col-"]:nth-child(1)  { animation-delay: .00s; }
.dashboard-cards > [class*="col-"]:nth-child(2)  { animation-delay: .04s; }
.dashboard-cards > [class*="col-"]:nth-child(3)  { animation-delay: .08s; }
.dashboard-cards > [class*="col-"]:nth-child(4)  { animation-delay: .12s; }
.dashboard-cards > [class*="col-"]:nth-child(5)  { animation-delay: .16s; }
.dashboard-cards > [class*="col-"]:nth-child(6)  { animation-delay: .20s; }
.dashboard-cards > [class*="col-"]:nth-child(7)  { animation-delay: .24s; }
.dashboard-cards > [class*="col-"]:nth-child(8)  { animation-delay: .28s; }
.dashboard-cards > [class*="col-"]:nth-child(9)  { animation-delay: .32s; }
.dashboard-cards > [class*="col-"]:nth-child(10) { animation-delay: .36s; }
.dashboard-cards > [class*="col-"]:nth-child(11) { animation-delay: .40s; }
.dashboard-cards > [class*="col-"]:nth-child(12) { animation-delay: .44s; }
@keyframes statCardIn {
    0%   { opacity: 0; transform: translateY(10px) scale(.98); }
    100% { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* Colour-coded strip driven by DOM position - no markup changes required */
.stat-card { position: relative; }
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: var(--slate-200);
    opacity: 0;
    transition: opacity .2s ease;
}
.stat-card:hover::after { opacity: 1; }
.dashboard-cards > [class*="col-"]:nth-child(4n+1) .stat-card::after { background: var(--brand-500);   }
.dashboard-cards > [class*="col-"]:nth-child(4n+2) .stat-card::after { background: var(--accent-500);  }
.dashboard-cards > [class*="col-"]:nth-child(4n+3) .stat-card::after { background: var(--success-500); }
.dashboard-cards > [class*="col-"]:nth-child(4n)   .stat-card::after { background: #a855f7;            }
.stat-card-warn::after  { background: var(--warning-500) !important; opacity: 1 !important; }
.stat-card-error::after { background: var(--danger-500)  !important; opacity: 1 !important; }

/* Subtle icon block on the right of the value (uses first .bi inside if present) */
.stat-card { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.stat-card > .stat-body { flex: 1; min-width: 0; }
.stat-card > .stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--brand-600);
    background: var(--brand-50);
    font-size: 20px;
    flex-shrink: 0;
}

/* ---------- Sidebar active state: brighter accent + bolder rail ---------- */
.sidebar-nav .nav-item.active {
    background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(99,102,241,.06) 60%, transparent);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.sidebar-nav .nav-item.active::before {
    left: 0;
    top: 4px; bottom: 4px;
    width: 3px;
    background: linear-gradient(180deg, var(--brand-500), var(--accent-500));
    box-shadow: 0 0 8px rgba(99,102,241,.5);
}
.sidebar-nav .nav-item:not(.active):hover i { color: var(--brand-200); opacity: 1; }

/* Section separator: thin line between sidebar sections */
.sidebar-section + .sidebar-section .sidebar-section-title {
    border-top: 1px solid rgba(255,255,255,.04);
    padding-top: .875rem;
    margin-top: .25rem;
}

/* ---------- Sub-nav pill polish + animated underline ---------- */
.app-subnav a { position: relative; }
.app-subnav a::after {
    content: '';
    position: absolute;
    left: 12px; right: 12px; bottom: -6px;
    height: 2px;
    background: var(--brand-600);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .18s ease;
}
.app-subnav a.active { background: var(--brand-50); color: var(--brand-700); }
.app-subnav a.active::after { transform: scaleX(1); }

/* ---------- Topbar: subtle bottom shadow on scroll (works with plain CSS) ---------- */
.app-topbar { box-shadow: 0 1px 0 rgba(15,23,42,.04); }

/* ---------- Table refinement: better action buttons, comfortable rhythm ---------- */
.table td .btn.btn-sm,
.table td .btn.btn-outline-secondary {
    padding: .25rem .5rem;
    font-size: 12px;
    border-radius: 6px;
    opacity: .85;
    transition: opacity .15s, background .15s, border-color .15s;
}
.table tbody tr:hover td .btn { opacity: 1; }
.table td .btn.btn-outline-secondary:hover { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-700); }

/* Column-first-child spacing */
.table thead th:first-child,
.table tbody td:first-child { padding-left: 1.25rem; }
.table thead th:last-child,
.table tbody td:last-child   { padding-right: 1.25rem; }

/* ---------- Form focus glow refinement ---------- */
.form-control:focus,
.form-select:focus,
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(99,102,241,.15), 0 1px 2px rgba(15,23,42,.06);
    border-color: var(--brand-500);
}

/* ---------- Enhanced empty state (icon in a soft badge) ---------- */
.empty-state {
    padding: 3rem 1.5rem;
}
.empty-state i {
    width: 56px; height: 56px;
    background: var(--slate-100);
    color: var(--slate-400);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: .75rem;
}

/* ---------- Refined dropdown menu entrance ---------- */
.dropdown-menu {
    transform-origin: top right;
    animation: dropIn .16s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes dropIn {
    0%   { opacity: 0; transform: translateY(-4px) scale(.98); }
    100% { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ---------- Page title: optional subtitle + trailing meta line ---------- */
.page-title { display: flex; align-items: center; gap: .625rem; }
.page-title .badge { text-transform: none; font-size: 11px; }

/* ---------- Refined breadcrumb ---------- */
.breadcrumb .sep { font-size: 11px; }
.breadcrumb li.current { color: var(--slate-900); }

/* ---------- Softer body scroll (all major browsers) ---------- */
html { scroll-behavior: smooth; }

/* ---------- Focus-visible only on keyboard (removes ring on mouse click) ---------- */
:focus:not(:focus-visible) { outline: none; box-shadow: none; }

/* ---------- Reduced motion: respect user preference ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =============================================================================
   BEAUTIFICATION LAYER v2 - added 2026-07-19
     - Slow-panning gradient orbs behind auth pages
     - Floating top-right toast style for alerts
     - Skeleton row utility for tables that are still loading
     - .is-loading state on any button (inline spinner, disabled)
     - Table row hover pulse + shadow lift
     - Sidebar nav item elegant hover with icon slide
     - Improved dashboard "meta" line
     - Progress bar utility (upload / task progress)
   ============================================================================= */

/* --- Login backdrop: three slow-drifting radial orbs behind the card --- */
.auth-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.auth-orb {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
    will-change: transform;
}
.auth-orb-1 {
    width: 540px; height: 540px;
    top: -8%; left: -6%;
    background: radial-gradient(closest-side, #6366f1, transparent 70%);
    animation: orbDrift1 22s ease-in-out infinite alternate;
}
.auth-orb-2 {
    width: 460px; height: 460px;
    top: 40%; right: -8%;
    background: radial-gradient(closest-side, #0ea5e9, transparent 70%);
    animation: orbDrift2 26s ease-in-out infinite alternate;
}
.auth-orb-3 {
    width: 380px; height: 380px;
    bottom: -12%; left: 30%;
    background: radial-gradient(closest-side, #a855f7, transparent 70%);
    animation: orbDrift3 30s ease-in-out infinite alternate;
}
@keyframes orbDrift1 { to { transform: translate3d( 60px,  40px, 0) scale(1.08); } }
@keyframes orbDrift2 { to { transform: translate3d(-70px,  20px, 0) scale(1.05); } }
@keyframes orbDrift3 { to { transform: translate3d( 40px, -50px, 0) scale(1.10); } }
.auth-container { position: relative; z-index: 1; }
.auth-card {
    /* Refined glass-morphism polish over the animated backdrop */
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.5);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.5), 0 12px 24px -8px rgba(15,23,42,.35);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
}

/* --- Toast: turn the in-page alert into a floating top-right notification when opted in via .toast-fixed --- */
.toast-fixed {
    position: fixed;
    top: 74px;
    right: 20px;
    min-width: 280px;
    max-width: 420px;
    z-index: 60;
    animation: toastIn .32s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes toastIn {
    0%   { opacity: 0; transform: translateX(20px) scale(.98); }
    100% { opacity: 1; transform: translateX(0)    scale(1);   }
}
@keyframes toastOut {
    0%   { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(20px); }
}

/* --- Skeleton row for tables while data loads (used by JS to inject placeholder rows) --- */
.skeleton-row td {
    padding: .75rem 1rem;
}
.skeleton-row .skeleton {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--slate-100) 0%, var(--slate-200) 40%, var(--slate-100) 80%);
    background-size: 200% 100%;
    animation: skelShimmer 1.4s linear infinite;
}
.skeleton-row .skeleton.w-60 { width: 60%; }
.skeleton-row .skeleton.w-40 { width: 40%; }
.skeleton-row .skeleton.w-80 { width: 80%; }
@keyframes skelShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- .btn.is-loading: inline spinner + disabled interaction --- */
.btn.is-loading {
    pointer-events: none;
    color: transparent !important;
    position: relative;
}
.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 14px; height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: #fff;
    animation: btnSpin .65s linear infinite;
    opacity: .9;
}
.btn-outline-primary.is-loading::after,
.btn-outline-secondary.is-loading::after,
.btn-outline-danger.is-loading::after,
.btn-link.is-loading::after { color: var(--brand-600); }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* --- Table hover: tiny elevation + soft brand tint --- */
.table tbody tr {
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.table-hover tbody tr:hover {
    background: linear-gradient(90deg, rgba(99,102,241,.06), rgba(99,102,241,.02) 60%, transparent);
    box-shadow: inset 3px 0 0 var(--brand-500);
}

/* --- Sidebar hover polish: icon nudges right on hover --- */
.sidebar-nav .nav-item i { transition: transform .18s ease, color .18s ease, opacity .18s ease; }
.sidebar-nav .nav-item:hover i { transform: translateX(2px); }

/* --- Cards: elegant border sheen on hover (subtle top edge highlight) --- */
.card { position: relative; }
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,.35), transparent);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.card:hover::before { opacity: 1; }

/* --- Progress bar utility --- */
.progress {
    width: 100%;
    height: 8px;
    background: var(--slate-100);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--brand-600), var(--accent-500));
    border-radius: inherit;
    transition: width .3s cubic-bezier(.22,.61,.36,1);
    animation: progressStripe 1.2s linear infinite;
    background-size: 200% 100%;
}
@keyframes progressStripe {
    0%   { background-position: 200% 0; }
    100% { background-position:   0% 0; }
}

/* --- Definition list refinement --- */
dl.row dt { padding-right: 1rem; }
dl.row dd { font-weight: 500; }

/* --- Page-title micro polish (breathes) --- */
.page-title { line-height: 1.15; }
.page-title small { font-size: 12px; color: var(--slate-500); font-weight: 500; margin-left: .5rem; }

/* --- Refined focus ring on links inside content --- */
.app-content a:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: 4px; }

/* --- Small screens: shrink the auth orbs so mobile stays snappy --- */
@media (max-width: 640px) {
    .auth-orb-1 { width: 320px; height: 320px; }
    .auth-orb-2 { width: 280px; height: 280px; }
    .auth-orb-3 { width: 240px; height: 240px; }
    .toast-fixed { left: 12px; right: 12px; top: 66px; min-width: auto; max-width: none; }
}

/* --- Print: kill the animated backdrop --- */
@media print {
    .auth-orbs, .btn.is-loading::after { display: none !important; }
}
