/* DV SOFT typefaces (same as dvsoft.in), self-hosted: Inter for text, Sora for headings. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 600 800; font-display: swap; src: url('../fonts/sora-latin.woff2') format('woff2'); }

/* =====================================================================
   CORE design system — glass UI
   Tokens first; module stylesheets should use these variables.
   ===================================================================== */
:root {
    /* brand */
    --brand-50: #f8f1fb;
    --brand-100: #efe1f6;
    --brand-200: #e3cdee;
    --brand-400: #b47fd0;
    --brand-500: #7e3a99;
    --brand-600: #602874;
    --brand-700: #4a1d58;
    --brand-800: #3d1749;
    --brand-gradient: linear-gradient(135deg, #6e3285 0%, #602874 100%);
    --brand-gradient-hero: linear-gradient(120deg, #602874 0%, #d9294b 55%, #ea580c 100%);
    --accent-500: #ea580c;
    --accent-600: #c2410c;
    --brand-gradient-soft: linear-gradient(135deg, rgba(126, 58, 153, .14), rgba(96, 40, 116, .1));

    /* neutrals (slate) */
    --ink-900: #0b0f1a;
    --ink-800: #1f2330;
    --ink-700: #323642;
    --ink-500: #545a6b;
    --ink-400: #8a8d99;
    --ink-300: #c9c6bf;
    --ink-200: #e8e4dc;
    --ink-100: #f4f2ec;

    /* semantic */
    --success: #10b981;  --success-ink: #047857;
    --warning: #f59e0b;  --warning-ink: #b45309;
    --danger:  #f43f5e;  --danger-ink:  #be123c;
    --info:    #0f766e;  --info-ink:    #115e59;

    /* glass surfaces */
    --glass-bg: rgba(255, 255, 255, .94);
    --glass-bg-strong: rgba(255, 255, 255, .97);
    --glass-border: #e8e4dc;
    --glass-edge: #ece8e1;
    --glass-blur: blur(20px) saturate(140%);
    --shadow-sm: 0 0.3px 0.9px rgba(0, 0, 0, .07), 0 1.6px 3.6px rgba(0, 0, 0, .09);
    --shadow-md: 0 0.3px 0.9px rgba(0, 0, 0, .07), 0 1.6px 3.6px rgba(0, 0, 0, .09);
    --shadow-lg: 0 1.2px 3.6px rgba(0, 0, 0, .1), 0 6.4px 14.4px rgba(0, 0, 0, .13);
    --radius: 8px;
    --radius-sm: 4px;

    /* shell */
    --sidebar-width: 264px;
    --rail-width: 78px;
    --topbar-height: 64px;
    --sidebar-text: #aab4d0;

    /* compatibility aliases used by module stylesheets */
    --card-border: #e8e4dc;
    --app-bg: #faf8f4;
    --sidebar-bg: #0b1224;
    --sidebar-active: #7e3a99;

    /* bootstrap overrides */
    --bs-primary: #602874;
    --bs-primary-rgb: 96, 40, 116;
    --bs-link-color: #602874;
    --bs-link-color-rgb: 96, 40, 116;
    --bs-link-hover-color: #4a1d58;
    --bs-link-hover-color-rgb: 74, 29, 88;
    --bs-body-font-family: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    --font-display: 'Sora', 'Inter', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
    --bs-body-font-size: .925rem;
    --bs-body-color: #323642;
    --bs-emphasis-color: #0b0f1a;
    --bs-secondary-color: #545a6b;
    --bs-border-color: #e8e4dc;
    --bs-border-radius: 4px;
    --bs-border-radius-sm: 4px;
    --bs-border-radius-lg: 8px;
    --bs-success-rgb: 16, 185, 129;
    --bs-danger-rgb: 244, 63, 94;
    --bs-warning-rgb: 245, 158, 11;
    --bs-info-rgb: 15, 118, 110;
}

/* ---------------------------------------------------------------- base */
html, body { height: 100%; }
body { font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11'; -webkit-font-smoothing: antialiased; }
.app-body {
    color: var(--ink-700);
    background:
        radial-gradient(1100px 620px at -10% -10%, rgba(126, 58, 153, .22), transparent 60%),
        radial-gradient(900px 560px at 110% -5%, rgba(15, 118, 110, .18), transparent 60%),
        radial-gradient(900px 700px at 60% 115%, rgba(190, 18, 60, .18), transparent 60%),
        radial-gradient(700px 500px at 35% 45%, rgba(236, 72, 153, .05), transparent 60%),
        linear-gradient(180deg, #f5f7fc 0%, #eef1f8 100%);
    background-attachment: fixed;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink-900); letter-spacing: -.01em; }
a { text-decoration: none; }
a:hover { text-decoration: none; }
::selection { background: rgba(126, 58, 153, .22); }
.text-muted { color: var(--ink-500) !important; }
.text-primary { color: var(--brand-600) !important; }
.bg-primary { background: var(--brand-600) !important; }
.fw-semibold { font-weight: 600 !important; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .35) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- glass primitives */
.glass,
.card,
.filter-bar,
.stat-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.glass-strong { background: var(--glass-bg-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }

/* ---------------------------------------------------------------- buttons */
.btn { border-radius: var(--radius-sm); font-weight: 500; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    --bs-btn-bg: #602874; --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: #4a1d58; --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: #3d1749; --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-bg: #7e3a99; --bs-btn-disabled-border-color: transparent;
    background-image: var(--brand-gradient);
    box-shadow: 0 6px 16px -6px rgba(96, 40, 116, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background-image: linear-gradient(135deg, #6e3285 0%, #4a1d58 50%, #4a1d58 100%); box-shadow: 0 10px 22px -8px rgba(96, 40, 116, .6); }
.btn-outline-primary { --bs-btn-color: #602874; --bs-btn-border-color: rgba(96, 40, 116, .45); --bs-btn-hover-bg: #602874; --bs-btn-hover-border-color: #602874; --bs-btn-active-bg: #4a1d58; --bs-btn-active-border-color: #4a1d58; background: rgba(255, 255, 255, .5); }
.btn-outline-secondary { --bs-btn-color: #475569; --bs-btn-border-color: #cbd5e1; --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-color: #0f172a; --bs-btn-hover-border-color: #cbd5e1; --bs-btn-active-bg: #e2e8f0; --bs-btn-active-color: #0f172a; background: rgba(255, 255, 255, .55); }
.btn-light { --bs-btn-bg: rgba(255, 255, 255, .7); --bs-btn-border-color: rgba(15, 23, 42, .08); --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: rgba(15, 23, 42, .12); }
.btn-success { --bs-btn-bg: #10b981; --bs-btn-border-color: #10b981; --bs-btn-hover-bg: #059669; --bs-btn-hover-border-color: #059669; --bs-btn-active-bg: #047857; }
.btn-danger { --bs-btn-bg: #f43f5e; --bs-btn-border-color: #f43f5e; --bs-btn-hover-bg: #e11d48; --bs-btn-hover-border-color: #e11d48; --bs-btn-active-bg: #be123c; }
.btn-warning { --bs-btn-bg: #f59e0b; --bs-btn-border-color: #f59e0b; --bs-btn-hover-bg: #d97706; --bs-btn-hover-border-color: #d97706; --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
.btn-outline-danger { --bs-btn-color: #e11d48; --bs-btn-border-color: rgba(225, 29, 72, .4); --bs-btn-hover-bg: #e11d48; --bs-btn-hover-border-color: #e11d48; background: rgba(255, 255, 255, .5); }
.btn-outline-success { --bs-btn-color: #059669; --bs-btn-border-color: rgba(5, 150, 105, .4); --bs-btn-hover-bg: #059669; --bs-btn-hover-border-color: #059669; background: rgba(255, 255, 255, .5); }
.btn-link { --bs-btn-color: #602874; --bs-btn-hover-color: #4a1d58; }

.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 12px; font-size: 1.15rem; color: var(--ink-500); border: 1px solid transparent; }
.btn-icon:hover { background: rgba(255, 255, 255, .8); border-color: var(--glass-edge); color: var(--ink-900); }
.btn.btn-sm.btn-icon { width: 30px; height: 30px; font-size: .9rem; border-radius: 8px; }

/* ---------------------------------------------------------------- forms */
.form-control, .form-select {
    background-color: rgba(255, 255, 255, .82);
    border-color: #dbe2ec;
    border-radius: var(--radius-sm);
    color: var(--ink-800);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form-control:hover, .form-select:hover { border-color: #c5cfdd; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: #c9a6dc; box-shadow: 0 0 0 4px rgba(126, 58, 153, .15); }
.form-control::placeholder { color: var(--ink-400); }
.form-label { font-weight: 500; color: var(--ink-700); font-size: .875rem; margin-bottom: .35rem; }
.form-text { color: var(--ink-500); }
.form-check-input { border-color: #cbd5e1; }
.form-check-input:checked { background-color: #602874; border-color: #602874; }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(126, 58, 153, .15); border-color: #c9a6dc; }
.form-range::-webkit-slider-thumb { background: #602874; }
.form-range::-moz-range-thumb { background: #602874; }
.input-group-text { background: rgba(241, 245, 249, .8); border-color: #dbe2ec; color: var(--ink-500); }

/* ---------------------------------------------------------------- shell */
.app-wrapper { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: var(--sidebar-width); transition: margin-left .25s cubic-bezier(.4, 0, .2, 1); }
.app-content { flex: 1; padding: 1.5rem 1.75rem 2rem; }
.app-footer { display: flex; justify-content: space-between; padding: .9rem 1.75rem; border-top: 1px solid var(--glass-edge); color: var(--ink-400); }

/* sidebar */
.app-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width); z-index: 1040;
    display: flex; flex-direction: column; color: var(--sidebar-text);
    background:
        radial-gradient(420px 320px at 0% 0%, rgba(126, 58, 153, .28), transparent 70%),
        radial-gradient(360px 300px at 100% 100%, rgba(190, 18, 60, .22), transparent 70%),
        linear-gradient(180deg, #0b1224 0%, #111a38 55%, #1a1747 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 8px 0 30px -18px rgba(15, 23, 42, .6);
    transition: width .25s cubic-bezier(.4, 0, .2, 1), transform .25s cubic-bezier(.4, 0, .2, 1);
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem; height: var(--topbar-height); color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .06); flex-shrink: 0; overflow: hidden; }
.sidebar-brand:hover { color: #fff; }
.sidebar-logo { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; background: var(--brand-gradient); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff; box-shadow: 0 8px 18px -6px rgba(126, 58, 153, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.sidebar-brand-text strong { font-weight: 800; font-size: 1.1rem; letter-spacing: .03em; }
.sidebar-brand-text small { font-size: .68rem; color: #8f9bbf; font-weight: 500; letter-spacing: .02em; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .6rem .75rem 1rem; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); }

/* sections: heading doubles as the accordion toggle (HMS style) */
.nav-section + .nav-section { margin-top: .35rem; }
.nav-section-title {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: .6rem .75rem .4rem; background: none; border: 0; border-radius: 9px;
    font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: #6f7a9c; white-space: nowrap; transition: color .15s, background-color .15s;
}
.nav-section-title:hover { color: #dbe2f5; background: rgba(255, 255, 255, .04); }
.nav-section-title:focus-visible { outline: 2px solid rgba(201, 166, 220, .7); outline-offset: -2px; }
.nav-section[data-has-active] > .nav-section-title { color: #e3cdee; }
.nav-section-caret { font-size: .68rem; transition: transform .2s ease; }
.nav-section-title[aria-expanded="false"] .nav-section-caret { transform: rotate(-90deg); }
.nav-section-items { list-style: none; margin: 0; padding: .1rem 0 .25rem; }

.sidebar-link {
    display: flex; align-items: center; gap: .8rem; margin: 2px 0; padding: .55rem .8rem;
    color: var(--sidebar-text); text-decoration: none; font-size: .875rem; font-weight: 500;
    border-radius: 11px; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s;
}
.sidebar-icon { width: 22px; flex: 0 0 22px; text-align: center; font-size: 1.05rem; opacity: .9; }
.sidebar-text { overflow: hidden; text-overflow: ellipsis; }
.sidebar-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(126, 58, 153, .95), rgba(126, 58, 153, .88));
    box-shadow: 0 10px 22px -10px rgba(126, 58, 153, .9), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.sidebar-link.active .sidebar-icon { opacity: 1; }

.sidebar-footer { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .06); overflow: hidden; flex-shrink: 0; text-decoration: none; transition: background .15s; }
.sidebar-footer:hover { background: rgba(255, 255, 255, .04); }
.sidebar-user { min-width: 0; }
.sidebar-user-name { color: #fff; font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .74rem; color: #8f9bbf; white-space: nowrap; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 1035; }

/* collapsed = narrow icon rail, every page icon visible; labels become tooltips (desktop only) */
@media (min-width: 992px) {
    body.sidebar-collapsed .app-sidebar { width: var(--rail-width); }
    body.sidebar-collapsed .app-main { margin-left: var(--rail-width); }
    body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .sidebar-text,
    body.sidebar-collapsed .sidebar-user { display: none; }
    body.sidebar-collapsed .sidebar-nav { padding-left: .7rem; padding-right: .7rem; }
    /* section heading turns into a divider rule; the accordion is meaningless when only icons show */
    body.sidebar-collapsed .nav-section-title { display: block; height: 1px; padding: 0; margin: .65rem .55rem; font-size: 0; background: rgba(255, 255, 255, .09); pointer-events: none; }
    body.sidebar-collapsed .nav-section-title > * { display: none; }
    body.sidebar-collapsed .nav-section:first-child .nav-section-title { background: transparent; margin-top: .2rem; }
    body.sidebar-collapsed .nav-section-items { display: block !important; height: auto !important; overflow: visible !important; padding: 0; }
    body.sidebar-collapsed .sidebar-link { justify-content: center; padding: .62rem 0; margin: 3px 0; }
    body.sidebar-collapsed .sidebar-icon { font-size: 1.15rem; }
    body.sidebar-collapsed .sidebar-footer { justify-content: center; padding: .9rem 0; }
}

/* topbar */
.app-navbar {
    position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .75rem;
    height: var(--topbar-height); padding: 0 1.75rem;
    background: rgba(248, 250, 252, .7);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-edge);
}
.navbar-title { font-weight: 600; font-size: 1rem; color: var(--ink-800); }
.navbar-search { position: relative; }
.btn-user { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .22rem .7rem .22rem .22rem; border: 1px solid var(--glass-edge); background: rgba(255, 255, 255, .6); color: var(--ink-800); font-weight: 500; }
.btn-user:hover, .btn-user.show { background: #fff; color: var(--ink-900); border-color: rgba(15, 23, 42, .1); }
.notif-badge { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: linear-gradient(135deg, #fb7185, #e11d48); color: #fff; font-size: .66rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #f8fafc; }

/* dropdowns, modals, toasts */
.dropdown-menu {
    --bs-dropdown-link-active-bg: #602874;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-radius: 14px; box-shadow: var(--shadow-lg); padding: .4rem;
}
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; color: var(--ink-700); font-size: .88rem; }
.dropdown-item:hover { background: rgba(126, 58, 153, .08); color: var(--ink-900); }
.dropdown-header { color: var(--ink-400); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.modal-content { border: 1px solid var(--glass-border); background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--glass-edge); }
.modal-backdrop.show { opacity: .35; }
.toast { border-radius: 12px; box-shadow: var(--shadow-lg); }
.popover, .tooltip-inner { border-radius: 8px; }
.tooltip-inner { background: rgba(15, 23, 42, .92); }

.notif-menu { width: 380px; max-width: 92vw; padding: 0; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--glass-edge); }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item { display: flex; gap: .75rem; padding: .75rem 1rem; text-decoration: none; color: inherit; border-bottom: 1px solid rgba(15, 23, 42, .04); transition: background .15s; }
.notif-item:hover { background: rgba(126, 58, 153, .06); color: inherit; }
.notif-item.unread { background: rgba(126, 58, 153, .07); }
.notif-icon { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.notif-foot { display: block; text-align: center; padding: .7rem; font-size: .85rem; font-weight: 500; border-top: 1px solid var(--glass-edge); }
.notif-foot:hover { background: rgba(126, 58, 153, .05); }
.notif-unread { background: rgba(126, 58, 153, .06); }

/* ---------------------------------------------------------------- page elements */
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.page-title { font-size: 1.55rem; font-weight: 750; margin: 0; color: var(--ink-900); letter-spacing: -.02em; }
.page-subtitle { font-size: .9rem; color: var(--ink-500); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { --bs-breadcrumb-divider-color: var(--ink-300); --bs-breadcrumb-item-active-color: var(--ink-500); font-size: .8rem; }
.breadcrumb a { color: var(--ink-500); }
.breadcrumb a:hover { color: var(--brand-600); }

.card { border-radius: var(--radius); --bs-card-bg: transparent; --bs-card-cap-bg: transparent; --bs-card-border-color: transparent; }
.card-header { background: transparent; border-bottom: 1px solid var(--glass-edge); font-weight: 600; padding: 1rem 1.25rem; color: var(--ink-900); border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-header .card-title { margin: 0; font-size: 1rem; font-weight: 650; }
.card-footer { background: transparent; border-top: 1px solid var(--glass-edge); border-radius: 0 0 var(--radius) var(--radius) !important; }
.card-body { padding: 1.25rem; }
.card .card { box-shadow: none; background: rgba(255, 255, 255, .55); border-color: rgba(15, 23, 42, .06); }
.bg-white, .bg-body { background-color: rgba(255, 255, 255, .7) !important; }
.bg-light { background-color: rgba(241, 245, 249, .7) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: rgba(15, 23, 42, .08) !important; }

.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: rgba(15, 23, 42, .06); --bs-list-group-action-hover-bg: rgba(126, 58, 153, .05); --bs-list-group-action-active-bg: rgba(126, 58, 153, .1); --bs-list-group-active-bg: #602874; --bs-list-group-active-border-color: #602874; }

/* tables */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: rgba(126, 58, 153, .045); --bs-table-striped-bg: rgba(248, 250, 252, .55); --bs-table-border-color: rgba(15, 23, 42, .06); color: var(--ink-700); }
.table > :not(caption) > * > * { padding: .75rem .9rem; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-500); font-weight: 650; border-bottom: 1px solid rgba(15, 23, 42, .08); white-space: nowrap; background: rgba(248, 250, 252, .65); }
.table td { vertical-align: middle; }
.table tfoot td, .table tfoot th { font-weight: 650; color: var(--ink-900); background: rgba(248, 250, 252, .6); }
.card > .table-responsive > .table, .card > .table { margin-bottom: 0; }
.card > .table-responsive:first-child .table thead th:first-child, .card > .table:first-child thead th:first-child { border-top-left-radius: var(--radius); }
.card > .table-responsive:first-child .table thead th:last-child, .card > .table:first-child thead th:last-child { border-top-right-radius: var(--radius); }
.table-light { --bs-table-bg: rgba(248, 250, 252, .65); }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { color: var(--brand-600); }
tr[data-href] { cursor: pointer; }

/* nav tabs & pills */
.nav-tabs { border-bottom-color: rgba(15, 23, 42, .08); gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--ink-500); font-weight: 500; padding: .6rem .9rem; border-radius: 0; background: transparent; }
.nav-tabs .nav-link:hover { color: var(--ink-900); border-bottom-color: var(--ink-200); }
.nav-tabs .nav-link.active { color: var(--brand-600); font-weight: 600; background: transparent; border-bottom-color: var(--brand-600); }
.nav-pills { --bs-nav-pills-link-active-bg: #602874; gap: .25rem; }
.nav-pills .nav-link { border-radius: 10px; color: var(--ink-500); font-weight: 500; }
.nav-pills .nav-link:hover { background: rgba(255, 255, 255, .65); color: var(--ink-900); }
.nav-pills .nav-link.active { background-image: var(--brand-gradient); box-shadow: 0 6px 16px -8px rgba(96, 40, 116, .6); }

/* pagination */
.pagination { --bs-pagination-bg: rgba(255, 255, 255, .65); --bs-pagination-border-color: rgba(15, 23, 42, .08); --bs-pagination-color: var(--ink-700); --bs-pagination-hover-bg: #fff; --bs-pagination-hover-color: var(--brand-600); --bs-pagination-active-bg: #602874; --bs-pagination-active-border-color: #602874; --bs-pagination-focus-box-shadow: 0 0 0 4px rgba(126, 58, 153, .15); gap: .25rem; }
.pagination .page-link { border-radius: 9px !important; }

/* alerts */
.alert { border-radius: 14px; border: 1px solid transparent; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--shadow-sm); }
.alert-success { background: rgba(236, 253, 245, .85); border-color: rgba(16, 185, 129, .25); color: #065f46; }
.alert-danger { background: rgba(255, 241, 242, .88); border-color: rgba(244, 63, 94, .25); color: #9f1239; }
.alert-warning { background: rgba(255, 251, 235, .88); border-color: rgba(245, 158, 11, .3); color: #92400e; }
.alert-info { background: rgba(236, 254, 255, .85); border-color: rgba(15, 118, 110, .25); color: #134e4a; }
.alert-primary { background: rgba(248, 241, 251, .88); border-color: rgba(126, 58, 153, .25); color: #3d1749; }
.alert-secondary, .alert-light { background: rgba(248, 250, 252, .8); border-color: rgba(15, 23, 42, .08); color: var(--ink-700); }

/* badges: status pills are soft-tinted, solid colours reserved for counters */
.badge { font-weight: 600; letter-spacing: .01em; }
.badge.rounded-pill.text-bg-primary   { background: rgba(126, 58, 153, .13) !important; color: #4a1d58 !important; box-shadow: inset 0 0 0 1px rgba(126, 58, 153, .22); }
.badge.rounded-pill.text-bg-success   { background: rgba(16, 185, 129, .13) !important; color: #047857 !important; box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .25); }
.badge.rounded-pill.text-bg-warning   { background: rgba(245, 158, 11, .15) !important; color: #b45309 !important; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .28); }
.badge.rounded-pill.text-bg-danger    { background: rgba(244, 63, 94, .12) !important; color: #be123c !important; box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .24); }
.badge.rounded-pill.text-bg-info      { background: rgba(15, 118, 110, .13) !important; color: #115e59 !important; box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .25); }
.badge.rounded-pill.text-bg-secondary { background: rgba(100, 116, 139, .12) !important; color: #475569 !important; box-shadow: inset 0 0 0 1px rgba(100, 116, 139, .2); }
.badge.rounded-pill.text-bg-light     { background: rgba(241, 245, 249, .9) !important; color: #475569 !important; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08); }
.badge.rounded-pill.text-bg-dark      { background: rgba(15, 23, 42, .85) !important; color: #fff !important; }
.text-bg-success { background-color: #10b981 !important; }
.text-bg-danger { background-color: #f43f5e !important; }
.text-bg-warning { background-color: #f59e0b !important; color: #fff !important; }
.text-bg-info { background-color: #0f766e !important; color: #fff !important; }
.text-bg-primary { background-color: #602874 !important; }

.badge-priority { font-weight: 600; border-radius: 999px; padding: .35em .7em; }
.priority-low { background: rgba(100, 116, 139, .12); color: #475569; }
.priority-medium { background: rgba(15, 118, 110, .13); color: #115e59; }
.priority-high { background: rgba(245, 158, 11, .16); color: #b45309; }
.priority-critical { background: rgba(244, 63, 94, .14); color: #be123c; }

/* progress */
.progress { background: rgba(148, 163, 184, .2); border-radius: 999px; overflow: hidden; }
.progress-bar { border-radius: 999px; }
.progress-bar.bg-primary { background: var(--brand-gradient) !important; }
.progress-bar.bg-success { background: linear-gradient(90deg, #34d399, #10b981) !important; }
.progress-bar.bg-warning { background: linear-gradient(90deg, #fbbf24, #f59e0b) !important; }
.progress-bar.bg-danger { background: linear-gradient(90deg, #fb7185, #f43f5e) !important; }
.progress-bar.bg-info { background: linear-gradient(90deg, #2dd4bf, #0f766e) !important; }

/* avatars */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 650; flex-shrink: 0; letter-spacing: .02em; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 4px 10px -4px rgba(15, 23, 42, .35); background-image: linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0)); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------------------------------------------------------------- stat cards */
.stat-card { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; border-radius: var(--radius); text-decoration: none; color: inherit; height: 100%; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease; }
.stat-card::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, var(--stat-glow, rgba(126, 58, 153, .14)), transparent 70%); pointer-events: none; }
.stat-icon { width: 50px; height: 50px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.stat-primary   { --stat-glow: rgba(126, 58, 153, .16); }  .stat-primary .stat-icon   { background: linear-gradient(135deg, rgba(126, 58, 153, .18), rgba(190, 18, 60, .14)); color: #602874; }
.stat-success   { --stat-glow: rgba(16, 185, 129, .16); }  .stat-success .stat-icon   { background: linear-gradient(135deg, rgba(16, 185, 129, .18), rgba(52, 211, 153, .12)); color: #059669; }
.stat-warning   { --stat-glow: rgba(245, 158, 11, .18); }  .stat-warning .stat-icon   { background: linear-gradient(135deg, rgba(245, 158, 11, .2), rgba(251, 191, 36, .12)); color: #d97706; }
.stat-danger    { --stat-glow: rgba(244, 63, 94, .15); }   .stat-danger .stat-icon    { background: linear-gradient(135deg, rgba(244, 63, 94, .17), rgba(251, 113, 133, .12)); color: #e11d48; }
.stat-info      { --stat-glow: rgba(15, 118, 110, .16); }   .stat-info .stat-icon      { background: linear-gradient(135deg, rgba(15, 118, 110, .18), rgba(45, 212, 191, .12)); color: #0d6b63; }
.stat-secondary { --stat-glow: rgba(100, 116, 139, .14); } .stat-secondary .stat-icon { background: linear-gradient(135deg, rgba(100, 116, 139, .16), rgba(148, 163, 184, .12)); color: #475569; }
.stat-body { min-width: 0; position: relative; z-index: 1; }
.stat-value { font-size: 1.6rem; font-weight: 750; line-height: 1.1; color: var(--ink-900); letter-spacing: -.02em; }
.stat-label { font-size: .8rem; color: var(--ink-500); margin-top: .2rem; font-weight: 500; }
.stat-hint { font-size: .74rem; color: var(--ink-400); margin-top: .1rem; }
.stat-arrow { position: absolute; top: .8rem; right: .9rem; font-size: .9rem; color: var(--ink-300); transition: transform .18s ease, color .18s ease; }

/* ---------------------------------------------------------------- clickable cards (href / data-href) */
a.stat-card, a.card, .card-link-block, [data-href] { cursor: pointer; }
a.stat-card:hover, a.card:hover, .card[data-href]:hover, .stat-card[data-href]:hover, .card-link-block:hover, .clickable-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, .8);
    border-color: rgba(126, 58, 153, .28);
    box-shadow: 0 18px 38px -18px rgba(96, 40, 116, .45), inset 0 1px 0 rgba(255, 255, 255, .7);
    color: inherit;
}
a.stat-card:hover .stat-arrow, .stat-card[data-href]:hover .stat-arrow { color: var(--brand-600); transform: translate(2px, -2px); }
a.stat-card:focus-visible, a.card:focus-visible, [data-href]:focus-visible { outline: 3px solid rgba(126, 58, 153, .45); outline-offset: 2px; }
a.card, .card[data-href], .card-link-block, .clickable-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease; color: inherit; }

/* ---------------------------------------------------------------- misc components */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-500); }
.empty-state > i { font-size: 2.4rem; display: inline-flex; width: 76px; height: 76px; align-items: center; justify-content: center; margin-bottom: .9rem; border-radius: 22px; color: var(--brand-500); background: var(--brand-gradient-soft); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.empty-state h5 { color: var(--ink-800); font-weight: 650; }

.error-page { text-align: center; padding: 4rem 1rem; }
.error-code { font-size: 6rem; font-weight: 850; line-height: 1; letter-spacing: -.04em; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .85; margin-bottom: .5rem; }

.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px dashed rgba(15, 23, 42, .08); font-size: .875rem; }
.activity-list li:last-child { border-bottom: 0; }
.activity-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; margin-top: .4rem; box-shadow: 0 0 0 3px rgba(255, 255, 255, .8); }

.filter-bar { border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1.25rem; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 140px; }
.filter-bar .form-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); }

.detail-list dt { color: var(--ink-500); font-weight: 500; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.detail-list dd { margin-bottom: .8rem; color: var(--ink-800); }

.min-w-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }
.chart-box { position: relative; height: 280px; }
.chart-box-sm { position: relative; height: 200px; }
hr { border-color: rgba(15, 23, 42, .1); opacity: 1; }
code { color: #be185d; }

/* kanban (tasks board / sales pipeline) */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.kanban-col { flex: 0 0 290px; background: rgba(255, 255, 255, .42); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid rgba(255, 255, 255, .6); border-radius: var(--radius); padding: .8rem; max-height: calc(100vh - 230px); display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.kanban-col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); padding: .2rem .25rem .7rem; }
.kanban-cards { overflow-y: auto; min-height: 70px; display: flex; flex-direction: column; gap: .6rem; padding: 2px; }
.kanban-card { background: rgba(255, 255, 255, .88); border: 1px solid rgba(15, 23, 42, .06); border-radius: 12px; padding: .8rem; font-size: .875rem; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; }
.kanban-card:hover { box-shadow: 0 12px 24px -14px rgba(96, 40, 116, .5); border-color: rgba(126, 58, 153, .25); transform: translateY(-1px); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; }
.kanban-col.drag-over { outline: 2px dashed #c9a6dc; outline-offset: -2px; background: rgba(248, 241, 251, .6); }

/* ---------------------------------------------------------------- auth */
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(900px 600px at 10% 10%, rgba(126, 58, 153, .55), transparent 60%),
        radial-gradient(800px 600px at 90% 90%, rgba(15, 118, 110, .35), transparent 60%),
        radial-gradient(700px 500px at 80% 10%, rgba(190, 18, 60, .45), transparent 60%),
        linear-gradient(135deg, #0b1224 0%, #1a0e20 100%);
    background-attachment: fixed;
}
.auth-wrapper { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 430px; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); border: 1px solid rgba(255, 255, 255, .6); border-radius: 22px; padding: 2.25rem; box-shadow: 0 30px 70px -20px rgba(2, 6, 23, .6), inset 0 1px 0 rgba(255, 255, 255, .8); }
.auth-brand { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.75rem; }
.auth-logo { width: 50px; height: 50px; border-radius: 14px; background: var(--brand-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 12px 24px -10px rgba(126, 58, 153, .9); }
.auth-brand-name { font-weight: 800; font-size: 1.4rem; color: var(--ink-900); line-height: 1.1; letter-spacing: .02em; }
.auth-brand-sub { font-size: .8rem; color: var(--ink-500); }
.auth-title { font-size: 1.4rem; font-weight: 750; margin-bottom: .25rem; letter-spacing: -.01em; }
.auth-footer { margin-top: 1.25rem; color: rgba(255, 255, 255, .7) !important; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 991.98px) {
    .app-main { margin-left: 0; }
    .app-sidebar { transform: translateX(-100%); }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .app-content { padding: 1rem; }
    .app-navbar { padding: 0 1rem; }
    .app-footer { padding: .8rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
    .app-sidebar, .app-navbar, .app-footer, .page-actions, .btn, .filter-bar { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .app-content { padding: 0; }
    .app-body { background: #fff; }
    .card, .stat-card { box-shadow: none; border: 1px solid #ccc; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* lift a glass card above its siblings while one of its dropdowns is open */
.dropdown-raised, .card:has(> * .dropdown-menu.show), .filter-bar:has(.dropdown-menu.show) { position: relative; z-index: 1055; }

/* =====================================================================
   Dark theme (navbar moon/sun toggle, persisted as coms.theme)
   ===================================================================== */
[data-bs-theme="dark"] {
    --ink-900: #f1f5f9; --ink-800: #e2e8f0; --ink-700: #cbd5e1; --ink-500: #94a3b8;
    --ink-400: #7c8aa5; --ink-300: #475569; --ink-200: #334155; --ink-100: #1e293b;
    --glass-bg: rgba(17, 24, 39, .58);
    --glass-bg-strong: rgba(17, 24, 39, .9);
    --glass-border: rgba(255, 255, 255, .08);
    --glass-edge: rgba(255, 255, 255, .07);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 32px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 56px -18px rgba(0, 0, 0, .75);
    --card-border: rgba(255, 255, 255, .08);
    --brand-gradient-soft: linear-gradient(135deg, rgba(126, 58, 153, .22), rgba(190, 18, 60, .18));
    --bs-body-color: #cbd5e1;
    --bs-emphasis-color: #f8fafc;
    --bs-secondary-color: #94a3b8;
    --bs-border-color: rgba(255, 255, 255, .1);
    --bs-body-bg: #0b1020;
    --bs-link-color: #c9a6dc;
    --bs-link-color-rgb: 201, 166, 220;
    --bs-link-hover-color: #e3cdee;
    --bs-link-hover-color-rgb: 227, 205, 238;
    --brand-600: #b47fd0;
    --brand-700: #c9a6dc;
    --brand-500: #c9a6dc;
    color-scheme: dark;
}
[data-bs-theme="dark"] .app-body {
    background:
        radial-gradient(1100px 620px at -10% -10%, rgba(126, 58, 153, .22), transparent 60%),
        radial-gradient(900px 560px at 110% -5%, rgba(15, 118, 110, .12), transparent 60%),
        radial-gradient(900px 700px at 60% 115%, rgba(190, 18, 60, .2), transparent 60%),
        linear-gradient(180deg, #0b1020 0%, #0d1328 100%);
    background-attachment: fixed;
}
[data-bs-theme="dark"] .glass,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .filter-bar,
[data-bs-theme="dark"] .stat-card { box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .04); }
[data-bs-theme="dark"] .text-primary { color: #c9a6dc !important; }
[data-bs-theme="dark"] .app-navbar { background: rgba(11, 16, 32, .7); }
[data-bs-theme="dark"] .btn-user { background: rgba(255, 255, 255, .05); color: var(--ink-800); }
[data-bs-theme="dark"] .btn-user:hover, [data-bs-theme="dark"] .btn-user.show { background: rgba(255, 255, 255, .1); color: #fff; }
[data-bs-theme="dark"] .btn-icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
[data-bs-theme="dark"] .notif-badge { box-shadow: 0 0 0 2px #0b1020; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #c9a6dc; --bs-btn-border-color: rgba(201, 166, 220, .4); background: rgba(255, 255, 255, .03); }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #cbd5e1; --bs-btn-border-color: rgba(255, 255, 255, .16); --bs-btn-hover-bg: rgba(255, 255, 255, .08); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: rgba(255, 255, 255, .22); --bs-btn-active-bg: rgba(255, 255, 255, .12); --bs-btn-active-color: #fff; background: rgba(255, 255, 255, .03); }
[data-bs-theme="dark"] .btn-outline-danger, [data-bs-theme="dark"] .btn-outline-success { background: rgba(255, 255, 255, .03); }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: rgba(255, 255, 255, .06); --bs-btn-color: #e2e8f0; --bs-btn-border-color: rgba(255, 255, 255, .1); --bs-btn-hover-bg: rgba(255, 255, 255, .12); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: rgba(255, 255, 255, .16); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: rgba(15, 23, 42, .65); border-color: rgba(255, 255, 255, .12); color: #e2e8f0; }
[data-bs-theme="dark"] .form-control:hover, [data-bs-theme="dark"] .form-select:hover { border-color: rgba(255, 255, 255, .2); }
[data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus { background-color: rgba(15, 23, 42, .85); border-color: #b47fd0; }
[data-bs-theme="dark"] .form-control::placeholder { color: #64748b; }
[data-bs-theme="dark"] .form-check-input { border-color: rgba(255, 255, 255, .25); background-color: rgba(15, 23, 42, .6); }
[data-bs-theme="dark"] .form-check-input:checked { background-color: #7e3a99; border-color: #7e3a99; }
[data-bs-theme="dark"] .input-group-text { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); color: #94a3b8; }
[data-bs-theme="dark"] .dropdown-item:hover { background: rgba(126, 58, 153, .18); color: #fff; }
[data-bs-theme="dark"] .modal-content { background: rgba(17, 24, 39, .92); }
[data-bs-theme="dark"] .notif-item { border-bottom-color: rgba(255, 255, 255, .05); }
[data-bs-theme="dark"] .notif-item:hover { background: rgba(126, 58, 153, .14); }
[data-bs-theme="dark"] .notif-item.unread, [data-bs-theme="dark"] .notif-unread { background: rgba(126, 58, 153, .14); }
[data-bs-theme="dark"] .table { --bs-table-hover-bg: rgba(126, 58, 153, .1); --bs-table-striped-bg: rgba(255, 255, 255, .03); --bs-table-border-color: rgba(255, 255, 255, .07); --bs-table-color: #cbd5e1; --bs-table-hover-color: #f1f5f9; }
[data-bs-theme="dark"] .table thead th { background: rgba(255, 255, 255, .03); border-bottom-color: rgba(255, 255, 255, .08); }
[data-bs-theme="dark"] .table tfoot td, [data-bs-theme="dark"] .table tfoot th, [data-bs-theme="dark"] .table-light { background: rgba(255, 255, 255, .03); --bs-table-bg: rgba(255, 255, 255, .03); color: #f1f5f9; }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { color: #c9a6dc; border-bottom-color: #c9a6dc; }
[data-bs-theme="dark"] .nav-pills .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
[data-bs-theme="dark"] .pagination { --bs-pagination-bg: rgba(255, 255, 255, .04); --bs-pagination-border-color: rgba(255, 255, 255, .08); --bs-pagination-color: #cbd5e1; --bs-pagination-hover-bg: rgba(255, 255, 255, .1); --bs-pagination-hover-color: #fff; --bs-pagination-disabled-bg: transparent; --bs-pagination-disabled-color: #475569; }
[data-bs-theme="dark"] .list-group { --bs-list-group-color: #cbd5e1; --bs-list-group-border-color: rgba(255, 255, 255, .06); --bs-list-group-action-hover-bg: rgba(126, 58, 153, .1); --bs-list-group-action-hover-color: #fff; --bs-list-group-action-color: #cbd5e1; }
[data-bs-theme="dark"] .alert-success { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .3); color: #6ee7b7; }
[data-bs-theme="dark"] .alert-danger { background: rgba(244, 63, 94, .12); border-color: rgba(244, 63, 94, .3); color: #fda4af; }
[data-bs-theme="dark"] .alert-warning { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }
[data-bs-theme="dark"] .alert-info { background: rgba(15, 118, 110, .12); border-color: rgba(15, 118, 110, .3); color: #5eead4; }
[data-bs-theme="dark"] .alert-primary { background: rgba(126, 58, 153, .14); border-color: rgba(126, 58, 153, .3); color: #e3cdee; }
[data-bs-theme="dark"] .alert-secondary, [data-bs-theme="dark"] .alert-light { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .08); color: #cbd5e1; }
[data-bs-theme="dark"] .badge.rounded-pill.text-bg-primary   { background: rgba(126, 58, 153, .2) !important; color: #e3cdee !important; }
[data-bs-theme="dark"] .badge.rounded-pill.text-bg-success   { background: rgba(16, 185, 129, .18) !important; color: #6ee7b7 !important; }
[data-bs-theme="dark"] .badge.rounded-pill.text-bg-warning   { background: rgba(245, 158, 11, .18) !important; color: #fcd34d !important; }
[data-bs-theme="dark"] .badge.rounded-pill.text-bg-danger    { background: rgba(244, 63, 94, .18) !important; color: #fda4af !important; }
[data-bs-theme="dark"] .badge.rounded-pill.text-bg-info      { background: rgba(15, 118, 110, .18) !important; color: #5eead4 !important; }
[data-bs-theme="dark"] .badge.rounded-pill.text-bg-secondary { background: rgba(148, 163, 184, .16) !important; color: #cbd5e1 !important; }
[data-bs-theme="dark"] .badge.rounded-pill.text-bg-light     { background: rgba(255, 255, 255, .08) !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .priority-low { background: rgba(148, 163, 184, .16); color: #cbd5e1; }
[data-bs-theme="dark"] .priority-medium { background: rgba(15, 118, 110, .18); color: #5eead4; }
[data-bs-theme="dark"] .priority-high { background: rgba(245, 158, 11, .18); color: #fcd34d; }
[data-bs-theme="dark"] .priority-critical { background: rgba(244, 63, 94, .18); color: #fda4af; }
[data-bs-theme="dark"] .stat-primary .stat-icon { color: #c9a6dc; }
[data-bs-theme="dark"] .stat-success .stat-icon { color: #34d399; }
[data-bs-theme="dark"] .stat-warning .stat-icon { color: #fbbf24; }
[data-bs-theme="dark"] .stat-danger .stat-icon { color: #fb7185; }
[data-bs-theme="dark"] .stat-info .stat-icon { color: #2dd4bf; }
[data-bs-theme="dark"] .stat-secondary .stat-icon { color: #cbd5e1; }
[data-bs-theme="dark"] .stat-card .stat-icon { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
[data-bs-theme="dark"] a.stat-card:hover, [data-bs-theme="dark"] a.card:hover, [data-bs-theme="dark"] .card[data-href]:hover,
[data-bs-theme="dark"] .stat-card[data-href]:hover, [data-bs-theme="dark"] .card-link-block:hover, [data-bs-theme="dark"] .clickable-card:hover {
    background: rgba(30, 41, 59, .72); border-color: rgba(180, 127, 208, .35); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8), 0 0 0 1px rgba(180, 127, 208, .12);
}
[data-bs-theme="dark"] .card .card { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .06); }
[data-bs-theme="dark"] .bg-white, [data-bs-theme="dark"] .bg-body { background-color: rgba(255, 255, 255, .04) !important; }
[data-bs-theme="dark"] .bg-light { background-color: rgba(255, 255, 255, .05) !important; }
[data-bs-theme="dark"] .border, [data-bs-theme="dark"] .border-top, [data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start, [data-bs-theme="dark"] .border-end { border-color: rgba(255, 255, 255, .09) !important; }
[data-bs-theme="dark"] .avatar { box-shadow: 0 0 0 2px rgba(15, 23, 42, .9), 0 4px 10px -4px rgba(0, 0, 0, .6); }
[data-bs-theme="dark"] .activity-list li { border-bottom-color: rgba(255, 255, 255, .07); }
[data-bs-theme="dark"] .activity-dot { box-shadow: 0 0 0 3px rgba(15, 23, 42, .9); }
[data-bs-theme="dark"] .kanban-col { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .07); }
[data-bs-theme="dark"] .kanban-card { background: rgba(30, 41, 59, .78); border-top-color: rgba(255, 255, 255, .07); border-right-color: rgba(255, 255, 255, .07); border-bottom-color: rgba(255, 255, 255, .07); }
[data-bs-theme="dark"] .kanban-col.drag-over { background: rgba(126, 58, 153, .12); }
[data-bs-theme="dark"] .progress { background: rgba(148, 163, 184, .16); }
[data-bs-theme="dark"] hr { border-color: rgba(255, 255, 255, .1); }
[data-bs-theme="dark"] code { color: #f9a8d4; }
[data-bs-theme="dark"] .empty-state > i { color: #c9a6dc; }
[data-bs-theme="dark"] .auth-card { background: rgba(17, 24, 39, .82); border-color: rgba(255, 255, 255, .1); }
[data-bs-theme="dark"] .auth-brand-name { color: #f8fafc; }

/* rail tooltips */
.rail-tooltip .tooltip-inner { background: rgba(15, 20, 45, .95); font-weight: 500; padding: .4rem .7rem; box-shadow: 0 10px 24px -10px rgba(2, 6, 23, .7); }
.rail-tooltip.bs-tooltip-end .tooltip-arrow::before { border-right-color: rgba(15, 20, 45, .95); }
/* HMS-compatible alias for clickable table rows */
tr.clickable-row { cursor: pointer; }

/* =====================================================================
   DV SOFT · Fluent finish (matches dvsoft.in): Inter text, Sora headings, DV plum #602874,
   warm paper canvas, crisp hairline surfaces, 4–8px corners, Fluent depth shadows.
   ===================================================================== */
.app-body {
    background:
        radial-gradient(900px 480px at -5% -10%, rgba(96, 40, 116, .07), transparent 60%),
        radial-gradient(700px 420px at 105% 0%, rgba(234, 88, 12, .04), transparent 60%),
        #faf8f4;
    background-attachment: fixed;
}
h1, h2, h3, h4, .h1, .h2, .h3, .h4, .page-title, .card-title, .stat-value, .auth-title, .auth-brand-name,
.sidebar-brand-text strong, .navbar-title, .error-code { font-family: var(--font-display); letter-spacing: -0.02em; }
.page-title { font-weight: 700; font-size: 1.5rem; }
.card-header .card-title { font-weight: 600; }

/* surfaces: Mica-like — near-opaque, hairline border, Fluent depth-4 shadow */
.glass, .card, .filter-bar, .stat-card { box-shadow: var(--shadow-md); border: 1px solid var(--glass-border); }
.card .card { border-color: var(--glass-edge); }
.stat-card::after { display: none; }
.stat-icon { border-radius: 6px; box-shadow: none; }
.stat-value { font-weight: 700; }
a.stat-card:hover, a.card:hover, .card[data-href]:hover, .stat-card[data-href]:hover, .card-link-block:hover, .clickable-card:hover {
    transform: translateY(-1px);
    background: #fff;
    border-color: #c9a6dc;
    box-shadow: 0 1.2px 3.6px rgba(0, 0, 0, .1), 0 6.4px 14.4px rgba(0, 0, 0, .13);
}

/* buttons: Fluent — solid brand, 4px corners, no glow */
.btn { border-radius: 4px; font-weight: 600; }
.btn-primary { background-image: none; box-shadow: none; --bs-btn-bg: #602874; --bs-btn-hover-bg: #4a1d58; --bs-btn-active-bg: #3d1749; --bs-btn-disabled-bg: #7e3a99; }
.btn-primary:hover { background-image: none; box-shadow: none; }
.btn-outline-primary, .btn-outline-secondary, .btn-light, .btn-outline-danger, .btn-outline-success { background-color: #fff; }
.btn-icon { border-radius: 4px; }
.form-control, .form-select, .input-group-text { border-radius: 4px; }
.form-control, .form-select { background-color: #fff; border-color: #d6d2ca; border-bottom-color: #8a8d99; }
.form-control:focus, .form-select:focus { border-color: #d6d2ca; border-bottom: 2px solid #602874; box-shadow: none; padding-bottom: calc(.375rem - 1px); }
.form-check-input:focus { box-shadow: 0 0 0 2px rgba(96, 40, 116, .25); }
.nav-pills .nav-link { border-radius: 4px; }
.nav-pills .nav-link.active { background-image: none; background-color: #602874; box-shadow: none; }
.progress-bar.bg-primary { background: #602874 !important; }
.badge-priority, .badge.rounded-pill { font-family: var(--bs-body-font-family); }
.dropdown-menu { border-radius: 8px; border: 1px solid #e8e4dc; background: #fff; box-shadow: var(--shadow-lg); }
.dropdown-item { border-radius: 4px; }
.modal-content { border-radius: 8px; background: #fff; border: 1px solid #e8e4dc; }
.alert { border-radius: 6px; box-shadow: none; }
.pagination .page-link { border-radius: 4px !important; }
.kanban-col { border-radius: 8px; background: rgba(244, 242, 236, .7); }
.kanban-card { border-radius: 6px; }
.empty-state > i { border-radius: 12px; }

/* shell: DV SOFT deep plum navigation, Fluent selection indicator */
.app-sidebar {
    background:
        radial-gradient(380px 300px at 0% 0%, rgba(126, 58, 153, .35), transparent 70%),
        radial-gradient(320px 260px at 100% 100%, rgba(234, 88, 12, .12), transparent 70%),
        linear-gradient(180deg, #1a0e20 0%, #24122c 55%, #2a1233 100%);
}
.sidebar-logo { border-radius: 8px; background: var(--brand-gradient-hero); box-shadow: 0 6px 16px -6px rgba(217, 41, 75, .6); }
.sidebar-link { border-radius: 4px; position: relative; }
.sidebar-link.active { background: rgba(255, 255, 255, .1); box-shadow: none; color: #fff; }
.sidebar-link.active::before { content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 2px; background: #e3cdee; }
body.sidebar-collapsed .sidebar-link.active::before { left: -2px; }
.nav-section[data-has-active] > .nav-section-title { color: #e3cdee; }
.app-navbar { background: rgba(250, 248, 244, .82); }
.btn-user { border-radius: 4px; background: #fff; }
.notif-badge { background: #d9294b; }

/* auth: DV SOFT gradient backdrop */
.auth-body { background: radial-gradient(900px 600px at 10% 10%, rgba(126, 58, 153, .55), transparent 60%), radial-gradient(800px 600px at 90% 90%, rgba(234, 88, 12, .25), transparent 60%), linear-gradient(135deg, #1a0e20 0%, #3d1749 100%); }
.auth-card { border-radius: 8px; background: #fff; }
.auth-logo { border-radius: 8px; background: var(--brand-gradient-hero); }
.error-code { background: var(--brand-gradient-hero); -webkit-background-clip: text; background-clip: text; }

/* dark: Fluent dark neutrals with plum accents */
[data-bs-theme="dark"] .app-body { background: radial-gradient(900px 480px at -5% -10%, rgba(126, 58, 153, .18), transparent 60%), #1b1a19; background-attachment: fixed; }
[data-bs-theme="dark"] {
    --glass-bg: rgba(41, 40, 39, .96); --glass-bg-strong: rgba(41, 40, 39, .98);
    --glass-border: #3b3a39; --glass-edge: #323130; --card-border: #3b3a39; --bs-body-bg: #1b1a19;
}
[data-bs-theme="dark"] a.stat-card:hover, [data-bs-theme="dark"] a.card:hover, [data-bs-theme="dark"] .card[data-href]:hover,
[data-bs-theme="dark"] .stat-card[data-href]:hover, [data-bs-theme="dark"] .clickable-card:hover { background: #323130; border-color: #7e3a99; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #292827; border-color: #484644; border-bottom-color: #8a8886; }
[data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus { background-color: #292827; border-bottom-color: #b47fd0; }
[data-bs-theme="dark"] .btn-outline-primary, [data-bs-theme="dark"] .btn-outline-secondary, [data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-outline-danger, [data-bs-theme="dark"] .btn-outline-success, [data-bs-theme="dark"] .btn-user { background-color: #292827; }
[data-bs-theme="dark"] .btn-primary { --bs-btn-bg: #7e3a99; --bs-btn-hover-bg: #602874; --bs-btn-active-bg: #4a1d58; }
[data-bs-theme="dark"] .dropdown-menu, [data-bs-theme="dark"] .modal-content, [data-bs-theme="dark"] .auth-card { background: #292827; border-color: #3b3a39; }
[data-bs-theme="dark"] .app-navbar { background: rgba(27, 26, 25, .85); }
[data-bs-theme="dark"] .kanban-col { background: rgba(255, 255, 255, .03); }
[data-bs-theme="dark"] .progress-bar.bg-primary { background: #b47fd0 !important; }
.empty-state > i { border-radius: 8px; box-shadow: none; }
.sidebar-logo { box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.auth-logo { box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
@media print {
    body, .app-body, .card, .table, .table td, .table th, h1, h2, h3, h4, h5, .page-title, .stat-value { color: #000 !important; background: #fff !important; }
    .badge, .status-badge { border: 1px solid #555; background: #fff !important; color: #000 !important; }
}
