/* SarayDar Management System — approved copper/espresso identity (design preview 2026-10-23) */
/* Fonts are self-hosted (SIL Open Font License, see /static/fonts/LICENSE-OFL.txt) */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url(/static/fonts/jost-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
:root {
  --band: #140D0A; --band-2: #241914; --band-line: #3A2B23; --band-ink: #F1E6DA; --band-muted: #B9A595; --band-soft: #D9C7B8;
  --bg: #F3ECE5; --surface: #FCF9F6; --sunken: #EDE3DA; --line: #E0D2C6; --line-strong: #D4C2B3;
  --ink: #2A1C15; --muted: #6E5B50;
  --accent: #8E4F2B; --accent-hover: #6E3A1E; --accent-ink: #FFF8F2; --accent-tint: #F1E2D6; --copper: #D29466;
  --ok: #24573A; --ok-bg: #E3EFE6; --warn: #7A4F0C; --warn-bg: #F6EBD6; --bad: #8F2E26; --bad-bg: #F6E1DE; --info: #2C506B; --info-bg: #E2EBF2;
  --radius: 14px; --f-display: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--f-body); }
a { color: var(--accent); } a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.main { padding-top: 24px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 16px; }
.grow { flex-grow: 1; min-width: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: var(--f-mono); font-size: 13px; }
.dim { opacity: .6; }

/* band */
.band { background: var(--band); color: var(--band-ink); }
.band a { color: var(--band-soft); }
.band-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 12px; padding-bottom: 12px; }
.wordmark { font-family: var(--f-display); letter-spacing: .42em; font-size: 18px; color: var(--band-ink) !important; text-decoration: none; }
.band-sub { font-size: 14px; color: #C9B6A6; }
.band-search { display: flex; align-items: center; gap: 8px; background: var(--band-2); border: 1px solid var(--band-line); border-radius: 10px; padding: 0 12px; height: 40px; flex: 0 1 320px; }
.band-search svg, .searchbox svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; color: var(--band-muted); flex-shrink: 0; }
.band-search input { background: transparent; border: 0; color: var(--band-ink); font: inherit; font-size: 14px; outline: none; width: 100%; min-width: 0; }
.band-search input::placeholder { color: var(--band-muted); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--copper); color: #1A110C; display: grid; place-items: center; font-weight: 700; }
.who { display: flex; flex-direction: column; line-height: 1.25; font-size: 14px; } .who small { color: var(--band-muted); font-size: 12px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(20, 13, 10, .25); min-width: 220px; padding: 6px; z-index: 20; display: flex; flex-direction: column; }
.menu a, .menu button { display: block; text-align: left; padding: 10px 12px; border-radius: 8px; color: var(--ink) !important; text-decoration: none; background: none; border: 0; font: inherit; width: 100%; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--sunken); }
.band-head { padding-bottom: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.crumbs { font-size: 13px; color: var(--band-muted); }
.band-title { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding-bottom: 14px; }
.band-title h1 { font-family: var(--f-display); font-weight: 500; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; }
.eyebrow { font-size: 12px; color: var(--band-muted); }
.band-meta { font-size: 14px; color: var(--band-soft); }
.tabs { display: flex; gap: 2px; overflow-x: auto; font-size: 14px; scrollbar-width: none; }
.tabs a { padding: 10px 12px; color: var(--band-muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--band-ink); border-bottom-color: var(--copper); }
.band .btn { background: transparent; color: var(--band-ink); border-color: #4A372C; }
.band .btn.accent { background: var(--copper); color: #1A110C; border-color: var(--copper); font-weight: 600; }
.band .pill { background: #2B1F18; color: #E6C29F; border-color: #4A372C; }

/* layout pieces */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.display { font-family: var(--f-display); font-weight: 500; font-size: clamp(26px, 4vw, 32px); }
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel.narrow { max-width: 560px; }
.h { font-family: var(--f-display); font-weight: 500; font-size: 20px; margin-bottom: 10px; }
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.grow1 { flex: 1 1 340px; min-width: 0; } .grow2 { flex: 999 1 520px; min-width: 0; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.section-card { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: center; gap: 12px; }
.section-head h2 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.section-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--accent-tint); display: grid; place-items: center; }
.section-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stats.inline { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin: 12px 0; }
.stats dt { font-size: 12px; color: var(--muted); } .stats dd { margin: 0; font-size: 24px; font-weight: 600; }
.section-card .btn { margin-top: auto; }
.details { margin: 0; display: grid; gap: 10px; }
.details > div { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--sunken); }
.details dt { color: var(--muted); font-size: 14px; } .details dd { margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--sunken); flex-wrap: wrap; }
.rows li:first-child { border-top: 0; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 32px 20px; text-align: center; }
.empty p { color: var(--muted); margin: 6px 0 0; }
.flash { background: var(--ok-bg); color: var(--ok); border: 1px solid #C5DCCB; border-radius: 10px; padding: 10px 14px; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 14px; }
.err { color: var(--bad); margin: 0; }
.pre { white-space: pre-wrap; font-family: var(--f-mono); font-size: 12px; background: var(--sunken); padding: 8px; border-radius: 8px; max-width: 520px; overflow: auto; }

/* status */
.pill { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); } .pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); } .pill-info { background: var(--info-bg); color: var(--info); }
.pill-muted { background: var(--sunken); color: #5A4A40; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn.block { width: 100%; } .btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.stack .field { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.field > span { color: var(--muted); font-size: 13px; } .field small { color: var(--muted); font-size: 12px; }
.req { color: var(--bad); font-style: normal; }
.field input, .field select, .field textarea, .filters select, .filters input { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; font: inherit; color: var(--ink); background: #fff; width: 100%; }
.field textarea { min-height: 96px; padding: 10px 12px; }
.field input[type="file"] { padding: 10px; }
.field.check { flex-direction: row; align-items: center; gap: 8px; } .field.check input { width: 20px; min-height: 20px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #C99A73; outline-offset: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters select { width: auto; }
.searchbox { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; min-height: 44px; flex: 1 1 260px; }
.searchbox svg { color: var(--muted); }
.searchbox input { border: 0 !important; min-height: 42px; padding: 0 !important; outline: none; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .table-wrap { border: 0; border-radius: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-top: 1px solid var(--sunken); vertical-align: top; }
th.c, td.c { text-align: center; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: center; font-size: 14px; color: var(--muted); }

/* files */
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--sunken); flex-wrap: wrap; }
.files li:first-child { border-top: 0; }
.thumb { width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--sunken); display: grid; place-items: center; flex-shrink: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.doc { font-weight: 700; color: var(--muted); font-size: 13px; }

/* auth */
.auth { max-width: 440px; margin: 32px auto 0; width: 100%; }
.auth h2 { font-family: var(--f-display); font-weight: 500; font-size: 26px; }
.auth .panel { display: flex; flex-direction: column; gap: 12px; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 8px; }
.key { letter-spacing: .08em; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; list-style: none; padding: 0; }
.codes li { background: var(--sunken); border-radius: 8px; padding: 8px; text-align: center; }
.steps { padding-left: 20px; margin: 0; }

@media (max-width: 640px) {
  .who { display: none; }
  .band-search { order: 5; flex: 1 1 100%; }
  .details > div { grid-template-columns: 1fr; gap: 2px; }
  .panel, .card { padding: 16px; }
}

/* Phase 3: project workspaces */
.big { font-size: 28px; font-weight: 600; line-height: 1.2; } .mid { font-size: 17px; font-weight: 600; }
.bar { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; margin: 6px 0; } .bar span { display: block; height: 100%; background: var(--accent); }
.kv { min-width: 0; } .kv th { text-align: left; font-weight: 400; color: var(--muted); border: 0; padding: 6px 0; font-size: 14px; white-space: normal; } .kv td { text-align: right; border-top: 1px solid var(--sunken); padding: 6px 0; } .kv tr:first-child td { border-top: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 10px 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--sunken); }
.big-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } .gallery figure { margin: 0; } .gallery figcaption { color: var(--muted); margin-top: 4px; }
.steps-nav ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; }
.steps-nav a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--muted); white-space: nowrap; font-size: 14px; min-height: 40px; }
.steps-nav a span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); font-size: 12px; font-weight: 600; }
.steps-nav li.done a span { background: var(--ok-bg); color: var(--ok); } .steps-nav li.on a { border-color: var(--accent); color: var(--ink); } .steps-nav li.on a span { background: var(--accent); color: var(--accent-ink); }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.h3 { font-size: 15px; font-weight: 600; margin: 12px 0 6px; } .pre-line { white-space: pre-line; }
tr.late td { background: #FBF1EF; } tr.total td { font-weight: 600; border-top: 2px solid var(--line); }
th.n, td.n { text-align: right; white-space: nowrap; } .warn-text { color: var(--warn); }
.subtabs { display: flex; gap: 6px; overflow-x: auto; } .subtabs a { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); white-space: nowrap; font-size: 14px; }
.subtabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.inline-form { margin-top: 12px; } .inline-form > summary { cursor: pointer; color: var(--accent); font-weight: 500; min-height: 32px; } .inline-form[open] > summary { margin-bottom: 10px; }
td .inline-form { margin: 0; } td .inline-form form { min-width: 520px; }
.q { display: flex; flex-direction: column; gap: 4px; } .q.full, .q:has(textarea) { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 6px; } .check input { width: 18px; height: 18px; }
.deps { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px; max-height: 260px; overflow: auto; }
.update .h a { color: var(--ink); text-decoration: none; }
.filters label.small { display: inline-flex; align-items: center; gap: 6px; } .filters input[type="date"] { width: auto; }
@media (max-width: 640px) { td .inline-form form { min-width: 0; } }
.letterhead-preview { width: 100%; max-width: 260px; border: 1px solid var(--line); border-radius: 8px; display: block; background: #fff; }
textarea.mono { font-family: var(--f-mono); font-size: 13px; line-height: 1.5; }
img.avatar { object-fit: cover; display: block; background: var(--sunken); }
.big-avatar { width: 96px; height: 96px; font-size: 36px; }
.photo-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.person { display: flex; align-items: center; gap: 10px; } .person .avatar { flex-shrink: 0; }
.creds { font-size: 18px; letter-spacing: .06em; background: var(--sunken); padding: 6px 10px; border-radius: 8px; display: inline-block; user-select: all; }
tr.sub td { border-top: 0; padding-top: 0; }
[hidden] { display: none !important; }
/* page navigation + export bar */
.pagenav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.navbtn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; white-space: nowrap; }
.navbtn:hover { border-color: var(--accent); color: var(--ink); }
.export-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
@media print { .pagenav, .band .tabs, .usermenu, .band-search { display: none !important; } }
/* All workspace tabs always visible: wrap onto extra lines instead of scrolling out of view */
.tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
.tabs a { padding: 9px 11px; }
@media (max-width: 640px) { .tabs { font-size: 13px; } .tabs a { padding: 8px 9px; } }
/* Tabs as light-bordered buttons (owner request) */
.tabs { gap: 6px; padding: 2px 0 14px; }
.tabs a { border: 1px solid rgba(241, 230, 218, 0.22); border-radius: 8px; padding: 7px 12px; color: var(--band-soft); background: rgba(255, 255, 255, 0.02); border-bottom-width: 1px; }
.tabs a:hover { border-color: rgba(241, 230, 218, 0.5); color: var(--band-ink); }
.tabs a[aria-current="page"] { background: var(--copper); border-color: var(--copper); color: #1A110C; font-weight: 600; }
/* Navigation and export: buttons grouped in the top-right corner */
.pagenav { justify-content: flex-end; gap: 10px; }
.navgroup { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.navgroup + .navgroup { padding-left: 10px; border-left: 1px solid var(--line); }
.navbtn { border-radius: 8px; gap: 6px; padding: 0 12px; min-height: 36px; font-weight: 500; }
.navbtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }
@media (max-width: 640px) { .navgroup + .navgroup { padding-left: 0; border-left: 0; } }
/* Tabs: equal-size buttons on a grid */
.tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 6px; }
.tabs a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 40px; padding: 6px 10px; white-space: normal; line-height: 1.25; }
@media (max-width: 640px) { .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tabs a { min-height: 38px; } }
/* Larger company wordmark in the top ribbon */
.band-row .wordmark { font-size: 34px; letter-spacing: .36em; line-height: 1; font-weight: 500; }
.band-row { padding-top: 16px; padding-bottom: 16px; }
.band-sub { font-size: 15px; }
@media (max-width: 640px) { .band-row .wordmark { font-size: 22px; letter-spacing: .3em; } .band-sub { font-size: 13px; } }
/* Logo with "Management System" beneath it */
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 9px; text-decoration: none; }
.brand .band-sub { font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: #C9B6A6; padding-left: 2px; }
@media (max-width: 640px) { .brand { gap: 7px; } .brand .band-sub { font-size: 10px; letter-spacing: .26em; } }
/* Clients Projects Management */
.notice.info { background: var(--sunken); color: var(--ink); }
.notice + .panel, .notice + section, section + .notice { margin-top: 0; }
.client-banner { display: flex; flex-wrap: wrap; gap: 14px 36px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--copper); border-radius: var(--radius); padding: 16px 20px; }
.client-name { font-family: var(--f-display); font-size: 24px; font-weight: 500; line-height: 1.2; margin: 0; }
.client-name a { color: inherit; text-decoration: none; } .client-name a:hover { text-decoration: underline; }
.client-cell { font-weight: 600; }
.panel-inner { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; }
.panel-inner .h3 { margin-top: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.nowrap { white-space: nowrap; }
/* Navigation and export buttons sit in the dark ribbon, top right, beside the breadcrumbs */
.band-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-bottom: 6px; }
.band-top .crumbs { flex: 1 1 260px; margin: 0; }
.band .pagenav { margin: 0; flex: 0 1 auto; }
.band .navbtn { background: rgba(255, 255, 255, 0.04); border-color: rgba(241, 230, 218, 0.28); color: var(--band-ink); }
.band .navbtn:hover { border-color: var(--copper); color: var(--band-ink); background: rgba(255, 255, 255, 0.08); }
.band .navgroup + .navgroup { border-left-color: rgba(241, 230, 218, 0.2); }
@media (max-width: 640px) { .band-top { flex-direction: column; align-items: stretch; } .band-top .crumbs { flex: none; } .band .pagenav { justify-content: flex-start; } }
/* Back / Home / PDF / Excel on the title row, right side, next to the status */
.band-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; }
@media (max-width: 640px) { .band-actions { margin-left: 0; justify-content: flex-start; width: 100%; } }
.band-badge { display: inline-block; margin-left: 8px; vertical-align: 1px; }
/* Page-specific buttons (Create, Clients…) on the breadcrumb row; Back / Home / PDF / Excel always alone at the far right of the title row */
.band-top .page-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.band-top .page-actions .btn { min-height: 38px; }
.band-actions { flex: 0 0 auto; }
@media (max-width: 640px) { .band-top .page-actions { justify-content: flex-start; } }
.band .page-actions .btn:not(.accent):not(.primary) { background: rgba(255, 255, 255, 0.04); border-color: rgba(241, 230, 218, 0.28); color: var(--band-ink); }

/* Everything in IBM Plex Sans (owner request 2026-10-24); references keep aligned digits */
.mono, .pre, textarea.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
/* The SΛRΛYDΛR logo keeps its own typeface (owner request 2026-10-24) */
.wordmark { font-family: "Jost", "Futura", "Century Gothic", sans-serif !important; font-weight: 500; }
/* ---------- Phase 7: invitations and the external portal ---------- */
form.inline { display: inline-block; margin: 0 4px 4px 0; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice { margin-bottom: 14px; }
.grant-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.grant-row:first-of-type { border-top: 0; }
.grant-row .check { display: inline-flex; gap: 6px; align-items: center; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
fieldset legend { padding: 0 6px; font-weight: 500; }
fieldset .check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.ws-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ws-card { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; background: var(--surface, #fff); min-height: 76px; }
.ws-card:hover { border-color: var(--copper); }
.ws-card img, .ws-card .ws-cover { width: 72px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; }
.ws-card .ws-cover { display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); font-size: 22px; font-weight: 600; }
.ws-card .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-card b { overflow: hidden; text-overflow: ellipsis; }
.preview-note a { margin-left: 6px; }
@media (max-width: 640px) {
  .ws-cards { grid-template-columns: 1fr; }
  .gallery.big-gallery { grid-template-columns: repeat(2, 1fr); }
  .grant-row { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 640px) { .stats.inline dd { font-size: 17px; white-space: nowrap; } .stats.inline { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ws-card { align-items: flex-start; } }
.ai-q { border-left: 3px solid var(--line-strong); padding: 4px 12px; margin-bottom: 12px; }
.ai-a { background: var(--info-bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.ai-a .pre-line { margin-top: 8px; }
/* ---------- Home: section cards (owner design 2026-10-24) — the whole card opens the section ---------- */
.home-sections { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
a.section-card { display: flex; flex-direction: column; gap: 0; padding: 0; color: inherit; text-decoration: none; border-radius: 22px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(70, 40, 20, .07); transition: box-shadow .15s, transform .15s, border-color .15s; }
a.section-card:hover { border-color: var(--copper); box-shadow: 0 10px 28px rgba(70, 40, 20, .12); transform: translateY(-1px); }
a.section-card:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }
a.section-card .section-head { gap: 18px; padding: 22px 22px 20px; border-bottom: 1px solid var(--line); }
a.section-card .section-head h2 { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; flex: 1; }
a.section-card .section-icon { width: 64px; height: 64px; border-radius: 16px; }
a.section-card .section-icon svg { width: 30px; height: 30px; }
.section-go { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; background: var(--accent-tint); display: grid; place-items: center; transition: background .15s; }
.section-go svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.section-card:hover .section-go { background: var(--accent); } a.section-card:hover .section-go svg { stroke: var(--accent-ink); }
.section-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 20px 22px 22px; }
.section-stats > div { padding: 0 18px; min-width: 0; } .section-stats > div:first-child { padding-left: 0; } .section-stats > div + div { border-left: 1px solid var(--line); }
.section-stats dt { color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.section-stats .dot { width: 12px; height: 12px; border-radius: 50%; background: #8FAE85; flex-shrink: 0; }
.section-stats dd { margin: 6px 0 0; font-size: 36px; font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.section-stats .sub { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
@media (max-width: 640px) {
  .home-sections { grid-template-columns: 1fr; }
  a.section-card .section-head { padding: 18px; gap: 14px; } a.section-card .section-head h2 { font-size: 19px; }
  a.section-card .section-icon { width: 54px; height: 54px; } .section-go { width: 40px; height: 40px; }
  .section-stats { padding: 16px 18px 18px; } .section-stats > div { padding: 0 12px; } .section-stats dt { font-size: 13.5px; gap: 8px; } .section-stats dd { font-size: 30px; }
}
@media (min-width: 900px) { .home-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* home cards: medium size (owner request 2026-10-24, 09:14) */
.home-sections { gap: 20px; margin-bottom: 22px; }
a.section-card { border-radius: 24px; }
a.section-card .section-head { padding: 26px 26px 22px; gap: 20px; }
a.section-card .section-head h2 { font-size: 24px; }
a.section-card .section-icon { width: 70px; height: 70px; border-radius: 18px; }
a.section-card .section-icon svg { width: 33px; height: 33px; }
.section-go { width: 50px; height: 50px; } .section-go svg { width: 24px; height: 24px; }
.section-stats { padding: 22px 26px 26px; }
.section-stats > div { padding: 2px 20px; }
.section-stats dt { font-size: 16px; } .section-stats .dot { width: 13px; height: 13px; }
.section-stats dd { font-size: 42px; margin-top: 8px; }
.section-stats .sub { font-size: 15px; margin-top: 5px; }
@media (max-width: 640px) {
  .home-sections { gap: 16px; }
  a.section-card .section-head { gap: 14px; padding: 18px 16px 16px; } a.section-card .section-head h2 { font-size: 19px; }
  a.section-card .section-icon { width: 54px; height: 54px; border-radius: 15px; } a.section-card .section-icon svg { width: 27px; height: 27px; }
  .section-go { width: 40px; height: 40px; } .section-go svg { width: 21px; height: 21px; }
  .section-stats { padding: 16px; } .section-stats > div { padding: 2px 12px; } .section-stats dt { font-size: 14.5px; } .section-stats dd { font-size: 34px; margin-top: 6px; } .section-stats .sub { font-size: 13px; }
}
/* section pages: workspaces as small cards (owner request 2026-10-24) */
.ws-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ws-tile { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 3px 14px rgba(70, 40, 20, .06); transition: border-color .15s, box-shadow .15s, transform .15s; }
.ws-tile:hover { border-color: var(--copper); box-shadow: 0 8px 22px rgba(70, 40, 20, .11); transform: translateY(-1px); }
.ws-tile:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }
.ws-tile-top { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.ws-tile-name { display: block; font-size: 18px; font-weight: 600; color: var(--accent); line-height: 1.25; margin-bottom: 2px; }
.ws-tile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0; padding: 14px 18px; flex: 1; }
.ws-tile-facts dt { color: var(--muted); font-size: 12.5px; }
.ws-tile-facts dd { margin: 2px 0 0; font-size: 14.5px; overflow-wrap: anywhere; }
.ws-tile-foot { display: flex; align-items: center; gap: 10px; padding: 10px 18px 14px; color: var(--muted); font-size: 13px; }
.ws-tile-foot span:first-child { flex: 1; }
.ws-tile-go { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-tint); display: grid; place-items: center; flex-shrink: 0; }
.ws-tile-go svg { width: 17px; height: 17px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ws-tile:hover .ws-tile-go { background: var(--accent); } .ws-tile:hover .ws-tile-go svg { stroke: var(--accent-ink); }
@media (max-width: 640px) { .ws-grid { grid-template-columns: 1fr; } }
.ws-tile-top { padding: 14px 16px 10px; } .ws-tile-name { font-size: 17px; }
.ws-tile-facts { gap: 8px 12px; padding: 12px 16px; } .ws-tile-facts dt { font-size: 12px; } .ws-tile-facts dd { font-size: 14px; margin-top: 1px; }
.ws-tile-foot { padding: 6px 16px 12px; } .ws-tile-go { width: 28px; height: 28px; }
@media (max-width: 640px) { .ws-grid { gap: 12px; } .ws-tile-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* home cards: compact (owner request 2026-10-24, 09:58) */
.home-sections { gap: 14px; margin-bottom: 18px; }
@media (min-width: 900px) { .home-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .home-sections { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
a.section-card { border-radius: 18px; }
a.section-card .section-head { padding: 14px 16px 12px; gap: 12px; }
a.section-card .section-head h2 { font-size: 16.5px; line-height: 1.25; }
a.section-card .section-icon { width: 44px; height: 44px; border-radius: 12px; }
a.section-card .section-icon svg { width: 22px; height: 22px; }
.section-go { width: 32px; height: 32px; } .section-go svg { width: 17px; height: 17px; }
.section-stats { padding: 12px 16px 14px; }
.section-stats > div { padding: 0 12px; }
.section-stats dt { font-size: 13px; gap: 7px; } .section-stats .dot { width: 9px; height: 9px; }
.section-stats dd { font-size: 26px; margin-top: 3px; }
.section-stats .sub { font-size: 12px; margin-top: 2px; }
@media (max-width: 640px) {
  .home-sections { gap: 12px; }
  a.section-card .section-head { padding: 12px 14px 10px; gap: 12px; } a.section-card .section-head h2 { font-size: 16px; }
  a.section-card .section-icon { width: 42px; height: 42px; } a.section-card .section-icon svg { width: 21px; height: 21px; }
  .section-go { width: 30px; height: 30px; } .section-go svg { width: 16px; height: 16px; }
  .section-stats { padding: 10px 14px 12px; } .section-stats > div { padding: 0 10px; } .section-stats dt { font-size: 12.5px; } .section-stats dd { font-size: 24px; } .section-stats .sub { font-size: 11.5px; }
}
/* ---------- tidy-up (owner request 2026-10-24, 10:01) ---------- */
/* tabs: slimmer; three per row on phones so long workspaces need fewer rows */
.tabs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tabs a { min-height: 36px; padding: 5px 8px; font-size: 13.5px; }
@media (max-width: 640px) { .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; } .tabs a { min-height: 34px; font-size: 12px; padding: 4px 4px; line-height: 1.15; } }
/* figure cards two per row on phones, smaller figures */
@media (max-width: 640px) {
  .grid-cards:not(.home-sections) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-cards:not(.home-sections) > .card { padding: 12px 14px; }
  .big { font-size: 22px; } .mid { font-size: 15px; }
}
/* the edit form on the overview opens on demand */
details.edit-panel > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.edit-panel > summary::-webkit-details-marker { display: none; }
details.edit-panel > summary h2 { margin: 0; }
details.edit-panel > summary::after { content: 'Open'; font-size: 13px; color: var(--accent); border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 12px; }
details.edit-panel[open] > summary::after { content: 'Close'; }
details.edit-panel[open] > summary { margin-bottom: 14px; }
details.edit-panel:not([open]) { align-self: flex-start; }
/* details lists stay label | value on phones (shorter pages) */
@media (max-width: 640px) {
  .details { gap: 6px; }
  .details > div { grid-template-columns: minmax(96px, 38%) 1fr; gap: 10px; padding-bottom: 6px; }
  .details dt { font-size: 13px; } .details dd { font-size: 14.5px; overflow-wrap: anywhere; }
}
/* undo / redo beside Back and Home */
.navform { display: inline-flex; margin: 0; }
.navbtn[disabled] { opacity: .38; cursor: default; }
button.navbtn { font: inherit; cursor: pointer; }
/* "What's missing" guide */
.guide { border-color: var(--copper); }
.guide-count { font-weight: 600; color: var(--accent); font-size: 14px; }
.guide-bar { height: 6px; border-radius: 6px; background: var(--sunken); overflow: hidden; margin: 8px 0 12px; }
.guide-bar span { display: block; height: 100%; background: var(--copper); border-radius: 6px; }
.guide-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.guide-list a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; background: var(--surface); }
.guide-list a:hover { border-color: var(--copper); }
.guide-dot { width: 9px; height: 9px; border-radius: 50%; background: #C9772E; flex-shrink: 0; }
.guide-go { color: var(--accent); font-weight: 600; font-size: 13px; white-space: nowrap; }
.guide-list.done { display: block; margin-top: 8px; } .guide-list.done li { padding: 3px 0; color: var(--muted); }
.guide-tick { color: var(--ok); font-weight: 700; margin-right: 6px; }
.guide-done { border-color: var(--line); }
@media (max-width: 640px) { .guide-list { grid-template-columns: 1fr; } }

/* tick-box groups */
fieldset.field.checks { border: 1px solid var(--line, #e2d6cb); border-radius: 10px; padding: 12px 14px; margin: 0; min-width: 0; }
fieldset.field.checks legend { padding: 0 6px; font-size: .86rem; color: var(--muted, #6e5b50); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; margin-bottom: 8px; }
.check-grid .check { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; line-height: 1.35; }
.check-grid .check input { margin: 1px 0 0; flex: none; width: 18px; height: 18px; min-height: 0; padding: 0; }

/* tab tips and help */
.tabtip { display: flex; gap: 16px; align-items: flex-start; background: var(--accent-tint); border: 1px solid #E6CDB8; border-left: 4px solid var(--copper); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; font-size: 14px; line-height: 1.5; }
.tabtip-ex { display: block; color: var(--muted); margin-top: 2px; }
.tabtip-act { display: flex; gap: 12px; white-space: nowrap; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
html.tips-off .tabtip { display: none; }
.help-list li { margin: 4px 0; }
.help-table td { vertical-align: top; }
@media (max-width: 640px) { .tabtip { flex-direction: column; gap: 6px; } }
.flash.flash-float { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; margin: 0; box-shadow: 0 6px 24px rgba(20,13,10,.25); transition: opacity .6s; max-width: calc(100vw - 32px); }
.flash.flash-out { opacity: 0; pointer-events: none; }
.btn.danger-link { color: var(--bad); border-color: #E6C4BF; }
.btn.danger-link:hover { background: var(--bad-bg); }
form.inline { display: inline; }
.form-section { margin: 6px 0 -4px; padding-top: 8px; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.tel-wrap { display: flex; gap: 8px; }
.tel-wrap .tel-cc { flex: 0 0 auto; width: 104px; }
.tel-wrap input { flex: 1 1 auto; min-width: 0; }
.profile-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 28px; }
.profile-groups .h3 { margin-top: 4px; }

/* larger logo and "Management System" line (owner request 2026-10-24) */
.band-row .wordmark { font-size: 42px; }
.brand { gap: 11px; }
.brand .band-sub { font-size: 14.5px; }
@media (max-width: 640px) { .band-row .wordmark { font-size: 27px; } .brand { gap: 8px; } .brand .band-sub { font-size: 12px; } }
.progress-field .pp-row { display: flex; align-items: center; gap: 14px; }
.progress-field input[type="range"] { flex: 1; accent-color: var(--accent); min-height: 32px; padding: 0; border: 0; background: none; }
.progress-field .pp-val { min-width: 52px; font-weight: 600; font-size: 18px; text-align: right; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pp-chips .chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.pp-chips .chip:hover { border-color: var(--accent); color: var(--accent); }
.cam-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.cam-btn { font-size: 15px; padding: 10px 16px; }
.cam-list { flex: 1 1 200px; }
/* every tab button the same height, even when one label wraps onto two lines */
.tabs { grid-auto-rows: 1fr; }

/* in-portal PDF viewer: light bar, white page background */
body.pdfview { background: #FFFFFF; margin: 0; color: var(--ink); }
.pv-bar { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 10px 14px 10px; padding-top: max(10px, env(safe-area-inset-top)); }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pv-actions { display: flex; gap: 8px; }
.pv-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); border-radius: 999px;
  padding: 8px 14px; font: 600 14px var(--f-body); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pv-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pv-back { border-color: transparent; padding-left: 4px; color: var(--accent); }
.pv-main { background: var(--accent); border-color: var(--accent); color: #fff; }
.pv-name { margin-top: 8px; font: 600 15px/1.35 var(--f-body); color: var(--ink); word-break: break-word; }
.pv-info { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
#pv-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px 8px 40px; background: #FFFFFF; }
.pv-page { background: #fff; border: 1px solid #E6DED6; box-shadow: 0 1px 6px rgba(42,28,21,.10); max-width: 100%; }
.pv-msg { color: var(--muted); padding: 40px 16px; text-align: center; }
@media (max-width: 480px) { .pv-btn { padding: 7px 11px; font-size: 13px; } .pv-ghost { padding: 7px 9px; } .pv-ghost span { display: none; } }
.client-name { font-weight: 600 !important; }

/* Tabs on a light SarayDar sand strip under the dark header (owner request 2026-10-24) */
.band .tabs { position: relative; margin-top: 4px; padding: 12px 0 12px; background: #EFE4D8;
  box-shadow: 0 0 0 100vmax #EFE4D8; clip-path: inset(0 -100vmax); border-bottom: 1px solid #E0D2C6; }
.band .tabs a { background: #FCF9F6; border: 1px solid #DCCBBC; color: #4A3A31; }
.band .tabs a:hover { border-color: var(--copper); color: var(--accent); background: #fff; }
.band .tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #FFF8F2; font-weight: 600; }
.band .tabs { margin-bottom: -1px; }
.band:has(.tabs) { border-bottom: 0; }
/* Desktop uses the full screen width (owner request 2026-10-25): no fixed 1280 px column, just a comfortable side margin */
.wrap { max-width: none; padding-left: max(clamp(16px, 2.5vw, 48px), env(safe-area-inset-left)); padding-right: max(clamp(16px, 2.5vw, 48px), env(safe-area-inset-right)); }
