/* ==========================================================================
   Admin Template — admin.css  (v2 "Aubergine & Marigold")
   Built on Bootstrap 5.3. Re-brand by editing the :root tokens only.
   Fonts: Bricolage Grotesque (display) + Figtree (text) from Google Fonts.
   ========================================================================== */

:root {
    /* palette */
    --ink: #1d1442; /* aubergine ink — sidebar, login panel, headings */
    --ink-2: #2c2163;
    --ink-3: #3d3080;
    --canvas: #f2f0fa; /* page background */
    --surface: #ffffff;
    --surface-2: #f8f7fd;
    --line: #e3dff1;
    --text: #221a45;
    --muted: #6f6894;
    --violet: #5b3df5; /* primary actions */
    --violet-hover: #4a2ee0;
    --violet-soft: #ece8ff;
    --marigold: #f5a524; /* signature accent */
    --marigold-soft: #fff1d6;
    --mint: #0fa47a;
    --mint-soft: #dcf6ec;
    --rose: #e5484d;
    --rose-soft: #fde4e4;
    --sky: #2481e8;
    --sky-soft: #e0eefd;
    --sidebar-text: #b9b2dc;
    --sidebar-muted: #7d74ab;
    /* type */
    /*--font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;*/
    --font-display: "Bebas Neue", "Figtree", system-ui, sans-serif;
    --title-weight: 400;
    --title-tracking: .01em;
    --font-text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    /* shape */
    --r-lg: 20px; /* panels */
    --r-md: 12px; /* inputs, buttons */
    --r-sm: 8px; /* small chips */
    --sidebar-w: 268px;
    --sidebar-w-collapsed: 84px;
    --topbar-h: 72px;
    --shadow-panel: 0 1px 0 rgba(29, 20, 66, .04), 0 12px 32px -18px rgba(29, 20, 66, .22);
    --shadow-pop: 0 18px 48px -12px rgba(29, 20, 66, .32);
    /* semantic aliases used by components.css (shared with Design 2) */
    --primary: var(--violet);
    --primary-hover: var(--violet-hover);
    --primary-soft: var(--violet-soft);
    --accent: var(--marigold);
    --accent-soft: var(--marigold-soft);
    --accent-ink: #9a5f00;
    --success: var(--mint);
    --success-soft: var(--mint-soft);
    --danger: var(--rose);
    --danger-soft: var(--rose-soft);
    --info: var(--sky);
    --info-soft: var(--sky-soft);
    --check-border: #c9c2e4;
    --bs-body-font-family: var(--font-text);
    --bs-body-color: var(--text);
    --bs-body-bg: var(--canvas);
    --bs-border-color: var(--line);
    --bs-primary: var(--violet);
    --bs-primary-rgb: 91, 61, 245;
    --bs-link-color-rgb: 91, 61, 245;
}

[data-bs-theme="dark"] {
  --accent-ink: #f5a524; --check-border: #4a3f8a;
  --ink: #0d0824;
  --ink-2: #1c1446;
  --ink-3: #2b2166;
  --canvas: #140e30;
  --surface: #1c1540;
  --surface-2: #221a4c;
  --line: #31286a;
  --text: #ece9fb;
  --muted: #a39cc9;
  --violet: #7d63ff;
  --violet-hover: #9480ff;
  --violet-soft: rgba(125, 99, 255, .18);
  --marigold-soft: rgba(245, 165, 36, .16);
  --mint-soft: rgba(15, 164, 122, .18);
  --rose-soft: rgba(229, 72, 77, .18);
  --sky-soft: rgba(36, 129, 232, .18);
  --shadow-panel: none;
  --shadow-pop: 0 18px 48px -12px rgba(0, 0, 0, .6);
}

/* ---------- Base ---------- */
html, body { height: 100%; }
body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-text);
  font-size: .95rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--violet-hover); }
.text-muted { color: var(--muted) !important; }
::selection { background: var(--marigold); color: var(--ink); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

h1, h2, h3, h4, h5, .display-font {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  color: var(--text);
  letter-spacing: -.02em;
}

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--r-md);
  --bs-btn-padding-y: .6rem;
  --bs-btn-padding-x: 1.1rem;
  --bs-btn-font-size: .92rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
}
.btn-sm { --bs-btn-padding-y: .45rem; --bs-btn-padding-x: .85rem; --bs-btn-font-size: .85rem; --bs-btn-border-radius: 10px; }
.btn-lg { --bs-btn-padding-y: .85rem; --bs-btn-font-size: 1rem; }
.btn-primary {
  --bs-btn-bg: var(--violet); --bs-btn-border-color: var(--violet);
  --bs-btn-hover-bg: var(--violet-hover); --bs-btn-hover-border-color: var(--violet-hover);
  --bs-btn-active-bg: var(--violet-hover); --bs-btn-active-border-color: var(--violet-hover);
  --bs-btn-disabled-bg: var(--violet); --bs-btn-disabled-border-color: var(--violet);
  box-shadow: 0 6px 16px -8px var(--violet);
}
.btn-accent {
  --bs-btn-bg: var(--marigold); --bs-btn-border-color: var(--marigold); --bs-btn-color: var(--ink);
  --bs-btn-hover-bg: #e8971a; --bs-btn-hover-border-color: #e8971a; --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: #e8971a; --bs-btn-active-color: var(--ink);
}
.btn-ghost {
  --bs-btn-color: var(--text); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--line); --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--surface-2); --bs-btn-active-border-color: var(--line);
}

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .4rem; color: var(--text); }
.form-text { color: var(--muted); font-size: .8rem; }
.form-control, .form-select {
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background-color: var(--surface);
  color: var(--text);
  min-height: 46px;
  padding: .6rem .9rem;
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control-sm, .form-select-sm { min-height: 38px; padding: .35rem .75rem; font-size: .85rem; border-radius: 10px; }
.form-control::placeholder { color: var(--muted); opacity: .75; }
.form-control:hover, .form-select:hover { border-color: #cfc8ea; }
.form-control:focus, .form-select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-soft); background-color: var(--surface); color: var(--text); }
textarea.form-control { min-height: 110px; }
.input-group-text { border: 1.5px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: var(--r-md); }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: var(--rose); }
.invalid-feedback { color: var(--rose); font-weight: 500; }

/* ---------- Layout shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--ink);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: width .22s ease, transform .22s ease;
}
.sidebar-brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .7rem;
  padding: 0 1.4rem;
  color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em;
  white-space: nowrap; overflow: hidden;
}
.sidebar-brand:hover { color: #fff; }
.brand-mark {
  flex: 0 0 36px; height: 36px;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px;
}
.brand-mark span { display: block; }
.brand-mark span:nth-child(1) { background: var(--marigold); border-radius: 100% 0 0 0; }
.brand-mark span:nth-child(2) { background: var(--violet); border-radius: 50%; }
.brand-mark span:nth-child(3) { background: #fff; border-radius: 0 0 0 100%; opacity: .9; }
.brand-mark span:nth-child(4) { background: var(--mint); border-radius: 0 100% 0 0; }

.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: .5rem 0 1rem 1rem;      /* no right padding: active item meets the page */
}
.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-heading {
  font-size: .78rem; font-weight: 600;
  color: var(--sidebar-muted);
  padding: 1.1rem .9rem .45rem;
  white-space: nowrap;
}
.side-link {
  position: relative;
  display: flex; align-items: center; gap: .85rem;
  padding: .65rem .9rem;
  margin: 0 1rem 3px 0;
  border-radius: 14px;
  color: var(--sidebar-text);
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.side-link > i:first-child { font-size: 1.15rem; flex: 0 0 22px; text-align: center; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link .badge { margin-left: auto; background: var(--marigold) !important; color: var(--ink) !important; font-weight: 700; }
.side-link .caret { margin-left: auto; font-size: .75rem; transition: transform .2s; }
.side-link[aria-expanded="true"] .caret { transform: rotate(90deg); }
.side-link.parent-active { color: #fff; }

/* The signature: active item is "cut out" of the sidebar into the page */
.side-link.active {
  background: var(--canvas);
  color: var(--text);
  font-weight: 700;
  margin-right: 0;
  border-radius: 16px 0 0 16px;
}
.side-link.active > i:first-child { color: var(--violet); }
.side-link.active::before,
.side-link.active::after {
  content: ""; position: absolute; right: 0;
  width: 20px; height: 20px; pointer-events: none;
}
.side-link.active::before { top: -20px; border-bottom-right-radius: 20px; box-shadow: 6px 6px 0 6px var(--canvas); }
.side-link.active::after  { bottom: -20px; border-top-right-radius: 20px; box-shadow: 6px -6px 0 6px var(--canvas); }

.side-sub { padding: 2px 1rem 6px 2.1rem; }
.side-sub .side-link { padding: .42rem .8rem; margin-right: 0; font-size: .9rem; gap: .65rem; }
.side-sub .side-link::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid currentColor; opacity: .6; flex: 0 0 7px;
}
.side-sub .side-link.active {
  background: rgba(255, 255, 255, .08); color: #fff; border-radius: 10px; font-weight: 600;
}
.side-sub .side-link.active::before { position: static; width: 7px; height: 7px; box-shadow: none; border: 0; background: var(--marigold); opacity: 1; border-radius: 50%; }
.side-sub .side-link.active::after { display: none; }

.sidebar-footer {
  margin: .75rem 1rem 1rem;
  padding: .75rem;
  border-radius: 16px;
  background: var(--ink-2);
  display: flex; align-items: center; gap: .7rem;
  white-space: nowrap; overflow: hidden;
}
.sidebar-footer .name { color: #fff; font-weight: 600; font-size: .9rem; line-height: 1.2; }
.sidebar-footer small { color: var(--sidebar-muted); }
.sidebar-footer .avatar { background: var(--marigold); color: var(--ink); }

/* main column */
.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  transition: margin-left .22s ease;
}

.topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 2rem;
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-grid; place-items: center;
  border: 0; background: transparent; color: var(--muted);
  font-size: 1.2rem; position: relative;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 9px; right: 10px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--marigold); border: 2px solid var(--canvas);
}
.topbar-search { position: relative; max-width: 380px; width: 100%; }
.topbar-search > i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 2; }
.topbar-search input { padding-left: 2.6rem; background: var(--surface); border-color: transparent; }
.topbar-search kbd {
  position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  font-family: var(--font-text); font-size: .72rem; padding: .15rem .45rem; border-radius: 6px;
}
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .3rem .6rem .3rem .3rem; border-radius: 14px; color: var(--text); }
.user-chip:hover { background: var(--surface); color: var(--text); }

.avatar {
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-grid; place-items: center;
  background: var(--violet-soft); color: var(--violet);
  font-weight: 700; font-size: .8rem; flex: 0 0 38px;
}
.avatar-sm { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; font-size: .72rem; }
.avatar.c1 { background: var(--marigold-soft); color: #b06d00; }
.avatar.c2 { background: var(--mint-soft); color: var(--mint); }
.avatar.c3 { background: var(--sky-soft); color: var(--sky); }
.avatar.c4 { background: var(--rose-soft); color: var(--rose); }

.content { padding: .5rem 2rem 2rem; flex: 1; }
.footer {
  padding: 1.1rem 2rem; color: var(--muted); font-size: .82rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
}

/* ---------- Page header: the big type moment ---------- */
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1.25rem; margin: .25rem 0 2rem;
}
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--violet); }
.crumbs span + span::before, .crumbs a + span::before, .crumbs a + a::before { content: "/"; margin-right: .4rem; opacity: .5; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 2.2vw + 1.6rem, 3.6rem);
  font-weight: var(--title-weight, 800);
  line-height: 1;
  letter-spacing: var(--title-tracking, -.045em);
  margin: 0;
  font-variation-settings: var(--title-vs, normal);
}

/* ---------- Collapsed sidebar (desktop only) ---------- */
@media (min-width: 992px) {
  .sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
  .sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
  .sidebar-collapsed .sidebar .label,
  .sidebar-collapsed .sidebar .nav-heading,
  .sidebar-collapsed .sidebar .badge,
  .sidebar-collapsed .sidebar .caret,
  .sidebar-collapsed .sidebar .side-sub,
  .sidebar-collapsed .sidebar-footer .meta { display: none !important; }
  .sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0 0 0 .2rem; }
  .sidebar-collapsed .side-link { justify-content: center; padding: .75rem 0; }
  .sidebar-collapsed .sidebar-footer { justify-content: center; padding: .5rem; margin: .75rem; }
  .sidebar-collapsed .sidebar-nav { padding-top: 1rem; }
}

/* ---------- Mobile ---------- */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(13, 8, 36, .5); z-index: 1035; display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .sidebar-backdrop { display: block; }
  .topbar { padding: 0 1rem; }
  .content { padding: .25rem 1rem 1.5rem; }
  .footer { padding: 1rem; }
  .page-head { margin-bottom: 1.4rem; }
}

/* ---------- Panels (cards) ---------- */
.card {
  --bs-card-bg: var(--surface);
  background: var(--surface);
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-panel);
  color: var(--text);
}
[data-bs-theme="dark"] .card { border: 1px solid var(--line); }
.card-header {
  background: transparent; border: 0;
  padding: 1.35rem 1.5rem .25rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.card-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin: 0; letter-spacing: -.025em; }
.card-sub { color: var(--muted); font-size: .85rem; margin: .1rem 0 0; }
.card-body { padding: 1.25rem 1.5rem 1.5rem; }
.card-footer { background: transparent; border-top: 1px solid var(--line); padding: 1rem 1.5rem; border-radius: 0 0 var(--r-lg) var(--r-lg) !important; }

/* Hero panel on dashboard */
.hero-panel {
  position: relative; overflow: hidden;
  background: var(--ink); color: #fff;
  border-radius: var(--r-lg);
  padding: 1.75rem 1.75rem 1.5rem;
}
.hero-panel h2 { color: #fff; font-size: clamp(1.6rem, 1.2vw + 1.2rem, 2.2rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin: 0 0 .5rem; max-width: 18ch; }
.hero-panel p { color: var(--sidebar-text); margin: 0 0 1.25rem; max-width: 42ch; }
.hero-shapes {
  position: absolute; right: -10px; top: -10px; bottom: -10px; width: 46%;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 8px;
  opacity: .95;
}
.hero-shapes i { display: block; }

/* KPI strip: one panel split into cells, not four floating cards */
.kpi-strip { display: grid; grid-template-columns: repeat(2, 1fr); }
.kpi { padding: 1.35rem 1.5rem; position: relative; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi:nth-child(3) { border-left: 0; }
.kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
.kpi-label { color: var(--muted); font-size: .88rem; font-weight: 500; display: flex; align-items: center; gap: .45rem; }
.kpi-label i { color: var(--violet); }
.kpi-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; margin: .3rem 0 .2rem; }
.trend { font-size: .8rem; font-weight: 700; display: inline-flex; align-items: center; gap: .2rem; padding: .1rem .45rem; border-radius: 6px; }
.trend.up { color: var(--mint); background: var(--mint-soft); }
.trend.down { color: var(--rose); background: var(--rose-soft); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); margin: 0; }
.table > :not(caption) > * > * { padding: .95rem 1.5rem; border-bottom-color: var(--line); }
.table thead th {
  font-size: .8rem; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--line); white-space: nowrap;
  padding-top: .8rem; padding-bottom: .8rem;
}
.table tbody tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--surface-2); --bs-table-color-state: var(--text); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable::after { content: "\F127"; font-family: "bootstrap-icons"; margin-left: .35rem; opacity: .35; font-size: .7rem; }
.table th.sort-asc::after { content: "\F148"; opacity: 1; color: var(--violet); }
.table th.sort-desc::after { content: "\F128"; opacity: 1; color: var(--violet); }
.cell-person { display: flex; align-items: center; gap: .75rem; }
.cell-person .who { font-weight: 600; line-height: 1.25; }
.cell-person small { color: var(--muted); }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .65rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.success { background: var(--mint-soft); color: var(--mint); }
.pill.warning { background: var(--marigold-soft); color: #b06d00; }
.pill.danger  { background: var(--rose-soft); color: var(--rose); }
.pill.info    { background: var(--sky-soft); color: var(--sky); }
.pill.neutral { background: var(--surface-2); color: var(--muted); }
[data-bs-theme="dark"] .pill.warning { color: var(--marigold); }

/* filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: 1.25rem 1.5rem; }
.filter-bar .grow { flex: 1 1 240px; max-width: 320px; }
.filter-bar .combo { width: 200px; }

/* ---------- Misc ---------- */
.activity { list-style: none; padding: 0; margin: 0; position: relative; }
.activity li { display: flex; gap: .9rem; padding: .7rem 0; }
.activity .what { line-height: 1.35; }
.activity small { color: var(--muted); }

.progress { height: 8px; background: var(--surface-2); border-radius: 99px; }
.progress-bar { background: var(--marigold); border-radius: 99px; }

.dropdown-menu {
  --bs-dropdown-bg: var(--surface); --bs-dropdown-color: var(--text);
  --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--surface-2); --bs-dropdown-link-hover-color: var(--text);
  --bs-dropdown-link-active-bg: var(--violet-soft); --bs-dropdown-link-active-color: var(--violet);
  --bs-dropdown-divider-bg: var(--line);
  border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  border-radius: 16px; font-size: .9rem; padding: .45rem;
}
.dropdown-item { border-radius: 10px; padding: .55rem .75rem; }
.dropdown-item i { width: 20px; margin-right: .45rem; color: var(--muted); }

.pagination {
  --bs-pagination-color: var(--text); --bs-pagination-bg: transparent; --bs-pagination-border-color: transparent;
  --bs-pagination-hover-color: var(--violet); --bs-pagination-hover-bg: var(--surface-2); --bs-pagination-hover-border-color: transparent;
  --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink);
  --bs-pagination-disabled-bg: transparent; --bs-pagination-disabled-border-color: transparent;
  --bs-pagination-focus-box-shadow: 0 0 0 4px var(--violet-soft);
  gap: 4px;
}
[data-bs-theme="dark"] .pagination { --bs-pagination-active-bg: var(--violet); --bs-pagination-active-border-color: var(--violet); }
.page-link { border-radius: 10px !important; min-width: 36px; text-align: center; font-weight: 600; }

.modal-content { border: 0; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-pop); }
.alert { border: 0; border-radius: 14px; font-weight: 500; }
.alert-success { background: var(--mint-soft); color: var(--mint); }
.alert-danger { background: var(--rose-soft); color: var(--rose); }

.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1090; }
.toast { background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow-pop); }
.toast .btn-close { filter: invert(1); }

.section-gap { margin-bottom: 1.5rem; }

/* ==========================================================================
   Sign-in pages (login, forgot, reset)
   ========================================================================== */
.auth-body { background: var(--canvas); }
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.auth-art {
  position: sticky; top: 0; height: 100vh; min-height: 640px;
  overflow: hidden; isolation: isolate;
  background: #1d1442;
  margin: 0; border-radius: 0 32px 32px 0;
  display: flex; flex-direction: column;
  padding: 2.25rem 2.5rem 2.5rem;
  color: #fff;
}
.mosaic {
  --cols: 6;
  position: absolute; inset: 0; z-index: -2;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-auto-rows: 1fr;
  gap: 10px; padding: 10px; opacity: .9;
}
.mosaic i { display: block; aspect-ratio: 1 / 1; width: 100%;
  transition: border-radius .9s cubic-bezier(.65, 0, .35, 1), background-color .9s ease; }
.auth-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 30% 45%, rgba(91, 61, 245, .45), transparent 70%),
    linear-gradient(180deg, rgba(29, 20, 66, .55) 0%, rgba(29, 20, 66, .35) 35%, rgba(29, 20, 66, .85) 72%, #1d1442 100%);
}
.auth-art-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-art .sidebar-brand { padding: 0; height: auto; }
.status-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .8rem .35rem .45rem; border-radius: 99px;
  background: rgba(255, 255, 255, .1); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: .78rem; font-weight: 600; color: #e9e5ff;
}
.status-chip .live { width: 18px; height: 18px; display: grid; place-items: center; }
.status-chip .live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); animation: ledePulse 2s ease-out infinite; }

.auth-float { flex: 1; display: grid; place-items: center; padding: 1.5rem 0; }
.float-stack { position: relative; width: min(440px, 100%); height: 300px; }
.glass {
  position: absolute;
  background: rgba(255, 255, 255, .09);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
  color: #fff;
  animation: glassIn .8s cubic-bezier(.2, .8, .2, 1) both;
}
.glass .g-label { font-size: .78rem; color: #c9c2ee; font-weight: 600; }
.glass .g-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; margin: .15rem 0 .35rem; }
.glass .g-trend { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 700; color: #3ddc97; background: rgba(61, 220, 151, .14); padding: .1rem .5rem .1rem .25rem; border-radius: 6px; }
.glass .spark { display: block; width: 100%; height: 40px; margin-top: .7rem; }
.glass .g-title { font-weight: 700; font-size: .95rem; }
.glass .g-sub { font-size: .8rem; color: #c9c2ee; }
.glass .g-chip { margin-left: auto; font-size: .72rem; font-weight: 800; background: var(--marigold); color: #1d1442; padding: .15rem .55rem; border-radius: 99px; }
.glass .stack { display: inline-flex; }
.glass .stack .avatar { border: 2px solid #2c2163; margin-left: -8px; width: 30px; height: 30px; flex-basis: 30px; border-radius: 50%; }
.glass .stack .avatar:first-child { margin-left: 0; }
.glass .g-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(61, 220, 151, .18); color: #3ddc97; font-size: 1.1rem; flex: 0 0 38px; }
.g1 { left: 0; top: 0; width: 270px; animation-delay: .15s; }
.g2 { right: 0; top: 118px; width: 236px; animation-delay: .3s; }
.g3 { left: 34px; bottom: 0; width: 240px; display: flex; gap: .75rem; align-items: center; animation-delay: .45s; }
@keyframes glassIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

.auth-msg { position: relative; max-width: 32rem; }
.auth-msg h2 {
  color: #fff; font-size: clamp(2.4rem, 3vw + .8rem, 4rem);
  font-weight: var(--title-weight, 800); line-height: .98; letter-spacing: var(--title-tracking, -.05em);
  font-variation-settings: var(--title-vs, normal);
  margin: 0 0 .9rem;
}
.auth-msg p { color: #c9c2ee; font-size: 1.05rem; margin: 0; max-width: 36ch; }

.auth-panel { position: relative; display: flex; flex-direction: column; padding: 1.5rem 2.5rem; min-height: 100vh; }
.auth-top { display: flex; align-items: center; gap: 1rem; }
.auth-top .mobile-brand { display: none; color: var(--text); padding: 0; height: auto; }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 2.5rem 0; }
.auth-card h1 {
  font-size: clamp(2.5rem, 2vw + 1.7rem, 3.3rem);
  font-weight: var(--title-weight, 800); letter-spacing: var(--title-tracking, -.045em); line-height: 1; margin: 0;
  font-variation-settings: var(--title-vs, normal);
}
.auth-card .lede { color: var(--muted); margin: 1rem 0 1.75rem; font-size: 1.02rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; }
.auth-card .lede strong { color: var(--text); }
.auth-foot { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--muted); font-size: .8rem; }
.auth-foot a { color: var(--muted); }
.auth-foot a:hover { color: var(--primary); }

/* floating-label field */
.field { position: relative; margin-bottom: 1rem; }
.field input {
  width: 100%; height: 60px;
  padding: 1.45rem 1rem .45rem 3rem;
  border: 1.5px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 1rem; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover { border-color: var(--check-border); }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.field label {
  position: absolute; left: 3rem; top: 30px; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
  transition: top .15s, font-size .15s, transform .15s, color .15s;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label { top: .95rem; transform: none; font-size: .74rem; font-weight: 700; }
.field input:focus + label { color: var(--primary); }
.field > i { position: absolute; left: 1.1rem; top: 30px; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; }
.field input:focus ~ i { color: var(--primary); }
.field .reveal {
  position: absolute; right: .6rem; top: 10px;
  border: 0; background: transparent; color: var(--muted);
  width: 40px; height: 40px; border-radius: 10px; font-size: 1.1rem;
}
.field .reveal:hover { background: var(--surface-2); color: var(--text); }
.field.has-reveal input { padding-right: 3.2rem; }
.was-validated .field input:invalid { border-color: var(--danger); }
.field .invalid-feedback { margin-left: .25rem; }
.was-validated .field input:invalid ~ .invalid-feedback { display: block; }

.auth-row { display: flex; justify-content: space-between; align-items: center; margin: .35rem 0 1.4rem; font-size: .9rem; }
.auth-submit { width: 100%; height: 56px; border-radius: 16px; font-size: 1.02rem; }
.auth-alt { text-align: center; margin-top: 1.5rem; color: var(--muted); font-size: .9rem; }
.auth-divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .82rem; margin: 1.5rem 0 1rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 1199.98px) { .float-stack { transform: scale(.88); } }
@media (max-width: 991.98px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { padding: 1.25rem; }
  .auth-top .mobile-brand { display: flex; }
  .auth-card { padding: 2rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Validation: show errors only, no green "valid" noise ---------- */
.was-validated .form-control:valid, .form-control.is-valid {
  border-color: var(--line); background-image: none; padding-right: .9rem;
}
.was-validated .form-control:valid:focus { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-soft); }
.was-validated .form-control:invalid { background-image: none; padding-right: .9rem; }

/* ---------- Login refinements ---------- */
.auth-panel { position: relative; }
@media (max-width: 991.98px) {
  .auth-art::after { background: linear-gradient(180deg, rgba(29, 20, 66, .35), rgba(29, 20, 66, .8)); }
  .auth-panel { padding-top: 2rem; }
}

/* Serif / single-weight heading fonts: avoid faux bold */
html[data-font-single] :is(h1, h2, h3, .card-title, .kpi-value, .cal-month, .sidebar-brand, .dp-title, .pw-ring .score),
html[data-font="instrument"] :is(h1, h2, h3, .card-title, .kpi-value, .cal-month, .sidebar-brand, .dp-title, .pw-ring .score),
html[data-font="gloock"] :is(h1, h2, h3, .card-title, .kpi-value, .cal-month, .sidebar-brand, .dp-title, .pw-ring .score) { font-weight: 400 !important; letter-spacing: .06em; }
html[data-font="unbounded"] :is(.card-title, .kpi-value, .cal-month) { letter-spacing: -.03em; }
html[data-font="bebas"] .page-title, html[data-font="anton"] .page-title { font-size: clamp(2.8rem, 2.6vw + 1.9rem, 4.3rem); }
