/* ============================================================
   Steda design system
   personality: calm, trustworthy, effortless
   primary #2b6c63 (brand teal) · ink #1f2a28 · paper #f4f3ee
   headings: serif (trust) · body: system sans (effortless)
   All selectors from the previous stylesheet are preserved —
   templates and app.js depend on these class names.
   ============================================================ */
:root {
  --primary: #2b6c63;
  --primary-deep: #1e4f48;
  --primary-hover: #235850;
  --primary-tint: rgba(43, 108, 99, 0.08);
  --ink: #1f2a28;
  --ink-soft: #5c6b68;
  --paper: #f4f3ee;
  --card: #ffffff;
  --line: #dde3e1;
  --focus-ring: rgba(43, 108, 99, 0.28);
  --danger: #b3261e;
  --radius: 10px;
  --shadow-card: 0 14px 38px -20px rgba(31, 42, 40, 0.22);
  --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
.brand-mark svg { width: 66%; height: 66%; display: block; }
.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.topbar nav a {
  margin-inline-start: 2px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.topbar nav a:hover {
  background: var(--primary-tint);
  color: var(--primary);
}

/* ---- Layout ---- */
.content { max-width: 760px; margin: 0 auto; padding: 40px 24px 72px; }
.content > h1:first-child { margin-top: 0; }

/* ---- Focus ---- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---- Forms ---- */
form label {
  display: block;
  margin-bottom: 16px;
  text-align: start;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}
form input, form select, form textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-top: 5px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fbfbf9;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
  background: #fff;
}
form fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 16px;
  background: var(--card);
}
form legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 0 6px;
}
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px !important;
}
.checkbox-label input { width: auto !important; margin-top: 0 !important; }

button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}
button:hover { background: var(--primary-hover); }
button:active { transform: translateY(1px); }

/* ---- Text helpers ---- */
.fine-print { font-size: 13px; margin-top: 16px; }
.fine-print a { color: var(--primary); text-decoration: none; }
.fine-print a:hover { text-decoration: underline; }
.hint { font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; }

.error { color: var(--danger); }
.success { color: var(--primary); }
p.error, p.success {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}
p.error { background: rgba(179, 38, 30, 0.07); border: 1px solid rgba(179, 38, 30, 0.25); }
p.success { background: var(--primary-tint); border: 1px solid rgba(43, 108, 99, 0.3); }

/* ---- Dashboard tiles ---- */
.tile-grid { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.tile {
  display: block;
  padding: 22px 20px;
  min-width: 170px;
  flex: 1 1 170px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tile:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .tile:hover { transform: none; }
}

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; margin: 16px 0; }
th, td {
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
}
tbody tr:hover { background: rgba(43, 108, 99, 0.035); }
.table-scroll { overflow-x: auto; }

/* ---- Boxes ---- */
.result-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
  box-shadow: 0 4px 14px -10px rgba(31, 42, 40, 0.15);
}
.result-box svg { max-width: 100%; height: auto; display: block; }

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.csv-import-box h3 { margin: 0 0 6px; font-size: 15px; }
.csv-import-box form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.csv-import-box input[type="file"] { width: auto; margin: 0; }

.diagram-edit-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.diagram-edit-form label { flex: 1; min-width: 220px; margin-bottom: 0; }
.diagram-edit-form input { margin-top: 4px; }
.diagram-edit-form button {
  background: var(--card);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.diagram-edit-form button:hover { background: var(--primary-tint); }

.row-actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions a { color: var(--primary); }
.link-button {
  background: none;
  border: none;
  color: var(--primary);
  padding: 0;
  font-size: 14px;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { background: none; color: var(--primary-hover); }

/* ---- Auth pages (login / forgot / reset) ---- */
.login-page {
  max-width: 440px;
  margin-top: 64px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: 16px;
  padding: 44px 42px 36px;
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: rise 0.45s ease-out both;
}
.login-page h1, .login-page h2 { margin-top: 0; }
.login-page h2 { font-size: 1.6rem; text-align: start; margin-bottom: 24px; }
.login-page form { margin-top: 8px; text-align: start; }
.login-page form input { padding: 12px 14px; }
.login-page button[type="submit"] { width: 100%; padding: 13px; font-size: 15px; margin-top: 6px; }
.login-page .fine-print { text-align: start; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .login-page { animation: none; } }

/* Split layout used by the main login page */
.auth-body {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 7fr);
  min-height: 100vh;
}
.brand-panel {
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(255, 255, 255, 0.07) 0%, transparent 55%),
    linear-gradient(160deg, #276057 0%, var(--primary-deep) 55%, #163d37 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  position: relative;
  overflow: hidden;
}
/* concentric rings — quiet depth behind the welcome text */
.brand-panel::before {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  inset-inline-start: -180px;
  top: 42%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.025),
    0 0 0 150px rgba(255, 255, 255, 0.02),
    0 0 0 240px rgba(255, 255, 255, 0.015);
  pointer-events: none;
}
/* quiet oversized portal ring — one deliberate asymmetric element */
.brand-panel::after {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  border: 52px solid rgba(255, 255, 255, 0.055);
  inset-inline-end: -150px;
  bottom: -150px;
  pointer-events: none;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; position: relative; }
.brand-lockup .brand-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
.brand-lockup h1 { margin: 0; font-size: 1.45rem; color: #fff; }
.brand-welcome { position: relative; margin: 24px 0; }
.welcome-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3.3rem);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}
.welcome-sub {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  max-width: 34ch;
}
.brand-legal { position: relative; font-size: 13px; margin: 0; }
.brand-legal a { color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.brand-legal a:hover { color: #fff; text-decoration: underline; }
.brand-legal span { color: rgba(255, 255, 255, 0.4); margin: 0 8px; }

.form-side {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background-image: radial-gradient(rgba(43, 108, 99, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
}
.form-side .login-page { margin: auto; width: 100%; }

/* ---- Language switcher: two equal white chips ---- */
.lang-switcher {
  position: fixed;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
  z-index: 100;
}
.lang-switcher form { display: inline; margin: 0; }
.lang-switcher a,
.lang-switcher button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lang-switcher a:hover,
.lang-switcher button:hover {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}
.lang-switcher a.active,
.lang-switcher button.active {
  color: var(--ink);
  font-weight: 700;
}
.lang-switcher span { color: var(--ink-soft); }

/* ---- Loading overlay ---- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(244, 243, 238, 0.92);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 1000;
}
/* [hidden] and a plain class selector have equal CSS specificity, and an
   author rule always beats the UA default — so "display: flex" here would
   otherwise win over the browser's built-in "[hidden] { display: none }"
   and leave this covering + intercepting clicks on the ENTIRE page at all
   times, hidden attribute or not. This is the actual fix. */
.loading-overlay:not([hidden]) {
  display: flex;
}
.loading-overlay p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--line); }
}

/* ---- Misc ---- */
.sign-document { white-space: pre-wrap; }
.brief-text { white-space: pre-wrap; }

.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 84px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--primary); }

.legal-page h2 { font-size: 1.1rem; margin-top: 28px; }
.legal-page p, .legal-page li { font-size: 14px; }

/* ---- Mobile ---- */
@media (max-width: 760px) {
  .auth-body { grid-template-columns: 1fr; min-height: auto; }
  .brand-panel { flex-direction: row; align-items: center; padding: 16px 20px; }
  .brand-panel::before, .brand-panel::after { display: none; }
  .brand-welcome { display: none; }
  .brand-legal { font-size: 12px; }
  .form-side { padding: 16px 16px 88px; }
  .form-side .login-page { margin-top: 24px; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .topbar nav a { margin-inline-start: 0; }
  .content { padding: 24px 16px 88px; }
  .tile { min-width: 100%; }
  .login-page { margin-top: 32px; padding: 28px 22px 24px; box-shadow: none; }
  .lang-switcher { left: 8px; bottom: 8px; }
}

/* ---- Ask Steda (chat) ---- */
.assistant-examples { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.assistant-examples form { display: inline; margin: 0; }
.example-chip {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.example-chip:hover { border-color: var(--primary); background: var(--primary-tint); transform: translateY(-1px); }
.chat { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.bubble.steda {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 5px;
  box-shadow: 0 4px 14px -10px rgba(31,42,40,.15);
}
.bubble.steda.error { border-color: rgba(179,38,30,.35); color: var(--danger); }
[dir="rtl"] .bubble.user { border-bottom-right-radius: 16px; border-bottom-left-radius: 5px; }
[dir="rtl"] .bubble.steda { border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.ask-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  position: sticky;
  bottom: 16px;
  background: var(--paper);
  padding-top: 8px;
}
.ask-form input {
  flex: 1;
  margin: 0;
  padding: 12px 16px;
  border-radius: 999px;
}
.ask-form button { border-radius: 999px; padding: 12px 22px; white-space: nowrap; }

/* ============================================================
   Dashboard — command center
   ============================================================ */
.content-wide { max-width: 1080px; }

.dash-hero { margin-bottom: 28px; }
.dash-eyebrow {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--primary);
}
.dash-hero h1 { margin: 0 0 6px; font-size: 2rem; }
.dash-plan { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* ---- Stat cards ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.stat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}
.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-value.is-positive { color: var(--primary); }
.stat-value.is-negative { color: var(--danger); }
.stat-sub { font-size: 13px; color: var(--ink-soft); }

/* ---- Tools section ---- */
.dash-section-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* ---- Tiles (richer: icon + label + description) ---- */
.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  flex: 1 1 300px;
  min-width: 280px;
}
.tile-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--primary-tint);
  color: var(--primary);
}
.tile-icon svg { width: 22px; height: 22px; display: block; }
.tile-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-label { font-weight: 700; font-size: 15px; }
.tile-desc { font-size: 13px; font-weight: 400; color: var(--ink-soft); line-height: 1.4; }
.tile-arrow {
  margin-inline-start: auto;
  color: var(--ink-soft);
  font-size: 18px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.15s, transform 0.15s;
}
.tile:hover .tile-arrow { opacity: 1; transform: translateX(0); color: var(--primary); }
[dir="rtl"] .tile-arrow { transform: scaleX(-1) translateX(-6px); }
[dir="rtl"] .tile:hover .tile-arrow { transform: scaleX(-1) translateX(0); }

/* Flagship tile stands out */
.tile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  border-color: transparent;
  color: #fff;
}
.tile-hero .tile-icon { background: rgba(255,255,255,0.16); color: #fff; }
.tile-hero .tile-desc { color: rgba(255,255,255,0.82); }
.tile-hero .tile-arrow { color: rgba(255,255,255,0.9); }
.tile-hero:hover { border-color: transparent; }
.tile-hero:hover .tile-arrow { color: #fff; }

@media (max-width: 560px) {
  .dash-hero h1 { font-size: 1.6rem; }
  .tile { min-width: 100%; }
}

/* ============================================================
   Shared app design system — used across every tool page
   ============================================================ */

/* ---- Page header ---- */
.page-head { margin-bottom: 26px; }
.page-head .eyebrow {
  margin: 0 0 3px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--primary);
}
.page-head h1 { margin: 0 0 6px; }
.page-head .sub { margin: 0; color: var(--ink-soft); font-size: 15px; max-width: 60ch; }
.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- Panels (the canonical content card) ---- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  margin: 0 0 22px;
  box-shadow: 0 10px 30px -24px rgba(31, 42, 40, 0.5);
}
.panel-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 9px;
}
.panel-title .t-ico {
  display: inline-flex;
  width: 30px; height: 30px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--primary-tint);
  color: var(--primary);
  flex: 0 0 auto;
}
.panel-title .t-ico svg { width: 17px; height: 17px; }
.panel > *:last-child { margin-bottom: 0; }

/* ---- Inline form grid ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 18px;
  align-items: end;
}
.form-grid label { margin-bottom: 0; }
.form-grid .field-full { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.form-actions .fine-print { margin: 0; }

/* Secondary / ghost button */
.btn-ghost {
  background: var(--card);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-ghost:hover { background: var(--primary-tint); }

/* ---- In-page summary metrics (static, non-clickable) ---- */
.stat-card.readonly { cursor: default; }
.stat-card.readonly:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line);
}

/* ---- Status badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-success { background: var(--primary-tint); color: var(--primary-deep); }
.badge-muted   { background: #eef0ef; color: var(--ink-soft); }
.badge-danger  { background: rgba(179,38,30,.09); color: var(--danger); }
.badge-info    { background: rgba(43,108,99,.08); color: var(--primary); }

/* ---- Amount coloring ---- */
.amt-in  { color: var(--primary); font-weight: 600; white-space: nowrap; }
.amt-out { color: var(--danger);  font-weight: 600; white-space: nowrap; }

/* ---- Table card ---- */
.table-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 10px 30px -24px rgba(31, 42, 40, 0.5);
}
.table-card .table-scroll { overflow-x: auto; }
.table-card table { margin: 0; }
.table-card thead th, .table-card tr:first-child th { background: #fbfbf9; }
.table-card th, .table-card td { padding: 12px 16px; }
.table-card tbody tr:last-child td, .table-card tr:last-child td { border-bottom: none; }

/* ---- Empty states ---- */
.empty-state {
  text-align: center;
  padding: 40px 24px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  background: rgba(255,255,255,0.4);
}
.empty-state .es-ico {
  display: inline-flex;
  width: 52px; height: 52px;
  align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--primary-tint);
  color: var(--primary);
  margin-bottom: 12px;
}
.empty-state .es-ico svg { width: 26px; height: 26px; }
.empty-state p { margin: 0; font-size: 15px; }

/* ---- Appointment cards ---- */
.appt-list { display: flex; flex-direction: column; gap: 12px; }
.appt-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 10px 30px -26px rgba(31, 42, 40, 0.5);
  transition: border-color .15s, box-shadow .15s;
}
.appt-card:hover { border-color: var(--primary); box-shadow: var(--shadow-card); }
.appt-date {
  flex: 0 0 auto;
  width: 58px;
  text-align: center;
  border-radius: 11px;
  background: var(--primary-tint);
  color: var(--primary-deep);
  padding: 8px 0;
  line-height: 1;
}
.appt-date .d { display: block; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; }
.appt-date .m { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
.appt-body { flex: 1 1 auto; min-width: 0; }
.appt-title { font-weight: 600; font-size: 15px; }
.appt-meta { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.appt-meta span + span::before { content: "·"; margin: 0 7px; opacity: .5; }
.appt-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.appt-actions form { display: inline; margin: 0; }
.appt-card.is-google { background: repeating-linear-gradient(135deg, var(--card), var(--card) 12px, #fbfbf8 12px, #fbfbf8 24px); }

/* ---- Signature request cards ---- */
.sig-card .sig-link-row { display: flex; gap: 8px; align-items: center; margin: 12px 0 6px; }
.sig-card .sig-link-row input {
  margin: 0;
  font-size: 13px;
  background: #fbfbf9;
  color: var(--ink-soft);
}

/* ---- Detail (key/value) list ---- */
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; font-size: 14px; }
.detail-list dt { color: var(--ink-soft); font-weight: 600; }
.detail-list dd { margin: 0; font-weight: 500; }

/* ---- AI content note ---- */
.ai-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; display: flex; align-items: center; gap: 6px; }

/* ---- Auth split shell (login family) ---- */
.auth-narrow { max-width: 420px; }

@media (max-width: 560px) {
  .panel { padding: 18px 18px; border-radius: 12px; }
  .appt-actions { gap: 8px; }
}
