/* Waha Hub · Waha Expo identity: night, sand, gold (brand) and the emblem's navy. */
:root {
  --night: #0a0a0b;
  --stage: #141416;
  --sand: #f4f1ea;
  --gold: #f2b33d;
  --gold-hi: #ffc95c;
  --gold-deep: #9a6a10;
  --navy: #143a4e;

  --bg: #f8f8f6;
  --panel: #ffffff;
  --ink: #17191b;
  --muted: #6e6a62;
  --line: #e6e1d6;
  --accent: var(--navy);
  --accent-ink: #ffffff;
  --accent-soft: #e5edf1;
  --gold-soft: #fdf2d8;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --warn: #9a6a10;
  --warn-soft: #fdf2d8;
  --good: #1a7f4b;
  --good-soft: #e5f4ec;
  --grey-soft: #f0ede6;
  --side: var(--night);
  --side-ink: #a39e93;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(10, 10, 11, .05), 0 2px 8px rgba(10, 10, 11, .04);
  --font: "Archivo", "Alexandria", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.55 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
.muted { color: var(--muted); font-weight: normal; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.err { color: var(--bad); }
.empty { color: var(--muted); padding: 10px 0; margin: 0; }
.icon { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- app frame: white top bar, module tabs ---------- */
body.app { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(10, 10, 11, .04); }
.topbar-row { display: flex; align-items: center; gap: 10px; padding: 10px 28px; max-width: 1480px; margin: 0 auto; }
.home-logo { display: flex; align-items: center; padding-inline-end: 12px; margin-inline-end: 2px; border-inline-end: 1px solid var(--line); }
.home-logo img { height: 38px; width: auto; display: block; }
.module-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--ink); }
.module-name:hover { text-decoration: none; color: var(--navy); }
.module-name .icon { color: var(--gold-deep); }
.topbar-spacer { flex: 1; }
.module-tabs { display: flex; gap: 4px; padding: 0 28px; max-width: 1480px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.module-tabs a { padding: 10px 14px 11px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.module-tabs a:hover { color: var(--ink); text-decoration: none; }
.module-tabs a.on { color: var(--navy); border-bottom-color: var(--gold); }
.badge { background: var(--gold); color: var(--night); border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; line-height: 18px; min-width: 18px; text-align: center; display: inline-block; font-style: normal; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.icon-btn .badge { position: absolute; top: -6px; inset-inline-end: -6px; }
.avatar-btn { list-style: none; cursor: pointer; }
.avatar-btn::-webkit-details-marker { display: none; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel {
  position: absolute; inset-inline-start: 0; top: calc(100% + 8px); z-index: 40; width: 340px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 16px 40px rgba(10, 10, 11, .14);
}
.dropdown-panel.right { inset-inline-start: auto; inset-inline-end: 0; }
.dropdown-title { margin: 6px 10px 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.dropdown-panel > a, .dropdown-panel > button, .dropdown-panel form button {
  display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 10px; color: var(--ink);
  background: none; border: 0; font: inherit; text-align: start; cursor: pointer;
}
.dropdown-panel > a:hover, .dropdown-panel > button:hover, .dropdown-panel form button:hover { background: var(--grey-soft); text-decoration: none; }
.dropdown-panel .quick { align-items: flex-start; }
.dropdown-panel .quick .icon { color: var(--gold-deep); margin-top: 2px; }
.dropdown-panel .quick small { display: block; color: var(--muted); font-size: 12px; }
.dropdown-panel .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown-panel .who small { display: block; color: var(--muted); }
.user-menu .dropdown-panel { width: 280px; }
.apps-panel { width: 380px; }
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.app-mini { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: center; }
.app-mini:hover { background: var(--grey-soft); text-decoration: none; }
.app-mini .icon { color: var(--navy); }
.app-mini .badge { position: absolute; top: 6px; inset-inline-end: 10px; }

main { padding: 22px 28px 64px; min-width: 0; max-width: 1480px; margin: 0 auto; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head h1 small { font-size: 15px; font-weight: 500; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs span::before { content: "\203A"; margin-inline-end: 6px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top-actions form { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2.wide-left { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.grid2.wide-right { grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); }
.grid2 > * { min-width: 0; }

/* ---------- home: module tiles ---------- */
.app-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 22px; }
.app-tile { position: relative; display: flex; gap: 14px; align-items: center; padding: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; color: var(--ink); box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.app-tile:hover { text-decoration: none; border-color: var(--gold); transform: translateY(-1px); }
.app-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.app-text strong { display: block; font-size: 15px; }
.app-text small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.app-tile .badge { position: absolute; top: 10px; inset-inline-end: 10px; }
.c-navy .app-icon { background: #e5edf1; color: var(--navy); }
.c-gold .app-icon { background: var(--gold-soft); color: var(--gold-deep); }
.c-green .app-icon { background: var(--good-soft); color: var(--good); }
.c-purple .app-icon { background: #efe9f7; color: #6b4ba1; }
.c-teal .app-icon { background: #e3f3f2; color: #1d7a74; }
.c-red .app-icon { background: var(--bad-soft); color: var(--bad); }
.c-grey .app-icon { background: var(--grey-soft); color: var(--muted); }
.upcoming { margin: 0 0 10px; }
.event-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.event-row:last-child { border-bottom: 0; }
.event-row:hover { text-decoration: none; }
.event-row:hover strong { color: var(--navy); }

/* ---------- components ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  margin-bottom: 16px; box-shadow: var(--shadow); overflow-x: auto;
}
.card > h2:first-child, .card > .row-between:first-child { margin-top: 0; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); border-radius: 10px; padding: 8px 15px; font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: border-color .12s, background .12s, transform .05s;
}
.btn:hover { text-decoration: none; border-color: var(--navy); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--night); }
.btn.primary:hover { background: var(--gold-hi); border-color: var(--gold-hi); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 11px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 11px 26px; font-size: 15px; }
.btn.wide { width: 100%; justify-content: center; }
button.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--accent); }
.flash .msg, .msg { padding: 11px 14px; border-radius: 10px; margin: 0 0 12px; background: var(--accent-soft); border: 1px solid transparent; }
.msg.error { background: var(--bad-soft); color: var(--bad); }
.msg.success { background: var(--good-soft); color: var(--good); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--ink);
  box-shadow: var(--shadow); display: block;
}
a.stat:hover { text-decoration: none; border-color: var(--navy); }
.stat b { display: block; font-size: 26px; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.bad { border-color: #f2c6c1; background: var(--bad-soft); }
.stat.bad b { color: var(--bad); }
.stat.warn { border-color: #f1d9a3; background: var(--warn-soft); }
.stat.warn b { color: var(--warn); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--grey-soft) 55%, transparent); }
.table tr:last-child td { border-bottom: 0; }
.table tr.late td:first-child { box-shadow: inset 3px 0 var(--bad); }
.table.compact td, .table.compact th { padding: 6px 8px; }

.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--grey-soft); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.s-todo { background: var(--grey-soft); }
.s-in_progress { background: var(--accent-soft); color: var(--accent); }
.s-review { background: var(--warn-soft); color: var(--warn); }
.s-done { background: var(--good-soft); color: var(--good); }
.pri { font-size: 12px; font-weight: 700; white-space: nowrap; }
.p-low { color: var(--muted); }
.p-high { color: var(--warn); }
.p-urgent, .p-critical { color: var(--bad); }
.health { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.h-green { background: var(--good-soft); color: var(--good); }
.h-amber { background: var(--warn-soft); color: var(--warn); }
.h-red { background: var(--bad-soft); color: var(--bad); }
.h-grey { background: var(--grey-soft); color: var(--muted); }
.bar { height: 6px; background: var(--grey-soft); border-radius: 999px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--navy); border-radius: 999px; }
.bar.bar-bad span { background: var(--bad); }
.bar.bar-warn span { background: var(--gold); }

.tabs { display: flex; gap: 2px; margin-bottom: 18px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a, .tabs button { padding: 9px 14px; color: var(--muted); border: 0; background: none; font: inherit; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.on, .tabs button.on { color: var(--ink); border-color: var(--gold); }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .count { font-size: 11px; background: var(--grey-soft); border-radius: 999px; padding: 0 7px; }
.filters { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters a { padding: 5px 13px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 13px; }
.filters a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.filters a:hover { text-decoration: none; color: var(--ink); }
.filters a.on:hover { color: #fff; }
.filters select, .filters input { width: auto; }
.filters.tight { margin: 0; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.alert-row { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); border-inline-start: 3px solid transparent; margin-bottom: 4px; }
.alert-row:hover { background: var(--grey-soft); text-decoration: none; }
.alert-row small { display: block; }
.alert-row.unread { background: var(--accent-soft); }
.alert-row.lvl-high { border-inline-start-color: var(--gold); }
.alert-row.lvl-critical { border-inline-start-color: var(--bad); }

.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; vertical-align: middle; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment p { margin: 4px 0 0; }
.comment.internal { background: var(--warn-soft); padding: 10px; border-radius: 10px; }
.comment.client { background: var(--accent-soft); padding: 10px; border-radius: 10px; }
.activity { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ms { margin: 0 0 8px; }
.ms.done strong { text-decoration: line-through; color: var(--muted); }
.status-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.pm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pm-head h2 { margin: 0; }
.pm-stats { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.pm-stats b { color: var(--ink); }
.pm-stats .err b { color: var(--bad); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- guide: the system takes the user by the hand ---------- */
.journey { display: flex; gap: 0; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: step; overflow-x: auto; }
.journey li { flex: 1; min-width: 110px; position: relative; padding-top: 34px; text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.journey li::before {
  counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel);
  border: 2px solid var(--line); color: var(--muted); font-weight: 700; z-index: 1; font-size: 12px;
}
.journey li::after { content: ""; position: absolute; top: 12px; inset-inline-start: calc(-50% + 13px); inset-inline-end: calc(50% + 13px); height: 2px; background: var(--line); }
.journey li:first-child::after { display: none; }
.journey li.done { color: var(--ink); }
.journey li.done::before { content: "✓"; background: var(--navy); border-color: var(--navy); color: #fff; }
.journey li.done::after, .journey li.current::after { background: var(--navy); }
.journey li.current { color: var(--ink); }
.journey li.current::before { background: var(--gold); border-color: var(--gold); color: var(--night); box-shadow: 0 0 0 5px var(--gold-soft); }
.journey li.skipped::before { content: "–"; }

.next-step {
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(90deg, var(--gold-soft), color-mix(in srgb, var(--gold-soft) 30%, var(--panel)));
  border: 1px solid #f1d9a3; border-inline-start: 5px solid var(--gold); border-radius: 14px; padding: 16px 18px; margin-bottom: 18px;
}
.next-step .ns-text { flex: 1; min-width: 240px; }
.next-step .ns-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-deep); }
.next-step h2 { margin: 2px 0 4px; font-size: 18px; }
.next-step p { margin: 0; color: var(--muted); }
.next-step .ns-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.next-step.done { background: var(--good-soft); border-color: #bfe3cd; border-inline-start-color: var(--good); }
.next-step.done .ns-label { color: var(--good); }
.next-step.blocked { background: var(--bad-soft); border-color: #f2c6c1; border-inline-start-color: var(--bad); }
.next-step.blocked .ns-label { color: var(--bad); }
.hint { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; background: var(--grey-soft); border-radius: 10px; padding: 9px 12px; margin: 0 0 12px; }
.hint .icon { color: var(--gold-deep); margin-top: 1px; }
.panel-tab[hidden] { display: none; }

/* ---------- forms ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; width: 100%; min-height: 42px; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--navy); }
input[type=file] { border-style: dashed; padding: 8px; background: var(--grey-soft); }
textarea { min-height: 84px; margin-bottom: 8px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.fields.three { grid-template-columns: 1fr 1fr 2fr; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field.check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; }
.field label { font-weight: 600; font-size: 13px; }
.field small.muted { font-size: 12px; }
.field.has-error input, .field.has-error select, .field.has-error .combo-input { border-color: var(--bad); }
.form-actions { display: flex; gap: 8px; margin-top: 18px; }
.form.card { max-width: 880px; }
aside .fields { grid-template-columns: 1fr; }
label.inline { display: inline-flex; gap: 6px; align-items: center; margin-inline-end: 12px; }
.optional { font-weight: 400; color: var(--muted); font-size: 12px; margin-inline-start: 4px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.inline-form > input, .inline-form > select { width: auto; flex: 1 1 140px; min-width: 0; }
.inline-form > input[type=file] { flex: 2 1 200px; }
.note-form { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: start; margin-bottom: 12px; }
.note-form textarea { min-height: 42px; margin: 0; }

select.enhanced { display: none; }
.combo { position: relative; }
.combo-input { padding-inline-end: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.combo-badge { position: absolute; inset-inline-end: 34px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700;
  background: var(--gold); color: var(--night); padding: 1px 8px; border-radius: 999px; pointer-events: none; }
.combo-list { position: absolute; z-index: 30; inset-inline-start: 0; inset-inline-end: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; max-height: 280px; overflow-y: auto; box-shadow: 0 12px 28px rgba(10, 10, 11, .14); }
.combo-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-list li.on { background: var(--accent-soft); color: var(--accent); }
.combo-list li.create { color: var(--gold-deep); font-weight: 700; border-top: 1px solid var(--line); margin-top: 2px; }
.combo-list li.none { color: var(--muted); cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); cursor: pointer; transition: background .12s, border-color .12s; }
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.small { font-size: 12px; padding: 3px 10px; }
.chip:disabled { opacity: .6; cursor: not-allowed; }
.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.affix { position: relative; }
.affix input { padding-inline-end: 46px; }
.affix span { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 13px; }

.deal-form { max-width: 920px; }
.form-section { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.form-section > header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.form-section h2 { margin: 0 0 2px; font-size: 17px; }
.form-section header p { margin: 0; font-size: 13px; }
.step { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--night); font-weight: 800; }
.form-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 5; }
.role-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.role-pick { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.role-pick:has(input:checked) { border-color: var(--navy); background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* ---------- login ---------- */
body.bare { min-height: 100vh; background: radial-gradient(circle at 20% 10%, var(--gold-soft), transparent 45%), #fff; }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 34px; box-shadow: 0 20px 50px rgba(10, 10, 11, .08); }
.login-logo { width: 240px; height: auto; display: block; margin: 0 auto 22px; }
.login-card h1 { font-size: 21px; margin-bottom: 4px; }
.login-card label { display: block; font-weight: 600; margin: 14px 0; }
.login-card input { margin-top: 6px; }
.login-card .btn { margin-top: 10px; }
.login-foot { color: var(--muted); font-size: 13px; margin-top: 18px; }

/* ---------- boards and gantt ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; }
.board.stages { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
.board.six { grid-template-columns: repeat(6, minmax(190px, 1fr)); }
.col { background: var(--grey-soft); border-radius: 14px; padding: 10px; min-height: 300px; }
.col.over { outline: 2px dashed var(--gold); }
.col h3 { display: flex; justify-content: space-between; margin: 2px 4px 10px; }
.col-total { margin: -8px 4px 10px; font-size: 12px; }
.drop { display: flex; flex-direction: column; gap: 8px; min-height: 240px; }
.kcard { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); cursor: grab; box-shadow: var(--shadow); }
.kcard:hover { text-decoration: none; border-color: var(--navy); }
.kcard.late { border-inline-start: 3px solid var(--bad); }
.kcard.dragging { opacity: .5; }
.money { font-weight: 700; font-variant-numeric: tabular-nums; }
.gantt { --name: 240px; }
.g-head, .g-row, .g-overlay { display: grid; grid-template-columns: var(--name) 1fr; }
.g-head { height: 26px; border-bottom: 1px solid var(--line); }
.g-body { position: relative; }
.g-overlay { position: absolute; inset: 0; pointer-events: none; }
.g-track { position: relative; min-width: 500px; }
.g-tick { position: absolute; top: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.g-line { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.g-event { position: absolute; top: 0; bottom: 0; background: var(--gold-soft); }
.g-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--bad); }
.g-row { position: relative; min-height: 34px; border-bottom: 1px solid var(--line); }
.g-name { padding: 6px 12px 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-name small { display: block; font-size: 11px; }
.g-bar { position: absolute; top: 10px; height: 14px; border-radius: 4px; background: var(--navy); min-width: 4px; }
.g-bar.s-done { background: var(--good); opacity: .55; }
.g-bar.s-review { background: var(--gold); }
.g-bar.s-todo { background: var(--muted); }
.g-bar.late { background: var(--bad); }
.legend { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 12px 0 0; }
.g-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 10px; }
.g-key.today { border-left: 2px solid var(--bad); border-radius: 0; }
.g-key.event { background: var(--gold-soft); }
.g-key.late { background: var(--bad); }
.g-key.done { background: var(--good); opacity: .55; }

/* ---------- sales, design, finance bits ---------- */
.num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tfoot td { border-bottom: 0; padding-top: 4px; padding-bottom: 4px; }
.table tfoot tr.strong td { font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between h2 { margin: 0; }
.card > .row-between { margin-bottom: 12px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.subcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.subcard h3 { margin: 0; }
.grid2.tight { gap: 12px; margin: 14px 0 8px; }
.proposal { padding: 12px 0; border-bottom: 1px solid var(--line); }
.proposal:last-of-type { border-bottom: 0; }
.warn-card { border-color: #f1d9a3; background: var(--warn-soft); }
.warn-card .row-between { padding: 6px 0; }
.render { margin-bottom: 14px; }
.render img { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--line); display: block; margin-bottom: 6px; }
.st-lead, .st-qualified { background: var(--grey-soft); }
.st-proposal, .st-negotiation { background: var(--accent-soft); color: var(--accent); }
.st-won { background: var(--good-soft); color: var(--good); }
.st-lost { background: var(--bad-soft); color: var(--bad); }
.pr-pending, .pr-rejected { background: var(--warn-soft); color: var(--warn); }
.pr-approved, .pr-sent { background: var(--accent-soft); color: var(--accent); }
.pr-signed { background: var(--good-soft); color: var(--good); }
.ds-internal_review, .ds-client_review { background: var(--warn-soft); color: var(--warn); }
.ds-in_design, .ds-revision, .ds-assigned { background: var(--accent-soft); color: var(--accent); }
.ds-approved { background: var(--good-soft); color: var(--good); }
.ds-cancelled { background: var(--grey-soft); color: var(--muted); }

.person-cell { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.person-cell:hover { text-decoration: none; }
.person-cell:hover strong { color: var(--accent); }
.page-head h1 .avatar { width: 42px; height: 42px; font-size: 14px; }
.score { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; vertical-align: middle; }
.kpi-group { margin-top: 16px; }
.kpi-group h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; border-top: 4px solid var(--line); background: var(--panel); }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 24px; line-height: 1.2; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-target { font-size: 12px; color: var(--muted); }
.kpi.k-green { border-top-color: var(--good); }
.kpi.k-amber { border-top-color: var(--gold); }
.kpi.k-red { border-top-color: var(--bad); }
.kpi.k-red .kpi-value { color: var(--bad); }
.kpi.k-grey .kpi-value { color: var(--muted); }
.score.k-green { background: var(--good-soft); color: var(--good); }
.score.k-amber { background: var(--warn-soft); color: var(--warn); }
.score.k-red { background: var(--bad-soft); color: var(--bad); }

.money-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 8px; }
.money-row > div { background: var(--grey-soft); border-radius: 12px; padding: 12px 14px; }
.money-row span { display: block; font-size: 12px; }
.money-row b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.money-row b.good { color: var(--good); }
.pay-form, .book-form { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.pay-form h3, .book-form h3 { margin: 14px 0 8px; }
.desk-steps { margin: 4px 0 8px; padding-inline-start: 20px; color: var(--muted); }
.desk-steps strong { color: var(--ink); }
.aging-row { display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; align-items: center; margin-bottom: 8px; }
.pay-received, .inv-partial, .inst-partial { background: var(--warn-soft); color: var(--warn); }
.pay-confirmed, .inv-paid, .inst-paid { background: var(--good-soft); color: var(--good); }
.pay-rejected, .inv-cancelled, .inst-overdue { background: var(--bad-soft); color: var(--bad); }
.inv-not_paid, .inst-open { background: var(--grey-soft); }
.acct-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; color: var(--ink); border: 1px solid var(--line); margin-bottom: 8px; }
.acct-row:hover { border-color: var(--navy); text-decoration: none; }
.acct-row b { font-size: 18px; }
.good-text { color: var(--good); }
.tick { border: 1px solid var(--line); background: var(--panel); color: var(--line); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; }
.tick.on { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.inline-card .inline-form { margin: 0 0 6px; }
.bill-draft, .bill-partial, .exp-submitted { background: var(--warn-soft); color: var(--warn); }
.bill-paid, .exp-paid { background: var(--good-soft); color: var(--good); }
.exp-approved { background: var(--accent-soft); color: var(--accent); }
.bill-not_paid { background: var(--grey-soft); }
.bill-rejected, .bill-cancelled, .exp-rejected { background: var(--bad-soft); color: var(--bad); }

/* ---------- My day ---------- */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 20px; }
.quick-tile { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: var(--shadow); }
.quick-tile:hover { border-color: var(--gold); text-decoration: none; }
.quick-tile .icon-wrap { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--night); color: var(--gold); flex: none; }
.quick-tile strong { display: block; font-size: 14px; }
.quick-tile small { color: var(--muted); font-size: 12px; line-height: 1.35; display: block; }
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.inbox li:last-child { border-bottom: 0; }
.inbox .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--navy); flex: none; }
.inbox .dot.high { background: var(--gold); }
.inbox .dot.critical { background: var(--bad); }
.inbox .what { flex: 1; min-width: 0; }
.inbox .what strong { display: block; }
.inbox .what small { color: var(--muted); }
.inbox .kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.all-clear { text-align: center; padding: 30px 10px; color: var(--muted); }
.all-clear b { display: block; font-size: 18px; color: var(--ink); margin-bottom: 4px; }

/* toasts (when desktop alerts are off) */
#toasts { position: fixed; inset-inline-end: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: 360px; }
.toast { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-inline-start: 4px solid var(--navy); border-radius: 12px; padding: 11px 14px; box-shadow: 0 10px 30px rgba(10, 10, 11, .18); }
.toast small { display: block; color: var(--muted); }
.toast.lvl-high { border-inline-start-color: var(--gold); }
.toast.lvl-critical { border-inline-start-color: var(--bad); }

/* ---------- small screens ---------- */
@media (max-width: 1000px) {
  .topbar-row { padding: 8px 14px; gap: 8px; }
  .home-logo img { height: 30px; }
  .module-name { font-size: 14px; }
  .module-tabs { padding: 0 14px; }
  main { padding: 16px; }
  .grid2, .grid2.wide-left, .grid2.wide-right, .fields, .fields.three, .money-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .module-name { display: none; }
  /* Menus open full-width under the top bar so nothing runs off the screen. */
  .dropdown-panel, .dropdown-panel.right, .apps-panel { position: fixed; inset-inline-start: 12px; inset-inline-end: 12px; top: 64px; width: auto; }
}

.flash-target { animation: flash-target 1.6s ease-out; }
@keyframes flash-target { 0% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
details.more > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
details.more[open] > summary { margin-bottom: 12px; }

/* task owner pickers */
.assign-form { margin: 0; }
.assign-form select { min-height: 34px; padding: 5px 8px; font-size: 13px; max-width: 220px; }
.assign-form select.unassigned { border-color: var(--gold); background: var(--gold-soft); font-weight: 600; }
.unassigned-pill { background: var(--gold-soft); color: var(--gold-deep); }

.cat-row { margin: 0; }
.cat-row input { flex: 1 1 160px; min-height: 36px; padding: 6px 10px; }

/* list search, filters and export */
.list-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.list-tools select, .list-tools input[type=date] { width: auto; min-height: 38px; padding: 6px 10px; }
.lt-search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.lt-search .icon { position: absolute; inset-inline-start: 11px; color: var(--muted); }
.lt-search input { padding-inline-start: 34px; min-height: 38px; }
.lt-date { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.lt-export { display: inline-flex; gap: 6px; margin-inline-start: auto; }

/* --- sales goals ------------------------------------------------------------------------------- */
.goal-requested, .goal-signing { background: var(--gold-soft); color: var(--gold-deep); }
.goal-active { background: var(--good-soft); color: var(--good); }
.goal-cancelled { background: var(--grey-soft); color: var(--muted); }
.goal-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.goal-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "head head" "ring nums"; gap: 10px 14px;
  align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--panel); }
.goal-card:hover { text-decoration: none; border-color: var(--gold); box-shadow: var(--shadow); }
.goal-card.reached { background: linear-gradient(135deg, #fffaf0, var(--gold-soft)); border-color: var(--gold); }
.gc-head { grid-area: head; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.gc-event { font-weight: 800; }
.gc-nums { grid-area: nums; }
.gc-nums strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gc-ring { grid-area: ring; --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--grey-soft) 0); }
.gc-ring > span { width: 76%; height: 76%; border-radius: 50%; background: var(--panel); display: grid; place-content: center; text-align: center; line-height: 1.1; }
.gc-ring b { font-size: 15px; font-weight: 800; }
.gc-ring small { font-size: 10px; color: var(--muted); }
.gc-ring.big { width: 120px; height: 120px; flex: none; }
.gc-ring.big b { font-size: 28px; }
.reached .gc-ring { background: conic-gradient(var(--good) 100%, var(--good) 0); }
.my-goal { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; border-inline-start: 4px solid var(--gold); }
.my-goal.reached { background: linear-gradient(135deg, #fffaf0, var(--gold-soft)); }
.my-goal h2 { font-size: 26px; margin: 2px 0 6px; }
.my-goal .ns-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-deep); }
.my-goal p { margin: 0 0 8px; }
.mg-text { flex: 1; min-width: 220px; }
.team-bar { height: 10px; margin: 0 0 12px; }
.bar.bar-good span { background: var(--good); }
.table tr.me td { background: var(--gold-soft); }
.sign-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.sign-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }
.sign-list li.signed { border-style: solid; border-color: #bfe3cd; background: var(--good-soft); color: var(--good); }
.sign-list li strong { color: var(--ink); }
.split-input { width: 140px; text-align: end; }
.split-msg { margin: 8px 0 0; font-weight: 600; }
.split-msg.ok { color: var(--good); }
.split-msg.short { color: var(--bad); }
.cancel-box summary { cursor: pointer; margin-top: 8px; }
.cancel-box form { margin-top: 8px; }

/* The celebration */
.celebrate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 10, 11, .55); backdrop-filter: blur(3px); animation: cel-fade .3s ease; }
.celebrate[hidden] { display: none; }
.celebrate .confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.celebrate-card { position: relative; max-width: 440px; width: 100%; text-align: center; background: var(--panel);
  border-radius: 20px; padding: 28px 24px 22px; border-top: 6px solid var(--gold);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: cel-pop .6s cubic-bezier(.2, 1.6, .4, 1); }
.celebrate-card h2 { font-size: 24px; margin: 6px 0 8px; }
.celebrate-card p { margin: 0 0 8px; }
.celebrate-card .ns-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-deep); }
.celebrate .trophy { font-size: 72px; line-height: 1; animation: cel-bounce 1.2s ease-in-out infinite; filter: drop-shadow(0 8px 12px rgba(154, 106, 16, .35)); }
.celebrate-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
@keyframes cel-fade { from { opacity: 0; } }
@keyframes cel-pop { from { transform: scale(.6) translateY(30px); opacity: 0; } }
@keyframes cel-bounce { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .celebrate, .celebrate-card, .celebrate .trophy { animation: none; } }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }

/* Printed papers: the event's style with a live preview of a sample page. */
.style-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
.preview-card { position: sticky; top: 120px; }
.paper-frame { height: 640px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f2f1ee; position: relative; }
.paper-frame iframe { border: 0; width: 900px; height: 1280px; transform: scale(.5); transform-origin: 0 0; position: absolute; left: 50%; margin-left: -225px; }
input[type=color] { width: 64px; height: 40px; padding: 3px; cursor: pointer; }
.danger-text { color: var(--bad, #b42318); }
@media (max-width: 900px) { .style-grid { grid-template-columns: 1fr; } .preview-card { position: static; } }

/* Website requests */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
a.chip { text-decoration: none; color: inherit; }
.pill.web-exhibitor { background: #fdf1d8; color: #8a5a00; }
.pill.web-sponsor { background: #efe7fb; color: #5b3a99; }
.pill.web-visitor { background: #e3f1ec; color: #1a6b4b; }
.pill.web-contact { background: #e5edf1; color: #143a4e; }
.pill.web-st-new { background: #fdecea; color: #b42318; }
.pill.web-st-lead, .pill.web-st-handled, .pill.web-st-registered { background: #e3f1ec; color: #1a6b4b; }
pre.code { background: #f6f5f2; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto;
  font: 12.5px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
pre.code.small { font-size: 11.5px; }
.note-log { white-space: normal; background: #f6f5f2; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.clip { overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.form-actions.wrap { flex-wrap: wrap; }

/* Attendance */
.month-nav { display: inline-flex; align-items: center; gap: 8px; }
tr.off-day td { background: #faf9f6; color: var(--muted); }
tr.absent-day td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.pill.warn-pill { background: #fdf1d8; color: #8a5a00; white-space: normal; margin: 1px 0; }
.bad-text { color: var(--bad); }
.small-print { font-size: 12px; margin-top: 10px; }
.totals-table th { font-weight: 500; }
.totals-table tr.strong th, .totals-table tr.strong td { font-weight: 700; font-size: 16px; border-top: 2px solid var(--line); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; display: grid; gap: 2px; }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); }
.stat.warn { border-color: #f2b33d; background: #fffaf0; }

/* Management: money in/out chart and small lists */
.legend { display: inline-flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.sw.in, .flow-bars .b.in { background: #1a7f4b; }
.sw.out, .flow-bars .b.out { background: #d9822b; }
.flow-chart { display: flex; align-items: flex-end; gap: 2px; height: 210px; padding: 8px 0 0; border-bottom: 1px solid var(--line); }
.flow-day { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.flow-day small { height: 16px; text-align: center; font-size: 10.5px; color: var(--muted); }
.flow-bars { flex: 1; display: flex; align-items: flex-end; gap: 1px; justify-content: center; }
.flow-bars .b { width: 45%; max-width: 9px; border-radius: 4px 4px 0 0; min-height: 0; }
.flow-day.today small { color: var(--ink); font-weight: 700; }
.flow-day:hover .flow-bars, .flow-day:focus .flow-bars { background: #f2f1ee; border-radius: 4px; }
.flow-tip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); z-index: 3; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; box-shadow: 0 6px 18px rgba(0,0,0,.1); font-size: 12px;
  white-space: nowrap; flex-direction: column; gap: 1px; }
.flow-day:hover .flow-tip, .flow-day:focus .flow-tip { display: flex; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; gap: 10px; align-items: center; margin: 7px 0; font-size: 13.5px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 8px; background: #f2f1ee; border-radius: 4px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.kpi-list { list-style: none; margin: 0; padding: 0; }
.kpi-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
tr.late-row td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.done-row td { color: var(--muted); text-decoration: line-through; }
.minutes { background: #f6f5f2; border-radius: 10px; padding: 4px 14px; margin-bottom: 12px; }
.action-rows input, .action-rows select { width: 100%; }
.pill.prop-sent { background: #e5edf1; color: #143a4e; }
.pill.prop-accepted { background: #e3f1ec; color: #1a6b4b; }
.pill.prop-declined { background: #fdecea; color: #b42318; }
.prose h3 { margin-top: 16px; }

/* Mail */
.mail-list { padding: 0; overflow: hidden; }
.mail-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 18px;
  border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.mail-row:hover { background: #faf9f6; }
.mail-row.unread { box-shadow: inset 3px 0 0 var(--gold, #f2b33d); }
.mail-row.unread .mr-who { font-weight: 700; }
.mail-row:not(.unread) .mr-subject strong { font-weight: 500; }
.mr-who, .mr-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.mail-list .empty { padding: 24px; }
.mail-head { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.mail-head > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mail-frame { width: 100%; min-height: 300px; border: 0; }
.mail-text { white-space: normal; line-height: 1.55; overflow-wrap: anywhere; }
.footer-preview { border: 1px dashed var(--line); border-radius: 12px; padding: 4px 14px 12px; background: #fff; overflow-x: auto; }
.footer-preview .ns-label { display: block; margin-top: 8px; }
.quoted { margin: 10px 0; }
@media (max-width: 760px) { .mail-row { grid-template-columns: minmax(0, 1fr) auto; } .mr-subject { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- sign-in security ---------- */
.narrow-card { max-width: 640px; }
.login-link { margin: 14px 0 0; font-size: 14px; text-align: center; }
.code-input { font-size: 22px; letter-spacing: .25em; text-align: center; max-width: 220px; font-variant-numeric: tabular-nums; }
.login-card .code-input { max-width: none; }
.setup-steps { padding-inline-start: 20px; display: grid; gap: 16px; }
.setup-steps .qr { display: block; margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.secret { font-size: 15px; word-break: break-all; }
.recovery-codes { columns: 2; list-style: none; padding: 0; margin: 10px 0; }
.recovery-codes code { font-size: 15px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.inline-form input { width: auto; flex: 1 1 160px; }
.block { display: block; }
.mt { margin-top: 14px; }
.pill.good { background: var(--good-soft); color: var(--good); }
.msg.info { background: #e5edf1; color: #143a4e; }

/* ---------- activity log ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select, .filters input[type=date] { width: auto; }
.filters label.inline { display: flex; gap: 6px; align-items: center; font-weight: 500; }
.audit-table .change { font-size: 13px; line-height: 1.5; }
.audit-table del { color: var(--bad); text-decoration: line-through; opacity: .8; }
.audit-table ins { color: var(--good); text-decoration: none; font-weight: 600; }
.pill.audit-created { background: var(--good-soft); color: var(--good); }
.pill.audit-deleted, .pill.audit-sign_in_failed { background: var(--bad-soft); color: var(--bad); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; }

/* ---------- Arabic (right to left) ---------- */
[dir=rtl] body { font-family: "Alexandria", "Archivo", system-ui, sans-serif; }
[dir=rtl] .icon-arrow, [dir=rtl] .crumbs span::before { transform: scaleX(-1); display: inline-block; }
[dir=rtl] .gantt, [dir=rtl] .flow-chart, [dir=rtl] .num-ltr, [dir=rtl] input[type=tel], [dir=rtl] input[type=email],
[dir=rtl] .code-input, [dir=rtl] .secret { direction: ltr; }
[dir=rtl] .table th { letter-spacing: 0; text-transform: none; }
[dir=rtl] .num { unicode-bidi: plaintext; }
.lang-switch { margin-top: 14px; text-align: center; }

/* ---------- phones: bottom tab bar, bigger touch targets, installed-app safe areas ---------- */
.tabbar { display: none; }
#install-app [data-phone] { display: none; }
.ios-install { position: fixed; inset: 0; background: rgba(10, 10, 11, .45); z-index: 80; display: grid; place-items: end center; padding: 16px; }
.ios-install[hidden] { display: none; }
.ios-install-card { background: var(--panel); border-radius: 18px; padding: 20px; max-width: 420px; width: 100%; }
.ios-install-card h2 { margin-top: 0; font-size: 18px; }
.ios-install-card ol { padding-inline-start: 20px; display: grid; gap: 8px; }
@media (max-width: 760px) {
  #install-app [data-pc] { display: none; }
  #install-app [data-phone] { display: inline; }
  body.app { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 60; background: var(--panel);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(10, 10, 11, .06); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: 0; position: relative; min-height: 52px; justify-content: center; }
  .tabbar .on { color: var(--navy); }
  .tabbar .badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 4px); }
  .topbar .new-menu > summary, .topbar .bell { display: none; }
  .topbar { padding-top: env(safe-area-inset-top); }
  input, select, textarea, button { font-size: 16px; }  /* stops iPhones zooming into a field */
  .btn { min-height: 42px; }
  .btn.small { min-height: 34px; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head h1 { font-size: 21px; }
  .top-actions { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
  .card { padding: 14px; border-radius: 14px; }
  .table th, .table td { padding: 8px 6px; }
  .filters > * { flex: 1 1 140px; }
  .form-bar { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--panel); padding: 10px 0; z-index: 5; }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); inset-inline: 12px; max-width: none; }
  .login { padding: 16px; justify-content: flex-start; padding-top: max(32px, env(safe-area-inset-top)); }
  .login-card { padding: 22px; }
  .login-logo { width: 190px; }
}

/* ---------- bring over Odoo data ---------- */
.transfer-counts { columns: 2; padding-inline-start: 18px; }
.transfer-counts strong { font-variant-numeric: tabular-nums; }
pre.cmd { background: var(--grey-soft); padding: 10px 12px; border-radius: 10px; overflow-x: auto; direction: ltr; text-align: left; }
@media (max-width: 760px) { .transfer-counts { columns: 1; } }

.skip-two-step summary { color: var(--muted); cursor: pointer; }
.stack-form { display: grid; gap: 10px; margin-top: 8px; }
.stack-form label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.msg.warning { background: #fdf1d8; color: #8a5a00; }
