/* ================================================================
   OroDrive — SaluVista's CRM. Same structural system as admin.css
   (buttons/cards/dialogs/kanban/tables all share the same shapes and
   ui.js contract), retheme: black/white primary, SaluVista blue accent.
   Brand: Lora (headings) + Inter (body).
   ================================================================ */

:root {
  --blue: #273ED4;
  --blue-hover: #3550E0;
  --blue-light: #5B72F0;
  --black: #000000;
  --black-soft: #17171B;
  --tint: #F7F7F9;
  --tint-2: #EFEFF2;
  --border: #DCDCE1;
  --border-soft: #EAEAEE;
  --ink: #0B0B0E;
  --muted: #4B4B55;
  --faint: #86868F;
  --surface: #FFFFFF;
  --bg: #FDFDFE;
  --green: #0E7C4F;
  --green-tint: #E4F6EE;
  --amber: #9A6200;
  --amber-tint: #FCF1DC;
  --red: #C0313D;
  --red-tint: #FCE9EB;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(11, 11, 14, .05), 0 2px 10px rgba(11, 11, 14, .04);
  --shadow-md: 0 8px 24px rgba(11, 11, 14, .09), 0 2px 6px rgba(11, 11, 14, .05);
  --shadow-lg: 0 24px 64px rgba(11, 11, 14, .22), 0 4px 16px rgba(11, 11, 14, .09);
  --sidebar-w: 258px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.33, 1, .5, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.45, .64, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  /* a barely-there blue wash high in the frame — static, costs nothing,
     reads as "light in the room" rather than decoration */
  background: radial-gradient(1100px 380px at 82% -120px, rgba(39, 62, 212, .05), transparent 62%) fixed, var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.has-dialog { overflow: hidden; }

h1, h2, h3, h4 { font-family: 'Lora', Georgia, serif; color: var(--ink); margin: 0; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(39, 62, 212, .14); }

.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3.5px; }

/* thin, quiet scrollbars everywhere content scrolls */
.sidebar__nav::-webkit-scrollbar, .kanban::-webkit-scrollbar, .kanban-col__body::-webkit-scrollbar,
.dialog__body::-webkit-scrollbar, .table-scroll::-webkit-scrollbar, .subtabs::-webkit-scrollbar { width: 8px; height: 8px; }
.kanban::-webkit-scrollbar-thumb, .kanban-col__body::-webkit-scrollbar-thumb,
.dialog__body::-webkit-scrollbar-thumb, .table-scroll::-webkit-scrollbar-thumb, .subtabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 99px; }
.sidebar__nav::-webkit-scrollbar-track, .kanban::-webkit-scrollbar-track, .kanban-col__body::-webkit-scrollbar-track,
.dialog__body::-webkit-scrollbar-track, .table-scroll::-webkit-scrollbar-track, .subtabs::-webkit-scrollbar-track { background: transparent; }

/* ================= App shell ================= */

.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ================= Sidebar ================= */

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: linear-gradient(180deg, #1B1B21 0%, #0B0B0E 55%, var(--black) 100%);
  color: #E9E9EC;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: width .28s var(--ease);
  overflow: hidden;
}
/* a faint blue bloom behind the logo — the dark anchor gets one deliberate
   accent, and it breathes: slow scale + opacity, like the lens is alive */
.sidebar::before {
  content: '';
  position: absolute;
  top: -120px; left: -60px;
  width: 320px; height: 300px;
  background: radial-gradient(closest-side, rgba(91, 114, 240, .24), transparent 70%);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .sidebar::before { animation: sideBreathe 11s ease-in-out infinite alternate; }
  @keyframes sideBreathe {
    from { transform: scale(1) translateY(0); opacity: .75; }
    to { transform: scale(1.18) translateY(14px); opacity: 1; }
  }
}
/* hairline where sidebar meets content */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  pointer-events: none;
}

.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 14px 18px; gap: 8px; }

.oro-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.salu-mark { flex: none; filter: drop-shadow(0 2px 8px rgba(39, 62, 212, .45)); }
.oro-logo__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.oro-logo__word { font-family: 'Lora', Georgia, serif; font-size: 19px; font-weight: 500; letter-spacing: .01em; white-space: nowrap; }
.oro-logo__word b { font-weight: 700; }
.oro-logo__tag { font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #7D86A6; margin-top: 1px; }

.salu-wave path { transform: translateX(0); }
@media (prefers-reduced-motion: no-preference) {
  .salu-wave--front path { animation: svDrift 9s linear infinite; }
  .salu-wave--back path { animation: svDrift 14s linear infinite reverse; }
  @keyframes svDrift { to { transform: translateX(32px); } }
}

.sidebar__collapse, .topbar__menu, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: none; border-radius: 10px;
  background: transparent; color: inherit;
  transition: background .15s ease, transform .15s var(--ease-spring), color .15s ease;
}
.sidebar__collapse:hover { background: rgba(255, 255, 255, .1); }
.sidebar__collapse:active { transform: scale(.9); }
.sidebar__collapse .ico { width: 19px; height: 19px; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10.5px 12px; border-radius: 11px;
  color: #A9A9B4; text-decoration: none; font-weight: 500; font-size: 14px; white-space: nowrap;
  position: relative; transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.nav-item .ico { width: 19px; height: 19px; transition: transform .2s var(--ease-spring); }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item:hover .ico { transform: translateX(1px) scale(1.06); }
.nav-item.is-active {
  background: linear-gradient(135deg, #3149E2, var(--blue) 65%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(39, 62, 212, .45), inset 0 1px 0 rgba(255, 255, 255, .18);
  font-weight: 600;
}
.nav-item.is-active .ico { transform: none; }
.nav-item.is-active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: var(--blue-light);
  box-shadow: 0 0 10px rgba(91, 114, 240, .8);
  animation: railIn .32s var(--ease-spring);
  transform-origin: center;
}
@keyframes railIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.nav-item__badge { margin-left: auto; background: rgba(255, 255, 255, .1); color: #C9C9D2; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; transition: background .16s ease, color .16s ease; }
.nav-item:hover .nav-item__badge { background: rgba(255, 255, 255, .16); color: #fff; }
.nav-item.is-active .nav-item__badge { background: rgba(255, 255, 255, .22); color: #fff; }

.sidebar__foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 10px; background: rgba(255, 255, 255, .02); }
.sidebar__settings {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px;
  border: 1.5px dashed rgba(255, 255, 255, .22); border-radius: 11px; background: transparent;
  color: #C7C7CF; font-size: 13px; font-weight: 600; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sidebar__settings .ico { width: 16px; height: 16px; }
.sidebar__settings:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .4); }
.app.sidebar-collapsed .sidebar__settings span:not(.ico) { display: none; }
.app.sidebar-collapsed .sidebar__settings { justify-content: center; padding: 9px; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; border: none; background: transparent; width: 100%; text-align: left; transition: background .16s ease; }
.user-chip:hover { background: rgba(255, 255, 255, .07); }
.user-chip__avatar {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12), 0 4px 10px rgba(39, 62, 212, .4);
  transition: box-shadow .2s ease;
}
.user-chip:hover .user-chip__avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .28), 0 4px 12px rgba(39, 62, 212, .5); }
.user-chip__meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-chip__name { font-weight: 600; font-size: 13.5px; color: #fff; text-transform: capitalize; }
.user-chip__role { font-size: 11.5px; color: #7D86A6; }

.app.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app.sidebar-collapsed .oro-logo__text, .app.sidebar-collapsed .nav-item span, .app.sidebar-collapsed .nav-item__badge,
.app.sidebar-collapsed .user-chip__meta { display: none; }
.app.sidebar-collapsed .sidebar__head { flex-direction: column; padding: 16px 0 8px; gap: 12px; }
.app.sidebar-collapsed .nav-item { justify-content: center; padding: 11px; }
.app.sidebar-collapsed .user-chip { justify-content: center; padding: 4px; }
.app.sidebar-collapsed .sidebar__collapse .ico { transform: rotate(180deg); }

.sidebar-scrim { position: fixed; inset: 0; background: rgba(11, 11, 14, .55); backdrop-filter: blur(2px); z-index: 35; opacity: 0; transition: opacity .25s ease; }
.sidebar-scrim.is-in { opacity: 1; }

/* ================= Topbar ================= */

.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 16px; padding: 0 22px;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: 30;
}
/* the "hero energy" line: a soft light that travels the topbar's bottom edge.
   Slow, dim, blue-on-hairline — presence, not a marketing band. */
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent 20%, rgba(39, 62, 212, .35) 42%, rgba(91, 114, 240, .75) 50%, rgba(39, 62, 212, .35) 58%, transparent 80%);
  background-size: 220% 100%;
  background-position: 220% 0;
  pointer-events: none;
  opacity: .9;
}
@media (prefers-reduced-motion: no-preference) {
  .topbar::after { animation: topGlow 13s ease-in-out infinite; }
  @keyframes topGlow {
    0% { background-position: 220% 0; }
    55% { background-position: -120% 0; }
    100% { background-position: -120% 0; }
  }
}
.topbar__menu { display: none; color: var(--ink); }
.topbar__menu:hover { background: var(--tint); }
.topbar__title-wrap { min-width: 0; }
.topbar__crumb { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.topbar__title { font-size: 20px; font-weight: 600; white-space: nowrap; letter-spacing: -.01em; }
.topbar__spacer { flex: 1; }
.topbar__action { margin-left: auto; }

.topbar__search { flex: 1; max-width: 380px; margin-left: 20px; position: relative; display: flex; align-items: center; }
.topbar__search-icon { position: absolute; left: 12px; color: var(--faint); display: flex; pointer-events: none; }
.topbar__search-icon .ico { width: 16px; height: 16px; }
.topbar__search input { width: 100%; padding: 8px 12px 8px 36px; border: 1.5px solid var(--border-soft); border-radius: 10px; background: var(--tint); font-size: 13.5px; color: var(--ink); transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.topbar__search input::placeholder { color: var(--faint); }
.topbar__search input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(39, 62, 212, .12); }

.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; max-height: 380px; overflow-y: auto; z-index: 60; }
.search-results__group { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.search-results__item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: none; background: none; border-radius: 9px; color: var(--ink); font-size: 13.5px; }
.search-results__item:hover, .search-results__item.is-hl { background: var(--tint); }
.search-results__item .ico { width: 16px; height: 16px; color: var(--blue); }
.search-results__item small { margin-left: auto; color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.search-results__none { padding: 16px; text-align: center; color: var(--faint); font-size: 13px; }

/* ================= Buttons ================= */

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9.5px 17px; border: none; border-radius: 11px;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .16s ease, transform .16s var(--ease-spring), box-shadow .2s ease, color .16s ease, border-color .16s ease;
}
.btn:active { transform: scale(.96); }
.btn .ico { width: 16px; height: 16px; }
.btn--primary {
  background: linear-gradient(180deg, #3149E2, var(--blue));
  color: #fff;
  box-shadow: 0 4px 14px rgba(39, 62, 212, .32), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn--primary:hover { background: linear-gradient(180deg, #3D55EA, var(--blue-hover)); box-shadow: 0 7px 20px rgba(39, 62, 212, .4), inset 0 1px 0 rgba(255, 255, 255, .22); transform: translateY(-1px); }
.btn--primary:active { transform: scale(.96); }
.btn--dark { background: linear-gradient(180deg, #232329, var(--black)); color: #fff; box-shadow: 0 4px 14px rgba(11, 11, 14, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn--dark:hover { background: linear-gradient(180deg, #2E2E35, #17171B); transform: translateY(-1px); box-shadow: 0 7px 20px rgba(11, 11, 14, .3), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn--dark:active { transform: scale(.96); }
.btn--ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--border-soft); }
.btn--ghost:hover { background: var(--tint); color: var(--ink); border-color: var(--border); }
.btn--danger { background: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(192, 49, 61, .25); }
.btn--danger:hover { background: #A82833; box-shadow: 0 6px 16px rgba(192, 49, 61, .32); }
.btn--won { background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(14, 124, 79, .25); }
.btn--won:hover { background: #0B6A44; box-shadow: 0 6px 16px rgba(14, 124, 79, .32); }
.btn--soft { background: var(--tint-2); color: var(--ink); }
.btn--soft:hover { background: #DEDEE4; }
.icon-btn { color: var(--muted); }
.icon-btn:hover { background: var(--tint); color: var(--blue); }
.icon-btn:active { transform: scale(.86); }
.icon-btn--danger:hover { background: var(--red-tint); color: var(--red); }
.icon-btn .ico { width: 17px; height: 17px; }

/* ================= Content area ================= */

/* full-bleed: the whole viewport is working surface — no centred column,
   no dead side gutters on wide monitors (owner: "fitted to the full screen") */
.content { flex: 1; padding: 18px 22px 24px; max-width: none; width: 100%; margin: 0; outline: none; }
.view { animation: viewIn .34s var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view__intro { margin-bottom: 16px; max-width: 720px; }
.view__intro p { color: var(--muted); font-size: 13.5px; }

/* ================= Cards ================= */

.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: box-shadow .25s ease; }
.card__head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--tint-2); }
.card__head h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card__head .ico { color: var(--blue); }
.card__head-note { margin-left: auto; font-size: 12px; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ================= Dashboard / stats ================= */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 17px 18px 15px; display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), border-color .22s ease;
  animation: riseIn .45s var(--ease-out) backwards;
}
.stat-row .stat-card:nth-child(1) { animation-delay: .03s; }
.stat-row .stat-card:nth-child(2) { animation-delay: .09s; }
.stat-row .stat-card:nth-child(3) { animation-delay: .15s; }
.stat-row .stat-card:nth-child(4) { animation-delay: .21s; }
.stat-row .stat-card:nth-child(5) { animation-delay: .27s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* hairline accent that draws itself across the top on hover */
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  transform: scaleX(0); transform-origin: left; transition: transform .32s var(--ease-out);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border); }
.stat-card:hover::after { transform: scaleX(1); }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-card__label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.stat-card__ico {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  background: var(--tint); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  transition: background .22s ease, color .22s ease, transform .22s var(--ease-spring), box-shadow .22s ease;
}
.stat-card:hover .stat-card__ico { background: var(--blue); color: #fff; transform: scale(1.06); box-shadow: 0 5px 14px rgba(39, 62, 212, .35); }
.stat-card__ico .ico { width: 17px; height: 17px; }
.stat-card__value { font-family: 'Lora', Georgia, serif; font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.015em; }
.stat-card__delta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.stat-card__delta .ico { width: 14px; height: 14px; }
.stat-card__delta--up { color: var(--green); }
.stat-card__delta--down { color: var(--red); }
.stat-card__delta small { color: var(--faint); font-weight: 500; }

.dash-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }
.chart-wrap { padding: 8px 14px 14px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-tip { position: absolute; pointer-events: none; background: var(--black); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px; transform: translate(-50%, -130%); white-space: nowrap; opacity: 0; transition: opacity .12s ease; z-index: 5; }
.chart-tip.is-on { opacity: 1; }
.chart-tip small { display: block; font-weight: 500; color: #B8B8C2; font-size: 10.5px; }

.activity-list { list-style: none; margin: 0; padding: 6px 0; }
.activity-item { display: flex; gap: 12px; padding: 11px 20px; align-items: flex-start; transition: background .15s ease; }
.activity-item:hover { background: var(--tint); }
.activity-item + .activity-item { border-top: 1px solid var(--tint); }
.activity-item__ico { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--tint); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-top: 1px; transition: background .15s ease, color .15s ease; }
.activity-item:hover .activity-item__ico { background: var(--blue); color: #fff; }
.activity-item__ico .ico { width: 15px; height: 15px; }
.activity-item p { font-size: 13px; color: var(--ink); line-height: 1.45; }
.activity-item time { font-size: 11.5px; color: var(--faint); }

/* horizontal bar report chart */
.bar-report { display: flex; flex-direction: column; gap: 13px; padding: 18px 20px; }
.bar-report__row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; }
.bar-report__row:hover .bar-report__label { color: var(--ink); }
.bar-report__label { font-size: 12.5px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s ease; }
.bar-report__track { height: 11px; border-radius: 7px; background: var(--tint); overflow: hidden; box-shadow: inset 0 1px 2px rgba(11, 11, 14, .05); }
.bar-report__fill {
  height: 100%; border-radius: 7px;
  background: linear-gradient(90deg, var(--blue-light), var(--blue));
  transition: width .6s var(--ease);
  position: relative; overflow: hidden;
  transform-origin: left center;
  animation: barGrow .7s var(--ease-out) backwards;
}
.bar-report__row:nth-child(1) .bar-report__fill { animation-delay: .05s; }
.bar-report__row:nth-child(2) .bar-report__fill { animation-delay: .11s; }
.bar-report__row:nth-child(3) .bar-report__fill { animation-delay: .17s; }
.bar-report__row:nth-child(4) .bar-report__fill { animation-delay: .23s; }
.bar-report__row:nth-child(5) .bar-report__fill { animation-delay: .29s; }
.bar-report__row:nth-child(6) .bar-report__fill { animation-delay: .35s; }
.bar-report__row:nth-child(7) .bar-report__fill { animation-delay: .41s; }
.bar-report__row:nth-child(8) .bar-report__fill { animation-delay: .47s; }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* one soft sheen sweep after the bars grow in */
.bar-report__fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, .35) 50%, transparent 75%);
  transform: translateX(-130%);
  animation: barSheen 1.1s var(--ease-out) .75s forwards;
}
@keyframes barSheen { to { transform: translateX(130%); } }
.bar-report__fill--won { background: linear-gradient(90deg, #3FBE86, var(--green)); }
.bar-report__fill--lost { background: linear-gradient(90deg, #E8707C, var(--red)); }
.bar-report__value { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; color: var(--ink); }

/* won/lost list rows (wonlost.js renders .proc-row — shared shape with admin) */
.proc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--tint); transition: background .15s ease; }
.proc-row:hover { background: var(--tint); }
.proc-row__name { font-size: 13.5px; font-weight: 600; color: var(--ink); min-width: 0; }
.proc-row__name small { display: block; font-size: 11.5px; font-weight: 500; color: var(--faint); margin-top: 1px; }
.proc-row__price { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); flex: none; }

/* settings.js: draggable stage/lost-reason rows */
.rule-card { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--tint); transition: background .15s ease, opacity .15s ease, box-shadow .15s ease; }
.rule-card:first-child { border-top: none; }
.rule-card:hover { background: var(--tint); }
.rule-card[draggable="true"]:active { cursor: grabbing; }
.rule-card.is-dragging { opacity: .4; box-shadow: var(--shadow-md); }

/* ================= Subtabs / toolbar / chips ================= */

.subtabs { display: flex; gap: 5px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 6px; margin-bottom: 16px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.subtab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.subtab .ico { width: 16px; height: 16px; }
.subtab:hover { background: var(--tint); color: var(--blue); }
.subtab.is-active { background: linear-gradient(135deg, #3149E2, var(--blue) 65%); color: #fff; box-shadow: 0 4px 12px rgba(39, 62, 212, .3), inset 0 1px 0 rgba(255, 255, 255, .18); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar__search { position: relative; flex: 1; min-width: 200px; max-width: 340px; display: flex; align-items: center; }
.toolbar__search .ico { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--faint); pointer-events: none; transition: color .15s ease; }
.toolbar__search:focus-within .ico { color: var(--blue); }
.toolbar__search input { width: 100%; padding: 8.5px 12px 8.5px 34px; border: 1.5px solid var(--border-soft); border-radius: 10px; background: #fff; font-size: 13.5px; transition: border-color .15s ease, box-shadow .15s ease; }
.toolbar__search input:hover { border-color: var(--border); }
.toolbar__search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39, 62, 212, .12); }
.toolbar__spacer { flex: 1; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6.5px 13px; border: 1.5px solid var(--border-soft); border-radius: 99px; background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 600; transition: all .18s var(--ease-spring); }
.chip:hover { border-color: var(--blue-light); color: var(--blue); transform: translateY(-1px); }
.chip:active { transform: scale(.95); }
.chip.is-on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 3px 10px rgba(39, 62, 212, .28); }

.select-filter { padding: 8px 30px 8px 12px; border: 1.5px solid var(--border-soft); border-radius: 10px; background: #fff; font-size: 13px; font-weight: 600; color: var(--muted); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B4B55' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 15px; transition: border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.select-filter:hover { border-color: var(--border); color: var(--ink); }
.select-filter:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39, 62, 212, .12); }

/* ================= Tables ================= */

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.sv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sv-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); padding: 11px 14px; border-bottom: 1px solid var(--tint-2); background: var(--tint); white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; z-index: 1; transition: color .15s ease; }
.sv-table th:hover { color: var(--blue); }
.sv-table th .ico { width: 12px; height: 12px; margin-left: 4px; opacity: .6; }
.sv-table td { padding: 10px 14px; border-bottom: 1px solid var(--tint); vertical-align: middle; }
.sv-table tbody tr { transition: background .13s ease, box-shadow .13s ease; cursor: pointer; }
.sv-table tbody tr:hover { background: var(--tint); box-shadow: inset 3px 0 0 var(--blue); }
.sv-table tbody tr:last-child td { border-bottom: none; }
.sv-table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.sv-table__check { width: 34px; cursor: default; }
.sv-table__check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); }
.sv-table tbody tr.is-selected { background: rgba(39, 62, 212, .05); box-shadow: inset 3px 0 0 var(--blue); }

.cell-person { display: flex; align-items: center; gap: 11px; }
.cell-person__avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--tint-2), var(--tint)); color: var(--blue); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-soft); transition: background .15s ease, color .15s ease, border-color .15s ease; }
.sv-table tbody tr:hover .cell-person__avatar { background: var(--blue); color: #fff; border-color: var(--blue); }
.cell-person__name { font-weight: 600; }
.cell-person__sub { font-size: 12px; color: var(--faint); display: block; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge .ico { width: 12px; height: 12px; }
.badge--stage { background: var(--tint-2); color: var(--ink); border-color: var(--border-soft); }
.badge--won { background: var(--green-tint); color: var(--green); border-color: rgba(14, 124, 79, .18); }
.badge--lost { background: var(--red-tint); color: var(--red); border-color: rgba(192, 49, 61, .16); }
.badge--open { background: rgba(39, 62, 212, .08); color: var(--blue); border-color: rgba(39, 62, 212, .16); }
.badge--source { background: var(--tint); color: var(--muted); border-color: var(--border-soft); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ================= Empty state ================= */

.empty-state { text-align: center; padding: 54px 24px; color: var(--muted); }
.empty-state__ico {
  display: inline-flex; width: 56px; height: 56px; border-radius: 18px;
  background: linear-gradient(160deg, var(--tint), var(--tint-2));
  color: var(--blue-light);
  align-items: center; justify-content: center; margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), var(--shadow-sm);
  animation: emptyFloat 4s ease-in-out infinite alternate;
}
@keyframes emptyFloat { from { transform: translateY(2px); } to { transform: translateY(-3px); } }
.empty-state__ico .ico { width: 26px; height: 26px; }
.empty-state h3 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; color: var(--faint); margin-bottom: 16px; }

/* ================= Dialogs ================= */

.modal-root, .slideover-root { position: fixed; inset: 0; z-index: 100; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11, 11, 14, .48); backdrop-filter: blur(3px); opacity: 0; transition: opacity .26s ease; }
.is-open .modal-backdrop { opacity: 1; }
.modal {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -45%) scale(.96);
  width: min(520px, calc(100vw - 32px)); max-height: min(86vh, 720px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .22s var(--ease-out), transform .3s var(--ease-spring);
}
.is-open .modal { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.slideover {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100vw);
  background: #fff; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(103%);
  transition: transform .38s cubic-bezier(.32, .72, 0, 1);
}
.is-open .slideover { transform: none; }
@media (prefers-reduced-motion: reduce) { .modal, .slideover, .modal-backdrop { transition: none; } }

.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--tint-2); flex: none; }
.dialog__eyebrow { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin-bottom: 2px; }
.dialog__title { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.dialog__title-ico { color: var(--blue); width: 20px; height: 20px; }
.dialog__body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--tint-2); background: var(--tint); flex: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.slideover .dialog__foot { border-radius: 0; }
.confirm-text { font-size: 14px; color: var(--muted); line-height: 1.6; }
.confirm-text b { color: var(--ink); }

/* ================= Forms ================= */

.form-grid { display: flex; flex-wrap: wrap; gap: 14px 12px; }
.field { flex: 1 1 100%; display: flex; flex-direction: column; gap: 5px; }
.field--half { flex: 1 1 calc(50% - 6px); min-width: 150px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field__req { color: var(--red); }
.field__error { font-size: 11.5px; color: var(--red); min-height: 0; font-weight: 500; }
.field__error:empty { display: none; }
.field__hint { font-size: 11.5px; color: var(--faint); }

.input { padding: 9px 12px; border: 1.5px solid var(--border-soft); border-radius: 10px; background: #fff; font-size: 13.5px; color: var(--ink); width: 100%; transition: border-color .15s ease, box-shadow .15s ease; }
.input:hover { border-color: var(--border); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39, 62, 212, .12); }
.input--invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192, 49, 61, .1); }
textarea.input { resize: vertical; min-height: 70px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B4B55' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 15px; padding-right: 32px; }

/* repeatable phone-number rows in the deal form: #phoneRows is a plain div,
   so it needs its own stacking gap (rows were touching each other before) */
#phoneRows { display: flex; flex-direction: column; gap: 8px; }
[data-phone-row] { animation: riseIn .24s var(--ease-out); }
[data-phone-row] .input { flex: 1; min-width: 0; }
[data-phone-row] .icon-btn { flex: none; }

.toggle-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--tint); border-radius: 11px; }
.toggle-field__label { font-size: 13px; font-weight: 600; color: var(--ink); }
.toggle-field__hint { display: block; font-size: 11.5px; font-weight: 400; color: var(--faint); }

.switch { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track { position: absolute; inset: 0; border-radius: 99px; background: #D3D3D9; transition: background .2s ease, box-shadow .2s ease; pointer-events: none; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease-spring); }
.switch input:checked + .switch__track { background: var(--blue); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ================= Toasts ================= */

.toast-stack { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #1E1E24, var(--black));
  color: #fff; padding: 11px 18px 11px 14px; border-radius: 12px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .1);
  font-size: 13.5px; font-weight: 500;
  opacity: 0; transform: translateY(14px) scale(.97);
  transition: opacity .3s var(--ease-out), transform .35s var(--ease-spring);
  max-width: 380px; position: relative; overflow: hidden;
}
.toast.is-in { opacity: 1; transform: none; }
/* lifetime hairline — drains over the 3.2s the toast is on screen (matches ui.js) */
.toast.is-in::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: rgba(255, 255, 255, .28);
  transform-origin: left;
  animation: toastLife 3.2s linear forwards;
}
@keyframes toastLife { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast .ico { width: 17px; height: 17px; color: #7DE8B2; }
.toast--danger .ico { color: #FF9DA6; }
.toast--info .ico { color: #9AAAE0; }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity .15s ease; transform: none; } .toast.is-in::after { animation: none; } }

/* ================= Kanban ================= */

/* Pipedrive-style board: columns flow in ONE row. Few stages → they stretch
   to fill the full board width; many stages → horizontal scroll, never a
   second wrapped row (wrapping is what made it feel "small-screen"). */
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr);
  gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: thin; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}
/* fixed height = topbar + content padding + subtabs row accounted for, so
   every column runs to the bottom of the viewport like a real working board */
.kanban-col {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 116px);
  height: calc(100dvh - var(--topbar-h) - 116px);
  min-height: 300px;
  scroll-snap-align: start;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.kanban-col.is-over {
  background: rgba(39, 62, 212, .05);
  border-color: var(--blue-light); border-style: dashed;
  box-shadow: 0 0 0 3px rgba(39, 62, 212, .1), var(--shadow-sm);
}
.kanban-col__head { display: flex; align-items: center; gap: 9px; padding: 11px 13px 8px; flex: none; }
.kanban-col__head .ico { width: 16px; height: 16px; color: var(--blue); }
.kanban-col__title { font-size: 12.5px; font-weight: 700; color: var(--ink); letter-spacing: .015em; }
.kanban-col__count { margin-left: auto; background: #fff; border: 1px solid var(--border-soft); color: var(--muted); font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 0 8px; min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.kanban-col.is-over .kanban-col__count { background: var(--blue); color: #fff; border-color: var(--blue); }
.kanban-col__sum { padding: 0 13px 7px; font-size: 11.5px; color: var(--faint); font-weight: 600; flex: none; font-variant-numeric: tabular-nums; }
.kanban-col__body { padding: 3px 9px 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 7px; scrollbar-width: thin; }
/* with full-height columns the drop zone stretches too — the whole empty
   column reads as a target, like the reference board */
.kanban-col__empty { flex: 1; display: flex; align-items: center; justify-content: center; border: 1.5px dashed var(--border); border-radius: 12px; padding: 18px 10px; text-align: center; color: var(--faint); font-size: 12px; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.kanban-col.is-over .kanban-col__empty { border-color: var(--blue-light); color: var(--blue); background: rgba(39, 62, 212, .06); }

.kcard {
  background: #fff; border: 1px solid var(--border-soft); border-radius: 13px; padding: 11px 12px;
  cursor: grab; box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), opacity .16s ease, border-color .18s ease;
  position: relative;
}
/* blue rail that slides out when you engage with a card */
.kcard::before {
  content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--blue);
  transform: scaleY(0); transform-origin: center; transition: transform .2s var(--ease-out);
}
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border); }
.kcard:hover::before, .kcard:focus-visible::before { transform: scaleY(1); }
.kcard:active { cursor: grabbing; }
.kcard.is-dragging { opacity: .35; transform: scale(.965); border-style: dashed; border-color: var(--blue-light); box-shadow: none; }
.kcard.is-dragging::before { transform: scaleY(0); }

/* reminder-state colour coding: no reminder=yellow, upcoming=grey, due today=green, overdue=red.
   Each state keeps its always-on left rail (the hover rail recoloured), so the
   four states scan apart even in peripheral vision; tints stay light enough
   that --ink/--muted text passes comfortably on all of them. */
.kcard--none { background: #FFF8DB; border-color: #EDDD96; }
.kcard--upcoming { background: #F2F2F5; border-color: var(--border); }
.kcard--today { background: #E7F7EE; border-color: #A5DDBA; }
.kcard--overdue { background: #FDEAEA; border-color: #F1ABAB; }
.kcard--none::before { background: #D9A800; transform: scaleY(1); }
.kcard--upcoming::before { background: #9A9AA3; transform: scaleY(1); }
.kcard--today::before { background: #2FAE64; transform: scaleY(1); }
.kcard--overdue::before { background: #D6494F; transform: scaleY(1); }
/* hover shouldn't grey the tinted borders back to neutral */
.kcard--none:hover { border-color: #E0CC7E; }
.kcard--upcoming:hover { border-color: #C9C9D0; }
.kcard--today:hover { border-color: #8FD1A9; }
.kcard--overdue:hover { border-color: #E99898; }

.reminder-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.reminder-dot--none { background: #D9A800; box-shadow: 0 0 0 3px rgba(217, 168, 0, .16); }
.reminder-dot--upcoming { background: #9A9AA3; box-shadow: 0 0 0 3px rgba(154, 154, 163, .16); }
.reminder-dot--today { background: #2FAE64; box-shadow: 0 0 0 3px rgba(47, 174, 100, .18); }
.reminder-dot--overdue { background: #D6494F; animation: dotPulse 2.4s ease-in-out infinite; }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(214, 73, 79, .22); }
  50% { box-shadow: 0 0 0 5.5px rgba(214, 73, 79, .1); }
}
.kcard__top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kcard__name { font-weight: 700; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.005em; }
.kcard__grip { color: var(--border); display: flex; transition: color .18s ease; }
.kcard:hover .kcard__grip { color: var(--faint); }
.kcard__grip .ico { width: 14px; height: 14px; }
.kcard__rot { display: flex; color: var(--amber); flex: none; }
.kcard__rot .ico { width: 15px; height: 15px; }
.kcard__proc { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.kcard__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kcard__source { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--faint); }
.kcard__source .ico { width: 13px; height: 13px; }
.kcard__value { font-size: 12.5px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.kcard__owner { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11.5px; color: var(--faint); }
.kcard__owner .ico { width: 13px; height: 13px; }

/* lead routing (Settings > Lead routing) + unrouted-leads alert */
.route-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.route-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(39, 62, 212, .06); color: var(--blue); font-size: 13px; font-weight: 600; }
.route-chip .ico { width: 14px; height: 14px; }
.route-empty { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 13px; }
.route-empty .ico { width: 16px; height: 16px; flex: none; color: var(--faint); margin-top: 1px; }
.route-picks { display: flex; flex-direction: column; gap: 2px; }
.route-pick { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius); cursor: pointer; transition: background .15s ease; }
.route-pick:hover { background: var(--tint); }
.route-pick input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.route-pick > span:first-of-type { font-weight: 600; }
.route-pick__email { margin-left: auto; color: var(--faint); font-size: 12.5px; }
.route-alert { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--amber-tint); border: 1px solid rgba(154, 98, 0, .22); }
.route-alert > .ico { width: 20px; height: 20px; flex: none; color: var(--amber); }
.route-alert__text { flex: 1; font-size: 13.5px; color: var(--ink); }
.route-alert__text b { color: var(--amber); }
.route-alert .btn { flex: none; }

/* deal detail slide-over */
.detail-rows { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.detail-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--tint); align-items: flex-start; font-size: 13.5px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .ico { width: 16px; height: 16px; color: var(--blue); margin-top: 2px; flex: none; }
.detail-row__label { color: var(--faint); font-size: 12px; width: 90px; flex: none; padding-top: 1px; }
.detail-row__value { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* copy-to-clipboard: compact, quiet until engaged; negative margins keep it
   from inflating the row height it sits in */
.copy-btn { width: 26px; height: 26px; border-radius: 8px; color: var(--faint); }
.copy-btn .ico { width: 14px; height: 14px; }
.copy-btn:hover { background: rgba(39, 62, 212, .08); color: var(--blue); }
.copy-btn:active { transform: scale(.8); }
.detail-row .copy-btn { margin: -4px 0 -4px auto; flex: none; }
/* ready for a JS hook: add .is-copied for the one-beat confirmation flash */
.copy-btn.is-copied { color: var(--green); background: var(--green-tint); animation: copyPop .35s var(--ease-spring); }
@keyframes copyPop { 40% { transform: scale(1.18); } }

.stage-stepper { display: flex; flex-direction: column; gap: 0; margin-bottom: 4px; position: relative; }
/* connecting rail behind the dots */
.stage-stepper::before { content: ''; position: absolute; left: 10px; top: 17px; bottom: 17px; width: 2px; background: var(--tint-2); border-radius: 2px; }
.stage-step { display: flex; align-items: center; gap: 10px; padding: 6px 0; border: none; background: none; text-align: left; border-radius: 8px; color: var(--muted); font-size: 13px; position: relative; transition: color .15s ease; }
.stage-step:hover { color: var(--blue); }
.stage-step:hover .stage-step__dot { border-color: var(--blue-light); transform: scale(1.08); }
.stage-step__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); background: #fff; flex: none; display: flex; align-items: center; justify-content: center; color: transparent; transition: all .2s var(--ease-spring); }
.stage-step__dot .ico { width: 12px; height: 12px; }
.stage-step.is-done .stage-step__dot { background: var(--tint-2); border-color: var(--blue-light); color: var(--blue); }
.stage-step.is-current { color: var(--ink); font-weight: 700; }
.stage-step.is-current .stage-step__dot { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 4px rgba(39, 62, 212, .14); }

.close-actions { display: flex; gap: 10px; margin-top: 14px; }
.close-actions .btn { flex: 1; justify-content: center; }

/* activity timeline inside deal detail */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--tint); }
.timeline-item:last-child { border-bottom: none; }
.timeline-item__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-light); flex: none; margin-top: 6px; box-shadow: 0 0 0 3px rgba(91, 114, 240, .15); }
.timeline-item__body { flex: 1; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.timeline-item time { font-size: 11px; color: var(--faint); }
/* edit/delete controls on note & reminder rows: compact, half-asleep until
   the row is engaged, so the timeline reads as text first, chrome second */
.timeline-item .icon-btn { width: 28px; height: 28px; flex: none; opacity: .45; transition: opacity .15s ease, background .15s ease, color .15s ease, transform .15s var(--ease-spring); }
.timeline-item .icon-btn .ico { width: 15px; height: 15px; }
.timeline-item:hover .icon-btn, .timeline-item:focus-within .icon-btn { opacity: 1; }
/* inline note editing: the input takes the note's place without jolting the row */
.timeline-item__body .input { padding: 6px 10px; font-size: 13px; border-radius: 8px; margin: -1px 0 2px; animation: noteEditIn .2s var(--ease-out); }
@keyframes noteEditIn { from { opacity: .3; transform: translateY(-2px); } to { opacity: 1; transform: none; } }

/* ================= Loading skeleton (pure CSS; needs a JS hook to use) ===
   Add class "skeleton" to any placeholder block, e.g.
   <li class="activity-item"><span class="skeleton" style="width:70%"></span></li>
   ======================================================================== */
.skeleton {
  display: inline-block; height: 1em; width: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--tint-2) 25%, var(--tint) 45%, var(--tint-2) 65%);
  background-size: 200% 100%;
  animation: skeletonSweep 1.4s ease infinite;
}
@keyframes skeletonSweep { from { background-position: 120% 0; } to { background-position: -80% 0; } }

/* ================= Responsive ================= */

@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-104%); transition: transform .3s cubic-bezier(.32, .72, 0, 1); width: var(--sidebar-w) !important; box-shadow: var(--shadow-lg); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-collapsed .oro-logo__text, .app.sidebar-collapsed .nav-item span, .app.sidebar-collapsed .nav-item__badge, .app.sidebar-collapsed .user-chip__meta { display: initial; }
  .app.sidebar-collapsed .sidebar__head { flex-direction: row; padding: 18px 14px 14px 18px; }
  .app.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 10.5px 12px; }
  .sidebar__collapse { display: none; }
  .topbar__menu { display: inline-flex; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar__crumb { display: none; }
  .topbar__title { font-size: 17px; }
  .content { padding: 14px 12px 32px; }
  /* narrow screens: keep the one-row board, swipe between near-full-width
     columns; height released so the page scrolls naturally */
  .kanban { grid-auto-columns: minmax(min(84vw, 300px), 1fr); scroll-snap-type: x mandatory; }
  .kanban-col { height: auto; min-height: 220px; max-height: calc(100dvh - var(--topbar-h) - 150px); }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
  .field--half { flex-basis: 100%; }
  .dash-grid { grid-template-columns: 1fr; }
  .bar-report__row { grid-template-columns: 96px 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================================================================
   Auth gate — the first thing anyone sees; treat it like a lobby.
   ================================================================ */
.auth-gate {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(160deg, #000000, var(--black-soft) 55%, #101638 100%);
  overflow: hidden;
}
/* slow-breathing blue bloom, echoing the Vista Lens mark */
.auth-gate::before {
  content: ''; position: absolute;
  width: 720px; height: 720px; right: -220px; bottom: -320px;
  background: radial-gradient(closest-side, rgba(39, 62, 212, .5), rgba(39, 62, 212, .12) 55%, transparent 72%);
  animation: gateBloom 9s ease-in-out infinite alternate;
  pointer-events: none;
}
.auth-gate::after {
  content: ''; position: absolute;
  width: 480px; height: 480px; left: -160px; top: -200px;
  background: radial-gradient(closest-side, rgba(91, 114, 240, .2), transparent 70%);
  animation: gateBloom 12s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}
@keyframes gateBloom { from { transform: translateY(0) scale(1); opacity: .85; } to { transform: translateY(-36px) scale(1.08); opacity: 1; } }

.auth-gate__box {
  width: 100%; max-width: 380px;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), var(--shadow-lg);
  padding: 32px 28px 28px;
  position: relative;
  animation: gateIn .55s var(--ease-out) backwards;
}
@keyframes gateIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-gate__mark { display: block; margin-bottom: 14px; filter: drop-shadow(0 4px 12px rgba(39, 62, 212, .3)); }
.auth-gate__brand {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue); background: rgba(39, 62, 212, .08);
  border: 1px solid rgba(39, 62, 212, .16);
  padding: 4px 11px; border-radius: 99px; margin-bottom: 14px;
}
.auth-gate__box h1 { font-size: 22px; margin-bottom: 6px; letter-spacing: -.01em; }
.auth-gate__sub { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 20px; }
.auth-gate__error { background: var(--red-tint); color: var(--red); border: 1px solid rgba(192, 49, 61, .18); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin-bottom: 16px; animation: gateShake .4s var(--ease-out); }
@keyframes gateShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 55% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }
.auth-gate__field { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.auth-gate__field .input { margin-top: 6px; width: 100%; }
.auth-gate__submit { width: 100%; justify-content: center; margin-top: 4px; padding: 11px 17px; }
.auth-gate__link { display: block; width: 100%; text-align: center; margin-top: 16px; background: none; border: none; color: var(--blue); font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px; border-radius: 8px; transition: background .15s ease; }
.auth-gate__link:hover { text-decoration: underline; background: rgba(39, 62, 212, .05); }
