/* ==========================================================================
   DTMS — design system (navy + white)
   Offline: font and icons are bundled under static/vendor/.
   ========================================================================== */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("vendor/inter/inter-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("vendor/inter/inter-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --dtms-sidebar-w: 256px;
    --dtms-topbar-h: 60px;

    /* Brand */
    --dtms-navy: #0b2545;
    --dtms-navy-2: #12315a;
    --dtms-navy-3: #1a3f70;
    --dtms-primary: #13448a;
    --dtms-primary-600: #0f3670;
    --dtms-primary-700: #0d2f63;
    --dtms-accent: #2f6fb3;
    --dtms-sky: #e8f0fb;

    /* Surfaces */
    --dtms-bg: #f3f6fb;
    --dtms-card: #ffffff;
    --dtms-line: #e4e9f1;
    --dtms-ink: #0f1b2d;
    --dtms-ink-2: #44526a;
    --dtms-ink-3: #74829a;

    /* Status palette */
    --st-received: #2563eb;
    --st-received-bg: #e8effd;
    --st-returned: #c2410c;
    --st-returned-bg: #fdf0e7;
    --st-in_process: #7c3aed;
    --st-in_process-bg: #f1ebfe;
    --st-completed: #047857;
    --st-completed-bg: #e6f6ef;
    --st-archived: #475569;
    --st-archived-bg: #eef1f5;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 27, 45, .05), 0 1px 3px rgba(15, 27, 45, .06);
    --shadow: 0 4px 14px -4px rgba(11, 37, 69, .12), 0 2px 4px rgba(11, 37, 69, .04);
    --shadow-lg: 0 18px 40px -12px rgba(11, 37, 69, .28);
    --ease: cubic-bezier(.2, .8, .2, 1);

    /* Bootstrap re-pointing */
    --bs-primary: #13448a;
    --bs-primary-rgb: 19, 68, 138;
    --bs-link-color: #13448a;
    --bs-link-color-rgb: 19, 68, 138;
    --bs-link-hover-color: #0f3670;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: var(--dtms-ink);
    --bs-border-color: var(--dtms-line);
    --bs-border-radius: .6rem;
    --bs-border-radius-lg: .85rem;
}

html { scroll-behavior: smooth; }
body {
    background-color: var(--dtms-bg);
    font-family: var(--bs-body-font-family);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.005em;
}
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { letter-spacing: -.02em; font-weight: 700; color: var(--dtms-ink); }
.font-monospace, code { font-family: "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace !important; }
::selection { background: rgba(47, 111, 179, .22); }

/* ---------- Bootstrap accents ---------- */
.btn { font-weight: 600; border-radius: .6rem; transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s, color .2s; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn-primary {
    --bs-btn-bg: var(--dtms-primary);
    --bs-btn-border-color: var(--dtms-primary);
    --bs-btn-hover-bg: var(--dtms-primary-600);
    --bs-btn-hover-border-color: var(--dtms-primary-600);
    --bs-btn-active-bg: var(--dtms-primary-700);
    --bs-btn-active-border-color: var(--dtms-primary-700);
    --bs-btn-disabled-bg: var(--dtms-primary);
    --bs-btn-disabled-border-color: var(--dtms-primary);
    box-shadow: 0 6px 14px -6px rgba(19, 68, 138, .55);
}
.btn-primary:hover { box-shadow: 0 10px 20px -8px rgba(19, 68, 138, .6); }
.btn-outline-primary {
    --bs-btn-color: var(--dtms-primary);
    --bs-btn-border-color: rgba(19, 68, 138, .35);
    --bs-btn-hover-bg: var(--dtms-primary);
    --bs-btn-hover-border-color: var(--dtms-primary);
    --bs-btn-active-bg: var(--dtms-primary);
    --bs-btn-active-border-color: var(--dtms-primary);
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--dtms-line); --bs-btn-hover-bg: var(--dtms-sky); --bs-btn-hover-border-color: #cfdcef; }
.btn-soft { background: var(--dtms-sky); color: var(--dtms-primary); border: 1px solid transparent; }
.btn-soft:hover { background: #dbe7f8; color: var(--dtms-primary-700); }
.btn-link { --bs-btn-color: var(--dtms-primary); --bs-btn-hover-color: var(--dtms-primary-600); }
.bg-primary { background-color: var(--dtms-primary) !important; }
.text-primary { color: var(--dtms-primary) !important; }
.text-bg-primary { background-color: var(--dtms-primary) !important; color: #fff !important; }
a { color: var(--dtms-primary); }
a:hover { color: var(--dtms-primary-600); }
.page-link { color: var(--dtms-primary); border-radius: .5rem !important; margin: 0 2px; border-color: var(--dtms-line); }
.page-item.active .page-link { background-color: var(--dtms-primary); border-color: var(--dtms-primary); }
.nav-pills .nav-link.active { background-color: var(--dtms-primary); }
.dropdown-menu { border: 1px solid var(--dtms-line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .35rem; animation: pop-in .16s var(--ease); }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; }
.dropdown-item.active, .dropdown-item:active { background-color: var(--dtms-primary); }
.form-control, .form-select { border-radius: .6rem; border-color: #d8e0eb; padding-top: .5rem; padding-bottom: .5rem; transition: border-color .15s, box-shadow .2s; }
.form-control-sm, .form-select-sm { padding-top: .3rem; padding-bottom: .3rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #7d9bc9;
    box-shadow: 0 0 0 .25rem rgba(19, 68, 138, .14);
}
.form-label { font-weight: 600; font-size: .85rem; color: var(--dtms-ink-2); margin-bottom: .3rem; }
.form-text { color: var(--dtms-ink-3); }
.form-check-input:checked { background-color: var(--dtms-primary); border-color: var(--dtms-primary); }
.card { border: 1px solid var(--dtms-line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.card-header { background: transparent; border-bottom: 1px solid var(--dtms-line); padding: .9rem 1.1rem; font-weight: 700; }
.card-body { padding: 1.1rem; }
.badge { font-weight: 600; letter-spacing: .01em; }
.table { --bs-table-hover-bg: #f5f8fd; }
.table > thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dtms-ink-3);
    font-weight: 700; border-bottom-width: 1px; background: #f8fafd; white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .7rem .75rem; border-color: #edf1f6; }
.alert { border-radius: 12px; border: 0; animation: fade-up .35s var(--ease); }
.breadcrumb { margin-bottom: .6rem; }
:focus-visible { outline: 2px solid var(--dtms-accent); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar {
    background: var(--dtms-navy);
    height: var(--dtms-topbar-h);
    z-index: 1030;
    border-bottom: 1px solid rgba(255, 255, 255, .06) !important;
}
.topbar .navbar-brand, .topbar .navbar-brand * { color: #fff !important; }
.topbar .brand-mark {
    width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(140deg, #2f6fb3, #13448a); color: #fff; font-size: 1.05rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.topbar .brand-sub { display: block; font-size: .68rem; font-weight: 500; color: #9fb3d1 !important; letter-spacing: .02em; line-height: 1.1; }
.topbar .nav-link { color: #dbe4f3; border-radius: 10px; transition: background-color .2s; }
.topbar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.topbar .btn-link.text-body { color: #dbe4f3 !important; }
.avatar-sm {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(140deg, #4c8ad0, #2f6fb3); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; box-shadow: 0 0 0 2px rgba(255, 255, 255, .2);
}
#bellCount { animation: bump .5s var(--ease); }

/* Global search */
.gsearch { position: relative; flex: 1 1 auto; max-width: 480px; }
.gsearch .gs-input {
    width: 100%; height: 38px; border-radius: 10px; padding: 0 70px 0 38px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #fff;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.gsearch .gs-input::placeholder { color: #9fb3d1; }
.gsearch .gs-input:focus { outline: 0; background: #fff; color: var(--dtms-ink); border-color: #fff; box-shadow: 0 0 0 4px rgba(47, 111, 179, .35); }
.gsearch .gs-input:focus::placeholder { color: var(--dtms-ink-3); }
.gsearch .gs-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9fb3d1; pointer-events: none; }
.gsearch .gs-input:focus ~ .gs-ico { color: var(--dtms-ink-3); }
.gsearch kbd {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: rgba(255, 255, 255, .12); color: #c9d6ea; border: 0; font-size: .68rem; padding: .15rem .4rem; border-radius: 6px;
}
.gsearch .gs-input:focus ~ kbd { opacity: 0; }
.gs-panel {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border-radius: 14px;
    box-shadow: var(--shadow-lg); border: 1px solid var(--dtms-line); overflow: hidden; z-index: 1060;
    animation: pop-in .16s var(--ease);
}
.gs-item { display: flex; gap: .75rem; align-items: center; padding: .65rem .85rem; color: var(--dtms-ink); text-decoration: none; border-bottom: 1px solid #f0f3f8; }
.gs-item:last-child { border-bottom: 0; }
.gs-item:hover, .gs-item.active { background: var(--dtms-sky); color: var(--dtms-ink); }
.gs-item .gs-tn { font-weight: 700; font-size: .85rem; }
.gs-item .gs-sub { font-size: .8rem; color: var(--dtms-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-empty { padding: 1rem; color: var(--dtms-ink-3); font-size: .85rem; text-align: center; }

/* Top progress bar (page navigation + AJAX) */
#dtmsProgress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000;
    background: linear-gradient(90deg, #60a5fa, #fff, #60a5fa); background-size: 200% 100%;
    box-shadow: 0 0 10px rgba(96, 165, 250, .7); opacity: 0;
    transition: width .4s var(--ease), opacity .3s;
    animation: shimmer 1.2s linear infinite;
}
#dtmsProgress.on { opacity: 1; }

/* ---------- Shell + sidebar ---------- */
.dtms-shell { display: flex; align-items: flex-start; }
.dtms-sidebar {
    width: var(--dtms-sidebar-w);
    flex: 0 0 var(--dtms-sidebar-w);
    background: var(--dtms-navy);
    height: calc(100vh - var(--dtms-topbar-h));
    position: sticky;
    top: var(--dtms-topbar-h);
    overflow-y: auto;
    padding: 1rem .75rem;
    border-right: 0 !important;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.dtms-sidebar .side-foot { margin-top: 1.25rem; padding: .9rem; border-radius: 12px; background: rgba(255, 255, 255, .05); color: #9fb3d1; font-size: .75rem; }
.dtms-sidebar .side-foot strong { color: #e7eefb; display: block; font-size: .8rem; }
.dtms-main { flex: 1 1 auto; min-width: 0; }
.dtms-main > .container-fluid { max-width: 1600px; }

.dtms-nav .nav-link {
    display: flex; align-items: center; gap: .7rem;
    border-radius: 10px;
    color: #b9c8df;
    padding: .55rem .75rem;
    font-size: .9rem; font-weight: 500;
    position: relative;
    transition: background-color .2s, color .2s, padding-left .2s var(--ease);
}
.dtms-nav .nav-link .bi { font-size: 1.05rem; width: 1.2rem; text-align: center; transition: transform .25s var(--ease); }
.dtms-nav .nav-link:hover { background: var(--dtms-navy-2); color: #fff; }
.dtms-nav .nav-link:hover .bi:not(.nav-caret) { transform: scale(1.12); }
.dtms-nav .nav-link.active { background: linear-gradient(90deg, var(--dtms-primary), var(--dtms-navy-3)); color: #fff; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .6); }
.dtms-nav .nav-link.active::before {
    content: ""; position: absolute; left: -.75rem; top: 20%; bottom: 20%; width: 3px; border-radius: 0 3px 3px 0; background: #7fb2ec;
}
.dtms-nav .nav-link.disabled { color: #6f82a3; }
.dtms-nav .nav-parent { font-weight: 600; color: #e7eefb; }
.dtms-nav .nav-parent .nav-caret { margin-left: auto; width: auto; font-size: .75rem; transition: transform .25s var(--ease); }
.dtms-nav .nav-parent[aria-expanded="true"] { color: #fff; }
.dtms-nav .nav-parent[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.dtms-subnav { margin: .15rem 0 .45rem 1rem; padding-left: .4rem; border-left: 1px solid rgba(255, 255, 255, .1); }
.dtms-subnav .nav-link { font-size: .86rem; padding: .42rem .6rem; }
.dtms-subnav .nav-link.active::before { left: calc(-.4rem - 2px); }
.dtms-nav .nav-count { margin-left: auto; font-size: .68rem; background: rgba(255, 255, 255, .12); color: #e7eefb; border-radius: 99px; padding: .05rem .45rem; }

#sidebarOff { background: var(--dtms-navy); color: #fff; }
#sidebarOff .offcanvas-title, #sidebarOff .text-muted { color: #c3d0e6 !important; }
#sidebarOff .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.offcanvas .dtms-nav { padding: .5rem .75rem; }

/* ---------- Page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.55rem; margin: 0; }
.page-head .sub { color: var(--dtms-ink-3); font-size: .9rem; margin-top: .15rem; }
.page-head .eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dtms-accent); }

/* ---------- Status pill ---------- */
.st {
    display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem .25rem .55rem;
    border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; line-height: 1.3;
    color: var(--c); background: var(--b);
}
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-received { --c: var(--st-received); --b: var(--st-received-bg); }
.st-returned { --c: var(--st-returned); --b: var(--st-returned-bg); }
.st-in_process { --c: var(--st-in_process); --b: var(--st-in_process-bg); }
.st-in_process::before { animation: pulse-dot 1.8s ease-out infinite; }
.st-completed { --c: var(--st-completed); --b: var(--st-completed-bg); }
.st-archived { --c: var(--st-archived); --b: var(--st-archived-bg); }
.st-lg { font-size: .85rem; padding: .35rem .85rem .35rem .7rem; }

.idle { font-size: .72rem; font-weight: 600; padding: .1rem .45rem; border-radius: 6px; background: #f1f4f8; color: var(--dtms-ink-3); }
.idle.warn { background: #fff4e5; color: #b45309; }
.idle.bad { background: #fdecec; color: #b91c1c; }
.holder { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; }
.holder .bi { color: var(--dtms-ink-3); }

/* ---------- KPI cards ---------- */
.kpi {
    position: relative; overflow: hidden; display: block; height: 100%;
    background: var(--dtms-card); border: 1px solid var(--dtms-line); border-radius: var(--radius);
    padding: 1rem 1.1rem; color: var(--dtms-ink); text-decoration: none; box-shadow: var(--shadow-sm);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
a.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d3deee; color: var(--dtms-ink); }
.kpi .kpi-ico {
    width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: var(--c, var(--dtms-primary)); background: var(--b, var(--dtms-sky)); margin-bottom: .75rem;
}
.kpi .kpi-val { font-size: 1.85rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .kpi-lbl { font-size: .8rem; color: var(--dtms-ink-3); font-weight: 500; margin-top: .3rem; }
.kpi::after {
    content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
    background: var(--b, var(--dtms-sky)); opacity: .55; transition: transform .5s var(--ease);
}
a.kpi:hover::after { transform: scale(1.25); }
.kpi > * { position: relative; z-index: 1; }
.kpi-hero { background: linear-gradient(135deg, var(--dtms-navy) 0%, var(--dtms-primary) 100%); color: #fff; border: 0; }
.kpi-hero .kpi-lbl { color: #c3d3ea; }
.kpi-hero .kpi-ico { background: rgba(255, 255, 255, .14); color: #fff; }
.kpi-hero::after { background: rgba(255, 255, 255, .08); opacity: 1; }
a.kpi-hero:hover { color: #fff; }

/* Legacy stat cards (other pages) */
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: .75rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }

/* ---------- Pipeline (dashboard) ---------- */
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.pipe {
    position: relative; padding: .9rem .9rem .8rem; border-radius: 12px; background: var(--b); color: var(--c);
    text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s;
}
.pipe:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--c); }
.pipe .n { font-size: 1.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pipe .l { font-size: .78rem; font-weight: 600; margin-top: .3rem; opacity: .9; }
.pipe .bar { height: 4px; border-radius: 4px; background: rgba(0, 0, 0, .06); margin-top: .65rem; overflow: hidden; }
.pipe .bar i { display: block; height: 100%; width: 0; background: currentColor; border-radius: 4px; transition: width 1.1s var(--ease); }
.pipe:not(:last-child)::after {
    content: "\F285"; font-family: "bootstrap-icons"; position: absolute; right: -.62rem; top: 50%; transform: translateY(-50%);
    z-index: 2; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: #fff; color: var(--dtms-ink-3);
    display: flex; align-items: center; justify-content: center; font-size: .65rem; box-shadow: var(--shadow-sm);
}
@media (max-width: 767.98px) {
    .pipeline { grid-template-columns: repeat(2, 1fr); }
    .pipe:not(:last-child)::after { display: none; }
}

/* Horizontal bars */
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: .65rem; font-size: .85rem; margin-bottom: .6rem; }
.hbar .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hbar .track { height: 10px; border-radius: 99px; background: #eef2f8; overflow: hidden; display: flex; }
.hbar .track i { display: block; height: 100%; width: 0; transition: width 1s var(--ease); }
.hbar .val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

/* Donut */
.donut { width: 160px; height: 160px; border-radius: 50%; position: relative; flex: 0 0 auto; animation: spin-in 1s var(--ease); }
.donut::after { content: ""; position: absolute; inset: 20px; background: #fff; border-radius: 50%; box-shadow: inset 0 2px 6px rgba(11, 37, 69, .06); }
.donut .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.legend-row { display: flex; align-items: center; gap: .55rem; font-size: .85rem; padding: .3rem .4rem; border-radius: 8px; color: var(--dtms-ink); text-decoration: none; }
a.legend-row:hover { background: #f4f7fc; color: var(--dtms-ink); }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }

/* Sparkline columns */
.spark { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.spark .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.spark .col .b {
    width: 100%; max-width: 40px; border-radius: 8px 8px 3px 3px; min-height: 3px;
    background: linear-gradient(180deg, #4c8ad0, var(--dtms-primary)); transform-origin: bottom; animation: grow-y .9s var(--ease) both;
}
.spark .col:last-child .b { background: linear-gradient(180deg, #7fb2ec, #2f6fb3); }

/* ---------- Activity feed / timeline ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px dashed #e8edf4; }
.feed li:last-child { border-bottom: 0; }
.feed .dot {
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: var(--b); color: var(--c); font-size: .95rem;
}
.feed .what { font-size: .88rem; }
.feed .meta { font-size: .76rem; color: var(--dtms-ink-3); }

.act-forward  { --c: #7c3aed; --b: #f1ebfe; }
.act-receive  { --c: #2563eb; --b: #e8effd; }
.act-return   { --c: #c2410c; --b: #fdf0e7; }
.act-complete { --c: #047857; --b: #e6f6ef; }
.act-release, .act-archive { --c: #334155; --b: #eef1f5; }
.act-note     { --c: #64748b; --b: #f3f5f8; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 .25rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: 1.32rem; top: .5rem; bottom: .5rem; width: 2px; background: linear-gradient(#dbe4f1, #eef2f8); }
.tl { position: relative; display: flex; gap: .9rem; padding: 0 0 1.15rem; }
.tl:last-child { padding-bottom: 0; }
.tl .tl-dot {
    position: relative; z-index: 1; flex: 0 0 2.15rem; width: 2.15rem; height: 2.15rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: var(--b); color: var(--c);
    box-shadow: 0 0 0 4px #fff; font-size: .9rem;
}
.tl.is-latest .tl-dot { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--b); animation: ring 2.2s ease-out infinite; }
.tl .tl-body { flex: 1; min-width: 0; padding-top: .15rem; }
.tl .tl-title { font-weight: 700; font-size: .92rem; }
.tl .tl-route { font-size: .85rem; color: var(--dtms-ink-2); }
.tl .tl-meta { font-size: .76rem; color: var(--dtms-ink-3); margin-top: .1rem; }
.tl .tl-note { margin-top: .4rem; background: #f6f8fc; border: 1px solid #edf1f7; border-radius: 10px; padding: .5rem .7rem; font-size: .85rem; white-space: pre-wrap; }

/* ---------- Stepper (document lifecycle) ---------- */
.stepper { display: flex; align-items: flex-start; gap: 0; margin: 0; padding: 0; list-style: none; }
.stepper li { flex: 1; position: relative; text-align: center; font-size: .78rem; color: var(--dtms-ink-3); font-weight: 600; }
.stepper li .s-ico {
    width: 34px; height: 34px; margin: 0 auto .4rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: #fff; border: 2px solid #d6dfec; color: #9aa9bf; position: relative; z-index: 1;
    transition: all .4s var(--ease);
}
.stepper li:not(:first-child)::before {
    content: ""; position: absolute; top: 16px; right: 50%; width: 100%; height: 2px; background: #dfe6f0;
}
.stepper li:not(:first-child)::after {
    content: ""; position: absolute; top: 16px; right: 50%; width: 0; height: 2px; background: var(--dtms-primary);
    transition: width .7s var(--ease);
}
.stepper li.done .s-ico { background: var(--dtms-primary); border-color: var(--dtms-primary); color: #fff; }
.stepper li.done, .stepper li.current { color: var(--dtms-ink); }
.stepper li.done::after, .stepper li.current::after { width: 100%; }
.stepper li.current .s-ico { border-color: var(--dtms-primary); color: var(--dtms-primary); box-shadow: 0 0 0 5px rgba(19, 68, 138, .12); animation: ring-blue 2.2s ease-out infinite; }
.stepper li.warn .s-ico { border-color: #ea580c; background: #fff4ec; color: #c2410c; box-shadow: 0 0 0 5px rgba(234, 88, 12, .12); }
.stepper li.warn { color: #c2410c; }

/* ---------- Document hero ---------- */
.doc-hero {
    position: relative; overflow: hidden; border-radius: 18px; padding: 1.4rem 1.5rem; color: #fff;
    background: radial-gradient(1200px 300px at 100% -40%, rgba(127, 178, 236, .35), transparent 60%), linear-gradient(130deg, var(--dtms-navy), var(--dtms-primary));
    box-shadow: var(--shadow);
}
.doc-hero .tn { font-family: "JetBrains Mono", Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .02em; }
.doc-hero .subj { font-size: 1.05rem; color: #dbe6f6; max-width: 900px; }
.doc-hero .chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; padding: .25rem .6rem; border-radius: 99px; background: rgba(255, 255, 255, .12); color: #eaf1fb; }
.doc-hero .st { background: #fff; }
.doc-hero .btn-hero { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.doc-hero .btn-hero:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.now-card { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: 14px; background: var(--dtms-sky); border: 1px solid #d7e4f6; }
.now-card .ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--dtms-primary); font-size: 1.25rem; box-shadow: var(--shadow-sm); }
.now-card .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dtms-ink-3); font-weight: 700; }
.now-card .val { font-weight: 700; font-size: 1rem; }

/* Next-step tiles */
.step-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.step-tile {
    display: flex; align-items: center; gap: .7rem; text-align: left; width: 100%;
    border: 1px solid var(--dtms-line); background: #fff; border-radius: 12px; padding: .75rem .85rem;
    font-weight: 600; font-size: .88rem; color: var(--dtms-ink); cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s, background-color .2s;
}
.step-tile .bi { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; background: var(--tb, var(--dtms-sky)); color: var(--tc, var(--dtms-primary)); transition: transform .3s var(--ease); }
.step-tile small { display: block; font-weight: 500; color: var(--dtms-ink-3); font-size: .74rem; }
.step-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cfdcef; }
.step-tile:hover .bi { transform: rotate(-8deg) scale(1.08); }
.step-tile.primary-step { border-color: transparent; background: linear-gradient(135deg, var(--dtms-primary), var(--dtms-navy-3)); color: #fff; box-shadow: 0 10px 22px -12px rgba(19, 68, 138, .8); }
.step-tile.primary-step small { color: #c9d8ee; }
.step-tile.primary-step .bi { background: rgba(255, 255, 255, .16); color: #fff; }
.tone-primary { --tc: #13448a; --tb: #e8f0fb; }
.tone-info { --tc: #2563eb; --tb: #e8effd; }
.tone-success { --tc: #047857; --tb: #e6f6ef; }
.tone-warning { --tc: #c2410c; --tb: #fdf0e7; }
.tone-dark { --tc: #1e293b; --tb: #eef1f5; }
.tone-secondary { --tc: #475569; --tb: #f1f4f8; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.25rem; }
.info-grid .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--dtms-ink-3); font-weight: 700; }
.info-grid .v { font-size: .92rem; font-weight: 500; margin-top: .15rem; word-break: break-word; }
.info-grid .wide { grid-column: 1 / -1; }

/* ---------- Masterlist ---------- */
.status-tabs { display: flex; gap: .4rem; overflow-x: auto; padding: .2rem .1rem .5rem; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar { display: none; }
.status-tabs .tab {
    display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
    border: 1px solid var(--dtms-line); background: #fff; color: var(--dtms-ink-2);
    border-radius: 99px; padding: .4rem .5rem .4rem .9rem; font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: all .2s var(--ease);
}
.status-tabs .tab .n { min-width: 1.6rem; text-align: center; padding: .05rem .45rem; border-radius: 99px; background: #f1f4f9; font-size: .75rem; font-variant-numeric: tabular-nums; transition: all .2s; }
.status-tabs .tab:hover { border-color: #c9d7ec; color: var(--dtms-ink); }
.status-tabs .tab.active { background: var(--dtms-navy); color: #fff; border-color: var(--dtms-navy); box-shadow: 0 6px 14px -8px rgba(11, 37, 69, .8); }
.status-tabs .tab.active .n { background: rgba(255, 255, 255, .18); color: #fff; }
.status-tabs .tab .sw { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters .form-select, .filters .form-control { width: auto; min-width: 150px; }

table.dataTable tbody tr { transition: background-color .15s; }
table.dataTable tbody tr.selected > * { box-shadow: inset 0 0 0 9999px rgba(19, 68, 138, .07) !important; color: var(--dtms-ink) !important; }
table.dataTable tbody tr.selected a.tn-link { color: var(--dtms-primary) !important; }
table.dataTable td .subj {
    font-weight: 600; color: var(--dtms-ink); max-width: 460px; min-width: 180px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
table.dataTable td .subj-sub { font-size: .78rem; color: var(--dtms-ink-3); display: block; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.dataTable td a.tn-link { font-weight: 700; text-decoration: none; }
table.dataTable td a.tn-link:hover { text-decoration: underline; }
.dt-container .dt-search input, .dataTables_filter input { border-radius: 10px !important; min-width: 240px; }
div.dt-processing, div.dataTables_processing {
    background: rgba(255, 255, 255, .92) !important; border: 1px solid var(--dtms-line) !important; border-radius: 12px !important;
    box-shadow: var(--shadow) !important; font-weight: 600; color: var(--dtms-primary);
}
div.dt-processing > div:last-child > div, div.dataTables_processing > div:last-child > div { background: var(--dtms-primary) !important; }
.row-actions { display: inline-flex; gap: .25rem; }
.row-actions .btn { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; }

.bulkbar {
    position: fixed; left: 50%; bottom: 22px; z-index: 1040; transform: translate(-50%, calc(100% + 60px));
    visibility: hidden;
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: center;
    background: var(--dtms-navy); color: #fff; padding: .55rem .6rem .55rem 1rem; border-radius: 16px;
    box-shadow: 0 22px 50px -12px rgba(11, 37, 69, .6); transition: transform .4s var(--ease), visibility .4s; max-width: calc(100vw - 24px);
}
.bulkbar.show { transform: translate(-50%, 0); visibility: visible; }
.bulkbar .count { font-weight: 700; white-space: nowrap; }
.bulkbar .btn { --bs-btn-padding-y: .35rem; --bs-btn-font-size: .85rem; }
.bulkbar .btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 0; }
.bulkbar .btn-ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Action dialog ---------- */
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal.fade .modal-dialog { transform: translateY(14px) scale(.98); transition: transform .3s var(--ease), opacity .3s; }
.modal.show .modal-dialog { transform: none; }
.modal-header { background: var(--dtms-navy); color: #fff; border-bottom: 0; padding: 1rem 1.25rem; }
.modal-title { color: #fff; font-weight: 700; }
.modal-header .btn-close { filter: invert(1) grayscale(100%) brightness(200%); opacity: .85; }
.modal-footer { border-top: 1px solid var(--dtms-line); background: #fafbfd; }
.modal-backdrop.show { opacity: .45; backdrop-filter: blur(2px); }
.wf-help { display: flex; gap: .65rem; align-items: flex-start; background: var(--dtms-sky); border-radius: 12px; padding: .7rem .85rem; font-size: .86rem; color: var(--dtms-ink-2); }
.wf-help .bi { color: var(--dtms-primary); font-size: 1.05rem; margin-top: .05rem; }
.wf-flow { display: flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 600; flex-wrap: wrap; }
.wf-targets { display: flex; flex-wrap: wrap; gap: .4rem; }
.wf-targets .chip-btn {
    border: 1px solid var(--dtms-line); background: #fff; border-radius: 99px; padding: .3rem .75rem; font-size: .8rem; font-weight: 600; color: var(--dtms-ink-2);
    transition: all .15s;
}
.wf-targets .chip-btn:hover, .wf-targets .chip-btn.on { background: var(--dtms-primary); color: #fff; border-color: var(--dtms-primary); }

/* Keep scrollable modals scrollable even when a <form> wraps the body/footer. */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; max-height: 100%; min-height: 0; overflow: hidden; }
.modal-dialog-scrollable .modal-body { overflow-y: auto; }

.form-section { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dtms-accent); display: flex; align-items: center; gap: .5rem; margin: .25rem 0 -.25rem; }
.form-section::after { content: ""; flex: 1; height: 1px; background: var(--dtms-line); }

/* ---------- Toasts ---------- */
#dtmsToasts { z-index: 2100 !important; }
.toast { border-radius: 12px !important; box-shadow: var(--shadow-lg) !important; animation: toast-in .35s var(--ease); overflow: hidden; }
.toast .toast-body { font-weight: 600; display: flex; gap: .5rem; align-items: center; }

/* ---------- Scanner ---------- */
.scan-stage { position: relative; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--dtms-line); box-shadow: var(--shadow-sm); min-height: 320px; }
.scan-stage #reader { border: 0 !important; }
.scan-stage #reader video { border-radius: 0 !important; object-fit: cover; }
.scan-stage #reader__dashboard { background: #fff; padding: .75rem !important; }
.scan-frame { pointer-events: none; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.scan-frame span { width: 62%; max-width: 260px; aspect-ratio: 1; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(8, 24, 46, .35); position: relative; }
.scan-frame span::before { content: ""; position: absolute; left: 8%; right: 8%; height: 2px; top: 10%; background: #60a5fa; box-shadow: 0 0 14px #60a5fa; animation: scanline 2.2s ease-in-out infinite alternate; }
.scan-result { animation: pop-in .3s var(--ease); }

/* ---------- Empty / skeleton ---------- */
.empty { text-align: center; padding: 2rem 1rem; color: var(--dtms-ink-3); }
.empty .bi { font-size: 2.2rem; display: block; margin-bottom: .5rem; color: #b7c4d8; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 50%, #eef2f7 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }

/* ---------- Auth (login / forgot / reset) ---------- */
.auth-body { min-height: 100vh; background: #fff; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }

/* Brand panel */
.auth-hero {
    position: relative; overflow: hidden; color: #fff; padding: 2.5rem 3rem 2rem;
    display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
    background: radial-gradient(1000px 520px at 0% 0%, #1a4f96 0%, transparent 55%),
                radial-gradient(800px 500px at 100% 100%, #123a6e 0%, transparent 60%),
                linear-gradient(160deg, #0b2545 0%, #0e2d55 55%, #0a2140 100%);
}
.auth-grid {
    position: absolute; inset: 0; pointer-events: none; opacity: .35;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 40% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse at 40% 40%, #000 30%, transparent 75%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.orb-1 { width: 380px; height: 380px; background: #2f6fb3; top: -120px; right: -100px; animation: drift 16s ease-in-out infinite; }
.orb-2 { width: 300px; height: 300px; background: #4c8ad0; bottom: -110px; left: -80px; opacity: .35; animation: drift 20s ease-in-out infinite reverse; }
.orb-3 { width: 180px; height: 180px; background: #7fb2ec; top: 45%; left: 55%; opacity: .18; animation: drift 13s ease-in-out infinite; }
.auth-hero > *:not(.orb):not(.auth-grid) { position: relative; z-index: 1; }

.hero-top { display: flex; align-items: center; gap: .8rem; animation: fade-up .6s var(--ease) both; }
.hero-mark {
    width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(140deg, #4c8ad0, #13448a); color: #fff; font-size: 1.35rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 10px 24px -10px rgba(0,0,0,.6);
}
.hero-mark.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
.hero-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.1; }
.hero-org { font-size: .8rem; color: #a9bddb; }

.hero-body { max-width: 560px; }
.hero-eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8fb6e6; margin-bottom: .75rem; animation: fade-up .6s .1s var(--ease) both; }
.hero-title { color: #fff; font-size: clamp(1.7rem, 2.6vw, 2.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; margin-bottom: 1.5rem; animation: fade-up .6s .18s var(--ease) both; }
.hero-title span { color: #9cc3f0; }

.route-card {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: .75rem .75rem .9rem;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 20px 40px -24px rgba(0,0,0,.7);
    animation: fade-up .7s .26s var(--ease) both;
}
.route-card svg { width: 100%; height: auto; display: block; overflow: visible; }
.rnode .halo { fill: rgba(127,178,236,.14); transform-box: fill-box; transform-origin: center; transition: fill .4s; }
.rnode .core { fill: #0e2d55; stroke: rgba(255,255,255,.45); stroke-width: 2.5; transition: fill .4s, stroke .4s; }
.rnode text { fill: #a9bddb; font: 600 12px Inter, system-ui, sans-serif; transition: fill .4s; }
.rnode.done .core { fill: #7fb2ec; stroke: #fff; }
.rnode.done text { fill: #fff; }
.rnode.now .halo { fill: rgba(127,178,236,.35); animation: node-pulse 1.4s ease-out infinite; }
.route-status { display: flex; align-items: center; justify-content: center; gap: .5rem; font-size: .85rem; color: #dbe6f6; font-weight: 600; margin-top: .1rem; }
.route-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.18); }
.route-status.pop { animation: pop-in .35s var(--ease); }

.hero-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .9rem; }
.hero-points li { display: flex; gap: .85rem; align-items: flex-start; animation: fade-up .6s var(--ease) both; }
.hero-points li:nth-child(1) { animation-delay: .38s; }
.hero-points li:nth-child(2) { animation-delay: .46s; }
.hero-points li:nth-child(3) { animation-delay: .54s; }
.hero-points .bi {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08); color: #9cc3f0; font-size: 1.05rem; border: 1px solid rgba(255,255,255,.1);
}
.hero-points strong { display: block; font-size: .92rem; }
.hero-points span { font-size: .84rem; color: #a9bddb; }
.hero-foot { font-size: .76rem; color: #7f96b8; }

/* Form panel */
.auth-panel { display: flex; flex-direction: column; padding: 1.5rem 2rem; background: #fff; position: relative; }
.auth-panel::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(600px 300px at 100% 0%, rgba(47,111,179,.07), transparent 70%);
}
.auth-topline { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; position: relative; }
.mobile-brand { display: none; align-items: center; gap: .55rem; margin-right: auto; color: var(--dtms-navy); }
.clock-chip { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 600; color: var(--dtms-ink-3); background: #f3f6fb; border: 1px solid var(--dtms-line); padding: .35rem .75rem; border-radius: 99px; }
.auth-form-wrap { width: 100%; max-width: 410px; margin: auto; padding: 2rem 0; position: relative; animation: fade-up .55s .1s var(--ease) both; }
.auth-head h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .35rem; }
.auth-head p { color: var(--dtms-ink-3); margin-bottom: 1.75rem; }
.auth-form-wrap .alert { font-size: .88rem; }
.auth-legal { text-align: center; font-size: .75rem; color: var(--dtms-ink-3); position: relative; }

/* Floating-label fields */
.fx { position: relative; margin-bottom: 1rem; animation: fade-up .5s calc(.15s + var(--d, 0) * 70ms) var(--ease) both; }
.fx-row { animation: fade-up .5s calc(.15s + var(--d, 0) * 70ms) var(--ease) both; }
.fx-input {
    width: 100%; height: 58px; border: 1.5px solid #d8e0eb; border-radius: 14px; background: #fff;
    padding: 1.35rem 3rem .4rem 2.9rem; font-size: 1rem; color: var(--dtms-ink);
    transition: border-color .2s, box-shadow .25s, background-color .2s;
}
.fx-input:hover { border-color: #b9c8de; }
.fx-input:focus { outline: 0; border-color: var(--dtms-accent); box-shadow: 0 0 0 4px rgba(47,111,179,.15); }
.fx-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; }
.fx label {
    position: absolute; left: 2.9rem; top: 50%; transform: translateY(-50%); transform-origin: left center;
    color: var(--dtms-ink-3); font-size: 1rem; pointer-events: none; transition: all .2s var(--ease);
}
.fx-input:focus + label, .fx-input:not(:placeholder-shown) + label, .fx-input:-webkit-autofill + label {
    top: .95rem; transform: translateY(-50%) scale(.78); color: var(--dtms-accent); font-weight: 600;
}
.fx-icon { position: absolute; left: 1.05rem; top: 50%; transform: translateY(-50%); font-size: 1.1rem; color: #8a9ab3; transition: color .2s; z-index: 1; }
.fx:focus-within .fx-icon { color: var(--dtms-accent); }
.fx-eye {
    position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px;
    background: transparent; color: #8a9ab3; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: background-color .2s, color .2s;
}
.fx-eye:hover { background: #f1f5fb; color: var(--dtms-primary); }
.caps-hint { font-size: .8rem; font-weight: 600; color: #b45309; background: #fff7ed; border-radius: 8px; padding: 0 .6rem; max-height: 0; overflow: hidden; opacity: 0; margin-top: -.5rem; transition: all .25s var(--ease); }
.caps-hint.show { max-height: 40px; opacity: 1; padding: .35rem .6rem; margin: -.4rem 0 .6rem; }
.auth-form .form-switch .form-check-input { width: 2.3em; height: 1.25em; cursor: pointer; }
.auth-form .form-check-label { cursor: pointer; color: var(--dtms-ink-2); }

.btn-auth {
    height: 54px; border-radius: 14px; border: 0; color: #fff; font-weight: 700; font-size: 1rem; letter-spacing: .01em;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem; position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--dtms-primary) 0%, var(--dtms-navy-3) 100%);
    box-shadow: 0 14px 28px -14px rgba(19,68,138,.9);
}
.btn-auth::after {
    content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); transition: left .7s var(--ease);
}
.btn-auth:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 18px 32px -14px rgba(19,68,138,.95); }
.btn-auth:hover::after { left: 120%; }
.btn-auth .bi-arrow-right { transition: transform .25s var(--ease); }
.btn-auth:hover .bi-arrow-right { transform: translateX(4px); }
.btn-auth:disabled { color: #fff; opacity: .85; }
.auth-help { margin-top: 1.25rem; font-size: .82rem; color: var(--dtms-ink-3); text-align: center; }

/* Legacy auth input-groups (forgot / reset) inside the new panel */
.auth-form-wrap .input-group-text { background: #f6f8fc; border-color: #d8e0eb; color: #8a9ab3; border-radius: 12px 0 0 12px; }
.auth-form-wrap .input-group .form-control { height: 50px; border-color: #d8e0eb; }
.auth-form-wrap .input-group > :last-child { border-radius: 0 12px 12px 0; }
.auth-form-wrap .btn-primary { height: 50px; border-radius: 12px; }

.auth-form-wrap.shake { animation: shake .5s .25s cubic-bezier(.36,.07,.19,.97) both; }

@media (max-width: 991.98px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .mobile-brand { display: inline-flex; }
    .auth-panel { min-height: 100vh; padding: 1.1rem 1.25rem; background: linear-gradient(180deg, #eef3fa 0%, #fff 38%); }
    .auth-form-wrap { margin: 0 auto; padding-top: 2.75rem; }
    .auth-legal { margin-top: auto; padding-top: 1.5rem; }
    .auth-head h1 { font-size: 1.7rem; }
}
@media (max-width: 400px) { .clock-chip { display: none; } }

@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(30px, -25px) scale(1.06); } 66% { transform: translate(-20px, 20px) scale(.96); } }
@keyframes node-pulse { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }

/* ==========================================================================
   Motion
   ========================================================================== */
/* No fill-mode: once finished, nothing stays applied, so the wrapper never
   becomes a containing block / stacking context for fixed children
   (Bootstrap modals, the bulk bar). */
.page-enter { animation: fade-up .45s var(--ease); }
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease), transform .55s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
[data-reveal].in { opacity: 1; transform: none; }
.tl[data-reveal] { transform: translateX(-10px); }
.tl[data-reveal].in { transform: none; }

@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes spin-in { from { transform: rotate(-90deg) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes ring { 0% { box-shadow: 0 0 0 4px #fff, 0 0 0 4px var(--b); } 70% { box-shadow: 0 0 0 4px #fff, 0 0 0 11px transparent; } 100% { box-shadow: 0 0 0 4px #fff, 0 0 0 4px var(--b); } }
@keyframes ring-blue { 0% { box-shadow: 0 0 0 0 rgba(19, 68, 138, .25); } 70% { box-shadow: 0 0 0 10px rgba(19, 68, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(19, 68, 138, 0); } }
@keyframes bump { 0% { transform: translate(-50%, -50%) scale(.4); } 60% { transform: translate(-50%, -50%) scale(1.2); } 100% { transform: translate(-50%, -50%) scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes scanline { from { top: 10%; } to { top: 88%; } }
@keyframes flash-row { 0% { background: rgba(250, 204, 21, .35); } 100% { background: transparent; } }
.flash { animation: flash-row 1.6s ease-out; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .page-head h1 { font-size: 1.3rem; }
    .doc-hero .tn { font-size: 1.3rem; }
}
@media (max-width: 575.98px) {
    .bulkbar {
        left: 10px; right: 10px; bottom: 10px; transform: translateY(calc(100% + 40px));
        flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: .5rem; border-radius: 14px;
        scrollbar-width: none;
    }
    .bulkbar::-webkit-scrollbar { display: none; }
    .bulkbar.show { transform: none; }
    .bulkbar .btn { white-space: nowrap; flex: 0 0 auto; }
    .dtms-main > .container-fluid { padding-left: .85rem; padding-right: .85rem; }
    .kpi .kpi-val { font-size: 1.5rem; }
    .filters .form-select, .filters .form-control { flex: 1 1 140px; min-width: 0; }
    .stepper li { font-size: .68rem; }
}

@media print {
    .topbar, .dtms-sidebar, .bulkbar, #dtmsProgress { display: none !important; }
    [data-reveal] { opacity: 1 !important; transform: none !important; }
}
