/* =====================================================================
   Data Management — "Royal Amethyst" (from the Claude Design handoff)
   Plus Jakarta Sans for UI · Sora for headings and numbers · tabular figures
   No gradients: solid fills, 1px borders, two shadow levels (card, overlay).
   The accent comes from Settings (--app-accent / --app-accent-rgb).
   ===================================================================== */

:root {
    --app-accent: #6d28d9;
    --app-accent-rgb: 109, 40, 217;
    --app-accent-dark: #55189f;

    --ink: #1b1730;
    --ink-2: #2b1b57;
    --ink-3: #413c5e;
    --muted: #6e6a88;
    --muted-2: #8e8aa6;
    --page: #f8f7fc;
    --surface: #ffffff;
    --panel: #fbfaff;
    --line: #e5e1ee;
    --line-2: #eeebf5;
    --line-3: #f1eff7;
    --control: #e0dbed;
    --tint: #f3edfd;
    --tint-2: #f2eefb;
    --tint-ink: #5a1fb8;
    --hover-row: #faf8fe;

    --shadow-card: 0 6px 18px -8px rgba(27, 23, 48, .22);
    --shadow-overlay: 0 18px 40px -12px rgba(27, 23, 48, .28);

    --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Sora", "Plus Jakarta Sans", sans-serif;

    /* Bootstrap hooks */
    --bs-font-sans-serif: var(--font-ui);
    --bs-body-font-size: 13px;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--page);
    --bs-secondary-color: var(--muted);
    --bs-border-color: var(--line);
    --bs-primary: var(--app-accent);
    --bs-primary-rgb: var(--app-accent-rgb);
    --bs-link-color: var(--app-accent);
    --bs-link-color-rgb: var(--app-accent-rgb);
    --bs-link-hover-color: var(--app-accent-dark);
    --bs-border-radius: 8px;
    --bs-border-radius-sm: 7px;
    --bs-border-radius-lg: 11px;
    --bs-tertiary-bg: var(--panel);
}

body {
    background: var(--page);
    color: var(--ink);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--app-accent); text-decoration: none; }
a:hover { color: var(--app-accent-dark); text-decoration: underline; }
a.dm-btn:hover, a.dm-icon-btn:hover, .dropdown-item:hover, a.dt-who:hover, .dm-nav a:hover, .list-group-item-action:hover { text-decoration: none; }

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5, .font-display { font-family: var(--font-display); letter-spacing: -.02em; font-weight: 600; }
.h5, h5 { font-size: 14.5px; }
.h6, h6 { font-size: 13px; font-weight: 600; }

.tabular, .dt-num, .stat-value, .metric-pill .value { font-variant-numeric: tabular-nums; }
.dm-muted { color: var(--muted); }
.text-body-secondary, .text-muted { color: var(--muted) !important; }
.small, small { font-size: 11.5px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfc9de; border-radius: 9px; border: 2px solid var(--page); }

/* ---------- Animations (from the design) ---------- */
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.9); opacity: 0; } }
@keyframes feedIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes tick { from { opacity: .4; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleY(.15); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes screenIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes drift { 0% { transform: translateY(0); } 50% { transform: translateY(-9px); } 100% { transform: translateY(0); } }
@keyframes barGrow { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
@keyframes fadeOnly { from { opacity: 0; } to { opacity: 1; } }
@keyframes rowFlash { from { background: #f6f1ff; } to { background: transparent; } }

.spin { display: inline-block; animation: spin 2.4s linear infinite; }

/* ---------- Live dot ---------- */
.dm-dot { position: relative; width: 6px; height: 6px; flex: 0 0 6px; display: inline-block; }
.dm-dot::before, .dm-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #10b981; }
.dm-dot::after { animation: pulseDot 1.8s ease-out infinite; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; display: inline-block; position: relative; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #10b981; animation: pulseDot 1.8s ease-out infinite; }

/* =====================================================================
   App shell
   ===================================================================== */
.app-shell { display: flex; height: 100vh; min-height: 620px; overflow: hidden; }

/* Sidebar (light) */
.app-sidebar {
    width: 208px;
    flex: 0 0 208px;
    background: var(--panel);
    border-right: 1px solid #e9e5f3;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px 10px 10px;
    overflow-y: auto;
    transition: width .2s ease, flex-basis .2s ease;
}

.app-sidebar.offcanvas-lg { --bs-offcanvas-width: 240px; --bs-offcanvas-bg: var(--panel); }

@media (min-width: 992px) {
    .app-sidebar.offcanvas-lg { background: var(--panel) !important; }
}

.dm-brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 6px; color: var(--ink); min-width: 0; }
.dm-brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: var(--app-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    overflow: hidden;
}
.dm-brand-mark.has-logo { background: #fff; border: 1px solid var(--line); }
.dm-brand-mark img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dm-brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dm-brand-name { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-brand-sub { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dm-nav { display: flex; flex-direction: column; gap: 2px; }
.dm-nav-heading { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); padding: 4px 10px 5px; text-transform: uppercase; white-space: nowrap; }
.dm-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    color: #4a4567;
    transition: background .14s, color .14s;
    white-space: nowrap;
}
.dm-nav a::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: transparent; }
.dm-nav a:hover { background: var(--tint-2); color: #4a4567; }
.dm-nav a.active { background: var(--tint); color: var(--tint-ink); }
.dm-nav a.active::before { background: var(--app-accent); }
.dm-nav i { font-size: 15px; line-height: 1; }
.dm-nav-label { font-size: 12.5px; font-weight: 600; }
.dm-nav-meta { margin-left: auto; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.dm-nav-meta.accent { color: var(--tint-ink); }
.dm-nav-meta.blue { color: #1d4ed8; }

.dm-sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.dm-usercard {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 8px;
    border-radius: 9px;
    border: 1px solid #e9e5f3;
    background: #fff;
    text-align: left;
    color: var(--ink);
    transition: background .14s;
}
.dm-usercard:hover, .dm-usercard[aria-expanded="true"] { background: #f7f5fd; }
.dm-usercard-text { display: flex; flex-direction: column; min-width: 0; }
.dm-usercard-name { font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-usercard-role { font-size: 9.5px; color: var(--muted); }
.dm-usercard .bi-three-dots { margin-left: auto; font-size: 12px; color: var(--muted); }
.dm-collapse {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    transition: background .14s;
}
.dm-collapse:hover { background: var(--tint-2); }
.dm-collapse i { font-size: 13px; transition: transform .2s; }

/* Collapsed (icons only) */
@media (min-width: 992px) {
    .sidebar-collapsed .app-sidebar { width: 64px; flex-basis: 64px; }
    .sidebar-collapsed .dm-brand-text,
    .sidebar-collapsed .dm-nav-label,
    .sidebar-collapsed .dm-nav-meta,
    .sidebar-collapsed .dm-usercard-text,
    .sidebar-collapsed .dm-usercard .bi-three-dots,
    .sidebar-collapsed .dm-collapse span { display: none; }
    .sidebar-collapsed .dm-nav-heading { font-size: 0; padding: 4px 0; border-top: 1px solid var(--line-2); margin: 2px 8px; }
    .sidebar-collapsed .dm-nav a, .sidebar-collapsed .dm-collapse, .sidebar-collapsed .dm-usercard { justify-content: center; }
    .sidebar-collapsed .dm-collapse i { transform: rotate(180deg); }
    .sidebar-collapsed .dm-brand { justify-content: center; }
}

/* Main column + header */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--page); }

.app-topbar {
    height: 50px;
    flex: 0 0 50px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
}
.app-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.app-title h1 { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-subtitle { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-search { flex: 1; max-width: 400px; margin-left: 8px; position: relative; display: flex; }
.app-search > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted-2); pointer-events: none; }
.app-search input {
    width: 100%;
    height: 31px;
    border-radius: 8px;
    border: 1px solid var(--control);
    background: var(--page);
    padding: 0 34px 0 29px;
    font-size: 12px;
    color: var(--ink);
    outline: none;
    transition: border-color .14s, box-shadow .14s, background .14s;
}
.app-search input::placeholder { color: var(--muted); }
.app-search input:hover { border-color: #c9c0e4; }
.app-search input:focus { border-color: var(--app-accent); background: #fff; box-shadow: 0 0 0 3px rgba(var(--app-accent-rgb), .14); }
.app-search kbd, .dm-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    background: #fff;
    border: 1px solid #ded8ec;
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 1px 6px;
    box-shadow: none;
    pointer-events: none;
}

.app-topbar-end { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.dm-live-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border-radius: 20px;
    background: #f0fdf7;
    border: 1px solid #bbead3;
    font-size: 11px;
    font-weight: 600;
    color: #0b6b46;
}
.dm-square-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--control);
    background: #fff;
    display: grid;
    place-items: center;
    color: #4c4766;
    position: relative;
    transition: background .14s;
}
.dm-square-btn:hover { background: #f5f3fa; }
.dm-square-btn i { font-size: 14px; }
.dm-square-btn .dm-badge-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--app-accent); border: 1.5px solid #fff; }

.app-content { flex: 1; overflow: auto; padding: 14px 16px 20px; }
.app-content > * { animation: screenIn .28s ease; }
.dm-stack { display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 991.98px) {
    .app-shell { height: auto; min-height: 100vh; overflow: visible; }
    .app-content { overflow: visible; }
    .app-topbar { position: sticky; top: 0; z-index: 1020; }
}

@media (max-width: 575.98px) {
    .app-topbar { gap: 8px; padding: 0 10px; }
    .app-content { padding: 12px 10px 18px; }
    .dm-live-pill span.lbl { display: none; }
}

/* =====================================================================
   Building blocks
   ===================================================================== */

/* Cards */
.dm-card, .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    overflow: hidden;
    min-width: 0;
}
.card { --bs-card-border-color: var(--line); --bs-card-cap-bg: transparent; --bs-card-bg: var(--surface); box-shadow: none; }
.dm-card-head, .card > .card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-bottom: 1px solid var(--line-2);
    background: transparent;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    flex-wrap: wrap;
}
.dm-card-title { font-family: var(--font-display); font-size: 13px; font-weight: 600; }
.dm-card-body, .card > .card-body { padding: 13px 15px; }
.dm-card-hover { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.dm-card-hover:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); border-color: #d6cfe9; }
.dm-link-more { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--app-accent); font-family: var(--font-ui); }
.dm-divider { height: 1px; background: var(--line-2); }

/* Buttons */
.dm-btn {
    height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid var(--control);
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-ui);
    font-size: 11.5px;
    font-weight: 600;
    color: #3a3554;
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s, border-color .14s, filter .14s, transform .12s;
}
.dm-btn:hover { background: #f5f3fa; color: #3a3554; }
.dm-btn:active { transform: translateY(1px); }
.dm-btn i { font-size: 12px; }
.dm-btn .dm-caret, .dm-caret { font-size: 9px; opacity: .6; }
.dm-btn.is-on { border-color: #ddcdfa; background: var(--tint); color: var(--tint-ink); }
.dm-btn-primary { background: var(--app-accent); border-color: var(--app-accent); color: #fff; box-shadow: 0 1px 2px rgba(var(--app-accent-rgb), .35); }
.dm-btn-primary:hover { background: var(--app-accent); color: #fff; filter: brightness(1.08); }
.dm-btn-danger { border-color: #f3c6c6; color: #b91c1c; }
.dm-btn-danger:hover { background: #fdeded; color: #b91c1c; }
.dm-btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.dm-btn-ghost:hover { background: transparent; color: var(--ink-3); }
.dm-btn-lg { height: 32px; padding: 0 13px; border-radius: 8px; font-size: 12.5px; }
.dm-btn-md { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12px; }
.dm-btn:disabled, .dm-btn.disabled { opacity: .55; pointer-events: none; }
.dm-count { background: var(--app-accent); color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 20px; padding: 1px 5px; }

.dm-icon-btn {
    width: 25px;
    height: 25px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    cursor: pointer;
    transition: background .14s, color .14s;
}
.dm-icon-btn i { font-size: 12px; }
.dm-icon-btn:hover { background: #f2edfd; color: var(--tint-ink); }
.dm-icon-btn.danger:hover { background: #fdeded; color: #b91c1c; }

/* Bootstrap buttons → design buttons */
.btn {
    --bs-btn-font-family: var(--font-ui);
    --bs-btn-font-size: 12px;
    --bs-btn-font-weight: 600;
    --bs-btn-padding-y: 0;
    --bs-btn-padding-x: 12px;
    --bs-btn-border-radius: 8px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .14s, border-color .14s, filter .14s, transform .12s, color .14s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-sm { --bs-btn-font-size: 11.5px; --bs-btn-padding-x: 10px; --bs-btn-border-radius: 7px; min-height: 28px; }
.btn-lg { --bs-btn-font-size: 13.5px; --bs-btn-border-radius: 9px; min-height: 42px; font-weight: 700; }
.btn-primary {
    --bs-btn-bg: var(--app-accent);
    --bs-btn-border-color: var(--app-accent);
    --bs-btn-hover-bg: var(--app-accent);
    --bs-btn-hover-border-color: var(--app-accent);
    --bs-btn-active-bg: var(--app-accent-dark);
    --bs-btn-active-border-color: var(--app-accent-dark);
    --bs-btn-disabled-bg: var(--app-accent);
    --bs-btn-disabled-border-color: var(--app-accent);
    box-shadow: 0 1px 2px rgba(var(--app-accent-rgb), .35);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline-secondary, .btn-light, [class*="btn-soft-"] {
    --bs-btn-color: #3a3554;
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--control);
    --bs-btn-hover-color: #3a3554;
    --bs-btn-hover-bg: #f5f3fa;
    --bs-btn-hover-border-color: var(--control);
    --bs-btn-active-color: #3a3554;
    --bs-btn-active-bg: #efecf7;
    --bs-btn-active-border-color: var(--control);
    color: #3a3554;
    background: #fff;
    border: 1px solid var(--control);
}
.btn-outline-secondary:hover, .btn-light:hover, [class*="btn-soft-"]:hover { background: #f5f3fa; color: #3a3554; }
.btn-soft-ruby, .btn-outline-danger { color: #b91c1c !important; border-color: #f3c6c6 !important; background: #fff; }
.btn-soft-ruby:hover, .btn-outline-danger:hover { background: #fdeded !important; }
.btn-danger { --bs-btn-bg: #b91c1c; --bs-btn-border-color: #b91c1c; --bs-btn-hover-bg: #a31818; --bs-btn-hover-border-color: #a31818; }
.btn-success { --bs-btn-bg: #047857; --bs-btn-border-color: #047857; --bs-btn-hover-bg: #036148; --bs-btn-hover-border-color: #036148; }
.btn-warning { --bs-btn-bg: #f5b301; --bs-btn-border-color: #f5b301; --bs-btn-color: #2b1a00; }
.btn-link { --bs-btn-color: var(--app-accent); --bs-btn-hover-color: var(--app-accent-dark); text-decoration: none; }
.btn-icon { width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 8px; border: 1px solid var(--control); background: #fff; color: #4c4766; }

/* Pills (status / category) */
.pill {
    --p-bg: #f4f3f8; --p-fg: #4a4567; --p-bd: #e0dbed;
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
    background: var(--p-bg);
    color: var(--p-fg);
    border: 1px solid var(--p-bd);
    line-height: 1.5;
}
.pill-emerald { --p-bg: #ecfdf5; --p-fg: #065f46; --p-bd: #bbf0d8; }
.pill-sapphire, .pill-indigo { --p-bg: #eff4ff; --p-fg: #1e40af; --p-bd: #c7d8fb; }
.pill-gold, .pill-amber { --p-bg: #fdf6e3; --p-fg: #78500a; --p-bd: #f2dfae; }
.pill-ruby { --p-bg: #fdeded; --p-fg: #991b1b; --p-bd: #f6c7c7; }
.pill-slate { --p-bg: #f4f3f8; --p-fg: #4a4567; --p-bd: #e0dbed; }
.pill-violet { --p-bg: #f2edfd; --p-fg: #5a1fb8; --p-bd: #ddcdfa; }
.pill-teal { --p-bg: #ecfbf8; --p-fg: #0f5f58; --p-bd: #bde9e1; }
.pill-magenta { --p-bg: #fbeefb; --p-fg: #86198f; --p-bd: #efc8f2; }
.pill-upper { font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; padding: 1.5px 7px; }

/* Bootstrap badges → pills */
.badge { font-size: 10px; font-weight: 700; border-radius: 20px; padding: 3px 8px; }
.text-bg-success { background: #ecfdf5 !important; color: #065f46 !important; border: 1px solid #bbf0d8; }
.text-bg-primary, .text-bg-info { background: #eff4ff !important; color: #1e40af !important; border: 1px solid #c7d8fb; }
.text-bg-warning { background: #fdf6e3 !important; color: #78500a !important; border: 1px solid #f2dfae; }
.text-bg-danger { background: #fdeded !important; color: #991b1b !important; border: 1px solid #f6c7c7; }
.text-bg-secondary, .text-bg-dark, .text-bg-light { background: #f4f3f8 !important; color: #4a4567 !important; border: 1px solid #e0dbed; }

/* Initials tile */
.dm-ini {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 7px;
    background: #f2edfd;
    color: var(--tint-ink);
    display: inline-grid;
    place-items: center;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .02em;
}
.dm-ini.round { border-radius: 50%; }
.dm-ini.lg { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; font-family: var(--font-display); font-size: 14px; }
.dm-ini.md { width: 26px; height: 26px; flex-basis: 26px; font-size: 10px; }
.dm-ini.sm { width: 18px; height: 18px; flex-basis: 18px; font-size: 8px; }

.dm-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--page);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 3px 9px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ink-3);
}
a.dm-tag:hover { background: var(--tint-2); color: var(--ink-3); }
.dm-tag.person { padding: 3px 9px 3px 4px; font-size: 11px; }

/* Forms */
.form-label, .dm-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.form-control, .form-select {
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid var(--control);
    background-color: #fff;
    font-size: 12.5px;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.form-control-sm, .form-select-sm { min-height: 28px; border-radius: 7px; font-size: 11.5px; }
.form-control-lg { min-height: 40px; border-radius: 9px; font-size: 13px; }
.form-control:hover, .form-select:hover { border-color: #c9c0e4; }
.form-control:focus, .form-select:focus { border-color: var(--app-accent); box-shadow: 0 0 0 3px rgba(var(--app-accent-rgb), .14); }
.form-control::placeholder { color: #9b97b3; }
.form-text { font-size: 10.5px; color: var(--muted); }
.input-group-text { background: #fff; border-color: var(--control); color: var(--muted-2); font-size: 12px; }
.form-check-input { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #cdc7de; margin-top: .2em; cursor: pointer; }
.form-check-input:checked, .form-check-input:indeterminate { background-color: var(--app-accent); border-color: var(--app-accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--app-accent-rgb), .14); border-color: var(--app-accent); }
.form-switch .form-check-input { width: 34px; height: 19px; border-radius: 20px; border: 0; background-color: #dcd7e8; margin-top: 0; }
.form-switch .form-check-input:checked { background-color: var(--app-accent); }
.form-check-label { font-size: 12px; color: var(--ink-3); }
.form-control-color { width: 46px; padding: 4px; }
.invalid-feedback { font-size: 11px; }

/* Alerts → design notices */
.alert { font-size: 11.5px; line-height: 1.5; border-radius: 10px; padding: 10px 13px; border: 1px solid; }
.alert-warning { background: #fdf8e9; border-color: #f1e2b4; color: #7a5200; }
.alert-danger { background: #fdeded; border-color: #f6c7c7; color: #8f1d1d; }
.alert-info { background: #eff4ff; border-color: #c7d8fb; color: #1e3a8a; }
.alert-success { background: #ecfdf5; border-color: #bbf0d8; color: #065f46; }

/* Dropdowns / modals / toasts */
.dropdown-menu {
    --bs-dropdown-font-size: 12px;
    --bs-dropdown-border-color: var(--line);
    --bs-dropdown-link-color: var(--ink-3);
    --bs-dropdown-link-hover-bg: var(--tint-2);
    --bs-dropdown-link-active-bg: var(--tint);
    --bs-dropdown-link-active-color: var(--tint-ink);
    border-radius: 10px;
    padding: 5px;
    box-shadow: var(--shadow-overlay);
    animation: fadeOnly .14s ease;
}
.dropdown-item { border-radius: 7px; padding: 6px 9px; font-weight: 500; }
.dropdown-item-text { font-size: 11px; padding: 6px 9px; }
.dropdown-divider { border-color: var(--line-2); margin: 4px 0; }
.dropdown-header { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.modal-content { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-overlay); }
.modal-header { padding: 12px 16px; border-bottom-color: var(--line-2); }
.modal-title { font-size: 14.5px; font-weight: 600; font-family: var(--font-display); }
.modal-body { padding: 16px; }
.modal-footer { padding: 10px 16px; border-top-color: var(--line-2); gap: 6px; }
.modal-backdrop.show { opacity: .35; }

.app-toasts { z-index: 2100; margin-top: 52px; }
.app-toast { border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-overlay); min-width: 300px; font-size: 12px; }
.app-toast-success { border-left: 3px solid #10b981; }
.app-toast-danger { border-left: 3px solid #b91c1c; }
.app-toast-warning { border-left: 3px solid #a16207; }
.app-toast-info { border-left: 3px solid #1d4ed8; }

.tooltip { --bs-tooltip-bg: var(--ink); --bs-tooltip-font-size: 11px; }
.progress { --bs-progress-bg: #ece9f5; --bs-progress-bar-bg: var(--app-accent); height: 7px; border-radius: 20px; }
.list-group-item { border-color: var(--line-3); font-size: 12px; padding: 9px 13px; }
.list-group-item-action:hover { background: var(--hover-row); }

/* =====================================================================
   Data table
   ===================================================================== */
.dt { display: flex; flex-direction: column; }

.dt-toolbar { display: flex; align-items: center; gap: 7px; padding: 9px 11px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.dt-toolbar-end { margin-left: auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dt-search { position: relative; width: 200px; margin: 0; }
.dt-search i { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted-2); pointer-events: none; }
.dt-search input {
    width: 100%;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--control);
    background: #fff;
    padding: 0 8px 0 25px;
    font-size: 11.5px;
    color: var(--ink);
    outline: none;
    transition: border-color .14s, box-shadow .14s;
}
.dt-search input::placeholder { color: var(--muted); }
.dt-search input:focus { border-color: var(--app-accent); box-shadow: 0 0 0 3px rgba(var(--app-accent-rgb), .12); }

.dm-select { position: relative; display: inline-flex; margin: 0; }
.dm-select select {
    appearance: none;
    height: 28px;
    padding: 0 24px 0 9px;
    border-radius: 7px;
    border: 1px solid var(--control);
    background: #fff;
    font-family: var(--font-ui);
    font-size: 11.5px;
    font-weight: 600;
    color: #3a3554;
    cursor: pointer;
    outline: none;
}
.dm-select .dm-caret { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }

.dt-saved-menu { min-width: 250px; max-height: 360px; overflow-y: auto; }
.dt-columns-menu { min-width: 250px; }
.dt-columns-list { max-height: 320px; overflow-y: auto; padding: 6px 10px; }
.dt-columns-list .form-check { padding: 3px 0 3px 22px; margin: 0; }

.dt-filter-panel { padding: 11px; background: var(--panel); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.dt-filter-lead { font-size: 11.5px; color: #55506f; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dt-match { height: 24px; border-radius: 6px; border: 1px solid var(--control); background: #fff; font-size: 11.5px; font-weight: 700; color: var(--ink); padding: 0 4px; }
.dt-rule { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 0; animation: screenIn .2s ease; }
.dt-rule select, .dt-rule input {
    height: 28px;
    min-height: 28px;
    border-radius: 7px;
    border: 1px solid var(--control);
    background-color: #fff;
    font-size: 11.5px;
    color: #2e2947;
    padding: 0 9px;
}
.dt-rule select[data-role="field"] { min-width: 150px; width: auto; }
.dt-rule select[data-role="op"] { min-width: 110px; width: auto; }
.dt-rule .dt-rule-values { display: flex; align-items: center; gap: 5px; }
.dt-rule .dt-rule-values input, .dt-rule .dt-rule-values select { min-width: 150px; width: auto; }
.dt-rule [data-role="remove"] { border: 0; background: transparent; color: var(--muted); width: 24px; height: 24px; border-radius: 6px; padding: 0; display: grid; place-items: center; }
.dt-rule [data-role="remove"]:hover { background: #fdeded; color: #b91c1c; }
.dt-rule [data-role="remove"] i { font-size: 11px; }

.dt-chips { display: flex; align-items: center; gap: 6px; padding: 8px 11px; background: var(--panel); border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.dt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f4eefe;
    border: 1px solid #ddcdfa;
    color: var(--tint-ink);
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 20px;
    padding: 3px 7px 3px 9px;
}
.dt-chip strong { font-weight: 700; }
.dt-chip a { color: inherit; opacity: .7; display: inline-flex; }
.dt-chip a:hover { opacity: 1; }
.dt-chip i { font-size: 12px; }
.dt-reset { font-size: 10.5px; font-weight: 600; color: var(--muted); margin-left: 2px; }

.dt-bulk-bar { display: flex; align-items: center; gap: 10px; padding: 8px 11px; background: var(--tint); border-bottom: 1px solid #e3d7fa; color: var(--ink-2); flex-wrap: wrap; row-gap: 6px; animation: screenIn .2s ease; }
.dt-bulk-bar strong { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dt-link { border: 0; background: transparent; padding: 0; font-size: 11px; color: var(--tint-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.dt-bulk-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.dt-bulk-btn {
    height: 25px;
    padding: 0 9px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #d9c9f7;
    color: #4c1d95;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background .14s;
}
.dt-bulk-btn:hover { background: #faf7ff; }
.dt-bulk-btn i { font-size: 11px; }
.dt-bulk-btn.danger { border-color: #f3c6c6; color: #b91c1c; }
.dt-bulk-btn.danger:hover { background: #fdeded; }
.dt-bulk-btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }

.dt-scroll { overflow: auto; max-height: calc(100vh - 230px); min-height: 160px; }
.dt-table { width: 100%; border-collapse: collapse; }
.dt-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel);
    text-align: left;
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.dt-table thead th.text-end { text-align: right; }
.dt-table td {
    padding: 10px;
    border-bottom: 1px solid var(--line-3);
    font-size: 12px;
    color: var(--ink-3);
    white-space: nowrap;
    vertical-align: middle;
}
.dt-table td.dt-num { font-variant-numeric: tabular-nums; }
.dt-table tbody tr { transition: background .14s; background: #fff; }
.dt-table tbody tr:hover { background: var(--hover-row); }
.dt-table tbody tr:has(input[data-dt-row]:checked) { background: #fbf9ff; }
.dt-table tbody tr.flash { animation: rowFlash 1.2s ease; }
tr[data-href] { cursor: pointer; }
.dt-check { width: 34px; padding-left: 11px !important; padding-right: 0 !important; }
.dt-table th:first-child:not(.dt-check), .dt-table td:first-child:not(.dt-check) { padding-left: 12px; }
.dt-sort { color: inherit; display: inline-flex; align-items: center; gap: 2px; }
.dt-sort:hover { color: var(--ink-3); text-decoration: none; }
.dt-sort i { font-size: 12px; color: var(--app-accent); }
.dt-primary-link { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.dt-primary-link:hover { color: var(--app-accent); text-decoration: none; }
.dt-who { display: flex; align-items: center; gap: 8px; color: inherit; min-width: 0; }
.dt-who-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dt-who-name { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.dt-who-sub { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dt-who:hover .dt-who-name { color: var(--app-accent); }
.dt-empty { color: #c9c4d8; }
.dt-actions-col { width: 84px; padding-right: 11px !important; }
.dt-row-actions { display: flex; gap: 3px; justify-content: flex-end; }

.dt-footer { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; border-top: 1px solid var(--line-2); background: var(--panel); flex-wrap: wrap; row-gap: 6px; font-size: 11px; font-variant-numeric: tabular-nums; }
.dm-pages { display: flex; gap: 4px; align-items: center; }
.dm-page {
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 6px;
    border: 1px solid var(--control);
    background: #fff;
    display: grid;
    place-items: center;
    font-size: 11.5px;
    font-weight: 600;
    color: #3a3554;
}
.dm-page:hover { background: #f5f3fa; color: #3a3554; text-decoration: none; }
.dm-page i { font-size: 11px; }
.dm-page.active { background: var(--app-accent); border-color: var(--app-accent); color: #fff; font-weight: 700; }
.dm-page.disabled { color: #a9a5bd; }
.dm-page-gap { font-size: 11px; color: #a9a5bd; padding: 0 2px; }

/* Plain Bootstrap tables used on a few admin pages */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--hover-row); --bs-table-border-color: var(--line-3); margin: 0; font-size: 12px; }
.table > thead th { background: var(--panel); padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table > tbody td { padding: 10px 12px; color: var(--ink-3); }

/* Empty state */
.dm-empty, .empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 38px 16px; color: var(--muted); }
.dm-empty-icon, .empty-state > i:first-child { width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--tint-ink); display: grid; place-items: center; font-size: 18px; }
.dm-empty-title { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--ink); }

/* =====================================================================
   Dashboard pieces
   ===================================================================== */
.dm-greet { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 16px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dm-greet h2 { font-size: 19px; margin: 0; }
.dm-greet p { font-size: 12.5px; color: #55506f; margin: 3px 0 0; }

/* Stat row */
.dm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 10px; }
.dm-stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 11px 13px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--ink);
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
a.dm-stat:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); border-color: #d6cfe9; color: var(--ink); text-decoration: none; }
.dm-stat-top { display: flex; align-items: center; justify-content: space-between; }
.dm-stat-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.dm-stat-top i { font-size: 13px; }
.dm-stat-value { display: flex; align-items: baseline; gap: 7px; }
.dm-stat-value .num { font-family: var(--font-display); font-size: 23px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.dm-stat-value .delta { font-size: 10.5px; font-weight: 700; color: #0b6b46; }
.dm-stat-value .cap { font-size: 10.5px; color: var(--muted); }
.dm-stat-note { font-size: 10.5px; color: var(--muted); }
.dm-stat-link { font-size: 10.5px; font-weight: 600; color: var(--app-accent); }
.dm-bars { display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.dm-bars span { flex: 1; background: #ece9f5; border-radius: 2px; transform-origin: bottom; animation: grow .7s cubic-bezier(.2, .8, .3, 1) both; min-height: 2px; }
.dm-bars span:nth-child(2) { animation-delay: .07s; }
.dm-bars span:nth-child(3) { animation-delay: .14s; }
.dm-bars span:nth-child(4) { animation-delay: .21s; }
.dm-bars span:nth-child(5) { animation-delay: .28s; }
.dm-bars span:nth-child(6) { animation-delay: .35s; }
.dm-bars span:nth-child(7) { animation-delay: .42s; }

/* Live activity feed */
.dm-feed-head { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.dm-feed-head .dm-card-title { font-size: 12.5px; }
.dm-feed-head small { margin-left: auto; font-size: 10px; color: var(--muted); }
.dm-feed { padding: 4px 0; max-height: 268px; overflow: hidden; }
.dm-feed-item { display: flex; gap: 9px; padding: 8px 12px; animation: feedIn .3s ease; }
.dm-feed-icon { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 6px; display: grid; place-items: center; }
.dm-feed-icon i { font-size: 11px; }
.dm-feed-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dm-feed-text span:first-child { font-size: 11.5px; color: #2e2947; line-height: 1.35; }
.dm-feed-text span:last-child { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tone-violet { background: #f2edfd; color: #5a1fb8; }
.tone-gold { background: #fdf6e3; color: #8a5a00; }
.tone-blue { background: #eff4ff; color: #1d4ed8; }
.tone-red { background: #fdeded; color: #b91c1c; }
.tone-green { background: #f0fdf7; color: #0b6b46; }
.tone-slate { background: #f4f3f8; color: #4a4567; }

/* Recent list rows */
.dm-row-link { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-bottom: 1px solid #f4f2f9; color: var(--ink); transition: background .14s; }
.dm-row-link:last-child { border-bottom: 0; }
.dm-row-link:hover { background: var(--hover-row); color: var(--ink); text-decoration: none; }
.dm-row-icon { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: grid; place-items: center; }
.dm-row-icon i { font-size: 13px; }
.dm-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dm-row-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-row-meta { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Quick actions */
.dm-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 7px; }
.dm-quick a { display: flex; flex-direction: column; gap: 5px; padding: 10px; border-radius: 9px; border: 1px solid var(--line-2); background: #fdfcff; transition: border-color .14s, background .14s; }
.dm-quick a:hover { border-color: #d6cfe9; background: var(--hover-row); text-decoration: none; }
.dm-quick i { font-size: 14px; color: var(--app-accent); }
.dm-quick span { font-size: 11.5px; font-weight: 600; color: #2e2947; line-height: 1.3; }

/* Grids */
.dm-grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 12px; align-items: start; }
.dm-grid-dash { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.dm-aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 1199.98px) {
    .dm-grid-main, .dm-grid-dash { grid-template-columns: minmax(0, 1fr); }
}

/* Small progress */
.dm-meter { height: 6px; border-radius: 20px; background: #ece9f5; overflow: hidden; }
.dm-meter > div { height: 100%; background: var(--app-accent); border-radius: 20px; transition: width .9s linear; }

/* =====================================================================
   Party page
   ===================================================================== */
.dm-back { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--app-accent); width: fit-content; }
.dm-back i { font-size: 12px; }
.dm-party-head { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.dm-party-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.dm-party-meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.dm-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px 18px; }
.dm-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dm-field-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dm-field-value { font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; word-break: break-word; }
.dm-field-note { font-size: 10px; color: var(--muted); }
.dm-side-title { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; }
.dm-note { display: flex; gap: 8px; }
.dm-note-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dm-note-text { font-size: 11.5px; color: #2e2947; line-height: 1.45; white-space: pre-line; word-break: break-word; }
.dm-note-meta { font-size: 10px; color: var(--muted); }
.dm-hist { font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.dm-hist .old { color: var(--muted); }
.dm-hist small { display: block; font-size: 10px; color: var(--muted); }
.field-list dt { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field-list dd { margin-bottom: 13px; font-size: 12.5px; word-break: break-word; }

/* =====================================================================
   Imports
   ===================================================================== */
.dm-running { background: #fff; border: 1px solid var(--line); border-left: 3px solid #1d4ed8; border-radius: 11px; padding: 11px 14px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; row-gap: 10px; }
.dm-running-icon { width: 32px; height: 32px; border-radius: 9px; background: #eff4ff; color: #1d4ed8; display: grid; place-items: center; }
.dm-running-icon i { font-size: 16px; }
.dm-running-bar { height: 7px; border-radius: 20px; background: #ece9f5; overflow: hidden; }
.dm-running-bar > div { height: 100%; background: #1d4ed8; border-radius: 20px; transition: width .9s linear; position: relative; }
.dm-running-bar > div::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 12px; background: #60a5fa; border-radius: 20px; animation: tick .9s ease-in-out infinite alternate; }
.dm-kpi { display: flex; flex-direction: column; gap: 1px; }
.dm-kpi-label { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dm-kpi-value { font-family: var(--font-display); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dm-kpi-value small { font-size: 10px; color: var(--muted); font-weight: 500; font-family: var(--font-ui); }
.dm-notice { display: flex; align-items: flex-start; gap: 9px; padding: 10px 13px; border-radius: 10px; background: #fdf8e9; border: 1px solid #f1e2b4; font-size: 11.5px; color: #7a5200; line-height: 1.5; }
.dm-notice i { font-size: 13px; color: #a16207; margin-top: 1px; }
.dm-notice a { color: #7a5200; font-weight: 700; text-decoration: underline; }

/* Older pieces still used on the batch page */
.stat-card .card-body { display: flex; align-items: center; gap: 10px; padding: 11px 13px; }
.stat-icon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: grid; place-items: center; font-size: 13px !important; }
.stat-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 20px !important; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.tone-accent .stat-icon, .stat-icon.tone-accent { background: #f2edfd; color: #5a1fb8; }
.tone-green .stat-icon, .stat-icon.tone-green { background: #ecfdf5; color: #065f46; }
.tone-blue .stat-icon, .stat-icon.tone-blue, .tone-cyan .stat-icon { background: #eff4ff; color: #1d4ed8; }
.tone-amber .stat-icon, .tone-gold .stat-icon, .stat-icon.tone-gold { background: #fdf6e3; color: #8a5a00; }
.tone-rose .stat-icon, .stat-icon.tone-rose { background: #fdeded; color: #b91c1c; }
.tone-slate .stat-icon, .tone-magenta .stat-icon { background: #f4f3f8; color: #4a4567; }
.number-tick { display: inline-block; transition: color .3s; }
.number-tick.bump { color: var(--app-accent); }
.metric-pill { display: inline-flex; flex-direction: column; gap: 1px; padding: 0 18px 0 0; min-width: 0; }
.metric-pill .label { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.metric-pill .value { font-family: var(--font-display); font-size: 14px; font-weight: 600; }
.progress-track { height: 7px; background: #ece9f5; border-radius: 20px; overflow: hidden; }
.progress-track .progress-bar { background: #1d4ed8; border-radius: 20px; transition: width .9s linear; }
.progress-bar-animated-soft { position: relative; }
.progress-bar-animated-soft::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 12px; background: #60a5fa; border-radius: 20px; animation: tick .9s ease-in-out infinite alternate; }

/* Fields: index switch */
.dm-switch { display: inline-flex; align-items: center; width: 34px; height: 19px; border-radius: 20px; padding: 2px; border: 0; background: #dcd7e8; justify-content: flex-start; transition: background .18s; cursor: pointer; }
.dm-switch span { width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.dm-switch.on { background: var(--app-accent); justify-content: flex-end; }

/* Roles grid */
.dm-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 12px; }
.dm-role { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; transition: border-color .14s, box-shadow .14s; }
.dm-role:hover { border-color: #d6cfe9; box-shadow: var(--shadow-card); }
.dm-role-icon { width: 28px; height: 28px; border-radius: 8px; background: #f2edfd; color: #5a1fb8; display: grid; place-items: center; }
.dm-role-icon i { font-size: 13px; }
.dm-role-name { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; }
.dm-role-desc { font-size: 11.5px; color: #55506f; line-height: 1.5; }
.dm-role-access { font-size: 11px; font-weight: 600; color: #5a1fb8; }
.dm-role-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* Settings */
.swatch { width: 30px; height: 30px; border-radius: 9px; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 0 2px #fff inset; transition: transform .12s; padding: 0; }
.swatch:hover { transform: scale(1.08); }
.swatch.selected { border-color: var(--ink); }
.logo-preview { width: 56px; height: 56px; border-radius: 12px; border: 1px dashed #d6cfe9; background: var(--panel); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* =====================================================================
   Login
   ===================================================================== */
.login-shell { display: flex; min-height: 100vh; color: var(--ink); font-size: 13px; }
.login-brand { flex: 1.05; min-width: 0; background: #15112e; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 38px 44px; }
.login-shapes { position: absolute; inset: 0; opacity: .5; pointer-events: none; }
.login-shapes span { position: absolute; border: 1px solid #2a2250; }
.login-shapes span:nth-child(1) { top: -70px; right: -60px; width: 240px; height: 240px; border-color: #2e2558; border-radius: 28px; transform: rotate(18deg); animation: drift 11s ease-in-out infinite; }
.login-shapes span:nth-child(2) { bottom: 40px; right: 70px; width: 150px; height: 150px; border-radius: 50%; animation: drift 8s ease-in-out infinite 1s; }
.login-shapes span:nth-child(3) { top: 46%; left: -40px; width: 120px; height: 120px; border-radius: 20px; transform: rotate(32deg); animation: drift 13s ease-in-out infinite .5s; }
.login-logo { position: relative; display: flex; align-items: center; gap: 11px; animation: rise .5s ease both; }
.login-logo .dm-brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 11px; font-size: 17px; }
.login-logo-name { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.login-logo-sub { color: #8c82b8; font-size: 11px; }
.login-copy { position: relative; display: flex; flex-direction: column; gap: 26px; max-width: 480px; }
.login-copy h1 { margin: 0; font-size: 33px; font-weight: 600; line-height: 1.18; letter-spacing: -.025em; color: #fff; animation: rise .55s ease .06s both; }
.login-copy p { margin: 12px 0 0; font-size: 13.5px; line-height: 1.65; color: #a79ccb; animation: rise .55s ease .06s both; }
.login-features { display: flex; flex-direction: column; gap: 8px; }
.login-feature { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 11px; border: 1px solid #241d49; background: transparent; transition: background .35s ease, border-color .35s ease; }
.login-feature.on { background: #211a44; border-color: #352c6b; }
.login-feature-icon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; display: grid; place-items: center; background: #241d49; color: #9a8fc4; transition: background .35s ease, color .35s ease; }
.login-feature.on .login-feature-icon { background: var(--app-accent); color: #fff; }
.login-feature-icon i { font-size: 14px; }
.login-feature-title { font-size: 12.5px; font-weight: 600; color: #fff; display: block; }
.login-feature-body { font-size: 11px; color: #9a8fc4; line-height: 1.45; display: block; }
.login-stats { position: relative; display: flex; align-items: flex-end; gap: 30px; animation: rise .6s ease .14s both; }
.login-stat { display: flex; flex-direction: column; gap: 3px; }
.login-stat-label { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8f85bd; }
.login-stat-value { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.login-bars { display: flex; align-items: flex-end; gap: 3px; height: 30px; margin-left: auto; }
.login-bars span { width: 5px; border-radius: 2px; transform-origin: bottom; animation: barGrow 1.3s ease-in-out infinite alternate; }
.login-form-side { flex: 1; min-width: 0; background: #fff; display: flex; align-items: center; justify-content: center; padding: 38px 30px; }
.login-card { width: 100%; max-width: 366px; display: flex; flex-direction: column; gap: 20px; animation: rise .5s ease .1s both; }
.login-card h2 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -.02em; }
.login-card .lead { margin: 5px 0 0; font-size: 12.5px; color: #787492; }
.login-error { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: 9px; background: #fdeded; border: 1px solid #f6c7c7; font-size: 11.5px; line-height: 1.5; color: #8f1d1d; }
.login-error i { font-size: 13px; color: #b91c1c; margin-top: 1px; }
.login-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5c5778; }
.login-input { position: relative; display: block; }
.login-input > i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted-2); pointer-events: none; }
.login-input input { width: 100%; height: 40px; border-radius: 9px; border: 1px solid var(--control); background: #fff; padding: 0 38px 0 33px; font-size: 13px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.login-input input:focus { border-color: var(--app-accent); box-shadow: 0 0 0 3px rgba(var(--app-accent-rgb), .14); }
.login-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); transition: background .14s; }
.login-eye:hover { background: #f5f3fa; }
.login-submit { height: 42px; border: none; border-radius: 9px; background: var(--app-accent); color: #fff; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 1px 2px rgba(var(--app-accent-rgb), .4); transition: transform .12s, filter .15s; width: 100%; }
.login-submit:hover { filter: brightness(1.08); }
.login-submit:active { transform: translateY(1px); }
.login-divider { display: flex; align-items: center; gap: 9px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.login-divider span { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.login-status { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--ink-3); }
.login-help { margin: 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
@media (max-width: 991.98px) { .login-brand { display: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
.min-w-0 { min-width: 0; }
.btn .spin, .dm-btn .spin, .login-submit .spin { animation-duration: .8s; }

/* A data table placed inside another card drops its own frame */
.dm-card-flush > .dt { border: 0; border-radius: 0; }

/* Chunked upload progress (public/js/chunked-upload.js) */
.dm-upload { border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.dm-upload-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.dm-upload-note { font-size: 11.5px; }
.dm-upload-files { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; }
.dm-upload-file { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 0; }
.dm-upload-file .dm-meter { height: 4px; }
.dm-upload-file.is-error .dm-meter > div { background: #b4233c; }
