/* AHC Concierge — calm warm teal on off-white. Inter (bundled, OFL) for crisp type on every PC. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: block;
}

:root {
  --teal: #2E7D74;
  --teal-600: #286E66;
  --teal-700: #22605A;
  --teal-900: #17433F;
  --teal-50: #EEF6F3;
  --teal-100: #DDEDE8;
  --bg: #F6F3ED;
  --surface: #FFFDFA;
  --ink: #1F2A29;
  --ink-2: #44514F;
  --muted: #7A8684;
  --hair: rgba(31, 42, 41, .08);
  --hair-2: rgba(31, 42, 41, .12);
  --sand: #F1E9DB;
  --gold: #D9AE5F;
  --amber: #A9701B;
  --amber-50: #FBF2E2;
  --rose: #AE4E44;
  --rose-50: #F9E9E6;
  --blue: #36698A;
  --blue-50: #E6EFF5;
  --r-lg: 18px;
  --r-md: 12px;
  --shadow-sm: 0 1px 2px rgba(23, 67, 63, .05);
  --shadow: 0 1px 2px rgba(23, 67, 63, .04), 0 6px 20px -6px rgba(23, 67, 63, .10);
  --shadow-lg: 0 2px 4px rgba(23, 67, 63, .05), 0 16px 40px -12px rgba(23, 67, 63, .22);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 13px; line-height: 1.5; letter-spacing: -.005em;
  font-feature-settings: "cv11", "ss01", "ss03";
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  user-select: none;
}
input, button { font: inherit; color: inherit; letter-spacing: inherit; }
.ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }
h1, h2 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 26px; font-weight: 650; line-height: 1.2; }
h2 { font-size: 14px; font-weight: 600; color: var(--ink); }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin: 3px 0 0; line-height: 1.5; }
.num, .kpi-value, .vol-total b, .bar-num { font-variant-numeric: tabular-nums; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 236px; flex: none; display: flex; flex-direction: column; padding: 22px 14px 16px;
  color: #CFE2DD;
  background:
    radial-gradient(260px 200px at 0% 0%, rgba(143, 211, 196, .10), transparent 70%),
    linear-gradient(180deg, #1B4C47 0%, #163F3B 100%);
  border-right: 1px solid rgba(0, 0, 0, .08);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 28px; }
.brand-mark svg { width: 38px; height: 38px; display: block; }
.brand-name { color: #FFFDFA; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.brand-sub { color: #8DB7AE; font-size: 11.5px; white-space: nowrap; }
.nav-label { padding: 0 12px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6F9F96; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 10px; background: transparent;
  color: #C3DAD4; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item .ic { width: 17px; height: 17px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .11); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.sidebar-foot {
  margin-top: auto; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .06); display: flex; flex-direction: column; gap: 6px; font-size: 12px;
}
.foot-row { display: flex; align-items: center; gap: 9px; }
.foot-row .ic { width: 14px; height: 14px; }
.muted-row { color: #85B0A7; font-size: 11.5px; }
.sidebar-foot .version { color: #6F9F96; font-size: 11px; }
.watch-dot { width: 8px; height: 8px; border-radius: 50%; background: #8FD3C4; box-shadow: 0 0 0 3px rgba(143, 211, 196, .18); flex: none; }
.watch-dot.checking { animation: pulse 1.2s ease-in-out infinite; }
.watch-dot.paused, .watch-dot.setup { background: #EBC37A; box-shadow: 0 0 0 3px rgba(235, 195, 122, .2); }
.watch-dot.error { background: #EB9C91; box-shadow: 0 0 0 3px rgba(235, 156, 145, .2); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- pages ---------- */
main { flex: 1; min-width: 0; overflow-y: auto; }
.page { display: none; padding: 28px 34px 32px; max-width: 1440px; margin: 0 auto; animation: fade .2s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 36px; padding: 0 14px; border: 1px solid var(--hair-2); border-radius: 10px; background: var(--surface);
  font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover { border-color: rgba(46, 125, 116, .45); color: var(--teal-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--teal); border-color: var(--teal-600); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(23, 67, 63, .2), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--teal-600); color: #fff; }
.btn.light { background: #FFFDFA; border-color: transparent; color: var(--teal-900); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.btn.light:hover { background: #fff; color: var(--teal); }
.btn.glass { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #F4FAF8; box-shadow: none; }
.btn.glass:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); color: #fff; }
.link { border: 0; background: none; color: var(--teal); cursor: pointer; padding: 2px 4px; font-size: 12.5px; font-weight: 500; }
.link:hover { text-decoration: underline; }
.pill-link {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--hair);
  background: var(--surface); color: var(--teal-700); font-size: 12px; font-weight: 600; cursor: pointer;
}
.pill-link .ic { width: 14px; height: 14px; }
.pill-link:hover { background: var(--teal-50); border-color: var(--teal-100); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: 26px 28px; margin-bottom: 16px; border-radius: 22px; color: #F7F4EE;
  background:
    radial-gradient(500px 260px at 100% 0%, rgba(143, 211, 196, .22), transparent 65%),
    radial-gradient(420px 220px at 0% 100%, rgba(233, 201, 137, .14), transparent 70%),
    linear-gradient(135deg, #194742 0%, #23635C 55%, #2E7D74 100%);
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  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: 28px 28px;
  mask-image: radial-gradient(500px 240px at 85% 20%, #000, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; right: -70px; top: -90px; width: 280px; height: 280px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .09); box-shadow: 0 0 0 44px rgba(255, 255, 255, .025), 0 0 0 88px rgba(255, 255, 255, .015);
  pointer-events: none;
}
.hero-text, .hero-side { position: relative; z-index: 1; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; font-weight: 600; color: #A9D3C9; margin-bottom: 8px; }
.hero h1 { color: #FFFDFA; font-size: 30px; font-weight: 650; margin-bottom: 6px; }
.hero p { margin: 0; color: #CFE5DF; font-size: 13.5px; max-width: 540px; }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.hero-actions { display: flex; gap: 8px; }
.live {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #FFFDFA; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px);
}
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8FD3C4; box-shadow: 0 0 0 3px rgba(143, 211, 196, .25); }
.live.checking::before { animation: pulse 1.2s ease-in-out infinite; }
.live.paused::before, .live.setup::before { background: #F0C77E; box-shadow: 0 0 0 3px rgba(240, 199, 126, .25); }
.live.error::before { background: #F0A398; box-shadow: 0 0 0 3px rgba(240, 163, 152, .25); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  padding: 15px 16px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hair);
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.kpi-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); }
.kpi-icon .ic { width: 16px; height: 16px; }
.kpi-value { margin-top: 8px; font-size: 30px; font-weight: 650; line-height: 1.1; letter-spacing: -.03em; color: var(--ink); }
.kpi-foot { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* ---------- panels ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); gap: 16px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }

/* feed */
.feed { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 30px; align-items: center; gap: 12px;
  padding: 11px 8px; border-radius: 12px; border-top: 1px solid var(--hair);
}
.row:first-child { border-top-color: transparent; }
.row:hover { background: var(--teal-50); border-top-color: transparent; }
.row:hover + .row { border-top-color: transparent; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-size: 12px; font-weight: 650; color: var(--teal-700); background: var(--teal-100);
}
.avatar.case_update { background: var(--blue-50); color: var(--blue); }
.avatar.not_relevant, .avatar.none { background: #EEEBE4; color: var(--muted); }
.avatar.pending { background: var(--amber-50); color: var(--amber); }
.avatar.failed { background: var(--rose-50); color: var(--rose); }
.row-main { min-width: 0; }
.row-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.row-title { flex-wrap: wrap; row-gap: 3px; }
.row-title span { overflow-wrap: break-word; min-width: 0; }
.row-sub { color: var(--muted); font-size: 12px; overflow-wrap: break-word; margin-top: 1px; }
.row-when { color: var(--muted); font-size: 11.5px; white-space: nowrap; text-align: right; }
.row-when small { display: block; font-size: 11px; }
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; flex: none;
  font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: 0;
}
.badge.new_case_retention, .badge.done { background: var(--teal-100); color: var(--teal-700); }
.badge.case_update { background: var(--blue-50); color: var(--blue); }
.badge.not_relevant, .badge.none { background: #EEEBE4; color: var(--muted); }
.badge.pending { background: var(--amber-50); color: var(--amber); }
.badge.failed { background: var(--rose-50); color: var(--rose); }
.icon-btn {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  display: grid; place-items: center; color: var(--teal-700); cursor: pointer;
}
.icon-btn .ic { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface); border-color: var(--hair-2); }
.empty {
  text-align: center; color: var(--muted); padding: 36px 20px; border: 1px dashed var(--hair-2);
  border-radius: var(--r-md); background: rgba(255, 253, 250, .6);
}
.empty b { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 4px; }

/* volume chart */
.vol-total { text-align: right; line-height: 1.1; }
.vol-total b { display: block; font-size: 22px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.vol-total span { font-size: 11px; color: var(--muted); }
.chart-wrap { position: relative; height: 158px; }
.gridlines { position: absolute; inset: 18px 0 22px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.gridlines span { border-top: 1px dashed var(--hair); }
.chart { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 100%; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar {
  width: 100%; max-width: 26px; min-height: 3px; border-radius: 7px;
  background: linear-gradient(180deg, #5DB0A2 0%, var(--teal) 100%); transition: height .5s cubic-bezier(.2, .8, .2, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.bar.today { background: linear-gradient(180deg, #EBCB8B 0%, #C9974A 100%); }
.bar.zero { background: #E8E3D8; box-shadow: none; }
.bar-num { font-size: 11px; font-weight: 600; color: var(--ink-2); min-height: 15px; }
.bar-day { font-size: 11px; color: var(--muted); }
.bar-day.today { color: var(--ink); font-weight: 600; }

/* quick access */
.quick h2 { margin-bottom: 8px; }
.quick-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%;
  padding: 9px 8px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left;
}
.quick-row:hover { background: var(--teal-50); }
.quick-row b { display: block; font-size: 13px; font-weight: 600; }
.quick-row small { color: var(--muted); font-size: 11.5px; }
.q-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sand); color: var(--teal-900); }
.q-icon .ic { width: 16px; height: 16px; }
.quick-row .chev { width: 16px; height: 16px; color: #A3ADAB; }
.last-check {
  display: flex; justify-content: space-between; margin-top: 8px; padding: 12px 8px 2px; border-top: 1px solid var(--hair);
  font-size: 12px; color: var(--muted);
}
.last-check b { color: var(--ink); font-weight: 600; }

/* ---------- activity ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: #EBE6DC; border: 1px solid var(--hair); }
.seg {
  padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2);
  font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.seg:hover { color: var(--ink); }
.seg.active { background: var(--surface); color: var(--teal-700); font-weight: 600; box-shadow: var(--shadow-sm); }
.search {
  width: 280px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--hair-2); background: var(--surface);
  user-select: text;
}
.search:focus, input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(46, 125, 116, .14); }
.table-wrap { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: #FAF7F1; padding: 11px 12px; border-bottom: 1px solid var(--hair);
}
.table td {
  padding: 12px 10px; border-bottom: 1px solid var(--hair); font-size: 12.5px; vertical-align: middle;
  white-space: normal; overflow-wrap: break-word; user-select: text;
}
.table td small { overflow-wrap: anywhere; }
.table .from-inline { display: none; color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.table th { padding-left: 10px; padding-right: 10px; }
.table .two { display: block; }
.table .two small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--teal-50); }
.table th:nth-child(1) { width: 12%; } .table th:nth-child(2) { width: 124px; } .table th:nth-child(3) { width: 15%; }
.table th:nth-child(5) { width: 19%; } .table th:nth-child(6) { width: 96px; } .table th:nth-child(7) { width: 52px; }
.table td:nth-child(3) { font-weight: 600; }
.table .detail { display: block; color: var(--muted); font-size: 11.5px; white-space: normal; margin-top: 2px; }
.table-wrap .empty { border: 0; border-radius: 0; }

/* ---------- settings ---------- */
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.card-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); flex: none; }
.card-icon .ic { width: 17px; height: 17px; }
.card-head.collapsible { width: 100%; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; text-align: left; align-items: center; }
.card-head.collapsible > div { flex: 1; }
.card-head.collapsible .chev { color: var(--muted); transition: transform .2s; }
.card-head.collapsible.open .chev { transform: rotate(180deg); }
.advanced { margin-top: 20px; }
.form { display: grid; grid-template-columns: 240px minmax(0, 460px); gap: 12px 18px; align-items: center; }
.form > label:not(.switch) { text-align: right; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number] {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--hair-2); border-radius: 10px; background: #fff;
  user-select: text; transition: border-color .15s, box-shadow .15s;
}
.form input::placeholder { color: #A7AFAD; }
.secret { position: relative; }
.secret input { padding-right: 56px !important; }
.secret .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.inline { display: flex; align-items: center; gap: 10px; }
.inline.grow input { flex: 1; }
.form input.num { width: 90px; }
.unit { color: var(--muted); }
.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.switch input { display: none; }
.switch .track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #D7D1C5; flex: none; transition: background .2s; }
.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 .2s;
}
.switch input:checked + .track { background: var(--teal); }
.switch input:checked + .track::after { transform: translateX(16px); }
.test-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-left: 258px; }
.test-result { font-size: 12.5px; color: var(--muted); }
.test-result.ok { color: var(--teal-700); }
.test-result.bad { color: var(--rose); }
.head-actions { display: flex; align-items: center; gap: 12px; }
.unsaved { font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-50); padding: 5px 11px; border-radius: 999px; }
.save-bar {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0 4px; background: linear-gradient(transparent, var(--bg) 35%);
}
.save-bar .hint { display: inline-flex; align-items: center; gap: 7px; }
.save-bar .hint .ic { width: 14px; height: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; right: 24px; bottom: 24px; max-width: 380px; padding: 12px 16px; border-radius: 12px;
  background: var(--teal-900); color: #fff; font-size: 13px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.bad { background: var(--rose); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #D6DDD9; border-radius: 6px; border: 2px solid var(--bg); }

@media (max-width: 1180px) {
  .table th:nth-child(5), .table td:nth-child(5) { display: none; }
  .table .from-inline { display: block; }
  .table th:nth-child(1) { width: 92px; } .table th:nth-child(3) { width: 18%; }
}
@media (max-width: 1100px) {
  .sidebar { width: 210px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .form > label:not(.switch) { text-align: left; }
  .test-row { padding-left: 0; }
}
