:root {
  --orange: #eda034;
  --blue: #016fac;
  --blue-soft: #e6f1f8;
  --ink: #16191d;
  --ink-2: #4a525c;
  --muted: #7c8590;
  --line: #e6e9ee;
  --bg: #f5f7fa;
  --card: #ffffff;
  --green: #1f9d6a;
  --red: #d64545;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --sidebar-w: 76px;
  --sidebar-w-open: 264px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
h1, h2, h3 { font-family: 'Montserrat', 'Inter', system-ui, sans-serif; margin: 0; letter-spacing: -.01em; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.muted { color: var(--muted); margin: 0; font-size: 14px; }
code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

/* ---------- buttons & inputs ---------- */
.btn-primary {
  width: 100%; margin-top: 24px; padding: 12px 16px; border: 0; border-radius: 10px;
  background: var(--blue); color: #fff; font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: #015a8c; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s;
}
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 18px 0 6px; }
input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 15px; color: var(--ink); background: #fff; transition: border .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1, 111, 172, .15); }

/* ---------- login ---------- */
.login-body { background: #fff; }
.login-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-brand {
  position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 56px;
  background: radial-gradient(circle at 85% 15%, rgba(245, 160, 30, .35), transparent 40%),
              radial-gradient(circle at 10% 90%, rgba(30, 143, 213, .55), transparent 50%),
              #0f1a24;
  color: #fff;
}
.login-brand::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.login-brand-inner { position: relative; z-index: 1; max-width: 460px; }
.login-brand h1 { font-size: 36px; line-height: 1.2; font-weight: 600; margin: 12px 0 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; color: var(--orange); margin: 0; }
.muted-light { color: rgba(255,255,255,.7); line-height: 1.6; margin: 0; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 380px; }
.login-logo { height: 52px; margin-bottom: 40px; }
.login-card h2 { font-size: 26px; font-weight: 600; margin-bottom: 6px; }
.alert { margin-top: 18px; padding: 10px 12px; border-radius: 10px; background: #fdecec; color: var(--red); font-size: 14px; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.nav-expanded { --sidebar-w: var(--sidebar-w-open); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px 14px; z-index: 30;
}
.nav-animate .sidebar { transition: width .22s ease; }
.nav-animate .main { transition: margin-left .22s ease; }

.brand-row { height: 48px; display: flex; align-items: center; margin-bottom: 22px; }
.brand { display: flex; align-items: center; height: 100%; overflow: hidden; border-radius: 10px; }
.brand-icon { width: 36px; height: 36px; margin-left: 6px; }
.brand-logo { height: 36px; padding-left: 8px; display: none; } /* same hexagon size and position as the collapsed icon */
.nav-expanded .brand-icon { display: none; }
.nav-expanded .brand-logo { display: block; animation: fadeIn .2s .08s both; }

.collapse-toggle {
  position: absolute; top: 32px; right: -13px; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  box-shadow: var(--shadow); cursor: pointer; transition: color .15s, border-color .15s; z-index: 2;
}
.collapse-toggle:hover { color: var(--blue); border-color: var(--blue); }
.collapse-toggle svg { width: 15px; height: 15px; stroke-width: 2.2; transition: transform .22s ease; }
.nav-expanded .collapse-toggle svg { transform: rotate(180deg); }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-label { height: 1px; background: var(--line); margin: 14px 10px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nav-label .nav-text { display: none; }
.nav-expanded .nav-label { height: auto; background: none; margin: 18px 12px 6px; }
.nav-expanded .nav-label .nav-text { display: inline; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.active { background: var(--blue-soft); color: var(--blue); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }
.nav-text { overflow: hidden; text-overflow: ellipsis; }
.nav .nav-text, .sidebar-foot .nav-text { display: none; }
.nav-expanded .nav a { overflow: hidden; }
.nav-expanded .nav .nav-text, .nav-expanded .sidebar-foot .nav-text { display: block; animation: fadeIn .2s .08s both; }
@keyframes fadeIn { from { opacity: 0; } }

.sidebar-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-expanded .sidebar-foot { flex-direction: row; justify-content: space-between; padding: 12px 6px 0; }
.user { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--orange), #e07f1c); color: #fff; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.user-name { font-size: 14px; font-weight: 500; white-space: nowrap; }
.signout { position: relative; }

/* tooltips — only while collapsed, on screens wide enough for the icon bar */
@media (min-width: 861px) {
  html:not(.nav-expanded) [data-tip]::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 16px); top: 50%;
    transform: translate(-4px, -50%); padding: 7px 11px; border-radius: 8px;
    background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
    box-shadow: 0 6px 20px rgba(16, 24, 40, .18); opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; z-index: 50;
  }
  html:not(.nav-expanded) .nav a::after { left: calc(100% + 26px); }
  html:not(.nav-expanded) [data-tip]:hover::after,
  html:not(.nav-expanded) [data-tip]:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
}

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 22px 36px; background: rgba(245, 247, 250, .85); backdrop-filter: blur(10px);
}
.topbar h1 { font-size: 24px; font-weight: 600; }
.topbar .muted { margin-top: 2px; }
.menu-toggle { display: none; }
.refresh {
  margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.refresh[hidden] { display: none; }
.refresh .btn-ghost { width: 30px; height: 30px; border-radius: 50%; }
.refresh svg { width: 16px; height: 16px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(31, 157, 106, .18); }
.dot.loading { background: var(--orange); box-shadow: 0 0 0 3px rgba(245, 160, 30, .2); animation: pulse 1s infinite; }
.dot.error { background: var(--red); box-shadow: 0 0 0 3px rgba(214, 69, 69, .18); }
@keyframes pulse { 50% { opacity: .4; } }

.content { padding: 8px 36px 48px; }

/* ---------- dashboard grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.card.sm { grid-column: span 1; }
.card.md { grid-column: span 2; }
.card.lg { grid-column: 1 / -1; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.widget { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.stat-value { font-family: 'Montserrat', 'Inter', sans-serif; font-size: 34px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.change { padding: 2px 7px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.change.up { background: #e6f6ef; color: var(--green); }
.change.down { background: #fdecec; color: var(--red); }

.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kv li:first-child { border-top: 0; padding-top: 0; }
.kv span { color: var(--ink-2); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
.widget-error { color: var(--red); font-size: 14px; margin: 0; }
pre { margin: 0; font-size: 12px; white-space: pre-wrap; color: var(--ink-2); }

.skeleton { min-height: 132px; background: linear-gradient(90deg, #fff 25%, #f1f4f8 50%, #fff 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton.md { min-height: 200px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- placeholder pages ---------- */
.empty { display: grid; place-items: center; text-align: center; padding: 96px 24px; background: var(--card); border: 1px dashed #d5dbe3; border-radius: var(--radius); }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); margin-bottom: 18px; }
.empty-icon svg { width: 26px; height: 26px; }
.empty h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  :root, .nav-expanded { --sidebar-w: 0px; }
  .sidebar { width: var(--sidebar-w-open); transform: translateX(-100%); transition: transform .2s ease; }
  .collapse-toggle { display: none; }
  .brand-icon { display: none; }
  .brand-logo { display: block; }
  .nav .nav-text, .sidebar-foot .nav-text, .nav-label .nav-text { display: block; }
  .nav-label { height: auto; background: none; margin: 18px 12px 6px; }
  .sidebar-foot { flex-direction: row; justify-content: space-between; padding: 12px 6px 0; }
  .nav-open .sidebar { transform: none; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(15, 26, 36, .35); z-index: 20; }
  .nav-open .scrim { display: block; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 16px 18px; flex-wrap: wrap; }
  .refresh { margin-left: 0; width: 100%; justify-content: space-between; }
  .content { padding: 8px 18px 32px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .card.sm, .card.md { grid-column: 1 / -1; }
}

/* =====================================================================
   SCHEDULE
   ===================================================================== */
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-family: inherit; font-weight: 500; font-size: 13.5px; line-height: 1;
  text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; white-space: nowrap;
}
.btn-secondary:hover { border-color: #cfd5dd; background: #fafbfc; }
.btn-secondary svg { width: 16px; height: 16px; }
.btn-primary-sm { height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--blue); color: #fff; font-family: inherit; font-weight: 600; font-size: 13.5px; line-height: 1; cursor: pointer; }
.btn-primary-sm:hover { background: #015a8c; }
.btn-danger { height: 36px; padding: 0 14px; border: 1px solid #f3c4c4; border-radius: 9px; background: #fff; color: var(--red); font-family: inherit; font-weight: 500; font-size: 13.5px; line-height: 1; cursor: pointer; }
.btn-danger:hover { background: #fdf2f2; }
.btn-ghost-text {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; color: var(--ink-2); font-family: inherit; font-weight: 500; font-size: 13px; line-height: 1; cursor: pointer;
}
.btn-ghost-text:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.btn-ghost-text:disabled { opacity: .4; cursor: default; }
.btn-ghost-text svg { width: 16px; height: 16px; }

.sched { display: flex; flex-direction: column; gap: 16px; }
.sched-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sched-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.day-tabs { display: flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; }
.day-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; padding: 7px 12px;
  border: 0; border-radius: 9px; background: none; font-family: inherit; cursor: pointer; color: var(--ink-2); transition: background .15s, color .15s;
}
.day-tab:hover { background: var(--bg); }
.day-tab.active { background: var(--blue); color: #fff; }
.dt-name { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.dt-sub { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }
.today-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.warn-dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--card); }
.day-tab.active .warn-dot { box-shadow: 0 0 0 2px var(--blue); }

.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.save-state.pending i, .save-state.saving i { background: var(--orange); }
.save-state.saving i { animation: pulse 1s infinite; }
.save-state.error { color: var(--red); }
.save-state.error i { background: var(--red); }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-radius: 12px; background: #fff8eb; border: 1px solid #f6dfb4; font-size: 14px; color: #7a4a06; }
.notice[hidden] { display: none; }

.sched-card { padding: 0; overflow: hidden; }
.sched-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 22px 24px 16px; flex-wrap: wrap; }
.sh-title h2 { font-size: 20px; font-weight: 600; }
.sh-title .muted { margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.chip-good { background: #e7f6ee; color: #17784f; }
.chip-bad { background: #fdecec; color: #b23535; }
.chip-muted { background: var(--bg); color: var(--ink-2); }
.sh-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--ink-2); font-weight: 500; }
select {
  height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-family: inherit; font-size: 13.5px; color: var(--ink);
  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='%237c8590' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; cursor: pointer;
}
select:disabled { opacity: .5; cursor: default; }
select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1, 111, 172, .15); }
.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #d5dbe3; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--ink-2); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(1, 111, 172, .25); }

.sched-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfcfd; flex-wrap: wrap; }
.toolseg { display: inline-flex; padding: 3px; gap: 2px; background: #eef1f5; border-radius: 10px; }
.seg-btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-family: inherit; font-weight: 500; font-size: 13px; line-height: 1; color: var(--ink-2); cursor: pointer; }
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 1px 3px rgba(16,24,40,.06); }
.tools-right { display: flex; gap: 4px; }

/* swatches */
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.sw-l1 { background: #34c38f; }
.sw-l2 { background: #3b8fe0; }
.sw-mgr { background: #9b72e6; }
.sw-b { background: repeating-linear-gradient(135deg, #f8c64a 0 3px, #fbd97a 3px 6px); }
.sw-o { background: #fff; border: 1.5px dashed #c3cad3; }
.sw-out { background: repeating-linear-gradient(135deg, #eef1f5 0 3px, #f8f9fb 3px 6px); border: 1px solid var(--line); }

/* grid */
.sched-scroll { overflow-x: auto; }
.sgrid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1100px; table-layout: fixed; user-select: none; }
.sgrid .name-col { position: sticky; left: 0; z-index: 2; width: 236px; background: var(--card); text-align: left; border-right: 1px solid var(--line); }
.sgrid thead th { position: sticky; top: 0; z-index: 3; background: var(--card); height: 38px; border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sgrid thead .corner { z-index: 4; padding-left: 24px; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.time-h { text-align: left; padding: 0 0 0 4px; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-h.now { color: var(--blue); }

.grp-head th { padding: 18px 12px 8px 24px; font-family: 'Montserrat', 'Inter', sans-serif; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.grp-head td { border-bottom: 0; }
.grp:first-of-type .grp-head th { padding-top: 14px; }
.grp-badge { display: inline-block; min-width: 30px; padding: 3px 6px; margin-right: 8px; border-radius: 6px; font: 600 10.5px/1 'Inter', sans-serif; letter-spacing: .04em; text-align: center; color: #fff; vertical-align: 1px; }
.grp-l1 .grp-badge { background: #34c38f; }
.grp-l2 .grp-badge { background: #3b8fe0; }
.grp-mgr .grp-badge { background: #9b72e6; }
.grp-count { margin-left: 8px; font: 500 12px 'Inter', sans-serif; color: var(--muted); }

.agent th { padding: 0; height: 46px; border-top: 1px solid #f0f2f5; }
.agent-btn {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 100%; height: 100%; padding: 0 12px 0 24px;
  border: 0; background: none; text-align: left; font-family: inherit; cursor: pointer; transition: background .12s;
}
.agent-btn:hover { background: #f7f9fb; }
.agent-btn:hover .agent-name { color: var(--blue); }
.agent-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.agent-name { font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { padding: 1px 6px; border-radius: 5px; background: #eef1f5; color: var(--ink-2); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; flex-shrink: 0; }
.agent-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

.sgrid td { padding: 0; height: 46px; }
.agent td { border-top: 1px solid #f0f2f5; }
.sgrid td.hr { border-left: 1px solid #e9ecf0; }
.sgrid td.half { border-left: 1px dashed #f0f2f5; }
.sgrid td.out { background: repeating-linear-gradient(135deg, #f6f7f9 0 4px, #fbfbfc 4px 8px); }
.sgrid td.now { box-shadow: inset 0 0 0 9999px rgba(1, 111, 172, .045); }
td.slot { cursor: pointer; touch-action: none; position: relative; }
td.slot:hover::after { content: ''; position: absolute; inset: 9px 1px; border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(1, 111, 172, .45); pointer-events: none; }

.seg { display: block; height: 28px; margin: 0; }
td.slot > .seg { position: absolute; left: -1px; right: 0; top: 9px; }
.seg.s { left: 2px !important; border-top-left-radius: 7px; border-bottom-left-radius: 7px; }
.seg.e { right: 2px !important; border-top-right-radius: 7px; border-bottom-right-radius: 7px; }
.seg-l1 { background: #34c38f; }
.seg-l2 { background: #3b8fe0; }
.seg-mgr { background: #9b72e6; }
.seg-b { background: repeating-linear-gradient(135deg, #f8c64a 0 4px, #fbd97a 4px 8px); }
.seg.clash { background: repeating-linear-gradient(135deg, #e5484d 0 4px, #ef6b6f 4px 8px); }

.cover th { height: 36px; padding: 0 12px 0 24px; }
.cover td { height: 36px; text-align: center; }
.cover-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cov { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 4px; border-radius: 5px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cov.c0 { background: #fde2e2; color: #b42323; }
.cov.c1 { background: #ffe7cc; color: #a8520a; }
.cov.c2 { background: #fdf3c4; color: #8a6a05; }
.cov.c3 { background: #d8f3e5; color: #17784f; }
.cov.c-out { color: #b6bdc6; }

.add-row th { padding: 6px 12px 10px 18px; border-top: 1px solid #f0f2f5; }
.add-row td { border-top: 1px solid #f0f2f5; }
.add-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--blue); font-family: inherit; font-weight: 500; font-size: 13px; line-height: 1; cursor: pointer; }
.add-btn:hover { background: var(--blue-soft); }
.add-btn svg { width: 15px; height: 15px; stroke-width: 2.2; }

.sched-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 14px 24px; border-top: 1px solid var(--line); background: #fbfcfd; font-size: 12.5px; color: var(--ink-2); }
.sched-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.sched-legend .cov { margin-left: -10px; }
.sched-legend .cov:first-of-type { margin-left: 0; }
.legend-sep { width: 1px; height: 16px; background: var(--line); }
.legend-hint { margin-left: auto; color: var(--muted); font-size: 12px; }

/* dialogs */
.modal { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 64px rgba(15, 26, 36, .25); color: var(--ink); }
.modal::backdrop { background: rgba(15, 26, 36, .4); backdrop-filter: blur(2px); }
.modal-body { padding: 24px; }
.modal-body h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.modal-body h3 .muted { font: 400 14px 'Inter', sans-serif; }
.modal-body label:not(.check) { display: flex; flex-direction: column; gap: 6px; margin: 16px 0 0; }
.modal-body input:not([type=checkbox]), .modal-body select { width: 100%; height: 40px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; font-size: 14px; color: var(--ink-2); font-weight: 400; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.small { font-size: 13px; margin-top: 12px; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 24px; }
.spacer { flex: 1; }
.day-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 11px 18px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .legend-hint { margin-left: 0; width: 100%; }
  .sched-head, .sched-tools, .sched-legend { padding-left: 16px; padding-right: 16px; }
  .sgrid .name-col { width: 170px; }
}
.skeleton-tall { min-height: 420px; }
.sw-clash { background: repeating-linear-gradient(135deg, #e5484d 0 3px, #ef6b6f 3px 6px); }

/* =====================================================================
   METRICS
   ===================================================================== */
.mx { display: flex; flex-direction: column; gap: 18px; }
.mx-source { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.mx-src-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; }
.mx-src-icon svg { width: 18px; height: 18px; }
.tone-good .mx-src-icon { background: #e7f6ee; color: #0f7a44; }
.tone-warn .mx-src-icon { background: #fff4dc; color: #a06400; }
.tone-bad .mx-src-icon { background: #fdecec; color: #b42323; }
.tone-warn { border-color: #f3dfb2; background: #fffcf4; }
.tone-bad { border-color: #f3c4c4; background: #fffafa; }
.mx-src-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.mx-src-text strong { font-size: 14px; font-weight: 600; }
.mx-src-text span { font-size: 13px; color: var(--ink-2); }
.mx-src-actions { display: flex; gap: 8px; flex-shrink: 0; }

.mx-filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mx-period { min-width: 290px; height: 38px; font-weight: 500; }
.mx-compare { font-size: 13px; }
.mx-note { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--blue-soft); color: #0b4c75; font-size: 13.5px; }
.mx-note svg { width: 17px; height: 17px; }

.mx-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mx-kpis .skeleton { min-height: 138px; }
.kpi { position: relative; padding: 18px 20px 16px; display: flex; flex-direction: column; min-height: 138px; }
.kpi h3 { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.kpi-value { margin-top: 8px; font-family: 'Inter', sans-serif; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kpi-delta { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; padding-right: 110px; min-height: 20px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.delta svg { width: 13px; height: 13px; stroke-width: 2.4; }
.delta.good { color: #006300; }
.delta.bad { color: #b42323; }
.delta.neutral { color: var(--ink-2); }
.delta-vs { color: var(--muted); }
.spark { position: absolute; right: 16px; bottom: 16px; width: 100px; height: 32px; overflow: visible; }

.mx-highlights { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-highlights:empty { display: none; }
.hl { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.hl svg { width: 15px; height: 15px; }
.hl.good { background: #e7f6ee; color: #0f6b3d; }
.hl.bad { background: #fdecec; color: #a32020; }

.mx-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.mx-section-head h2 { font-size: 17px; font-weight: 600; }
.mx-table-controls { display: flex; align-items: center; gap: 10px; }

.mx-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mx-chart { padding: 18px 20px 12px; }
.mx-chart header h3 { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.mx-chart header .muted { font-size: 12.5px; margin-top: 2px; }
.mx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 4px; font-size: 12.5px; color: var(--ink-2); min-height: 4px; }
.mx-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lk-line { display: inline-block; width: 14px; height: 2px; border-radius: 2px; background: var(--c); }
.lk-box { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.mx-plot { position: relative; width: 100%; min-height: 220px; }
.mx-plot svg { display: block; width: 100%; height: auto; }
.mx-plot .ax { font-size: 11px; fill: #8a929c; font-variant-numeric: tabular-nums; font-family: 'Inter', sans-serif; }
.mx-plot .hit { cursor: crosshair; }

.mx-tip { position: fixed; z-index: 80; min-width: 190px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(16, 24, 40, .14); font-size: 12.5px; pointer-events: none; }
.mx-tip[hidden] { display: none; }
.tip-title { font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.tip-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--ink-2); }
.tip-row b { margin-left: auto; padding-left: 14px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }

.mx-table-card { padding: 0; overflow: hidden; }
.mx-table-wrap { overflow-x: auto; }
.mx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; white-space: nowrap; }
.mx-table th, .mx-table td { padding: 10px 14px; border-bottom: 1px solid #f0f2f5; text-align: right; font-variant-numeric: tabular-nums; }
.mx-table th:first-child { position: sticky; left: 0; background: var(--card); text-align: left; font-weight: 500; color: var(--ink); z-index: 1; border-right: 1px solid var(--line); }
.mx-table thead th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; background: #fbfcfd; }
.mx-table thead th:first-child { background: #fbfcfd; }
.mx-table .grp-row th { padding-top: 12px; padding-bottom: 4px; border-bottom: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; text-align: left; color: var(--ink-2); }
.mx-table .grp-ai { border-left: 1px solid var(--line); }
.mx-table td { color: var(--ink-2); }
.mx-table tbody tr:hover td, .mx-table tbody tr:hover th { background: #f8fafc; }
.mx-table tfoot th, .mx-table tfoot td { font-weight: 600; color: var(--ink); background: #fbfcfd; border-bottom: 0; border-top: 1px solid var(--line); }
.mx-table tr.pending td { text-align: left; color: var(--muted); font-style: italic; }
.mx-table .tag { margin-left: 6px; }
.wk-n { display: inline-block; min-width: 42px; color: var(--muted); font-size: 12px; }

@media (max-width: 1200px) { .mx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .mx-charts { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .mx-source { flex-wrap: wrap; }
  .mx-src-actions { width: 100%; }
  .mx-period { min-width: 0; width: 100%; }
  .mx-filters .field-inline { width: 100%; }
}
@media (max-width: 520px) { .mx-kpis { grid-template-columns: 1fr; } }
/* chart SVGs must not inherit the icon defaults */
.mx-plot svg, svg.spark { stroke: none; stroke-width: 0; fill: none; }
.mx-plot svg { width: 100%; height: auto; }
.mx-table th { text-transform: none; letter-spacing: 0; font-size: 13px; }
.mx-table thead th { font-size: 11.5px; }
.mx-table .grp-row th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

/* =====================================================================
   TEAM
   ===================================================================== */
.tc-blue    { --tc: #2a78d6; --tc-bg: #e3eefb; --tc-fg: #1c5cab; }
.tc-orange  { --tc: #eb6834; --tc-bg: #fdeae1; --tc-fg: #a8431a; }
.tc-aqua    { --tc: #1baf7a; --tc-bg: #dcf5ec; --tc-fg: #0d7350; }
.tc-violet  { --tc: #6250d6; --tc-bg: #ebe8fb; --tc-fg: #4a3aa7; }
.tc-magenta { --tc: #e87ba4; --tc-bg: #fbe7ef; --tc-fg: #a3305f; }
.tc-green   { --tc: #008300; --tc-bg: #e1f2e1; --tc-fg: #006300; }
.tc-yellow  { --tc: #eda100; --tc-bg: #fdf2d6; --tc-fg: #7f5600; }
.tc-red     { --tc: #e34948; --tc-bg: #fce5e5; --tc-fg: #a82727; }

.tm { display: flex; flex-direction: column; gap: 14px; }
.tm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tm-search { position: relative; display: flex; align-items: center; margin: 0; flex: 0 1 340px; }
.tm-search svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.tm-search input { height: 38px; padding-left: 38px; font-size: 14px; }
.tm-add { display: inline-flex; align-items: center; gap: 6px; height: 36px; }
.tm-add svg, .btn-secondary svg { width: 16px; height: 16px; stroke-width: 2.2; }

.tm-summary { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.tm-summary strong { color: var(--ink); font-weight: 600; }
.tm-summary .sep { width: 1px; height: 14px; background: var(--line); }
.sum-on { display: inline-flex; align-items: center; gap: 7px; }
.sum-on i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(31,157,106,.16); }

.tm-team { margin-top: 22px; }
.tm-team-head { display: flex; align-items: center; gap: 12px; padding: 0 2px 12px; }
.tm-swatch { width: 4px; align-self: stretch; min-height: 34px; border-radius: 4px; background: var(--tc); }
.tm-team-title h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.tm-team-title .muted { margin-top: 2px; font-size: 13px; }
.tm-count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--tc-bg); color: var(--tc-fg); font: 600 12px 'Inter', sans-serif; }

.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.tm-grid .skeleton { min-height: 150px; }
.pcard {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pcard:hover { border-color: #d3d9e1; box-shadow: 0 6px 18px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.pcard:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(1, 111, 172, .25); border-color: var(--blue); }
.pc-top { display: flex; align-items: flex-start; gap: 12px; }
.pc-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; background: var(--tc-bg); color: var(--tc-fg); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.pc-id { min-width: 0; flex: 1; padding-top: 2px; }
.pc-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink); }
.pc-role { margin-top: 3px; font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.lead { padding: 2px 7px; border-radius: 999px; background: #fff4dc; color: #8a5a00; font-size: 11px; font-weight: 600; }
.pc-ext { flex-shrink: 0; padding: 3px 8px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }

.pc-status { padding-top: 12px; border-top: 1px solid #f0f2f5; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.st-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.st { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.st i { width: 8px; height: 8px; border-radius: 50%; background: #c3c9d1; flex-shrink: 0; }
.st-on i { background: var(--green); box-shadow: 0 0 0 3px rgba(31,157,106,.16); }
.st-break i { background: #eda100; box-shadow: 0 0 0 3px rgba(237,161,0,.18); }
.st-later i { background: #8fb9e8; }
.st-done, .st-off { color: var(--ink-2); font-weight: 500; }
.st-none { color: var(--muted); font-weight: 400; }
.st-warn { color: #8a5a00; font-weight: 500; }
.st-warn i { background: #eda100; }
.st-sub { color: var(--muted); }
.st-week { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wds { display: inline-flex; gap: 4px; }
.wd { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 10.5px; font-weight: 600; color: #b3bac3; background: #f4f6f8; }
.wd.on { background: var(--tc-bg); color: var(--tc-fg); }
.wd.today { box-shadow: 0 0 0 1.5px var(--ink-2); }
.st-hours { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-contact { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 4px; }
.pc-status:has(+ .pc-contact) .st-week { padding-right: 64px; }
.pc-contact a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ink-2); }
.pc-contact a:hover { background: var(--bg); color: var(--blue); }
.pc-contact svg { width: 16px; height: 16px; }
.pcard-empty { min-height: 120px; border: 1.5px dashed #d5dbe3; border-radius: var(--radius); background: none; color: var(--muted); font-family: inherit; font-size: 13.5px; cursor: pointer; }
.pcard-empty:hover { border-color: var(--blue); color: var(--blue); }

.form-error { margin: 14px 0 0; padding: 9px 12px; border-radius: 8px; background: #fdecec; color: var(--red); font-size: 13px; }
.form-error[hidden] { display: none; }
.colors { display: flex; gap: 10px; margin: 16px 0 0; padding: 0; border: 0; flex-wrap: wrap; }
.colors legend { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.color-opt { position: relative; margin: 0 !important; cursor: pointer; }
.color-opt input { position: absolute; opacity: 0; }
.color-opt span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--tc); box-shadow: inset 0 0 0 2px rgba(255,255,255,.9); }
.color-opt input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--tc); }
.color-opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 4px; }
.order-row { display: flex; align-items: center; gap: 4px; margin-top: 14px; }
.order-row .muted { margin: 0 6px 0 0; }

@media (max-width: 860px) {
  .tm-search { flex: 1 1 100%; }
  .tm-team-head .btn-ghost-text { display: none; }
}

/* Sidebar column runs the full length of the page (also in full-page captures and print) */
.shell { position: relative; }
.shell::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: var(--sidebar-w);
  background: var(--card); border-right: 1px solid var(--line); z-index: 0; pointer-events: none;
}
.nav-animate .shell::before { transition: width .22s ease; }
@media print {
  .sidebar { position: absolute; height: 100%; }
}
@media (max-width: 860px) { .shell::before { display: none; } }

/* =====================================================================
   SUPPORT COSTS
   ===================================================================== */
.co { display: flex; flex-direction: column; gap: 16px; }
.co-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.co-years { display: inline-flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.co-year { height: 34px; min-width: 64px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.co-year:hover { background: var(--bg); }
.co-year.active { background: var(--blue); color: #fff; }
.co-year-add { min-width: 34px; padding: 0; display: grid; place-items: center; color: var(--muted); }
.co-year-add svg { width: 16px; height: 16px; stroke-width: 2.2; }

.co-kpis .kpi-delta { padding-right: 0; }
.kpi-foot { margin-top: auto; padding-top: 10px; font-size: 12px; color: var(--muted); }
.co-kpis .kpi { min-height: 150px; }

.co-main-chart .mx-plot { min-height: 260px; }
.co-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mx-plot .ax-dim { fill: #b9c0c9; }
.mx-plot .ax-warn { fill: #a06400; font-size: 10px; }
.mx-plot .ax-val { fill: var(--ink-2); font-weight: 600; }
.mx-plot .ax-sel { fill: var(--blue); font-weight: 700; }
.mx-plot .hit-click { cursor: pointer; }
.lk-faded { opacity: .5; }
.tip-tag { margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 500; }
.tip-ch { font-weight: 600; margin-left: 4px; }
.tip-ch.good { color: #006300; }
.tip-ch.bad { color: #b42323; }
.tip-hint { margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.co-foot { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }

.co-items { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.ci-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.ci-name { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-track { height: 12px; }
.ci-bar { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--c); }
.ci-val { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 500; min-width: 76px; text-align: right; }

.co-table-card { padding: 0; overflow: hidden; }
.co-table-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; flex-wrap: wrap; }
.co-table-head h2 { font-size: 16px; font-weight: 600; }
.co-table-head h2 .muted { font: 500 15px 'Inter', sans-serif; }
.co-table-head p { margin-top: 3px; font-size: 13px; }
.co-swatch { width: 4px; align-self: stretch; min-height: 34px; border-radius: 4px; background: var(--c); }
.co-addrow { display: inline-flex; align-items: center; gap: 6px; }
.co-addrow svg { width: 15px; height: 15px; stroke-width: 2.2; }
.co-catnote { margin: 0 20px 12px; padding: 9px 12px; border-radius: 8px; background: #fff8eb; color: #7a4a06; font-size: 13px; white-space: pre-line; }
.co-noteedit { margin: 0 20px 12px; display: flex; flex-direction: column; gap: 8px; }
.co-noteedit textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: 14px 'Inter', sans-serif; resize: vertical; }
.co-noteedit textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1,111,172,.15); }
.co-noteedit div { display: flex; gap: 8px; justify-content: flex-end; }

.co-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.co-table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.co-table th, .co-table td { padding: 0; border-bottom: 1px solid #f0f2f5; text-align: right; height: 38px; text-transform: none; letter-spacing: 0; }
.co-table thead th { height: 36px; padding: 0 10px; background: #fbfcfd; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.co-table thead th.planned, .co-table tfoot td.planned { color: #b3bac3; }
.co-table th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); text-align: left; width: 270px; border-right: 1px solid var(--line); }
.co-table thead th:first-child { background: #fbfcfd; padding-left: 20px; }
.co-name-in { width: 100%; height: 38px; padding: 0 12px 0 20px; border: 0; border-radius: 0; background: transparent; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.co-in { width: 100%; min-width: 74px; height: 38px; padding: 0 10px; border: 0; border-radius: 0; background: transparent; text-align: right; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.co-in:hover, .co-name-in:hover { background: #f7f9fb; }
.co-in:focus, .co-name-in:focus { position: relative; z-index: 2; background: #fff; box-shadow: inset 0 0 0 2px var(--blue); color: var(--ink); }
.co-in.bad { box-shadow: inset 0 0 0 2px var(--red); }
.co-table td.planned { background: repeating-linear-gradient(135deg, #f8f9fb 0 4px, #fff 4px 8px); }
.co-table td.has-note { position: relative; }
.co-table td.has-note::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 8px 8px 0; border-color: transparent #eda100 transparent transparent; pointer-events: none; z-index: 3; }
.co-tot { padding: 0 12px !important; font-weight: 600; color: var(--ink); background: #fbfcfd; border-left: 1px solid var(--line); min-width: 96px; }
.co-tot-h { border-left: 1px solid var(--line); }
.co-act, .co-act-h { width: 40px; }
.co-del { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto; border: 0; border-radius: 7px; background: none; color: #b3bac3; cursor: pointer; opacity: 0; transition: opacity .12s; }
.co-table tr:hover .co-del, .co-del:focus-visible { opacity: 1; }
.co-del:hover { background: #fdecec; color: var(--red); }
.co-del svg { width: 15px; height: 15px; }
.co-table tfoot th, .co-table tfoot td { height: 40px; padding: 0 10px; font-weight: 600; color: var(--ink); background: #fbfcfd; border-top: 1px solid var(--line); border-bottom: 0; }
.co-table tfoot th { padding-left: 20px; }
.co-empty { text-align: center !important; color: var(--muted); padding: 18px !important; }

.co-notebar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--line); background: #fffcf4; font-size: 13px; }
.co-notebar[hidden] { display: none; }
.co-notebar svg { width: 16px; height: 16px; color: #a06400; flex-shrink: 0; }
.nb-label { color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.nb-in { flex: 1; height: 32px; font-size: 13px; }
.co-yearempty { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border: 1px dashed #d5dbe3; border-radius: var(--radius); }

@media (max-width: 860px) {
  .co-years { overflow-x: auto; max-width: 100%; }
  .co-table th:first-child { width: 160px; }
}

.co-hint { margin: 0; padding: 10px 20px; border-top: 1px solid #f0f2f5; font-size: 12px; color: var(--muted); }
.co-hint code { font-size: 11.5px; }

/* year over year chart */
.co-yoy .mx-plot { min-height: 280px; }
.mx-plot .ax-strong { fill: var(--ink); }
.mx-plot .ax-chg { font-weight: 600; font-size: 11.5px; }
.mx-plot .ax-chg.good { fill: #006300; }
.mx-plot .ax-chg.bad { fill: #b42323; }

/* account dialog */
button.user { border: 0; background: none; padding: 4px; margin: -4px; border-radius: 10px; font-family: inherit; color: var(--ink); cursor: pointer; text-align: left; position: relative; }
button.user:hover { background: var(--bg); }
button.user:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.modal-wide { width: min(720px, calc(100vw - 32px)); }
.acct { padding: 24px 26px; }
.acct-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.acct-head h3 { margin: 0; }
.acct-head .muted { margin-top: 2px; }
.acct-avatar { width: 46px; height: 46px; font-size: 16px; }
.acct-section { padding: 20px 0 4px; }
.acct-section + .acct-section { border-top: 1px solid var(--line); margin-top: 18px; }
.acct-section h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; font-family: 'Montserrat', 'Inter', sans-serif; }
.acct-form { max-width: 360px; }
.acct-users { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13.5px; }
.acct-users th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.acct-users td { padding: 8px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.acct-users select { height: 32px; font-size: 13px; }
.acct-actions { text-align: right; white-space: nowrap; }
.btn-ghost-text.danger { color: var(--red); }
.acct-add { margin-top: 18px; padding: 16px; border-radius: 12px; background: #fbfcfd; border: 1px solid var(--line); }
.acct-add h5 { margin: 0; font-size: 14px; font-weight: 600; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-ok { margin: 14px 0 0; padding: 9px 12px; border-radius: 8px; background: #e7f6ee; color: #0f6b3d; font-size: 13px; }
.form-ok[hidden] { display: none; }
@media (max-width: 600px) { .acct-grid { grid-template-columns: 1fr; } .acct-actions .btn-ghost-text { padding: 0 6px; } }
