/* Figaro design system. Ink #050908 · Emerald #0B9A68 · Mint #2ED3A2 · Aqua #7DEBF5 · Deep emerald #0A6B4C */
:root {
  --ink: #050908;
  --emerald: #0b9a68;
  --mint: #2ed3a2;
  --aqua: #7debf5;
  --deep: #0a6b4c;

  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --line: #e2e8e5;
  --line-strong: #cfd8d4;
  --text: #0b1411;
  --muted: #5a6964;
  --faint: #8a9893;
  --accent: #0a6b4c;
  --accent-hover: #085a40;
  --accent-soft: #e3f4ed;
  --warn: #8a4b00;
  --warn-soft: #fdf2e1;
  --danger: #a12622;
  --danger-soft: #fbeae8;
  --info: #1f4f7a;
  --info-soft: #e7f0f8;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(10, 40, 30, .05), 0 4px 16px rgba(10, 40, 30, .05);
  --shadow-lg: 0 12px 40px rgba(5, 30, 22, .14);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[lang="bn"] body, .bn { font-family: var(--font), "Noto Sans Bengali"; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
img, svg { display: block; max-width: 100%; }
code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem); font-weight: 650; }
h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: .9375rem; font-weight: 600; }
p { margin: 0 0 .75em; text-wrap: pretty; }
small, .small { font-size: .8125rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); transition: top .2s; }
.skip:focus { top: 12px; color: #fff; }
:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; border-radius: 4px; }

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 650; letter-spacing: -.02em; }
.brand img { height: 26px; width: auto; }
.biz-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: .8125rem; font-weight: 550; color: var(--text); background: var(--surface); max-width: 240px; }
.biz-pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.live { background: var(--emerald); box-shadow: 0 0 0 3px rgba(11, 154, 104, .18); }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 520; font-size: .875rem; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.nav-end { display: flex; align-items: center; gap: 8px; }
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .nav { order: 3; width: 100%; margin: 0 -4px; }
  .nav-end { margin-left: auto; }
  .biz-pill { display: none; }
}
.page { max-width: 1240px; margin: 0 auto; padding: 28px 20px 72px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 22px; }
.page-head .lede { color: var(--muted); margin: 6px 0 0; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-head .count { font-size: .8125rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.section-head .link { margin-left: auto; font-size: .8125rem; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card + .card { margin-top: 14px; }
.grid > .card + .card, .rail > .card + .card { margin-top: 0; }
.card h2 { margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: .875rem; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.layout-rail { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.layout-rail .rail { position: sticky; top: 76px; display: grid; gap: 14px; }
@media (max-width: 980px) { .layout-rail { grid-template-columns: 1fr; } .layout-rail .rail { position: static; order: -1; } }

/* stats */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: .8125rem; font-weight: 520; }
.stat .value { font-size: 1.75rem; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 6px; line-height: 1.1; }
.stat .hint { color: var(--faint); font-size: .75rem; margin-top: 6px; }
.stat.feature { background: radial-gradient(120% 140% at 100% 0%, rgba(46, 211, 162, .22), transparent 55%), var(--ink); color: #eaf7f2; border-color: transparent; }
.stat.feature .label, .stat.feature .hint { color: rgba(234, 247, 242, .68); }
.meter { height: 6px; background: var(--line); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--emerald), var(--mint)); border-radius: inherit; }

/* tables */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--faint); font-weight: 550; font-size: .75rem; letter-spacing: .02em; white-space: nowrap; background: var(--surface-2); }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fbfcfb; }
tr:last-child td { border-bottom: 0; }
td .who { font-weight: 560; }
td .sub { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
.row-link { color: var(--text); text-decoration: none; font-weight: 560; }
.row-link:hover { color: var(--accent); }

.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* tags */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 6px; font-size: .75rem; font-weight: 560; background: #edf1ef; color: var(--muted); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; opacity: .7; }
.tag.requested, .tag.open, .tag.pending { background: var(--warn-soft); color: var(--warn); }
.tag.confirmed, .tag.sent, .tag.completed { background: var(--accent-soft); color: var(--accent); }
.tag.declined, .tag.failed, .tag.no_show { background: var(--danger-soft); color: var(--danger); }
.tag.channel { background: var(--info-soft); color: var(--info); }

/* buttons */
.btn, button {
  font: inherit; font-size: .875rem; font-weight: 560; line-height: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease), color .2s;
}
.btn:hover, button:hover { background: var(--surface-2); border-color: var(--faint); color: var(--text); }
.btn:active, button:active { transform: translateY(1px) scale(.99); }
.btn-primary, button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 4px 12px rgba(10, 107, 76, .22); }
.btn-primary:hover, button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger, button.danger { color: var(--danger); border-color: #ecc9c6; background: var(--surface); }
.btn-danger:hover, button.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #e2aaa6; }
.btn-sm, td.actions button { min-height: 32px; padding: 0 11px; font-size: .8125rem; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: .9375rem; border-radius: 12px; }
form.inline { display: inline; }

/* alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: .875rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert svg { flex: none; margin-top: 2px; }
.alert.ok, .notice-ok { background: var(--accent-soft); color: #0a5a40; border-color: #c7e8da; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: #f2dcb8; }
.alert.error, .error { background: var(--danger-soft); color: var(--danger); border-color: #f0cbc8; }
.notice-ok, .error { display: block; padding: 12px 14px; border-radius: var(--radius); font-size: .875rem; }
.alert a { color: inherit; font-weight: 600; }

/* forms */
label, .label { display: block; font-weight: 560; font-size: .875rem; margin: 18px 0 6px; }
label small, .label small { display: block; font-weight: 400; color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.field:first-child label, label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=time], textarea, select {
  width: 100%; font: inherit; font-size: .9375rem; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); transition: border-color .2s, box-shadow .2s;
}
input:hover, textarea:hover, select:hover { border-color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(11, 154, 104, .14); }
input[readonly] { background: var(--surface-2); font-family: var(--mono); font-size: .8125rem; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; align-items: end; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 450; margin: 6px 16px 6px 0; font-size: .875rem; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 18px 0 0; }
legend { font-weight: 560; font-size: .875rem; padding: 0; margin-bottom: 6px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { margin: 0; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font-weight: 500; font-size: .8125rem; cursor: pointer; transition: all .15s; user-select: none; }
.days input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.days input:focus-visible + span { outline: 2px solid var(--emerald); outline-offset: 2px; }
.form-foot { display: flex; gap: 10px; align-items: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; }
@media (max-width: 520px) { .inline-field { flex-direction: column; } }

/* checklist */
.checklist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; }
.checklist .mark { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: .75rem; font-weight: 700; margin-top: 1px; }
.checklist .ok .mark, .mark.ok { background: var(--accent); color: #fff; }
.checklist .todo .mark, .mark.todo { background: var(--surface); border: 1.5px dashed var(--line-strong); color: transparent; }
.checklist .todo { color: var(--muted); }
.ok { color: var(--accent); font-weight: 600; }
.todo { color: var(--warn); font-weight: 600; }
.danger { color: var(--danger); }
.status-line { display: flex; align-items: center; gap: 8px; font-weight: 560; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.stack { display: grid; gap: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* transcript */
.thread { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.bubble { max-width: min(78%, 560px); padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9375rem; }
.bubble .meta { display: block; font-size: .6875rem; color: var(--faint); margin-top: 4px; font-variant-numeric: tabular-nums; }
.bubble.user { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.assistant { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 6px; }
.bubble.staff { align-self: flex-end; background: var(--ink); color: #f2fbf8; border-bottom-right-radius: 6px; }
.bubble.staff .meta { color: rgba(242, 251, 248, .6); }
.bubble.followup { align-self: flex-end; background: var(--info-soft); color: var(--info); border-bottom-right-radius: 6px; }
.bubble .from { display: block; font-size: .6875rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); margin-bottom: 2px; }
.bubble.staff .from { color: var(--mint); }

/* public (light) pages */
.public-top { max-width: 1240px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; gap: 18px; }
.public-top nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.public-top nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 520; font-size: .875rem; padding: 7px 10px; border-radius: 8px; }
.public-top nav a:not(.btn):hover { color: var(--text); background: rgba(0,0,0,.04); }
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: var(--ink); color: #eaf7f2; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 520px; height: 520px; background: radial-gradient(closest-side, rgba(46, 211, 162, .35), transparent); filter: blur(10px); }
.auth-art > * { position: relative; }
.auth-art blockquote { margin: 0; font-size: 1.5rem; line-height: 1.3; letter-spacing: -.02em; font-weight: 550; max-width: 30ch; }
.auth-art .cap { color: rgba(234, 247, 242, .6); font-size: .875rem; margin-top: 14px; }
.auth-main { display: grid; place-items: center; padding: 40px 20px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .lede { color: var(--muted); margin-bottom: 22px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; transition: all .15s; font-weight: 450; font-size: .8125rem; color: var(--muted); }
.seg span b { display: block; color: var(--text); font-weight: 600; font-size: .875rem; }
.seg input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 154, 104, .14); background: var(--accent-soft); }
.seg input:focus-visible + span { outline: 2px solid var(--emerald); outline-offset: 2px; }
@media (max-width: 860px) { .auth-shell { grid-template-columns: 1fr; } .auth-art { display: none; } }

.prose { max-width: 68ch; }
.prose h2 { font-size: 1.25rem; margin: 36px 0 10px; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin: 6px 0; }
.foot { max-width: 1240px; margin: 0 auto; padding: 28px 20px 40px; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--faint); font-size: .8125rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot .spacer { margin-left: auto; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats .stat.feature { grid-column: span 2; }
  .stat { padding: 14px 14px 12px; }
  .stat .value { font-size: 1.5rem; }
  .page { padding: 20px 16px 56px; }
  .page-head .actions { margin-left: 0; width: 100%; }
}
