/*
 * ATITHI design system.
 *
 * A token layer on top of Bootstrap 5 rather than a framework of its own. The rules in
 * docs/architecture.md hold: dark navy sidebar, light content, one meaning per status
 * colour, and not everything is a card — tables sit on the surface with hairline rules.
 */

:root {
  --atithi-navy: #0f1b2d;
  --atithi-navy-soft: #1b2b43;
  --atithi-navy-line: #26374f;
  --atithi-surface: #f6f7f9;
  --atithi-card: #ffffff;
  --atithi-accent: #0e7c86;
  --atithi-accent-dark: #0a626a;
  --atithi-accent-soft: #e6f2f3;
  --atithi-gold: #c8933a;
  --atithi-border: #e3e6eb;
  --atithi-text: #1c2431;
  --atithi-muted: #6b7788;

  --atithi-teal: #0e7c86;
  --atithi-indigo: #4f46e5;
  --atithi-amber: #b45309;
  --atithi-green: #15803d;
  --atithi-red: #b91c1c;
  --atithi-violet: #7c3aed;
  --atithi-slate: #64748b;

  --atithi-radius: 10px;
  --atithi-sidebar-width: 244px;
  --atithi-topbar-height: 60px;

  --bs-body-bg: var(--atithi-surface);
  --bs-body-color: var(--atithi-text);
  --bs-link-color: var(--atithi-accent);
  --bs-link-hover-color: var(--atithi-accent-dark);
  --bs-border-color: var(--atithi-border);
}

body {
  background: var(--atithi-surface);
  color: var(--atithi-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: -0.01em; color: var(--atithi-text); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.0625rem; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* Focus rings are never removed — only restyled. */
:focus-visible {
  outline: 2px solid var(--atithi-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Shell ────────────────────────────────────────────────────────────────── */

.atithi-shell { display: flex; min-height: 100vh; }

.atithi-sidebar {
  width: var(--atithi-sidebar-width);
  flex: 0 0 var(--atithi-sidebar-width);
  background: var(--atithi-navy);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.atithi-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--atithi-navy-line);
  color: #fff;
}

.atithi-brand:hover { text-decoration: none; color: #fff; }

.atithi-brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--atithi-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.atithi-brand-name { font-weight: 600; line-height: 1.1; letter-spacing: 0.02em; }
.atithi-brand-sub { font-size: 0.6875rem; color: #8ea2bd; letter-spacing: 0.04em; text-transform: uppercase; }

.atithi-nav { padding: 0.75rem 0.625rem; flex: 1; }

.atithi-nav-section {
  padding: 0.875rem 0.625rem 0.375rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b7f9c;
  font-weight: 600;
}

.atithi-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 7px;
  color: #c4d0e0;
  font-size: 0.875rem;
  margin-bottom: 1px;
}

.atithi-nav-link:hover { background: var(--atithi-navy-soft); color: #fff; text-decoration: none; }
.atithi-nav-link.is-active { background: var(--atithi-navy-soft); color: #fff; font-weight: 500; box-shadow: inset 2px 0 0 var(--atithi-accent); }
.atithi-nav-link svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.85; }
.atithi-nav-count { margin-left: auto; font-size: 0.75rem; background: var(--atithi-navy-line); padding: 0.05rem 0.4rem; border-radius: 20px; }
.atithi-nav-count.is-alert { background: var(--atithi-amber); color: #fff; }

.atithi-sidebar-foot { padding: 0.875rem 1.25rem; border-top: 1px solid var(--atithi-navy-line); font-size: 0.75rem; color: #7d8ea8; }

.atithi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.atithi-topbar {
  height: var(--atithi-topbar-height);
  background: var(--atithi-card);
  border-bottom: 1px solid var(--atithi-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.atithi-content { padding: 1.5rem; flex: 1; }
.atithi-content.is-flush { padding: 0; }

.atithi-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.atithi-page-head p { color: var(--atithi-muted); margin: 0.25rem 0 0; font-size: 0.875rem; }

/* ── Surfaces ─────────────────────────────────────────────────────────────── */

.atithi-card {
  background: var(--atithi-card);
  border: 1px solid var(--atithi-border);
  border-radius: var(--atithi-radius);
}

.atithi-card-head {
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--atithi-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.atithi-card-head h2, .atithi-card-head h3 { margin: 0; font-size: 0.9375rem; }
.atithi-card-body { padding: 1.125rem; }

/*
 * Chart containers. Chart.js with maintainAspectRatio:false sizes the canvas to its
 * parent; if the parent takes its height from its content (a card stretched by h-100 in
 * a row), each resize grows the chart, which grows the card, which grows the chart — the
 * page ends up hundreds of thousands of pixels tall. A fixed-height, relatively
 * positioned wrapper breaks that loop.
 */
.atithi-chart { position: relative; width: 100%; height: 260px; }
.atithi-chart canvas { position: absolute; inset: 0; }
.atithi-chart-sm { height: 200px; }

@media (max-width: 575.98px) {
  .atithi-chart { height: 220px; }
  .atithi-chart-sm { height: 180px; }
}

/* Inventory calendar: one row per week, one cell per night. */
.atithi-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.atithi-cal-head { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--atithi-muted); font-weight: 600; padding: 0 0.25rem; }
.atithi-cal-day {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-height: 84px; padding: 0.4rem 0.5rem; text-align: left;
  background: var(--atithi-card); border: 1px solid var(--atithi-border); border-radius: 8px;
  color: var(--atithi-text); font: inherit; cursor: pointer;
}
.atithi-cal-day:disabled { cursor: default; }
.atithi-cal-day:not(:disabled):hover { border-color: var(--atithi-accent); }
.atithi-cal-day.is-past { opacity: 0.45; }
.atithi-cal-day.is-today { box-shadow: inset 0 0 0 2px var(--atithi-accent); }
.atithi-cal-day.is-custom { background: #f3f8f8; }
.atithi-cal-day.is-full .atithi-cal-avail { color: var(--atithi-amber); }
.atithi-cal-day.is-closed { background: #fdf1f1; }
.atithi-cal-day.is-closed .atithi-cal-avail { color: var(--atithi-red); text-decoration: line-through; }
.atithi-cal-day.is-selected { border-color: var(--atithi-accent); background: var(--atithi-accent-soft); }
.atithi-cal-date { font-size: 0.75rem; color: var(--atithi-muted); font-weight: 600; }
.atithi-cal-avail { font-size: 1.05rem; font-weight: 650; line-height: 1.2; }
.atithi-cal-avail small { font-size: 0.7rem; color: var(--atithi-muted); font-weight: 500; }
.atithi-cal-rate { font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.atithi-cal-flag { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--atithi-amber); }
.atithi-cal-day.is-closed .atithi-cal-flag { color: var(--atithi-red); }
.atithi-cal-legend { display: flex; flex-wrap: wrap; gap: 1rem; }
.atithi-cal-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--atithi-border); vertical-align: -1px; }
.atithi-cal-swatch.is-custom { background: #f3f8f8; }
.atithi-cal-swatch.is-closed { background: #fdf1f1; }
.atithi-cal-swatch.is-full { background: var(--atithi-amber); }

@media (max-width: 575.98px) {
  .atithi-cal { gap: 3px; }
  .atithi-cal-day { min-height: 64px; padding: 0.3rem; }
  .atithi-cal-avail { font-size: 0.9rem; }
  .atithi-cal-rate, .atithi-cal-flag { font-size: 0.6rem; }
  .atithi-cal-avail small { display: none; }
}

/* Stat tiles: the dashboard's headline numbers. */
.atithi-stat { background: var(--atithi-card); border: 1px solid var(--atithi-border); border-radius: var(--atithi-radius); padding: 1rem 1.125rem; height: 100%; }
.atithi-stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--atithi-muted); font-weight: 600; }
.atithi-stat-value { font-size: 1.625rem; font-weight: 650; line-height: 1.2; margin-top: 0.3rem; letter-spacing: -0.02em; }
.atithi-stat-meta { font-size: 0.8125rem; color: var(--atithi-muted); margin-top: 0.15rem; }
.atithi-stat-value.is-revenue { color: var(--atithi-gold); }

/* Tables sit on the surface with hairlines, not inside heavy cards. */
.atithi-table { width: 100%; background: var(--atithi-card); border: 1px solid var(--atithi-border); border-radius: var(--atithi-radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.atithi-table th { background: #fbfcfd; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--atithi-muted); font-weight: 600; padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--atithi-border); white-space: nowrap; }
.atithi-table td { padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--atithi-border); vertical-align: middle; }
.atithi-table tbody tr:last-child td { border-bottom: 0; }
.atithi-table tbody tr:hover { background: #fafbfc; }
.atithi-table .is-numeric { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Status badges: one meaning per colour, used everywhere ───────────────── */

.atithi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.16rem 0.5rem;
  border-radius: 20px;
  line-height: 1.4;
  white-space: nowrap;
}

.atithi-badge--ai { background: var(--atithi-accent-soft); color: var(--atithi-teal); }
.atithi-badge--human { background: #eceafe; color: var(--atithi-indigo); }
.atithi-badge--escalated { background: #fdf0dd; color: var(--atithi-amber); }
.atithi-badge--open { background: #fff; color: var(--atithi-slate); border: 1px solid var(--atithi-border); }
.atithi-badge--closed { background: #f3f5f7; color: #8b95a4; }
.atithi-badge--completed { background: #fff; color: var(--atithi-green); border: 1px solid #bbe6c9; }
.atithi-badge--overdue, .atithi-badge--error { background: #fdeaea; color: var(--atithi-red); }
.atithi-badge--paused { background: #f3f5f7; color: var(--atithi-slate); }
.atithi-badge--urgent { background: var(--atithi-red); color: #fff; }
.atithi-badge--high { background: #fdf0dd; color: var(--atithi-amber); }
.atithi-badge--positive { background: #eaf6ee; color: var(--atithi-green); }
.atithi-badge--negative { background: #fdeaea; color: var(--atithi-red); }
.atithi-badge--neutral { background: #f3f5f7; color: var(--atithi-slate); }

.atithi-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.atithi-dot--connected { background: var(--atithi-green); }
.atithi-dot--mock { background: var(--atithi-violet); }
.atithi-dot--disconnected { background: #b6bdc7; }
.atithi-dot--error { background: var(--atithi-red); }

.atithi-mock-flag {
  background: #f3ecff;
  color: var(--atithi-violet);
  border: 1px solid #ddd0f7;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn { font-size: 0.875rem; border-radius: 7px; font-weight: 500; }
.btn-primary { background: var(--atithi-accent); border-color: var(--atithi-accent); }
.btn-primary:hover, .btn-primary:focus { background: var(--atithi-accent-dark); border-color: var(--atithi-accent-dark); }
.btn-outline-secondary { border-color: var(--atithi-border); color: var(--atithi-text); background: var(--atithi-card); }
.btn-outline-secondary:hover { background: #f2f4f6; border-color: #cfd6de; color: var(--atithi-text); }
.btn-sm { font-size: 0.8125rem; padding: 0.28rem 0.6rem; }

/* Every interactive target stays ≥ 40px on touch. */
@media (pointer: coarse) {
  .btn, .atithi-nav-link, .atithi-conv-item { min-height: 40px; }
}

/* ── Forms ────────────────────────────────────────────────────────────────── */

.form-label { font-size: 0.8125rem; font-weight: 600; color: var(--atithi-text); margin-bottom: 0.3rem; }
.form-control, .form-select { font-size: 0.875rem; border-color: var(--atithi-border); border-radius: 7px; padding: 0.45rem 0.7rem; }
.form-control:focus, .form-select:focus { border-color: var(--atithi-accent); box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.12); }
.form-text { font-size: 0.8125rem; color: var(--atithi-muted); }
.atithi-field { margin-bottom: 1.125rem; }

/* ── Conversation inbox: three panes on desktop, one at a time on a phone ─── */

/*
 * The inbox fills the viewport and each column scrolls on its own. Two things make that
 * hold: the grid row is minmax(0, 1fr) rather than the default auto (an auto row grows to
 * its content and pushes the whole page into scrolling), and every flex column and scroll
 * area has min-height: 0 (a flex item's default minimum is its content height, so
 * overflow-y: auto never gets a chance to scroll).
 */
.atithi-inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); height: calc(100vh - var(--atithi-topbar-height)); height: calc(100dvh - var(--atithi-topbar-height)); overflow: hidden; }
.atithi-inbox-list { border-right: 1px solid var(--atithi-border); background: var(--atithi-card); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.atithi-inbox-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--atithi-surface); }
.atithi-inbox-context { border-left: 1px solid var(--atithi-border); background: var(--atithi-card); overflow-y: auto; min-height: 0; padding: 1.125rem; }

.atithi-inbox-filters { padding: 0.75rem; border-bottom: 1px solid var(--atithi-border); }
.atithi-conv-scroll { overflow-y: auto; flex: 1; min-height: 0; }

.atithi-conv-item { display: block; padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--atithi-border); color: inherit; }
.atithi-conv-item:hover { background: #fafbfc; text-decoration: none; color: inherit; }
.atithi-conv-item.is-active { background: var(--atithi-accent-soft); box-shadow: inset 3px 0 0 var(--atithi-accent); }
.atithi-conv-item.is-unread .atithi-conv-name { font-weight: 700; }
.atithi-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.atithi-conv-name { font-weight: 600; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atithi-conv-time { font-size: 0.75rem; color: var(--atithi-muted); white-space: nowrap; }
.atithi-conv-preview { font-size: 0.8125rem; color: var(--atithi-muted); margin-top: 0.2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.atithi-conv-tags { display: flex; gap: 0.3rem; margin-top: 0.4rem; flex-wrap: wrap; }

.atithi-thread-head { padding: 0.75rem 1.125rem; background: var(--atithi-card); border-bottom: 1px solid var(--atithi-border); display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.atithi-thread-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.875rem; }
.atithi-composer { border-top: 1px solid var(--atithi-border); background: var(--atithi-card); padding: 0.875rem 1.125rem; }

.atithi-msg { max-width: 76%; }
.atithi-msg-bubble { padding: 0.625rem 0.875rem; border-radius: 12px; font-size: 0.875rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.atithi-msg-meta { font-size: 0.6875rem; color: var(--atithi-muted); margin-top: 0.25rem; display: flex; gap: 0.5rem; align-items: center; }

.atithi-msg--guest { align-self: flex-start; }
.atithi-msg--guest .atithi-msg-bubble { background: var(--atithi-card); border: 1px solid var(--atithi-border); border-bottom-left-radius: 3px; }

.atithi-msg--ai { align-self: flex-end; }
.atithi-msg--ai .atithi-msg-bubble { background: var(--atithi-accent); color: #fff; border-bottom-right-radius: 3px; }

.atithi-msg--staff { align-self: flex-end; }
.atithi-msg--staff .atithi-msg-bubble { background: var(--atithi-indigo); color: #fff; border-bottom-right-radius: 3px; }

.atithi-msg--system { align-self: center; max-width: 90%; }
.atithi-msg--system .atithi-msg-bubble { background: #eef1f4; color: var(--atithi-muted); font-size: 0.8125rem; font-style: italic; text-align: center; }

.atithi-sources { margin-top: 0.3rem; font-size: 0.6875rem; }
.atithi-sources summary { cursor: pointer; color: var(--atithi-muted); }
.atithi-sources-body { background: #fffdf5; border: 1px solid #f0e3c4; border-radius: 6px; padding: 0.5rem 0.625rem; margin-top: 0.3rem; color: var(--atithi-text); font-style: normal; }

.atithi-context-block { margin-bottom: 1.25rem; }
.atithi-context-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--atithi-muted); font-weight: 600; margin-bottom: 0.4rem; }
.atithi-context-row { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.8125rem; padding: 0.22rem 0; }
.atithi-context-row dt { color: var(--atithi-muted); font-weight: 400; }
.atithi-context-row dd { margin: 0; text-align: right; font-weight: 500; }

/* ── Kanban ───────────────────────────────────────────────────────────────── */

.atithi-board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 1rem; align-items: start; }
.atithi-board-col { background: #eef0f3; border-radius: var(--atithi-radius); padding: 0.75rem; }
.atithi-board-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.625rem; color: var(--atithi-text); }
.atithi-board-card { background: var(--atithi-card); border: 1px solid var(--atithi-border); border-radius: 8px; padding: 0.75rem; margin-bottom: 0.625rem; display: block; color: inherit; }
.atithi-board-card:hover { text-decoration: none; color: inherit; border-color: #cfd6de; }

/* ── States: loading, empty, error ────────────────────────────────────────── */

.atithi-empty { text-align: center; padding: 2.75rem 1.5rem; color: var(--atithi-muted); }
.atithi-empty-icon { width: 40px; height: 40px; margin: 0 auto 0.75rem; color: #c3cad4; }
.atithi-empty h3 { font-size: 0.9375rem; color: var(--atithi-text); margin-bottom: 0.3rem; }
.atithi-empty p { font-size: 0.875rem; margin-bottom: 1rem; }

.atithi-skeleton { background: linear-gradient(90deg, #eef1f4 25%, #e3e7ec 37%, #eef1f4 63%); background-size: 400% 100%; animation: atithi-shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes atithi-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.atithi-error-state { background: #fdeaea; border: 1px solid #f5c7c7; color: var(--atithi-red); border-radius: var(--atithi-radius); padding: 0.875rem 1.125rem; font-size: 0.875rem; }

/* ── Toasts ───────────────────────────────────────────────────────────────── */

.atithi-toasts { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 1080; display: flex; flex-direction: column; gap: 0.5rem; max-width: 360px; }
.atithi-toast { background: var(--atithi-navy); color: #fff; padding: 0.7rem 0.95rem; border-radius: 8px; font-size: 0.875rem; box-shadow: 0 8px 24px rgba(15, 27, 45, 0.22); animation: atithi-rise 0.18s ease; }
.atithi-toast--error { background: var(--atithi-red); }
.atithi-toast--success { background: var(--atithi-green); }
@keyframes atithi-rise { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Auth and public pages ────────────────────────────────────────────────── */

.atithi-auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.atithi-auth-panel {
  background: linear-gradient(150deg, var(--atithi-navy) 0%, #143050 55%, var(--atithi-accent-dark) 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.atithi-auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--atithi-card); }
.atithi-auth-inner { width: 100%; max-width: 380px; }
.atithi-auth-quote { font-size: 1.375rem; line-height: 1.45; font-weight: 500; letter-spacing: -0.01em; }
.atithi-auth-points { list-style: none; padding: 0; margin: 1.75rem 0 0; font-size: 0.9375rem; color: #c8d6e8; }
.atithi-auth-points li { padding-left: 1.4rem; position: relative; margin-bottom: 0.6rem; }
.atithi-auth-points li::before { content: "✓"; position: absolute; left: 0; color: #5fd0c5; font-weight: 700; }

.atithi-public { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 3rem; }

/* ── Responsive: 1024 tablet, 768 collapse, 375 phone ─────────────────────── */

@media (max-width: 1200px) {
  .atithi-inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .atithi-inbox-context { display: none; }
  .atithi-board { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 992px) {
  .atithi-sidebar { position: fixed; left: 0; top: 0; z-index: 1050; transform: translateX(-100%); transition: transform 0.18s ease; }
  .atithi-sidebar.is-open { transform: translateX(0); }
  .atithi-shell.is-nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 27, 45, 0.45); z-index: 1040; }
  .atithi-auth { grid-template-columns: 1fr; }
  .atithi-auth-panel { display: none; }
}

@media (max-width: 768px) {
  .atithi-content { padding: 1rem; }
  .atithi-board { grid-template-columns: 1fr; }
  .atithi-msg { max-width: 88%; }

  /* One pane at a time, with a back stack — a front-desk agent works from a phone. */
  .atithi-inbox { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; overflow: visible; }
  .atithi-inbox[data-pane="thread"] .atithi-inbox-list { display: none; }
  .atithi-inbox[data-pane="list"] .atithi-inbox-thread { display: none; }
  .atithi-inbox-list, .atithi-inbox-thread { height: calc(100vh - var(--atithi-topbar-height)); }
  .atithi-hide-sm { display: none !important; }
}

@media (max-width: 400px) {
  .atithi-content { padding: 0.75rem; }
  .atithi-stat-value { font-size: 1.375rem; }
}

@media print {
  .atithi-sidebar, .atithi-topbar, .atithi-composer { display: none; }
}
