/* The look follows the Yared website theme at yared.sa/wp: black, gold and paper, thin rules, square corners, a triangle lattice. */
@font-face { font-family: 'Araboto'; src: url('../assets/fonts/Araboto-Normal.ttf') format('truetype'); font-weight: 300 400; font-display: swap; }
@font-face { font-family: 'Araboto'; src: url('../assets/fonts/Araboto-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Araboto'; src: url('../assets/fonts/Araboto-Bold.ttf') format('truetype'); font-weight: 600 700; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #000;
  --surface: #0b0b0b;
  --surface-2: #161616;
  --gold: #dbb778;
  --gold-light: #ecd09a;
  --gold-text: #dbb778;
  --on-gold: #000;
  --paper: #f3f9ef;
  --muted: #a9a9a3;
  --rule: #262626;
  --rule-strong: #444;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --font-strong: 600;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --chart-a: #5b8fd6;
  --chart-b: #b8862f;
  --ok: #8fd3ab;
  --warn: #ecd09a;
  --bad: #f2998c;
  --info: #9cc3ee;
  --font: 'Cairo', system-ui, sans-serif;
  --font-en: 'Araboto', 'Cairo', system-ui, sans-serif;
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104'%3E%3Cpath d='M0 0h120M0 104h120M-60 104L0 0l60 104L120 0l60 104M0 0l60 104L120 0' fill='none' stroke='%23dbb778' stroke-width='.6' stroke-opacity='.16'/%3E%3C/svg%3E");
  --lattice-strong: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104'%3E%3Cpath d='M0 0h120M0 104h120M-60 104L0 0l60 104L120 0l60 104M0 0l60 104L120 0' fill='none' stroke='%23dbb778' stroke-width='.7' stroke-opacity='.5'/%3E%3Cpath d='M46 23h28L60 47z' fill='%23dbb778' fill-opacity='.55'/%3E%3C/svg%3E");
}
html[lang='en'] { --font-strong: 700; }

/* Light mode: gold stays for fills, but text uses a darker gold so it stays readable. */
:root[data-theme='light'] {
  color-scheme: light;
  --ink: #f3f9ef;
  --surface: #e8efe3;
  --surface-2: #dde6d7;
  --gold: #c79b52;
  --gold-text: #7a5a22;
  --gold-light: #5f4818;
  --on-gold: #0a0a0a;
  --paper: #0a0a0a;
  --muted: #55554f;
  --rule: #cfd6ca;
  --rule-strong: #a3a79a;
  --chart-a: #2f5f9a;
  --chart-b: #b8862f;
  --ok: #1f7a4d;
  --warn: #7a5a22;
  --bad: #b23a30;
  --info: #2a6099;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 400 15px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
[lang='en'] body { font-family: var(--font-en); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 2.8vw, 36px); line-height: 1.25; font-weight: var(--font-strong); }
h2 { font-size: 16px; line-height: 1.4; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--gold-light); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lattice { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--lattice) center / 120px 104px; -webkit-mask-image: radial-gradient(70% 60%, #000 0%, transparent 78%); mask-image: radial-gradient(70% 60%, #000 0%, transparent 78%); }
#app { position: relative; z-index: 1; }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 16px;
  border: 1px solid var(--rule-strong); background: transparent; font-weight: 500; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color .4s var(--ease), color .4s var(--ease), background .4s var(--ease);
}
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.small-btn { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-text); font-weight: 500; cursor: pointer; text-decoration: none; font-size: 14px; }
.link-btn:hover { color: var(--gold-light); text-decoration: underline; text-underline-offset: 3px; }
label.field { display: block; margin-bottom: 14px; font-weight: 500; font-size: 14px; }
label.field > span { display: block; margin-bottom: 5px; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='date'], input[type='file'], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: 0; background: var(--ink); font-weight: 400; transition: border-color .4s var(--ease);
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--gold); }
select option { background: var(--surface); }
input[type='file']::file-selector-button { font: inherit; color: var(--paper); background: transparent; border: 1px solid var(--rule-strong); padding: 3px 10px; margin-inline-end: 10px; cursor: pointer; }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-bottom: 14px; }
.check input { margin-top: 5px; accent-color: var(--gold); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin-bottom: 8px; }
.check-grid .check { margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--bad); font-size: 14px; margin-bottom: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Login: the website's full-photo hero. The photo side stays dark in both themes, as it does on the site. */
.login { position: relative; min-height: 100vh; min-height: 100svh; display: flex; overflow: hidden; isolation: isolate; background: #000; }
.login-bg { position: absolute; inset: 0; z-index: -3; background: #000 url('https://yared.sa/wp/wp-content/uploads/2026/10/hero-diriyah.webp') 50% 100% / cover no-repeat; opacity: .6; }
.login-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(to top, #000 4%, rgba(0, 0, 0, .35) 45%, rgba(0, 0, 0, .65) 100%); }
.login-lattice { position: absolute; inset: 0; z-index: -1; background: var(--lattice-strong) center / 120px 104px; -webkit-mask-image: radial-gradient(ellipse 62% 95% at 18% 48%, #000 18%, transparent 78%); mask-image: radial-gradient(ellipse 62% 95% at 18% 48%, #000 18%, transparent 78%); }
[dir='ltr'] .login-lattice { -webkit-mask-image: radial-gradient(ellipse 62% 95% at 82% 48%, #000 18%, transparent 78%); mask-image: radial-gradient(ellipse 62% 95% at 82% 48%, #000 18%, transparent 78%); }
.login-top { position: absolute; top: 20px; inset-inline-end: var(--gutter); z-index: 3; display: flex; gap: 8px; color: #f3f9ef; }
.login-inner { width: min(100% - 2 * var(--gutter), 1500px); margin-inline: auto; padding-block: 84px clamp(2rem, 6vh, 4rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.login-copy { display: grid; gap: 1.25rem; color: #f3f9ef; animation: rise 1s var(--ease) both; }
.logo-login { display: block; width: 210px; height: auto; margin-bottom: clamp(1rem, 8vh, 5rem); filter: drop-shadow(rgba(219, 183, 120, .18) 0 0 32px); }
.login-copy .kicker { color: #dbb778; }
.login-copy h1 { color: #f3f9ef; font-size: clamp(2.5rem, 6vw, 5.4rem); line-height: 1.12; font-weight: var(--font-strong); max-width: 11ch; }
.login-copy p:last-child { color: #b9b9b3; max-width: 46ch; font-size: clamp(1rem, 1.3vw, 1.15rem); }
.login-panel { background: var(--surface); border: 1px solid var(--rule); border-block-start: 3px solid var(--gold); padding: 22px 24px 18px; animation: rise 1s .15s var(--ease) both; }
.login-panel h2 { font-size: 20px; margin-bottom: 14px; }
.demo { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--rule); text-align: center; }
.demo h2 { font-weight: 400; font-size: 14px; margin: 0; }
.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; row-gap: 8px; }
.demo-btn { padding: 4px; background: none; border: 0; border-inline-start: 1px solid var(--rule); cursor: pointer; line-height: 1.35; transition: color .4s var(--ease); }
.demo-btn:nth-child(odd) { border-inline-start: 0; }
.demo-btn strong { display: block; font-size: 13px; font-weight: 500; }
.demo-btn span { font-size: 12px; color: var(--muted); }
.demo-btn:hover strong { color: var(--gold-text); }
.notice { margin-top: 12px; color: var(--muted); font-size: 12px; text-align: center; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 12px, 0); } }

/* App shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 0 14px; background: var(--ink); border-inline-end: 1px solid var(--rule); }
.side-brand { padding: 2px 20px 18px; }
.logo-side { display: block; width: 180px; height: auto; }
.side-brand small { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 20px; color: var(--paper); text-decoration: none; font-size: 14px; border-inline-start: 2px solid transparent; transition: color .4s var(--ease); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { color: var(--gold-light); }
.nav a.active { color: var(--gold-text); border-inline-start-color: var(--gold); }
.badge { margin-inline-start: auto; min-width: 20px; padding: 0 6px; background: var(--gold); color: var(--on-gold); font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.side-foot { border-top: 1px solid var(--rule); padding: 12px 20px 0; font-size: 13px; }
.side-user { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.side-user div { min-width: 0; line-height: 1.35; }
.side-user small { display: block; color: var(--muted); }
.proto-tag { margin-top: 6px; font-size: 11px; color: var(--muted); }
.main { padding: 30px 36px 56px; min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mobile-bar { display: none; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--rule); }
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 10px; }
.section { margin-bottom: 20px; }
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 24px 0 8px; }
.section-title .count { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; align-content: start; }

/* KPI strip: the website's countdown cells */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 22px; border-block: 1px solid var(--rule); }
.kpi { padding: 12px 16px; text-decoration: none; display: block; text-align: center; background: none; border: 0; border-inline-start: 1px solid var(--rule); }
.kpi:first-child { border-inline-start: 0; }
a.kpi:hover .value { color: var(--gold-light); }
.kpi .value { font-size: clamp(24px, 2.5vw, 32px); white-space: nowrap; line-height: 1.3; font-weight: 300; font-variant-numeric: tabular-nums; transition: color .4s var(--ease); }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi.alert .value { color: var(--bad); }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 22px; border: 1px solid var(--rule-strong); color: var(--muted); }
.pill.doing, .pill.pending { border-color: currentColor; color: var(--info); }
.pill.blocked, .pill.late, .pill.rejected { border-color: currentColor; color: var(--bad); }
.pill.review, .pill.planned { border-color: currentColor; color: var(--warn); }
.pill.done, .pill.approved { border-color: currentColor; color: var(--ok); }
.pill.high { border: 0; color: var(--gold-text); padding: 0; }
.pill.hold { border-style: dashed; color: var(--gold-text); border-color: currentColor; }

/* Rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--rule); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; min-height: 52px; }
.row-main { min-width: 0; flex: 1; }
.row-title { background: none; border: 0; padding: 0; text-align: start; font-weight: 500; cursor: pointer; display: block; line-height: 1.5; transition: color .4s var(--ease); }
.row-title:hover { color: var(--gold-light); }
.row-sub { color: var(--muted); font-size: 13px; }
.row-meta { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.avatar { width: 28px; height: 28px; flex: none; display: inline-grid; place-items: center; color: var(--gold-text); font-size: 12px; font-weight: 600; border: 1px solid var(--rule-strong); }
.empty { padding: 26px 18px; text-align: center; color: var(--muted); }
.cta-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; margin-bottom: 16px; border: 1px solid var(--gold); color: var(--gold-light); flex-wrap: wrap; }
.cta-banner.bad { border-color: var(--bad); color: var(--bad); }
.cta-banner.good { border-color: var(--rule-strong); color: var(--ok); }

/* Stage rail */
.rail { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.rail i { display: block; height: 3px; background: var(--rule); position: relative; overflow: hidden; }
.rail i.done { background: var(--paper); }
.rail i b { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--gold); display: block; }
.rail-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.rail-step { font-size: 12px; line-height: 1.4; padding-top: 7px; border-top: 3px solid var(--rule); color: var(--muted); }
.rail-step.done { border-color: var(--paper); color: var(--paper); }
.rail-step.current { border-color: var(--gold); color: var(--gold-text); font-weight: 600; }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.project-card { display: block; padding: 16px 18px; text-decoration: none; transition: border-color .4s var(--ease); }
.project-card:hover { border-color: var(--gold); }
.project-card .rail { margin: 14px 0 8px; }
.split { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.split strong { color: var(--paper); font-weight: 600; }
.health-row { display: grid; grid-template-columns: minmax(130px, 1.1fr) minmax(90px, 1.5fr) 46px; align-items: center; gap: 12px; padding: 9px 18px; text-decoration: none; }
.health-row:hover strong { color: var(--gold-light); }
.health-row small { display: block; color: var(--muted); font-size: 12px; }
.health-pct { text-align: end; font-weight: 400; font-variant-numeric: tabular-nums; }
.crumb { display: inline-block; margin-bottom: 8px; font-size: 14px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--gold-light); }
details.stage-block { background: var(--surface); border: 1px solid var(--rule); margin-bottom: 10px; }
details.stage-block summary { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 18px; cursor: pointer; font-weight: 600; }
details.stage-block[open] summary { border-bottom: 1px solid var(--rule); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: end; }
.meter { height: 3px; background: var(--rule); overflow: hidden; margin: 10px 0 8px; }
.meter b { display: block; height: 100%; background: var(--gold); }
.meter b.bad { background: var(--bad); }

/* Gate checklist and sign-off chain */
.checks { list-style: none; margin: 0 0 12px; padding: 0; font-size: 14px; }
.checks li { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.checks .tick { flex: none; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid var(--rule-strong); color: transparent; font-size: 12px; line-height: 1; }
.checks .ok .tick { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.checks .next .tick { border-color: var(--gold); }
.checks .next { color: var(--gold-light); }
.checks .grow { flex: 1; min-width: 0; }
.checks small { display: block; color: var(--muted); font-size: 12px; }
.panel-label { font-size: 12px; color: var(--muted); margin: 10px 0 2px; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.chain .ok { color: var(--ok); }
.chain .next { color: var(--gold-light); font-weight: 600; }
.chain i { font-style: normal; color: var(--rule-strong); }

/* Documents */
.doc-type { flex: none; width: 40px; height: 28px; display: grid; place-items: center; border: 1px solid var(--rule-strong); color: var(--gold-text); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.icon-btn { flex: none; width: 32px; height: 32px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); transition: color .4s var(--ease); }
.icon-btn:hover { color: var(--gold-light); }
.icon-btn svg { width: 17px; height: 17px; }
.attach { list-style: none; margin: 6px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.attach button { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 1px solid var(--rule-strong); padding: 1px 8px; font-size: 12px; cursor: pointer; transition: border-color .4s var(--ease), color .4s var(--ease); }
.attach button:hover { border-color: var(--gold); color: var(--gold-light); }
.file-btn { position: relative; cursor: pointer; }
.file-btn:focus-within { outline: 1px solid var(--gold-light); outline-offset: 2px; }
.attach-block { margin: 14px 0; }

/* Board */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.toolbar select { min-height: 36px; width: auto; max-width: 210px; color: var(--paper); }
.board { display: grid; grid-template-columns: repeat(5, minmax(176px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.column { background: var(--surface); border: 1px solid var(--rule); padding: 10px; min-height: 280px; }
.column.over { border-color: var(--gold); }
.column h2 { display: flex; justify-content: space-between; font-size: 14px; margin: 0 2px 9px; }
.column h2 span { font-weight: 400; color: var(--muted); }
.task-card { display: block; width: 100%; text-align: start; padding: 10px 11px; margin-bottom: 8px; background: var(--ink); border: 1px solid var(--rule); cursor: grab; transition: border-color .4s var(--ease); }
.task-card:hover { border-color: var(--gold); }
.task-card.dragging { opacity: .45; }
.task-card .t { display: block; font-weight: 500; font-size: 14px; line-height: 1.5; }
.task-card .p { display: block; color: var(--muted); font-size: 12px; margin: 2px 0 7px; }
.task-card .m { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.task-card .avatar { width: 24px; height: 24px; font-size: 11px; }

/* Approvals, reports, ideas */
.approval { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 13px 18px; flex-wrap: wrap; }
.approval-main { min-width: 220px; flex: 1; }
.approval-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.money { font-weight: 600; font-variant-numeric: tabular-nums; }
.report { padding: 14px 18px; }
.report-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; flex-wrap: wrap; }
.issue { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 8px 11px; border-inline-start: 2px solid var(--bad); background: var(--surface-2); font-size: 14px; flex-wrap: wrap; }
.idea { display: flex; gap: 14px; padding: 13px 18px; align-items: flex-start; }
.vote { flex: none; width: 66px; padding: 6px 2px; border: 1px solid var(--rule-strong); background: none; cursor: pointer; line-height: 1.3; font-size: 11px; text-align: center; transition: border-color .4s var(--ease); }
.vote:hover { border-color: var(--gold); }
.vote strong { display: block; font-size: 18px; font-weight: 300; }
.vote.on { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.idea-actions { display: flex; gap: 12px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.idea-form { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; flex-wrap: wrap; }
.idea-form textarea { flex: 1 1 260px; min-height: 42px; }

/* Insights */
.recs { list-style: none; margin: 0; padding: 0; counter-reset: rec; }
.rec { display: flex; gap: 12px; padding: 12px 18px; align-items: center; counter-increment: rec; border-top: 1px solid var(--rule); }
.rec-main { flex: 1; min-width: 0; }
.rec-main strong { font-weight: 500; display: block; line-height: 1.5; }
.chart { padding: 0 18px 16px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 0 18px 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; display: inline-block; }
.bar-row { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 3px 0; font-size: 13px; min-height: 28px; }
.bar-row .v { text-align: end; font-weight: 500; font-variant-numeric: tabular-nums; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: flex; gap: 2px; height: 16px; }
.bar { height: 100%; min-width: 3px; transition: opacity .1s; }
.bar-track .bar:hover { opacity: .8; }
.pair { padding: 7px 0; }
.pair + .pair { border-top: 1px solid var(--rule); }
.pair-name { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; margin-bottom: 4px; gap: 8px; }
.pair-bars { display: grid; gap: 2px; }
.pair-line { display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; gap: 8px; }
.pair-line .bar-track { height: 8px; background: var(--surface-2); }
.pair-line .v { font-size: 12px; text-align: end; color: var(--muted); font-variant-numeric: tabular-nums; }
.playbook { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.play { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.play p { font-size: 14px; color: var(--muted); flex: 1; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: start; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 10px 18px; border-bottom: 1px solid var(--rule); }
tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 9px; font-weight: 500; white-space: nowrap; }
td.bad-num { color: var(--bad); font-weight: 600; }

/* Modal and toast */
dialog#modal { width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--paper); }
dialog::backdrop { background: rgba(0, 0, 0, .72); }
dialog#modal.wide { width: min(920px, calc(100vw - 24px)); }
.preview { display: grid; place-items: center; min-height: 240px; background: var(--ink); border: 1px solid var(--rule); }
.preview-frame { display: block; width: 100%; height: min(65vh, 620px); border: 0; background: #fff; }
.preview-image { display: block; max-width: 100%; max-height: 65vh; }
.preview-none { padding: 40px 20px; color: var(--muted); text-align: center; }
.office-preview { width: 100%; align-self: stretch; }
.preview-tabs { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.preview-tabs select { width: auto; min-height: 34px; max-width: 280px; color: var(--paper); }
.preview-note { padding: 6px 10px; border-top: 1px solid var(--rule); }
.preview-note:empty { display: none; }
.doc-sheet { position: relative; width: min(420px, calc(100% - 32px)); margin: 20px auto; padding: 36px 30px; background: #fff; color: #141414; border: 1px solid #d8dccf; }
.doc-sheet h3 { font-size: 20px; font-weight: 500; margin-bottom: 8px; }
.doc-sheet p { color: #5c6056; }
.doc-sheet hr { border: 0; border-top: 1px solid #d8dccf; margin: 18px 0; }
.sheet-stamp { display: inline-block; margin-bottom: 18px; padding: 0 8px; border: 1px solid #806126; color: #806126; font-size: 12px; line-height: 22px; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 16px 20px 12px; background: var(--surface); border-bottom: 1px solid var(--rule); }
.modal-head h2 { font-size: 18px; font-weight: 500; color: var(--gold-text); }
.modal-body { padding: 16px 20px 20px; }
.task-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.block-note, .wait-note, .fix-note { padding: 8px 12px; font-size: 14px; margin-bottom: 14px; background: var(--surface-2); border-inline-start: 2px solid var(--bad); }
.wait-note { border-inline-start-color: var(--gold); }
.fix-note { border-inline-start-color: var(--ok); }
.comments { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 10px; }
.comments li { display: flex; gap: 9px; font-size: 14px; }
.comments small { color: var(--muted); font-size: 12px; }
#toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 50; max-width: min(90vw, 480px); padding: 10px 16px; background: var(--gold); color: var(--on-gold); font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .4s var(--ease); }
[dir='rtl'] #toast { transform: translateX(50%); }
#toast.show { opacity: 1; }

/* Signature details from the website's theme */
.kicker { display: inline-flex; align-items: center; gap: .75rem; color: var(--gold-text); font-weight: 500; font-size: 14px; }
.kicker::before { content: ''; width: 2.2rem; height: 1px; background: currentColor; }
.page-head .kicker { margin-bottom: 4px; }
.btn:hover { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn.danger:hover { background: none; }
.btn.primary { position: relative; overflow: hidden; isolation: isolate; }
.btn.primary::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--paper); clip-path: inset(0 0 0 100%); transition: clip-path .7s var(--ease); }
[dir='ltr'] .btn.primary::before { clip-path: inset(0 100% 0 0); }
.btn.primary:hover::before, .btn.primary:focus-visible::before { clip-path: inset(0); }
.btn.primary:hover, .btn.primary:focus-visible { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 36px; background: color-mix(in srgb, var(--ink) 82%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--rule); }
.tool-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); background: none; cursor: pointer; font-weight: 500; font-size: 13.6px; transition: border-color .3s, background-color .3s; }
.tool-btn:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.tool-btn svg { width: 18px; height: 18px; }

.arrow-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--rule); transition: background-color .5s var(--ease), border-color .5s, color .5s; }
.arrow-btn svg { width: 19px; height: 19px; }
[dir='ltr'] .arrow-btn svg { transform: scaleX(-1); }
.rec:hover .arrow-btn, .arrow-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.rec::before { content: counter(rec, decimal-leading-zero); flex: none; width: 2.2rem; color: var(--gold-text); font-weight: 500; font-variant-numeric: tabular-nums; }
.rec, .rows > li > .row { transition: background-color .5s var(--ease); }
.rec:hover, .rows > li > .row:hover { background: var(--surface-2); }
.play .n { color: var(--gold-text); font-weight: 500; font-size: 15px; line-height: 1.2; }

@media (max-width: 860px) {
  .login-inner { grid-template-columns: minmax(0, 1fr); padding-block: 72px 24px; align-items: start; gap: 1.5rem; }
  .login-copy { gap: .6rem; }
  .logo-login { width: 140px; margin-bottom: .5rem; }
  .login-copy h1 { font-size: 2.3rem; }
  .topbar { display: none; }
  .mobile-bar { position: sticky; top: 0; z-index: 15; }
  .tool-btn { width: 36px; height: 36px; }
}

[data-theme='light'] dialog::backdrop { background: rgba(0, 0, 0, .45); }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
  .rule i { display: none; }
}

/* Phone: site engineers use this on site, so navigation moves to the thumb. */
@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 16px 16px 92px; }
  h1 { font-size: 23px; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--rule); background: var(--ink); }
  .logo-side { width: 136px; }
  .mobile-bar .m-actions { display: flex; gap: 12px; }
  .bottom-nav { position: fixed; z-index: 20; inset-inline: 0; bottom: 0; display: flex; overflow-x: auto; background: var(--ink); border-top: 1px solid var(--rule); padding: 4px; gap: 2px; scrollbar-width: none; }
  .bottom-nav a { flex: 1 0 70px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--paper); text-decoration: none; font-size: 11px; white-space: nowrap; border-top: 2px solid transparent; }
  .bottom-nav a svg { width: 20px; height: 20px; }
  .bottom-nav a.active { color: var(--gold-text); border-top-color: var(--gold); }
  .bottom-nav .badge { position: absolute; top: 1px; inset-inline-end: 8px; margin: 0; min-width: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  .grid-2, .grid-even { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(odd) { border-inline-start: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x proximity; }
  .column { scroll-snap-align: start; }
  .row { flex-wrap: wrap; padding-inline: 14px; }
  .row-main { flex-basis: calc(100% - 44px); }
  .row-meta { justify-content: flex-start; width: 100%; padding-inline-start: 40px; }
  .row > .row-main:first-child { flex-basis: 100%; }
  .row > .row-main:first-child + .row-meta { padding-inline-start: 0; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rail-step { font-size: 0; padding-top: 0; }
  .rail-step.current { font-size: 12px; padding-top: 6px; white-space: nowrap; }
  .rec { flex-wrap: wrap; }
  .bar-row { grid-template-columns: minmax(84px, 110px) minmax(0, 1fr) 30px; }
  #toast { bottom: 84px; }
}
@media (min-width: 861px) { .bottom-nav { display: none; } }

/* Required fields, "Other" boxes and SLA counters */
.login-panel label.field:has(:required) > span::after, form:not([data-form$='comment']) label.field:has(:required) > span::after { content: ' *'; color: var(--bad); }
.other-field[hidden] { display: none; }
.required-note { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.sla { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 22px; border: 1px solid var(--rule-strong); color: var(--paper); }
.sla bdi { font-variant-numeric: tabular-nums; }
.sla.warn { border-color: var(--warn); color: var(--warn); }
.sla.over { border-color: var(--bad); color: var(--bad); }
.sla.met { border-color: var(--ok); color: var(--ok); }
.sla.paused { border-style: dashed; color: var(--muted); }
.card-sla { display: block; margin-top: 7px; }
.sla-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; border-block: 1px solid var(--rule); }
.sla-panel > div { display: grid; gap: 2px; justify-items: center; align-content: start; padding: 8px 6px; border-inline-start: 1px solid var(--rule); text-align: center; }
.sla-panel > div:first-child { border-inline-start: 0; }
.sla-panel span:not(.sla) { font-size: 12px; color: var(--muted); }
.sla-panel strong { font-weight: 300; font-size: 20px; line-height: 1.4; }

/* Sign-in steps and Governance pages */
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.auth-info { color: var(--ok); font-size: 14px; margin-bottom: 12px; }
.test-outbox { margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--gold); font-size: 13px; }
.test-label { color: var(--gold-text); font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.test-outbox p { color: var(--muted); }
.pw-rules { list-style: none; margin: -4px 0 12px; padding: 0; font-size: 12px; color: var(--muted); }
.pw-rules li::before { content: '– '; }
.pw-rules li.miss { color: var(--bad); }
.privacy-text { display: grid; gap: 8px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.chips { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding-inline: 14px; border: 1px solid var(--rule); font-size: 14px; text-decoration: none; transition: background-color .4s var(--ease), border-color .4s var(--ease), color .4s; }
.chip:hover, .chip.on { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }

/* Show and hide password */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle { position: absolute; top: 0; right: 0; width: 44px; height: 100%; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; transition: color .4s var(--ease); }
.pw-toggle:hover { color: var(--gold-text); }
.pw-toggle svg { width: 19px; height: 19px; }

/* Settings: people list. Actions wrap under the name so they're always reachable. */
.user-row { flex-wrap: wrap; }
.user-row .row-main { flex: 1 1 260px; min-width: 0; }
.user-row .row-sub bdi { overflow-wrap: anywhere; }
.user-actions { display: flex; flex-wrap: wrap; gap: 8px; }
