/* ABAN Real-estate — website styles
   Colors are defined once here; change them to rebrand. */
:root {
  --brand: #1f4e79;
  --brand-dark: #163a5b;
  --brand-soft: #e8f0f8;
  --accent: #c9a227;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #667085;
  --border: #e3e7ee;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --success: #1e8449;
  --success-soft: #e7f6ed;
  --warning: #b9770e;
  --warning-soft: #fdf3e1;
  --info: #2e6da4;
  --info-soft: #e6f0fa;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-fa: "Vazirmatn", "Vazir", Tahoma, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
html[lang="fa"] body { font-family: var(--font-fa); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--brand-dark); color: #dbe6f2;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px; font-weight: 700; font-size: 16px; color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; color: var(--brand-dark); font-weight: 800;
}
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: #dbe6f2; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.nav .icon { opacity: .9; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; }
.sidebar-foot .who { color: #fff; font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head .sub { margin-top: 4px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Cards / grid ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body { padding: 18px; }
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.kpi { padding: 16px 18px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
html[lang="fa"] .kpi .label, html[lang="hy"] .kpi .label, html[lang="ru"] .kpi .label { text-transform: none; letter-spacing: 0; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.kpi .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Definition lists ---------- */
.dl { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; line-height: 1.2;
}
.btn:hover { background: #f0f3f7; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: var(--surface); border-color: #f1c4bf; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #eef1f5; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-weight: 600; font-size: 13px; }
.field .help { color: var(--muted); font-size: 12px; }
input, select, textarea {
  font: inherit; color: inherit; background: #fff;
  border: 1px solid #cfd6e0; border-radius: 8px; padding: 8px 10px; width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[type="checkbox"] { width: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 140px; flex: 1 1 140px; max-width: 220px; }
.filters .field.grow { max-width: none; flex: 2 1 220px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f7f9fc; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); gap: 10px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #eef1f5; color: #475467; white-space: nowrap;
}
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.purple { background: #f1ebfa; color: #6c3fb5; }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(160px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.column { background: #eceff4; border-radius: var(--radius); padding: 10px; min-height: 160px; }
.column-head { display: flex; flex-direction: column; gap: 2px; padding: 2px 4px 10px; font-weight: 700; }
.column-head .muted { font-weight: 500; font-size: 12px; }
.deal-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
  cursor: pointer; box-shadow: var(--shadow);
}
.deal-card:hover { border-color: #b8c4d4; }
.deal-card .title { font-weight: 600; }
.deal-card .price { font-weight: 700; margin-top: 4px; }

/* ---------- Bars ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 140px; gap: 10px; align-items: center; }
.bar-track { height: 10px; background: #edf0f4; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.bar-row .v { text-align: end; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-inline-start: 20px; padding-bottom: 14px; }
.timeline li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--brand);
}
.timeline li::after {
  content: ""; position: absolute; inset-inline-start: 7px; top: 16px; bottom: 0; width: 2px; background: var(--border);
}
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
}
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 620px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 820px; }
.modal.xl { max-width: 1000px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Property form ---------- */
.lf-top { margin-bottom: 6px; }
.lf-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px 16px; margin: 0 0 14px; min-width: 0; }
.lf-section legend { font-weight: 700; padding: 0 6px; color: var(--brand-dark); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); background: var(--danger-soft); }
.field .err { color: var(--danger); font-size: 12px; font-weight: 600; }
.field[hidden] { display: none; }
.check-field { justify-content: flex-end; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.feature-cat { grid-column: 1 / -1; }
.feature-cat h4 { margin: 2px 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; background: #eef1f5; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chip-check:has(input:checked) { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.ppu { padding: 9px 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.toast { white-space: pre-line; }

/* ---------- Property detail & media ---------- */
.detail-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 20px 0 8px; }
.detail-section:first-child h3 { margin-top: 0; }
.prewrap { white-space: pre-wrap; margin: 0; }
.meta-line { margin-top: 18px; }
.nowrap { white-space: nowrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.media-tile { position: relative; margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fafbfc; }
.media-tile img, .media-doc { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eef1f5; }
.media-doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--brand); font-weight: 600; }
.media-doc .icon { width: 28px; height: 28px; }
.media-tile > a { display: block; }
/* Cover photo in the listings table */
.list-item { display: flex; align-items: center; gap: 10px; }
.list-thumb { flex: none; width: 64px; height: 48px; border-radius: 6px; object-fit: cover; background: #eef1f5; }
.list-thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: #b4bcc8; }
.list-thumb-empty .icon { width: 22px; height: 22px; }
.media-tile figcaption { padding: 6px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-cover { position: absolute; top: 6px; inset-inline-start: 6px; }
.media-ctrls { display: flex; justify-content: space-between; border-top: 1px solid var(--border); }
.media-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }

/* ---------- Company administration ---------- */
.brand-logo { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; flex-shrink: 0; }
.brand-sub { font-size: 11px; font-weight: 500; opacity: .7; letter-spacing: .04em; }
.nav-group { margin: 14px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.role-check { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.role-check span { display: flex; flex-direction: column; gap: 2px; }
.role-check .badge { align-self: flex-start; }
.role-check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.perm-grid .muted { opacity: .65; }
.role-card h3 { margin: 0; font-size: 16px; }
.role-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.logo-preview { min-height: 90px; display: grid; place-items: center; background: #fafbfc; border: 1px dashed var(--border); border-radius: 8px; padding: 10px; }
.logo-preview img { max-height: 90px; max-width: 100%; object-fit: contain; }
.notice { background: var(--info-soft); color: var(--info); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.shell.platform .sidebar { background: #2a1f4d; }
.shell.platform .brand-mark { background: var(--accent); color: #2a1f4d; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { padding: 12px 14px; border-radius: 10px; background: #1c2430; color: #fff; box-shadow: var(--shadow); font-weight: 500; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--brand-dark), var(--brand) 60%, #2c6aa3); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); padding: 28px; }
.auth-card .brand-line { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--brand-dark); margin-bottom: 18px; }
.auth-card .brand-mark { background: var(--brand); color: #fff; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; flex-wrap: wrap; }

/* ---------- Misc ---------- */
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.loading { padding: 36px; text-align: center; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { background: none; border: none; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #eef1f5; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.score { font-weight: 700; color: var(--brand); }
.lang-select { width: auto; padding: 6px 8px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: none; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
html[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; inset-inline-start: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .shell.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .grid-4, .grid-3, .grid-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filters .field { max-width: none; }
  .bar-row { grid-template-columns: 90px 1fr 120px; }
  .hide-sm { display: none; }
}

/* Listings: extra filters, translations, legacy values */
.filters .more-filters { flex-basis: 100%; }
.filters .more-filters summary, details.translations summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.filters .filters-inner { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
details.translations { grid-column: 1 / -1; }
.detail-section.legacy { background: var(--surface-2, #f7f7f9); border-radius: 8px; padding: 8px 12px; }

/* Customer app link (company settings) */
.app-link { width: 100%; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; margin-bottom: 10px; }
.ani-playbook { width: 100%; min-height: 200px; font: inherit; font-size: 14px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
/* Customer app settings, client level, messaging test */
.card-body > label.check { display: flex; margin-top: 8px; }
.form-inline { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.form-inline .field { flex: 1; min-width: 180px; margin: 0; }

/* Requests inbox (to-do) */
.prio { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c5ccd6; vertical-align: middle; }
.prio-high { background: var(--danger); }
.prio-normal { background: var(--info); }
.prio-low { background: #c5ccd6; }
table.tasks td:first-child, table.tasks th:first-child { width: 22px; padding-inline-end: 0; }
tr.row-overdue td { background: #fff7f6; }
.overdue { color: var(--danger); font-weight: 600; }
.kpi-link { display: block; color: inherit; text-decoration: none; }
.kpi-link:hover { border-color: #b8c4d4; text-decoration: none; }
.kpi-alert .value { color: var(--danger); }
.kpi-warn .value { color: var(--warning); }
.nav-count { margin-inline-start: auto; background: rgba(255, 255, 255, .2); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 20px; }
.nav-count.alert { background: var(--danger); }
.tabs .count { background: #eef1f5; color: var(--text); border-radius: 999px; padding: 0 7px; font-size: 12px; margin-inline-start: 4px; }
button.chip { border: 1px solid var(--border); cursor: pointer; font: inherit; font-size: 12px; padding: 4px 10px; }
button.chip:hover { background: var(--brand-soft); }
.bar-fill.st-new { background: var(--info); }
.bar-fill.st-in_progress { background: #6c3fb5; }
.bar-fill.st-no_answer, .bar-fill.st-needs_review { background: var(--warning); }
.bar-fill.st-viewing_set { background: var(--success); }
.task-details summary, .new-owner summary { cursor: pointer; font-weight: 600; color: var(--brand); margin: 6px 0; }
.task-details pre { background: #f7f9fc; border: 1px solid var(--border); border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; font: inherit; font-size: 13px; }
.new-owner .form-grid { margin: 6px 0; }
@media (max-width: 900px) { .grid-4 .kpi-link .value { font-size: 20px; } }
.due-echo { font-weight: 600; color: var(--brand); }

/* Viewing calendar */
.cal-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { margin: 0; font-size: 17px; }
.cal-date { width: auto; padding: 5px 8px; }
.cal-agent { width: auto; min-width: 160px; padding: 6px 8px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--brand); color: #fff; }
.cal-card { overflow: hidden; }
.cal-scroll { overflow: auto; max-height: calc(100vh - 260px); }
.cal-grid { display: grid; min-width: min-content; }
.cal-head { position: sticky; top: 0; z-index: 3; background: #f7f9fc; border-bottom: 1px solid var(--border); border-inline-start: 1px solid var(--border);
  padding: 8px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-head.corner { border-inline-start: 0; inset-inline-start: 0; z-index: 4; }
.cal-head[data-goto] { cursor: pointer; }
.cal-head.today { color: var(--brand); background: var(--brand-soft); }
.cal-head .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: hsl(var(--hue) 60% 45%); margin-inline-end: 6px; }
.cal-times { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--surface); }
.cal-hour { font-size: 11px; color: var(--muted); padding: 2px 6px; border-top: 1px solid var(--border); text-align: end; font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-inline-start: 1px solid var(--border); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 30px, #f1f3f6 30px 31px, transparent 31px 60px); }
.cal-col:hover { background-color: #fbfcfe; }
.cal-off { position: absolute; inset-inline: 0; background: rgba(120, 130, 150, .09); pointer-events: none; }
.cal-block { position: absolute; inset-inline: 3px; z-index: 1; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 1px; overflow: hidden; text-align: start;
  border: 0; border-inline-start: 4px solid hsl(var(--hue) 60% 45%); border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 12px; line-height: 1.25;
  background: hsl(var(--hue) 70% 95%); color: var(--text); cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.cal-block strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-block .marks i { font-style: normal; font-size: 11px; margin-inline-end: 4px; }
.cal-block .marks i.wait { opacity: .6; }
.cal-block.st-proposed { background: repeating-linear-gradient(135deg, hsl(var(--hue) 70% 96%) 0 6px, #fff 6px 12px); outline: 1px dashed hsl(var(--hue) 50% 60%); }
.cal-block.st-done { opacity: .65; }
.cal-block.short .marks { display: none; }
.cal-block.st-no_show { opacity: .6; text-decoration: line-through; }
.cal-block:hover { box-shadow: 0 2px 8px rgba(16, 24, 40, .2); z-index: 2; }
.cal-legend { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cal-block-mini { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: middle; background: hsl(210 70% 92%); border-inline-start: 3px solid hsl(210 60% 45%); }
.cal-block-mini.st-proposed { background: repeating-linear-gradient(135deg, hsl(210 70% 92%) 0 3px, #fff 3px 6px); }
.cal-block-mini.st-done { opacity: .6; }
.cal-block-mini.st-no_show { background: var(--danger-soft); border-color: var(--danger); }
.parties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.party { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 0; overflow-wrap: anywhere; }
.slot-check.ok { color: var(--success); font-weight: 600; }
.slot-check.bad { color: var(--danger); font-weight: 600; }
.slot-check ul { margin: 4px 0 0; padding-inline-start: 18px; font-weight: 500; }
.owner-line { padding: 6px 0; }
@media (max-width: 720px) { .parties { grid-template-columns: 1fr; } .cal-scroll { max-height: none; } }

/* Charts (reports, dashboard) */
.viz { position: relative; width: 100%; }
.viz svg { display: block; overflow: visible; }
.viz-ax { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.viz-hit { fill: transparent; cursor: default; }
.viz-hit.on { fill: rgba(31, 78, 121, .06); }
.viz-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, .14); padding: 8px 10px; font-size: 12px; line-height: 1.5; white-space: nowrap; }
.viz-tip i, .viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.viz-table { margin-top: 6px; font-size: 12px; }
.viz-table summary { cursor: pointer; color: var(--muted); }
.viz-table table { margin-top: 6px; }
.viz-table th, .viz-table td { padding: 4px 8px; }
.funnel { display: flex; flex-direction: column; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 10px; align-items: center; }
.funnel-label { font-weight: 600; font-size: 13px; }
.funnel-track { height: 22px; background: #f1f3f6; border-radius: 4px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 4px; }
.funnel-v { min-width: 70px; text-align: end; font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; color: var(--text); }
.delta i { font-style: normal; }
.inline-bar { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.inline-bar span { display: block; height: 8px; border-radius: 4px; background: #2a78d6; min-width: 2px; }
.inline-bar b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-block.cal-busy { background: repeating-linear-gradient(135deg, #eef0f3 0 6px, #f6f7f9 6px 12px); border-inline-start-color: #a3abb8; color: var(--muted); cursor: not-allowed; box-shadow: none; }
.cal-block.cal-busy:hover { box-shadow: none; }
.upload-status { margin: 10px 0 4px; }
.upload-bar { height: 6px; background: #edf0f4; border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.upload-bar span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.text-danger { color: var(--danger); }
.media-actions .btn .icon { width: 16px; height: 16px; margin-inline-end: 2px; }
@media (max-width: 720px) { .media-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .media-actions .btn { justify-content: center; padding: 10px; } }
.auth-note { margin: 12px 0 0; line-height: 1.6; }
