/* ECO Construction Platform — ECO BidFlow  |  RTL-first stylesheet */
:root {
  --g-950: #072a21; --g-900: #0b3329; --g-800: #0d3b30; --g-700: #135443; --g-600: #1f8a64; --g-500: #22a06b; --g-100: #e3f4ec; --g-50: #f1f9f5;
  --lime: #8cc63f; --lime-d: #6fa52b; --navy: #102b5c;
  --bg: #f3f6f5; --surface: #ffffff; --surface-2: #f8faf9; --text: #13201c; --muted: #66756f; --border: #e1e8e4;
  --danger: #d0453f; --danger-bg: #fdecea; --warning: #c98a0b; --warning-bg: #fff6df; --info: #1d6fb8; --info-bg: #e8f2fc;
  --success: #1f8a64; --success-bg: #e3f4ec;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 2px rgba(16,40,32,.05), 0 4px 16px rgba(16,40,32,.05);
  --sidebar-w: 256px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1613; --surface: #12201b; --surface-2: #172822; --text: #e4ece8; --muted: #93a39c; --border: #24372f;
    --g-100: #183a2e; --g-50: #13261f; --danger-bg: #3a1b19; --warning-bg: #3a2f12; --info-bg: #13283d; --success-bg: #183a2e;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1613; --surface: #12201b; --surface-2: #172822; --text: #e4ece8; --muted: #93a39c; --border: #24372f;
  --g-100: #183a2e; --g-50: #13261f; --danger-bg: #3a1b19; --warning-bg: #3a2f12; --info-bg: #13283d; --success-bg: #183a2e; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--text); background: var(--bg); }
a { color: var(--g-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.55rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; margin-top: 1em; }
p { margin: 0 0 .75em; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.ic { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; } .center { text-align: center; }
.text-danger { color: var(--danger) !important; } .text-success { color: var(--success) !important; } .text-start { text-align: start; }
.prewrap { white-space: pre-wrap; } .dim { opacity: .55; } .link { font-size: .85rem; font-weight: 600; }
.ltr-json { direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace; font-size: .75rem; word-break: break-all; }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }

/* ---------- Scrollbars (themed) ---------- */
:root { --sb-thumb: #a9c4b8; --sb-thumb-hover: var(--g-600); --sb-track: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sb-thumb: #2f4a3f; --sb-thumb-hover: var(--g-500); } }
:root[data-theme="dark"] { --sb-thumb: #2f4a3f; --sb-thumb-hover: var(--g-500); }
* { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) var(--sb-track); }
html { scrollbar-color: var(--sb-thumb) var(--bg); }
.sidebar, .sidebar * { scrollbar-color: rgba(140,198,63,.4) transparent; }
/* Older WebKit/Safari (ignored where scrollbar-color is supported) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--sb-thumb-hover); }
.sidebar::-webkit-scrollbar-thumb { background-color: rgba(140,198,63,.35); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: linear-gradient(180deg, var(--g-900), var(--g-950)); color: #cfe6dc;
  position: fixed; inset-block: 0; inset-inline-start: 0; display: flex; flex-direction: column; z-index: 40;
  overflow-y: auto; transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: .3px; }
.brand small { display: block; color: var(--lime); font-weight: 600; font-size: .78rem; margin-top: -3px; }
.sidebar nav { padding: 0 10px 16px; flex: 1; }
.nav-label { font-size: .7rem; letter-spacing: 1px; text-transform: uppercase; color: #7fa596; padding: 16px 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #cfe6dc; font-weight: 500; margin-bottom: 2px; }
.nav-item:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav-item.active { background: rgba(140,198,63,.16); color: #fff; box-shadow: inset -3px 0 0 var(--lime); }
.nav-item span { flex: 1; }
.nav-badge { flex: 0 0 auto !important; background: var(--lime); color: var(--g-950); font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 20px; }
.sidebar-foot { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.tag-chip { display: inline-block; font-size: .72rem; padding: 3px 10px; border: 1px solid rgba(140,198,63,.4); color: var(--lime); border-radius: 99px; font-weight: 600; }
.main { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.top-search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.top-search input { border: 0; background: transparent; padding: 9px 0; width: 100%; outline: none; color: var(--text); font: inherit; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn .dot { position: absolute; top: 3px; inset-inline-end: 2px; background: var(--danger); color: #fff; font-size: .65rem; min-width: 17px; height: 17px; line-height: 17px; text-align: center; border-radius: 99px; padding: 0 4px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-inline-start: 8px; border-inline-start: 1px solid var(--border); }
.user-chip strong { display: block; font-size: .85rem; line-height: 1.2; }
.user-chip small { color: var(--muted); font-size: .75rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--g-600); color: #fff; display: grid; place-items: center; font-weight: 700; }
.offline-pill { background: var(--warning-bg); color: var(--warning); font-size: .78rem; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.only-mobile { display: none; }
.sidebar-backdrop { display: none; }

/* ---------- Generic UI ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }
.page-actions, .btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.card.p0 { padding: 0; overflow: hidden; }
.card.narrow { max-width: 480px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 6px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { color: var(--g-600); opacity: .5; margin-bottom: 8px; }
.empty-sm { color: var(--muted); font-size: .9rem; padding: 10px 0; text-align: center; }
.stack > .card:last-child { margin-bottom: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; font-size: .92rem; line-height: 1.3;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; color: inherit; background: none;
}
.btn:hover { text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn-primary { background: var(--g-600); color: #fff; } .btn-primary:hover { background: var(--g-700); }
.btn-lime { background: var(--lime); color: var(--g-950); } .btn-lime:hover { background: var(--lime-d); }
.btn-danger { background: var(--danger); color: #fff; } .btn-danger:hover { filter: brightness(.92); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); } .btn-ghost:hover { background: var(--surface-2); }
.btn-outline-light { border-color: rgba(255,255,255,.4); color: #fff; } .btn-outline-light:hover { background: rgba(255,255,255,.08); }
.btn-sm { padding: 6px 12px; font-size: .84rem; border-radius: 8px; }
.btn-block { width: 100%; }

.alert { padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; vertical-align: middle; margin: 0; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--g-600); color: #fff; }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.big-badge { font-size: 1rem; padding: 6px 16px; margin-bottom: 10px; }

/* forms */
.form label { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: .93rem; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 11px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--g-600); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--g-500); box-shadow: 0 0 0 3px rgba(34,160,107,.15); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; }
.form-section { margin: 18px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); color: var(--g-600); font-size: .95rem; }
.form-section:first-of-type { margin-top: 0; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.inline-form input[name=title] { flex: 2 1 220px; } .inline-form select, .inline-form input[type=date] { flex: 1 1 140px; width: auto; }
.w-xs { width: 60px; } .w-sm { width: 90px; } .w-md { width: 130px; }
.or { text-align: center; position: relative; margin: 6px 0 12px; color: var(--muted); font-size: .85rem; }
.or::before { content: ""; position: absolute; inset-inline: 0; top: 50%; border-top: 1px dashed var(--border); }
.or span { position: relative; background: var(--surface); padding: 0 10px; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; font-size: .78rem; color: var(--muted); font-weight: 600; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 8px 10px; }
.card:not(.p0) .table th:first-child, .card:not(.p0) .table td:first-child { padding-inline-start: 4px; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: var(--g-50); }
.table input, .table select { padding: 6px 8px; font-size: .88rem; }
.matrix td:first-child { font-weight: 500; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.kpi small { color: var(--muted); font-size: .8rem; display: block; }
.kpi strong { font-size: 1.6rem; line-height: 1.2; display: block; font-variant-numeric: tabular-nums; }
.kpi strong em { font-size: .8rem; font-style: normal; color: var(--muted); font-weight: 500; }
.kpi-sub { font-style: normal; font-size: .75rem; color: var(--muted); }
.kpi-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--g-100); color: var(--g-600); flex-shrink: 0; }
.kpi-ic.ic-warn { background: var(--warning-bg); color: var(--warning); }
.kpi-ic.ic-alt { background: var(--info-bg); color: var(--info); }
.grid-dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; align-items: start; }
.grid-dash .span-2, .grid-overview .span-2 { grid-column: span 2; }
.funnel-row { display: grid; grid-template-columns: 120px 1fr 30px; gap: 10px; align-items: center; padding: 5px 0; color: var(--text); font-size: .88rem; }
.funnel-row:hover { text-decoration: none; color: var(--g-600); }
.f-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.f-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--g-600), var(--lime)); border-radius: 99px; }
.f-num { font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list a { color: var(--text); } .list a strong { color: var(--g-600); }
.meta { color: var(--muted); font-size: .8rem; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding-bottom: 14px; position: relative; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 5px; top: 14px; bottom: 0; border-inline-start: 2px solid var(--border); }
.timeline li:last-child::before { display: none; }
.t-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--g-600); margin-top: 5px; flex-shrink: 0; box-shadow: 0 0 0 3px var(--g-100); }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.donut { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut::after { content: ""; position: absolute; inset: 22px; background: var(--surface); border-radius: 50%; }
.donut span { position: relative; z-index: 1; font-size: 1.5rem; font-weight: 700; text-align: center; line-height: 1.1; }
.donut small { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.legend { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.legend li, .legend.inline span { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.legend.inline { display: flex; gap: 14px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { margin-inline-start: auto; padding-inline-start: 10px; }

/* stage chips */
.stage-chip { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap; background: var(--g-100); color: var(--g-700); }
.stage-chip.s-0, .stage-chip.s-1 { background: var(--info-bg); color: var(--info); }
.stage-chip.s-2, .stage-chip.s-3 { background: var(--warning-bg); color: var(--warning); }
.stage-chip.s-4, .stage-chip.s-5 { background: #efe9fb; color: #6b46c1; }
.stage-chip.s-8, .stage-chip.s-9 { background: var(--g-600); color: #fff; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.k-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.k-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--g-600); }
.k-head strong { color: var(--text); flex: 1; font-size: .9rem; }
.k-count { background: var(--surface); border: 1px solid var(--border); border-radius: 99px; font-size: .75rem; padding: 0 8px; font-weight: 700; color: var(--muted); }
.k-body { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.k-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; color: var(--text); display: flex; flex-direction: column; gap: 3px; font-size: .88rem; transition: border-color .15s, box-shadow .15s; }
.k-card:hover { text-decoration: none; border-color: var(--g-500); box-shadow: var(--shadow); }
.k-top, .k-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.k-top small { color: var(--muted); font-weight: 600; }
.k-foot { margin-top: 4px; font-weight: 600; font-size: .8rem; color: var(--g-700); }
.k-empty { text-align: center; color: var(--muted); padding: 10px; }

/* ---------- Tender page ---------- */
.tender-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.tender-head h1 { margin: 4px 0 8px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; color: var(--muted); font-size: .88rem; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.ref { font-weight: 700; color: var(--g-600) !important; background: var(--g-100); padding: 1px 10px; border-radius: 6px; direction: ltr; }
.stepper { list-style: none; margin: 0 0 16px; padding: 16px 12px; display: flex; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); gap: 0; }
.stepper li { flex: 1 0 92px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; gap: 6px; }
.stepper li::after { content: ""; position: absolute; top: 19px; inset-inline-start: calc(50% + 22px); inset-inline-end: calc(-50% + 22px); height: 2px; background: var(--border); }
.stepper li:last-child::after { display: none; }
.stepper li.done::after { background: var(--g-500); }
.st-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 2px solid var(--border); position: relative; z-index: 1; }
.stepper li.done .st-ic { background: var(--g-600); border-color: var(--g-600); color: #fff; }
.stepper li.current .st-ic { background: var(--lime); border-color: var(--lime); color: var(--g-950); box-shadow: 0 0 0 5px rgba(140,198,63,.22); }
.stepper li.current.closed .st-ic { background: var(--muted); border-color: var(--muted); color: #fff; box-shadow: none; }
.st-label { font-size: .78rem; font-weight: 600; line-height: 1.25; }
.st-label small { display: block; color: var(--muted); font-weight: 400; font-size: .68rem; direction: ltr; }
.stepper li.current .st-label { color: var(--g-700); }
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 18px; scrollbar-width: thin; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: .88rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--g-600); border-bottom-color: var(--g-600); }
.grid-overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 0 18px; align-items: start; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 10px; font-size: .9rem; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; }
.next-card { background: linear-gradient(135deg, var(--g-800), var(--g-700)); color: #fff; border: 0; }
.next-card small { color: var(--lime); font-weight: 600; }
.next-card p { font-size: 1.02rem; margin: 6px 0 14px; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-stats small { display: block; color: var(--muted); font-size: .78rem; }
.mini-stats strong { font-size: 1.2rem; display: block; margin-bottom: 2px; }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 600; font-size: .9rem; }
.danger-zone form { margin-top: 12px; }

.rating { display: inline-flex; flex-direction: row-reverse; gap: 3px; }
.rating input { display: none; }
.rating label { width: 30px; height: 30px; display: grid !important; place-items: center; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; font-weight: 700; margin: 0 !important; color: var(--muted) !important; font-size: .85rem !important; }
.rating input:checked ~ label { background: var(--g-100); border-color: var(--g-500); color: var(--g-700) !important; }
.rating input:checked + label { background: var(--g-600); color: #fff !important; }
.rating input:disabled + label { cursor: default; }
.score-card { text-align: center; }
.gauge { --v: 0; width: 150px; height: 150px; margin: 10px auto; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--g-600) calc(var(--v) * 1%), var(--surface-2) 0); position: relative; }
.gauge::after { content: ""; position: absolute; inset: 14px; background: var(--surface); border-radius: 50%; }
.gauge span { position: relative; z-index: 1; font-size: 2rem; font-weight: 700; }

.progress { display: inline-block; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; width: 140px; vertical-align: middle; }
.progress i { display: block; height: 100%; background: var(--g-500); border-radius: 99px; }
.progress-inline { font-size: .85rem; color: var(--muted); font-weight: 600; }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tasks li.done .t-title { text-decoration: line-through; color: var(--muted); }
.check-btn { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: #fff; padding: 0; }
.tasks li.done .check-btn { background: var(--g-600); border-color: var(--g-600); }

/* pricing */
.pricing-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.version-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.version-list a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); }
.version-list a:hover { text-decoration: none; border-color: var(--g-500); }
.version-list li.active a { border-color: var(--g-600); background: var(--g-50); box-shadow: inset -3px 0 0 var(--g-600); }
.items-table td { padding: 6px 6px; }
.items-table td:nth-child(2) { min-width: 200px; }
.items-table tr.new-row td { background: var(--g-50); }
.del-check { display: inline-flex !important; align-items: center; gap: 2px; cursor: pointer; color: var(--muted); margin: 0 !important; }
.del-check:has(input:checked) { color: var(--danger); }
tr:has(.del-check input:checked) td { opacity: .5; text-decoration: line-through; }
.totals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin: 18px 0; align-items: start; }
.cat-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .85rem; margin-bottom: 6px; }
.cat-row .progress { width: 100%; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; margin: 0; padding: 16px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: .9rem; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); } .totals dd { margin: 0; text-align: end; font-weight: 600; }
.totals .strong { color: var(--text); font-weight: 700; border-top: 1px dashed var(--border); padding-top: 7px; }
.totals .grand { color: var(--g-700); font-size: 1.08rem; font-weight: 700; border-top: 2px solid var(--g-600); padding-top: 9px; }
.submit-approval { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* approvals */
.approval-chain { list-style: none; margin: 0; padding: 0; }
.approval-chain li { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.approval-chain li::before { content: ""; position: absolute; inset-inline-start: 16px; top: 34px; bottom: 0; border-inline-start: 2px dashed var(--border); }
.approval-chain li:last-child::before { display: none; }
.ap-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--border); font-weight: 700; flex-shrink: 0; }
.ap-approved .ap-num { background: var(--g-600); border-color: var(--g-600); color: #fff; }
.ap-pending .ap-num { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.ap-rejected .ap-num { background: var(--danger); border-color: var(--danger); color: #fff; }
.ap-body { flex: 1; }
.ap-comment { background: var(--surface-2); padding: 8px 12px; border-radius: 8px; margin-top: 6px; font-size: .88rem; }
.ap-form { margin-top: 10px; max-width: 520px; }
.ap-form textarea { margin-bottom: 8px; }

/* documents */
.folder { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.folder summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; background: var(--surface-2); font-weight: 600; font-size: .9rem; list-style: none; }
.folder summary::-webkit-details-marker { display: none; }
.folder summary .ic { color: var(--warning); }
.folder summary span { flex: 1; }
.folder summary em { font-style: normal; font-size: .75rem; background: var(--surface); border: 1px solid var(--border); padding: 0 8px; border-radius: 99px; color: var(--muted); }
.folder > .empty-sm { padding: 10px; }
.doc-list { list-style: none; margin: 0; padding: 4px 14px; }
.doc-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list li > .ic { color: var(--g-600); }
.doc-main { flex: 1; min-width: 0; word-break: break-word; }

/* segmented */
.seg { display: flex; gap: 8px; margin-bottom: 14px; }
.seg label { flex: 1; margin: 0 !important; }
.seg input { display: none; }
.seg span { display: block; text-align: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; color: var(--text); font-weight: 600; }
.seg input:checked + span { background: var(--g-600); border-color: var(--g-600); color: #fff; }
.seg label:nth-child(2) input:checked + span { background: var(--danger); border-color: var(--danger); }
.seg label:nth-child(3) input:checked + span { background: var(--muted); border-color: var(--muted); }

/* lessons */
.lesson { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; font-size: .9rem; }
.lesson header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.lesson header .meta { margin: 0 auto 0 0; }
.lesson p { margin-bottom: 6px; }
.lesson .rec { background: var(--g-50); padding: 8px 10px; border-radius: 8px; border-inline-start: 3px solid var(--lime); }
.lessons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 16px; }
.lessons-grid .lesson { margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { padding: 5px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .85rem; font-weight: 500; }
.chip b { color: var(--muted); margin-inline-start: 4px; }
.chip:hover { text-decoration: none; border-color: var(--g-500); }
.chip.active { background: var(--g-600); border-color: var(--g-600); color: #fff; } .chip.active b { color: #d7f0e4; }

.project-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-color: var(--g-500); background: var(--g-50); }
.project-card small { color: var(--g-600); font-weight: 700; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 14px; margin-bottom: 8px; }
.checklist .check { margin-bottom: 6px; }

/* products */
.products { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
.product { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; color: var(--text); }
.product .ic { color: var(--g-700); }
.product strong { font-size: .98rem; color: var(--g-800); }
.product span { color: var(--muted); font-size: .85rem; line-height: 1.5; flex: 1; }
.product.live { background: var(--g-100); border-color: var(--g-500); }
a.product:hover { text-decoration: none; box-shadow: var(--shadow); }
.product.locked { opacity: .78; }
.pill-live, .pill-soon { font-style: normal; font-size: .72rem; font-weight: 700; padding: 3px 12px; border-radius: 99px; white-space: nowrap; }
.pill-live { background: var(--g-800); color: #fff; }
.pill-soon { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* notifications */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list a { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-list a:hover { background: var(--g-50); text-decoration: none; }
.notif-list li.unread a { background: var(--g-50); font-weight: 600; }
.notif-list li.unread .n-ic { background: var(--g-600); color: #fff; }
.n-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--g-600); flex-shrink: 0; }
.n-risk .n-ic { color: var(--danger); } .n-deadline .n-ic { color: var(--warning); }
.n-msg { flex: 1; font-size: .9rem; } .n-time { color: var(--muted); font-size: .78rem; white-space: nowrap; }

/* reports */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding-top: 10px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar-stack { width: 100%; max-width: 38px; display: flex; flex-direction: column; border-radius: 6px 6px 0 0; overflow: hidden; min-height: 2px; background: var(--surface-2); }
.bar-stack .won { background: var(--lime); } .bar-stack .lost { background: var(--danger); }
.bar-col small { color: var(--muted); font-size: .72rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 20% 10%, rgba(140,198,63,.18), transparent 40%), linear-gradient(160deg, var(--g-800), var(--g-950)); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; padding: 34px 30px; box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.auth-card h1 { margin: 12px 0 2px; color: var(--g-800); }
.auth-card .form { text-align: start; margin: 20px 0 14px; }
:root[data-theme="dark"] .auth-card h1 { color: var(--text); }

/* ---------- Landing ---------- */
.landing { background: var(--surface); }
.l-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.l-nav { position: sticky; top: 0; z-index: 30; background: rgba(11,51,41,.92); backdrop-filter: blur(10px); }
.l-nav .l-wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.l-nav .brand { padding: 0; }
.l-links { display: flex; gap: 22px; margin-inline-start: auto; }
.l-links a { color: #cfe6dc; font-weight: 500; font-size: .92rem; }
.l-links + .btn { margin-inline-start: 0; }
.l-nav .btn { margin-inline-start: auto; }
.l-links ~ .btn { margin-inline-start: 0; }
.hero { background: radial-gradient(circle at 75% 30%, rgba(233,138,60,.18), transparent 35%), linear-gradient(160deg, var(--g-800), var(--g-950)); color: #fff; padding: 70px 0 60px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; color: var(--lime); font-weight: 600; font-size: .85rem; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; margin-bottom: 18px; direction: ltr; text-align: right; }
.accent { color: var(--lime); }
.lead { font-size: 1.12rem; color: #cfe6dc; max-width: 640px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 36px; }
.hero-cta .btn { padding: 12px 24px; font-size: 1rem; }
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid rgba(255,255,255,.1); padding-top: 22px; }
.values div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 0 8px; border-inline-end: 1px solid rgba(255,255,255,.1); }
.values div:last-child { border: 0; }
.values .ic { color: var(--lime); }
.values strong { font-size: .95rem; } .values small { color: #9fbdb1; font-size: .78rem; }
.hero-art svg { width: 100%; height: auto; }
.l-section { padding: 64px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.h-accent { color: var(--g-600); }
.sectors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.sectors div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.sectors .ic { color: var(--g-700); }
.section-title { text-align: center; color: var(--g-600); font-size: 1.9rem; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 30px; }
.section-title.light { color: #fff; } .section-sub.light { color: #b9d3c8; }
.bidflow-band { background: linear-gradient(180deg, var(--g-50), var(--surface)); }
.bidflow-band .eyebrow { color: var(--navy); }
.big { font-size: clamp(1.6rem, 3.4vw, 2.5rem); color: var(--navy); }
.big .lime { color: var(--g-500); display: block; }
.bidflow-band .lead, .lead.dark { color: var(--muted); }
.big.dark { color: var(--g-800); }
.lifecycle { list-style: none; margin: 36px 0; padding: 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; counter-reset: s; }
.lifecycle li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; position: relative; }
.lifecycle li:not(:last-child)::after { content: "←"; position: absolute; top: 20px; inset-inline-end: -10px; color: var(--g-500); font-weight: 700; }
.lc-ic { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--navy); margin-bottom: 6px; box-shadow: 0 4px 12px rgba(16,43,92,.2); }
.lifecycle li:nth-child(n+5) .lc-ic { background: var(--g-600); }
.lifecycle li:nth-child(n+8) .lc-ic { background: var(--g-500); }
.lifecycle strong { font-size: .85rem; } .lifecycle small { color: var(--muted); font-size: .7rem; direction: ltr; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.feature { background: var(--surface); padding: 22px 18px; text-align: center; }
.feature .ic { color: var(--navy); margin-bottom: 8px; }
.feature strong { display: block; margin-bottom: 6px; color: var(--navy); }
.feature p { color: var(--muted); font-size: .88rem; margin: 0; }
.integ-row { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; font-weight: 600; color: var(--muted); }
.integ-row span { background: var(--surface); border: 1px solid var(--border); padding: 4px 14px; border-radius: 99px; color: var(--navy); }
.roadmap-band { background: linear-gradient(160deg, var(--g-900), #0b2e45); color: #fff; }
.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.phase { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 26px 22px; position: relative; }
.phase b { position: absolute; top: -18px; inset-inline-start: 22px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #3b6fb0; font-size: 1.1rem; }
.phase.current { border-color: var(--lime); background: rgba(140,198,63,.08); }
.phase.current b { background: var(--g-500); }
.phase h3 { margin-top: 8px; } .phase h3 small { color: #b9d3c8; font-weight: 500; }
.phase p { color: #d5e5de; margin: 0; }
.link-note { text-align: center; margin-top: 26px; color: #cfe6dc; display: flex; gap: 8px; justify-content: center; align-items: center; }
.contact-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; color: var(--g-800); font-weight: 600; }
.contact-list li { display: flex; align-items: center; gap: 10px; }
.contact-list .ic { color: var(--g-600); }
.l-foot { background: var(--g-950); color: #cfe6dc; padding: 52px 0 26px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; padding-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,.08); }
.foot-brand .brand { padding: 0; margin-bottom: 14px; }
.foot-brand p { color: #9fbdb1; font-size: .92rem; max-width: 380px; margin: 0; line-height: 1.8; }
.l-foot h4 { color: #fff; font-size: .95rem; margin: 6px 0 14px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .92rem; }
.foot-links li { display: flex; align-items: center; gap: 8px; color: #9fbdb1; }
.foot-links .ic { color: var(--lime); }
.foot-links a { color: #cfe6dc; }
.foot-links a:hover { color: var(--lime); text-decoration: none; }
.foot-slogan { text-align: center; color: #fff; font-weight: 600; font-size: 1.05rem; margin: 26px 0 6px; }
.foot-copy { text-align: center; color: #7f9d91; font-size: .82rem; margin: 0; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 460px) { .foot-grid { grid-template-columns: 1fr; } }
.landing .card { box-shadow: var(--shadow); }

/* language switch + LTR (English) landing adjustments */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; color: #cfe6dc; font-weight: 600; font-size: .88rem; padding: 6px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; white-space: nowrap; transition: background .15s, border-color .15s; }
.lang-switch:hover { text-decoration: none; background: rgba(255,255,255,.08); border-color: var(--lime); color: #fff; }
@media (max-width: 640px) { .l-nav .lang-switch { margin-inline-start: auto; padding: 5px 10px; } }
[dir="ltr"] .hero h1 { text-align: left; }
[dir="ltr"] .lifecycle li:not(:last-child)::after { content: "→"; }

/* mobile landing header: keep the brand on one line */
@media (max-width: 640px) {
  .l-nav .brand strong { white-space: nowrap; }
  .l-nav .brand small { display: none; }
  .hero { padding: 40px 0 36px; }
}

/* ---------- Landing animations ---------- */
.skyline { overflow: visible; }
.skyline .sk-draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: skDraw 1.4s cubic-bezier(.65,0,.35,1) var(--d, 0s) forwards; }
@keyframes skDraw { to { stroke-dashoffset: 0; } }
.skyline .sk-rise { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); animation: skRise 1s cubic-bezier(.2,.8,.2,1) var(--d, 0s) forwards; }
@keyframes skRise { to { transform: scaleY(1); } }
.skyline .sk-floor { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); opacity: 0; animation: skFloor .7s cubic-bezier(.2,.9,.25,1.15) var(--d) forwards; }
@keyframes skFloor { to { transform: scaleY(1); opacity: 1; } }
.skyline .sk-win { opacity: 0; animation: skWin var(--w, 4s) ease-in-out var(--wd, 3.5s) infinite alternate; }
@keyframes skWin { 0%, 45% { opacity: 0; } 55%, 100% { opacity: .85; } }
.skyline .sk-sun { animation: skSun 9s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes skSun { from { transform: translateY(14px); } to { transform: translateY(-8px); } }
.skyline .sk-glow { transform-box: fill-box; transform-origin: center; animation: skGlow 5s ease-in-out infinite alternate; }
@keyframes skGlow { from { transform: scale(.9); opacity: .6; } to { transform: scale(1.08); opacity: 1; } }
.skyline .sk-cloud { animation: skCloud 18s ease-in-out infinite alternate; }
.skyline .sk-cloud.c2 { animation-duration: 24s; animation-direction: alternate-reverse; }
@keyframes skCloud { from { transform: translateX(-20px); } to { transform: translateX(40px); } }
.skyline .sk-jib { transform-box: view-box; transform-origin: 70px 40px; opacity: 0; animation: skFade .4s ease .9s forwards, skSway 7s ease-in-out 2.4s infinite alternate; }
@keyframes skFade { to { opacity: 1; } }
@keyframes skSway { from { transform: rotate(-1.2deg); } to { transform: rotate(1deg); } }
/* load cycle: lift → travel → lower onto the building → lift → return */
.skyline .sk-trolley { animation: skTrolley 12s ease-in-out 2.4s infinite; }
.skyline .sk-cable { transform-box: view-box; transform-origin: 300px 83px; animation: skCable 12s ease-in-out 2.4s infinite; }
.skyline .sk-load { animation: skLoad 12s ease-in-out 2.4s infinite; }
@keyframes skTrolley { 0%, 15% { transform: translateX(0); } 40%, 80% { transform: translateX(-100px); } 95%, 100% { transform: translateX(0); } }
@keyframes skCable { 0% { transform: scaleY(1); } 15%, 40% { transform: scaleY(.3); } 55%, 65% { transform: scaleY(1); } 80%, 95% { transform: scaleY(.3); } 100% { transform: scaleY(1); } }
@keyframes skLoad { 0% { transform: translateY(0); } 15%, 40% { transform: translateY(-40px); } 55%, 65% { transform: translateY(0); } 80%, 95% { transform: translateY(-40px); } 100% { transform: translateY(0); } }
.skyline .sk-beacon { animation: skBeacon 1.6s steps(1) infinite; }
@keyframes skBeacon { 50% { opacity: .15; } }

/* hero text entrance */
.hero-grid > div:first-child > * { opacity: 0; transform: translateY(18px); animation: heroIn .8s cubic-bezier(.2,.8,.2,1) forwards; }
.hero-grid > div:first-child > :nth-child(1) { animation-delay: .1s; }
.hero-grid > div:first-child > :nth-child(2) { animation-delay: .25s; }
.hero-grid > div:first-child > :nth-child(3) { animation-delay: .4s; }
.hero-grid > div:first-child > :nth-child(4) { animation-delay: .55s; }
.hero-grid > div:first-child > :nth-child(5) { animation-delay: .7s; }
@keyframes heroIn { to { opacity: 1; transform: none; } }
.hero .accent { background: linear-gradient(90deg, var(--lime), #c6f07a, var(--lime)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: -200% 0; } }

/* scroll reveal (classes added by JS, so content stays visible without it) */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.in { opacity: 1; transform: none; }
.lifecycle li.reveal { transform: translateY(16px) scale(.85); }
.lifecycle li.reveal.in { transform: none; }
.lifecycle li.reveal.in .lc-ic { animation: lcPop .5s cubic-bezier(.2,.9,.3,1.4) calc(var(--i, 0) * 80ms + .2s) both; }
@keyframes lcPop { from { transform: scale(.6); } to { transform: scale(1); } }
.landing .product, .landing .feature, .landing .phase { transition: transform .25s ease, box-shadow .25s ease, opacity .7s cubic-bezier(.2,.8,.2,1); }
.landing .product:hover, .landing .feature:hover, .landing .phase:hover { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(16,40,32,.12); }
.landing .product.live .ic { animation: livePulse 2.4s ease-in-out infinite; }
@keyframes livePulse { 50% { transform: scale(1.12); } }
.l-nav { transition: background .25s ease, box-shadow .25s ease; }
.l-nav.scrolled { background: rgba(11,51,41,.98); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.hero-cta .btn-lime { position: relative; overflow: hidden; }
.hero-cta .btn-lime::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); animation: btnShine 4.5s ease-in-out 2s infinite; }
@keyframes btnShine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ---------- Icon micro-interactions (landing) ---------- */
/* lifecycle row: dock-style magnification driven by --mag (set by JS from mouse distance) */
.lifecycle .lc-ic { scale: var(--mag, 1); transition: scale .18s ease-out, box-shadow .25s ease, background-color .25s ease; position: relative; will-change: scale; }
.lifecycle li { cursor: default; }
.lifecycle li strong { transition: color .2s ease, translate .18s ease-out; translate: 0 calc((var(--mag, 1) - 1) * 14px); }
.lifecycle li:hover strong { color: var(--g-600); }
.lifecycle .lc-ic::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; opacity: 0; pointer-events: none; }
.lifecycle li:hover .lc-ic { box-shadow: 0 10px 26px rgba(16,43,92,.32); }
.lifecycle li:hover .lc-ic::after { animation: ringOut 1.2s ease-out infinite; }
.lifecycle li:hover .lc-ic .ic { animation: iconWiggle .55s ease-in-out; }
@keyframes ringOut { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.65); opacity: 0; } }
@keyframes iconWiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -12deg; } 50% { rotate: 10deg; } 75% { rotate: -5deg; } }

/* feature / product / sector / value icons: soft halo + pulse on hover, gentle pull toward the cursor (--mx/--my from JS) */
.feature .ic, .product .ic, .sectors .ic, .values .ic { translate: var(--mx, 0) var(--my, 0); transition: translate .2s ease-out, color .2s ease; }
.feature .ic, .product .ic { position: relative; z-index: 1; }
.feature, .product { position: relative; }
.feature::before, .product::before { content: ""; position: absolute; top: 18px; left: 50%; width: 56px; height: 56px; margin-left: -28px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--g-500) 22%, transparent) 0%, transparent 70%); transform: scale(.4); opacity: 0; transition: transform .35s ease, opacity .35s ease; pointer-events: none; }
.feature:hover::before, .product:hover::before { transform: scale(1.25); opacity: 1; }
.feature:hover .ic { color: var(--g-600); animation: iconPulse 1.1s ease-in-out infinite; }
.product:hover .ic { animation: iconPulse 1.1s ease-in-out infinite; }
.features .feature:nth-child(1):hover .ic { animation: iconRing .9s ease-in-out infinite; transform-origin: 50% 10%; }
.features .feature:nth-child(3):hover .ic { animation: iconWiggle .6s ease-in-out 2; }
.features .feature:nth-child(6):hover .ic { animation: iconNudge .9s ease-in-out infinite; }
.sectors > div:hover .ic, .values > div:hover .ic { animation: iconPulse 1s ease-in-out infinite; }
.sectors > div, .values > div { cursor: default; }
@keyframes iconPulse { 0%, 100% { scale: 1; } 50% { scale: 1.16; } }
@keyframes iconRing { 0%, 100% { rotate: 0deg; } 15% { rotate: 14deg; } 30% { rotate: -12deg; } 45% { rotate: 8deg; } 60% { rotate: -5deg; } 75% { rotate: 0deg; } }
@keyframes iconNudge { 0%, 100% { translate: var(--mx, 0) var(--my, 0); } 50% { translate: calc(var(--mx, 0px) + var(--nudge, -6px)) var(--my, 0); } }
[dir="ltr"] .features .feature:nth-child(6) { --nudge: 6px; }

@media (prefers-reduced-motion: reduce) {
  .lifecycle .lc-ic, .lifecycle li strong { scale: 1 !important; translate: none !important; }
  .lifecycle li:hover .lc-ic::after, .lifecycle li:hover .lc-ic .ic, .feature:hover .ic, .product:hover .ic, .sectors > div:hover .ic, .values > div:hover .ic { animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .skyline *, .hero-grid > div:first-child > *, .reveal, .hero .accent, .hero-cta .btn-lime::after, .landing .product.live .ic {
    animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important;
  }
  .skyline .sk-win { opacity: .5 !important; }
  .hero .accent { color: var(--lime); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-dash { grid-template-columns: repeat(2, 1fr); }
  .products { grid-template-columns: repeat(3, 1fr); }
  .lifecycle { grid-template-columns: repeat(5, 1fr); row-gap: 24px; }
  .lifecycle li:nth-child(5)::after { display: none; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(100%); box-shadow: none; }
  body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .main { margin-inline-start: 0; }
  .only-mobile { display: inline-grid; }
  .grid-overview, .pricing-layout, .totals-grid, .two-col, .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-overview .span-2 { grid-column: auto; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .roadmap { grid-template-columns: 1fr; gap: 30px; }
  .hero-art { order: 2; max-width: 460px; width: 100%; margin: 6px auto 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .content { padding: 16px; }
  .topbar { padding: 8px 12px; gap: 6px; }
  .hide-mobile { display: none !important; }
  .top-search { max-width: none; }
  .grid-dash, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-dash .span-2 { grid-column: auto; }
  .products { grid-template-columns: repeat(2, 1fr); }
  .lifecycle { grid-template-columns: repeat(2, 1fr); }
  .lifecycle li::after { display: none; }
  .values { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .values div:nth-child(2) { border: 0; }
  .features { grid-template-columns: 1fr; }
  .sectors { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .tasks li { grid-template-columns: auto 1fr auto; }
  .tasks li > span.small { grid-column: 2; }
  .kpi strong { font-size: 1.35rem; }
  .funnel-row { grid-template-columns: 95px 1fr 26px; }
  .l-section { padding: 44px 0; }
  .user-chip { border: 0; padding: 0; }
  .dl { grid-template-columns: 1fr; gap: 0; } .dl dd { margin-bottom: 8px; }
}
@media print {
  .sidebar, .topbar, .tabs, .page-actions, .btn, form button { display: none !important; }
  .main { margin: 0; } .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- ECO Sales ---------- */
/* SweetAlert2 theme */
.swal2-container { z-index: 2000; }
.swal2-container.swal2-backdrop-show { background: rgba(7, 42, 33, .45); backdrop-filter: blur(2px); }
.eco-swal.swal2-popup { font-family: var(--font); background: var(--surface); color: var(--text); border-radius: 18px; padding: 26px 22px 22px; border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.eco-swal .eco-swal-title { font-size: 1.25rem; font-weight: 700; color: var(--text); padding-top: 4px; }
.eco-swal .eco-swal-text { font-size: .98rem; color: var(--muted); line-height: 1.7; }
.eco-swal .eco-swal-actions { gap: 10px; margin-top: 20px; }
.eco-swal .eco-swal-actions .btn { min-width: 110px; padding: 10px 20px; }
.eco-swal .swal2-icon { border-width: 3px; margin-top: 6px; }
.eco-swal .swal2-icon.swal2-question { border-color: var(--g-500); color: var(--g-600); }
.eco-swal .swal2-icon.swal2-warning { border-color: var(--warning); color: var(--warning); }
.eco-swal .swal2-icon.swal2-success { border-color: var(--g-500); color: var(--g-600); }
.eco-swal .swal2-icon.swal2-success [class^='swal2-success-line'] { background-color: var(--g-600); }
.eco-swal .swal2-icon.swal2-success .swal2-success-ring { border-color: color-mix(in srgb, var(--g-500) 35%, transparent); }
.eco-swal .swal2-icon.swal2-success [class^='swal2-success-circular-line'], .eco-swal .swal2-icon.swal2-success .swal2-success-fix { background: var(--surface); }
.eco-swal .eco-swal-input.swal2-textarea { font-family: var(--font); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: none; margin: 16px 6px 4px; width: auto; min-height: 90px; font-size: .95rem; }
.eco-swal .eco-swal-input.swal2-textarea:focus { border-color: var(--g-500); box-shadow: 0 0 0 3px rgba(34,160,107,.15); }
.eco-swal .swal2-validation-message { background: var(--danger-bg); color: var(--danger); font-family: var(--font); border-radius: 8px; margin: 8px 6px 0; }
.eco-swal.eco-toast.swal2-popup { padding: 10px 14px; border-radius: 12px; }
.eco-swal.eco-toast .swal2-title { font-size: .92rem; color: var(--text); margin: 0 8px; }
.eco-swal.eco-toast .swal2-timer-progress-bar { background: var(--g-500); }
.eco-swal-in { animation: ecoSwalIn .18s ease-out; }
@keyframes ecoSwalIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
/* ---------- Collapsible sidebar (desktop icon rail) ---------- */
.sidebar, .main { transition: width .22s ease, margin .22s ease; }
@media (min-width: 961px) {
  body.sidebar-collapsed { --sidebar-w: 76px; }
  body.sidebar-collapsed .sidebar { overflow-x: hidden; }
  body.sidebar-collapsed .brand { justify-content: center; padding: 20px 0; }
  body.sidebar-collapsed .brand div, body.sidebar-collapsed .nav-label { display: none; }
  body.sidebar-collapsed .sidebar nav { padding: 6px 10px; }
  body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; position: relative; }
  body.sidebar-collapsed .nav-item > span:not(.nav-badge) { display: none; }
  body.sidebar-collapsed .nav-item.active { box-shadow: inset -3px 0 0 var(--lime); }
  body.sidebar-collapsed .nav-badge { position: absolute; top: 4px; inset-inline-start: 8px; line-height: 16px; min-width: 16px; padding: 0 4px; font-size: .65rem; text-align: center; }
  body.sidebar-collapsed .sidebar nav > .nav-item + .nav-label, body.sidebar-collapsed .sidebar nav .nav-label + .nav-item { margin-top: 0; }
  body.sidebar-collapsed .sidebar nav .nav-label { display: block; height: 1px; padding: 0; margin: 10px 8px; background: rgba(255,255,255,.08); font-size: 0; }
  body.sidebar-collapsed [data-collapse-sidebar] .ic { transform: scaleX(-1); }
}
@media (max-width: 960px) { .hide-mobile-sb { display: none; } }

/* ---------- Kanban tools: collapse / expand / fullscreen ---------- */
.kanban-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 12px; }
.kanban-total { margin-inline-end: auto; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--g-500); background: var(--surface); color: var(--g-600); cursor: pointer; transition: background .15s, transform .1s; }
.round-btn:hover { background: var(--g-100); }
.round-btn:active { transform: scale(.95); }
.kb-board { display: flex; align-items: stretch; }
.kb-board .k-col { flex: 1 0 270px; max-width: 360px; transition: flex-basis .2s ease, max-width .2s ease; background: color-mix(in srgb, var(--c) 5%, var(--surface-2)); }
.kb-board .k-head { gap: 6px; }
.k-share { font-size: .7rem; font-weight: 700; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 99px; padding: 0 7px; background: var(--surface); }
.k-toggle { width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; transform: scaleX(-1); }
.k-toggle:hover { background: var(--surface); color: var(--c); }
.k-rail { display: none; }
.kb-board .k-col.collapsed { flex: 0 0 66px; max-width: 66px; cursor: pointer; }
.kb-board .k-col.collapsed > .k-head, .kb-board .k-col.collapsed > .k-sum, .kb-board .k-col.collapsed > .k-body { display: none; }
.kb-board .k-col.collapsed > .k-rail { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0; width: 100%; flex: 1; border: 0; background: transparent; font: inherit; color: var(--c); cursor: pointer; min-height: 420px;
  border-bottom: 6px solid var(--c); border-radius: 0 0 var(--radius) var(--radius); }
.k-rail-name { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 700; letter-spacing: .5px; font-size: .95rem; }
.k-rail .k-rail-count { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; border: 0; font-size: .85rem; padding: 0; }
.k-rail-sum { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .8rem; font-weight: 600; }
.k-rail-share { font-size: .68rem; font-weight: 700; border: 1px solid currentColor; border-radius: 99px; padding: 1px 6px; background: var(--surface); }
.kb-board .k-col.collapsed.drop-over-col { outline: 2px dashed var(--c); outline-offset: -4px; }
.k-value { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-variant-numeric: tabular-nums; }
.k-prob { font-size: .7rem; font-weight: 700; padding: 0 7px; border-radius: 99px; }
.k-prob.p-hi { background: var(--success-bg); color: var(--success); }
.k-prob.p-mid { background: var(--warning-bg); color: var(--warning); }
.k-prob.p-lo { background: var(--danger-bg); color: var(--danger); }
.k-bar { display: block; height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 4px 0 2px; }
.k-bar i { display: block; height: 100%; border-radius: 99px; }
.k-bar.p-hi i { background: var(--success); } .k-bar.p-mid i { background: var(--warning); } .k-bar.p-lo i { background: var(--danger); }
.k-owner { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; font-size: .78rem; }
.avatar.xs { width: 22px; height: 22px; font-size: .7rem; }
.kanban-wrap:fullscreen { background: var(--bg); padding: 18px; overflow: auto; }
.kanban-wrap:fullscreen .kb-board .k-col { max-height: calc(100vh - 110px); }
.kanban-wrap:fullscreen .kb-board .k-col.collapsed > .k-rail { min-height: calc(100vh - 140px); }
/* ---------- Charts: grow-in animations, hover focus, tooltips ---------- */
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bars .bar-stack { position: relative; overflow: visible; background: transparent; transform-origin: 50% 100%; animation: growY .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 55ms + .1s); transition: opacity .2s, filter .2s; }
.bars .bar-stack i { border-radius: 4px 4px 0 0; }
.bars .bar-stack i + i { border-radius: 0; }
.bars .bar-col.is-empty .bar-stack { min-height: 3px; background: var(--surface-2); border-radius: 3px; }
.bar-val { position: absolute; bottom: calc(100% + 4px); left: 50%; translate: -50% 0; font-size: .75rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.bar-col { cursor: default; }
.bars:hover .bar-col:not(:hover) .bar-stack { opacity: .4; }
.bar-col:hover .bar-stack { filter: brightness(1.06) saturate(1.1); }
.bar-col:hover small { color: var(--text); font-weight: 700; }
.funnel-row .f-bar i { transform-origin: right center; animation: growX .9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms + .1s); transition: filter .2s; }
[dir="ltr"] .funnel-row .f-bar i { transform-origin: left center; }
.funnel:hover .funnel-row:not(:hover) { opacity: .55; }
.funnel-row { transition: opacity .2s; }
.funnel-row:hover .f-bar i { filter: brightness(1.1) saturate(1.2); }
.progress i, .k-bar i { transform-origin: right center; animation: growX 1s cubic-bezier(.2,.8,.2,1) both .15s; }
[dir="ltr"] .progress i, [dir="ltr"] .k-bar i { transform-origin: left center; }

.donut-svg { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.donut-svg svg { width: 100%; height: 100%; overflow: visible; }
.donut-track { fill: none; stroke: var(--surface-2); stroke-width: 5.2; }
.donut-seg { fill: none; stroke-width: 5.2; cursor: pointer; transition: stroke-width .2s ease, opacity .2s ease; }
.donut-seg.animating { transition: stroke-dasharray .9s cubic-bezier(.2,.8,.2,1), stroke-width .2s ease, opacity .2s ease; transition-delay: calc(var(--i, 0) * 120ms), 0s, 0s; }
.donut-seg.hot, .donut-seg:hover { stroke-width: 7; }
.donut-svg.has-hover .donut-seg:not(.hot) { opacity: .35; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.donut-center b { font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut-center small { font-size: .74rem; color: var(--muted); max-width: 90px; line-height: 1.3; }
.legend li[data-seg] { cursor: pointer; border-radius: 6px; padding: 2px 6px; margin-inline: -6px; transition: background .15s; }
.legend li[data-seg].hot { background: var(--surface-2); }

.chart-tip { position: fixed; z-index: 3000; pointer-events: none; background: #102a22; color: #e9f5ef; padding: 8px 12px; border-radius: 10px; font-size: .8rem; line-height: 1.6;
  box-shadow: 0 10px 28px rgba(0,0,0,.25); opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease; width: max-content; max-width: min(300px, calc(100vw - 16px)); white-space: normal; overflow-wrap: anywhere; }
.chart-tip.show { opacity: 1; transform: none; }
.chart-tip b { display: block; color: #fff; font-size: .85rem; margin-bottom: 2px; }
.chart-tip span { display: block; color: #bfe3d2; }
@media (prefers-reduced-motion: reduce) {
  .bars .bar-stack, .funnel-row .f-bar i, .progress i, .k-bar i { animation: none !important; }
}

/* ---------- ECO ProjectFlow ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 18px; }
.project-tile { display: flex; flex-direction: column; gap: 6px; color: var(--text); transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.project-tile:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16,40,32,.12); border-color: var(--g-500); }
.project-tile h3 { margin: 4px 0 0; font-size: 1.05rem; }
.project-tile p { margin: 0; }
.pt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pt-progress { margin: 8px 0 4px; }
.pt-bars { position: relative; display: block; height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 16%, var(--surface)); overflow: hidden; }
.pt-bars.lg { height: 14px; }
.pt-bars > span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; transform-origin: right center; animation: growX 1s cubic-bezier(.2,.8,.2,1) both .1s; }
[dir="ltr"] .pt-bars > span { transform-origin: left center; }
.pt-plan { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--muted) 30%, transparent) 0 4px, color-mix(in srgb, var(--muted) 14%, transparent) 4px 8px); }
.pt-actual { background: var(--g-600); }
.pt-actual.success { background: var(--g-600); } .pt-actual.warning { background: var(--warning); } .pt-actual.danger { background: var(--danger); } .pt-actual.muted { background: var(--muted); }
.pt-legend { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pt-legend b { font-size: 1.15rem; }
.pt-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; padding: 10px 0; border-block: 1px solid var(--border); }
.pt-meta dt { font-size: .72rem; color: var(--muted); } .pt-meta dd { margin: 0; font-weight: 600; font-size: .85rem; }
.project-strip { display: grid; grid-template-columns: minmax(0, 2.4fr) repeat(4, minmax(0, 1fr)); gap: 18px; align-items: center; }
.ps-labels { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ps-labels b { font-size: 1.6rem; }
.ps-stat small { display: block; color: var(--muted); font-size: .76rem; }
.ps-stat b { font-size: .95rem; }
.phase-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 46px auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.phase-row:last-child { border-bottom: 0; }
.phase-name { display: flex; align-items: center; font-weight: 600; font-size: .9rem; }
.legend-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sw { display: inline-block; width: 18px; height: 8px; border-radius: 4px; margin-inline-start: 8px; }
.sw-plan { background: repeating-linear-gradient(-45deg, #b9c3bf 0 3px, #dfe5e2 3px 6px); } .sw-actual { background: var(--g-600); }
.sw-bar { background: color-mix(in srgb, var(--g-600) 25%, var(--surface-2)); } .sw-today { width: 3px; height: 14px; background: var(--danger); } .sw-late { background: var(--danger); }
.milestones { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.milestones li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.ms-dia { width: 12px; height: 12px; background: var(--g-600); transform: rotate(45deg); margin-top: 6px; flex-shrink: 0; border-radius: 2px; }
.milestones li.late .ms-dia { background: var(--danger); }

.gantt-card { overflow-x: auto; }
.gantt { --label: 300px; min-width: 860px; position: relative; font-size: .84rem; }
.g-head, .g-row { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); }
.g-head { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 600; color: var(--muted); }
.g-label { padding: 8px 12px; display: flex; align-items: center; gap: 8px; border-inline-end: 1px solid var(--border); min-width: 0; }
.g-track { position: relative; min-height: 38px; }
.g-months span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: .72rem; border-inline-start: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.g-row { border-bottom: 1px solid var(--border); }
.g-row:hover { background: var(--g-50); }
.g-phase { background: color-mix(in srgb, var(--c) 6%, var(--surface)); }
.g-row .g-track::after { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: var(--today); width: 2px; background: color-mix(in srgb, var(--danger) 70%, transparent); pointer-events: none; }
.g-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-row:not(.g-phase) .g-label { flex-wrap: wrap; row-gap: 2px; padding-block: 6px; }
.g-row:not(.g-phase) .g-title { flex: 1 1 100%; font-weight: 500; }
.g-row:not(.g-phase) .g-label .icon-btn { margin-inline-start: auto; }
.g-row:not(.g-phase) .g-track { min-height: 52px; }
.g-row:not(.g-phase) .g-bar { top: 17px; }
.g-row:not(.g-phase) .g-milestone { top: 18px; }
.g-row.done .g-title { color: var(--muted); text-decoration: line-through; }
.g-row.late .g-title { color: var(--danger); font-weight: 600; }
.g-sub { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.g-bar { position: absolute; top: 10px; height: 18px; min-width: 12px; border-radius: 6px; background: color-mix(in srgb, var(--c) 25%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); overflow: hidden; cursor: pointer;
  transform-origin: right center; animation: growX .7s cubic-bezier(.2,.8,.2,1) both .1s; }
[dir="ltr"] .g-bar { transform-origin: left center; }
.g-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--c); }
.g-row.late .g-bar { border-color: var(--danger); }
.g-phase-bar { top: 13px; height: 12px; border-radius: 99px; }
.g-milestone { position: absolute; top: 11px; width: 16px; height: 16px; margin-inline-start: -8px; background: var(--c); transform: rotate(45deg); border-radius: 3px; cursor: pointer; box-shadow: 0 0 0 3px var(--surface); }
.g-row.done .g-milestone { background: var(--c); }
.g-row.late .g-milestone { background: var(--danger); }
.g-progress { display: flex; align-items: center; gap: 6px; margin: 0; }
.g-progress input[type=range] { width: 80px; padding: 0; accent-color: var(--c); }
.g-progress output { font-size: .74rem; font-weight: 700; min-width: 34px; }
.phase-edit { display: flex; align-items: center; gap: 8px; }
.phase-edit .inline-form { flex: 1; }

.daily-layout { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.report-list ul { list-style: none; margin: 10px 0 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.report-list li a { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--text); border-top: 1px solid var(--border); }
.report-list li a:hover { background: var(--g-50); text-decoration: none; }
.report-list li.active a { background: var(--g-100); box-shadow: inset -3px 0 0 var(--g-600); }
.rl-date { width: 44px; height: 46px; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.rl-date b { font-size: 1.1rem; line-height: 1; } .rl-date small { font-size: .66rem; color: var(--muted); }
.rl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rl-body .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 12px; }
.rs-date b { display: block; } .rs-date span { font-size: .8rem; color: var(--muted); }
.rs-crew { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.rs-crew b { color: var(--text); font-size: 1.1rem; margin-inline-end: 3px; }
.rs-total b { color: var(--g-600); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); transition: transform .2s ease; }
.photo-grid a:hover img { transform: scale(1.03); }
.photo-item { position: relative; }
.photo-item form { position: absolute; top: 6px; inset-inline-end: 6px; margin: 0; }
.photo-del { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-drop { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 16px; flex-direction: row !important; align-items: center; flex-wrap: wrap; gap: 8px !important; cursor: pointer; background: var(--surface-2); }
.photo-drop input { flex-basis: 100%; }
.photo-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-bottom: 10px; }
.photo-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.inline-status { display: inline; margin: 0; } .inline-status select { width: auto; padding: 4px 8px; font-size: .82rem; }
@media (max-width: 960px) {
  .project-strip { grid-template-columns: 1fr 1fr; } .project-strip .ps-progress { grid-column: 1 / -1; }
  .daily-layout { grid-template-columns: 1fr; }
  .phase-row { grid-template-columns: 120px minmax(0, 1fr) 40px; } .phase-row .badge { display: none; }
}
@media (max-width: 640px) { .gantt { --label: 210px; } .pt-meta { grid-template-columns: repeat(2, 1fr); } }

/* ---------- ProjectFlow: BOQ, claims, variations ---------- */
.fin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.fin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.fin-card small { color: var(--muted); font-size: .78rem; }
.fin-card b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.fin-card.accent { border-color: var(--g-500); background: var(--g-50); }
.fin-card .pt-bars { height: 8px; margin: 4px 0 2px; }
.text-warning { color: var(--warning) !important; }
.mini-bar { display: inline-block; width: 70px; height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 16%, var(--surface)); overflow: hidden; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; background: var(--g-600); border-radius: 99px; }
.boq-table tr.vo-row td { background: var(--info-bg); }
.boq-table tfoot td, .claim-table tfoot td { background: var(--surface-2); }
.claim-table td, .claim-table th { white-space: nowrap; }
.claim-table td:nth-child(2) { white-space: normal; min-width: 180px; }
.claim-table [data-cur], .claim-table [data-cur-amt] { color: var(--g-700); font-weight: 600; }
.input-warn { border-color: var(--danger) !important; background: var(--danger-bg) !important; }
.claim-totals { max-width: 420px; margin: 16px 0 16px auto; }
[dir="rtl"] .claim-totals { margin: 16px auto 16px 0; }
.claim-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.claim-actions .inline-form input { width: auto; min-width: 140px; }
.pay-form input[type=number] { width: 150px; }
.calc-steps { margin: 0; padding-inline-start: 18px; display: grid; gap: 8px; color: var(--muted); }
.calc-steps b { color: var(--text); }
.vo-total { font-size: 1rem; margin: 12px 0; }
.vo-total b { font-size: 1.2rem; color: var(--g-700); }
.fin-mini .fm-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: .9rem; border-bottom: 1px dashed var(--border); }
.fin-mini .fm-row span { color: var(--muted); }
.fin-mini .pt-bars { margin-top: 8px; }
.claim-doc .qd-table { font-size: .74rem; }
.claim-doc .qd-table th, .claim-doc .qd-table td { padding: 6px 5px; }
.claim-sign div { flex: 1; display: flex; flex-direction: column; }
.claim-sign .sig { margin-top: auto; min-height: 40px; }
.claim-doc { page: claim; }
@page claim { size: A4 landscape; margin: 10mm; }
@media print { .claim-doc .qd-table { font-size: 8.5pt; } }

.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.w-check { width: 36px; text-align: center !important; padding-inline: 8px !important; }
.table tr.row-active td { background: var(--g-50); }
.demo-delete { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.demo-list { margin: 0 0 16px; padding-inline-start: 20px; font-size: .9rem; display: grid; gap: 6px; }
/* platform page: rows of 4 then the rest centred (4 + 3 for seven products) */
.products.app-products { display: flex; flex-wrap: wrap; justify-content: center; }
.app-products > .product { flex: 0 0 calc((100% - 3 * 14px) / 4); min-width: 0; }
@media (max-width: 1000px) { .app-products > .product { flex-basis: calc((100% - 2 * 14px) / 3); } }
@media (max-width: 640px) { .app-products > .product { flex-basis: calc((100% - 14px) / 2); } }
.crm-pill { --c: #64748b; display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.dot-c { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-inline-end: 6px; }
.funnel-row.wide { grid-template-columns: 140px 1fr 30px 70px; }
.f-label { display: flex; align-items: center; }
.f-val { font-size: .8rem; color: var(--muted); text-align: end; white-space: nowrap; }
.tab-count { font-style: normal; font-size: .7rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 0 6px; }
.tabs a.active .tab-count { background: var(--g-100); border-color: var(--g-500); }

.crm-stagebar { display: flex; gap: 4px; margin: 0 0 16px; overflow-x: auto; padding-bottom: 2px; }
.crm-stagebar > button, .crm-stagebar > span { --c: #64748b; flex: 1 0 auto; min-width: 92px; padding: 9px 18px; font: inherit; font-size: .84rem; font-weight: 600;
  border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer; text-align: center; white-space: nowrap;
  clip-path: polygon(100% 0, 12px 0, 0 50%, 12px 100%, 100% 100%, calc(100% - 12px) 50%); }
.crm-stagebar > :first-child { clip-path: polygon(100% 0, 12px 0, 0 50%, 12px 100%, 100% 100%); }
.crm-stagebar > button:hover:not(:disabled) { background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--c); }
.crm-stagebar > .passed { background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); }
.crm-stagebar > .current { background: var(--c); color: #fff; cursor: default; }
.crm-stagebar.readonly > span { cursor: default; }
.lead-layout { margin-top: 4px; }
.convert-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; flex-wrap: wrap; }
.convert-row > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.convert-details summary { list-style: none; cursor: pointer; }
.convert-details summary::-webkit-details-marker { display: none; }
.convert-details[open] { flex-basis: 100%; }
.convert-details form { margin-top: 10px; }

.log-types { flex-wrap: wrap; }
.log-types label { flex: 1 1 auto; }
.log-types span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; font-size: .85rem; }
.crm-timeline li { gap: 10px; }
.crm-timeline li::before { inset-inline-start: 13px; top: 28px; }
.t-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex-shrink: 0; border: 1px solid var(--border); }
.crm-timeline li.manual .t-ic { background: var(--g-100); color: var(--g-600); border-color: var(--g-500); }
.crm-timeline p { margin: 4px 0; background: var(--surface-2); padding: 8px 12px; border-radius: 10px; }

.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; }
.contact-card header { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.contact-card.primary { border-color: var(--g-500); }
.contact-lines { list-style: none; margin: 0 0 10px; padding: 0; font-size: .88rem; display: grid; gap: 4px; }
.contact-lines li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.crm-tasks li { grid-template-columns: auto 1fr auto auto auto; }
.reminder-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.reminder-row > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.task-group h3 { display: flex; align-items: center; gap: 8px; }
.task-group.g-overdue { border-inline-start: 4px solid var(--danger); }
.task-group.g-today { border-inline-start: 4px solid var(--warning); }

.kb-board .k-col { border-top: 3px solid var(--c); }
.k-sum { padding: 6px 14px; font-size: .78rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.k-card[draggable="true"] { cursor: grab; }
.k-card.dragging { opacity: .45; }
.k-body.drop-over { background: color-mix(in srgb, var(--c) 10%, transparent); outline: 2px dashed var(--c); outline-offset: -6px; border-radius: 10px; }
.k-body { min-height: 80px; }
.page-actions .btn.active { background: var(--g-100); border-color: var(--g-500); color: var(--g-700); }

.calendar { overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: 10px; text-align: center; font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 112px; border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-inline-end: 0; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num { opacity: .45; }
.cal-num { font-size: .8rem; font-weight: 700; color: var(--muted); }
.cal-day.today .cal-num { background: var(--g-600); color: #fff; border-radius: 99px; width: 24px; height: 24px; display: grid; place-items: center; }
.ev { display: block; font-size: .72rem; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); border-inline-start: 3px solid; }
.ev:hover { text-decoration: none; filter: brightness(.95); }
.ev-task { background: var(--info-bg); border-color: var(--info); }
.ev-reminder { background: var(--warning-bg); border-color: var(--warning); }
.ev-close { background: var(--success-bg); border-color: var(--success); }
.ev-done { opacity: .5; text-decoration: line-through; }
.ev-more { font-size: .7rem; color: var(--muted); }
.cal-legend { margin-bottom: 10px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; border-inline-start: 3px solid; }
.color-in { width: 44px; height: 32px; padding: 2px; }

/* quotation document */
.quote-preview { padding: 0; overflow: hidden; }
.quote-doc { background: #fff; color: #13201c; padding: 34px 36px; font-size: .9rem; }
.qd-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 3px solid var(--g-600); flex-wrap: wrap; }
.qd-brand { display: flex; gap: 12px; align-items: flex-start; }
.qd-brand strong { display: block; font-size: 1.2rem; color: var(--g-800); }
.qd-brand small { display: block; color: #66756f; font-size: .78rem; }
.qd-title { text-align: end; }
.qd-title h2 { margin: 0; color: var(--g-700); font-size: 1.6rem; }
.qd-title span { display: block; color: #66756f; font-size: .8rem; letter-spacing: 2px; text-transform: uppercase; }
.qd-title b { display: inline-block; margin-top: 6px; background: #e3f4ec; color: var(--g-700); padding: 2px 12px; border-radius: 6px; }
.qd-meta { display: flex; justify-content: space-between; gap: 20px; margin: 20px 0; flex-wrap: wrap; }
.qd-meta > div { display: flex; flex-direction: column; gap: 2px; }
.qd-meta small { color: #66756f; }
.qd-meta strong { font-size: 1.05rem; }
.qd-meta span { color: #3d4a45; font-size: .85rem; }
.qd-meta dl { display: grid; grid-template-columns: auto auto; gap: 4px 16px; margin: 0; font-size: .85rem; }
.qd-meta dt { color: #66756f; }
.qd-meta dd { margin: 0; font-weight: 600; }
.qd-subject { background: #f1f9f5; padding: 8px 12px; border-radius: 8px; }
.qd-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .84rem; }
.qd-table th { background: var(--g-800); color: #fff; padding: 9px 8px; text-align: start; font-weight: 600; }
.qd-table td { padding: 9px 8px; border-bottom: 1px solid #e1e8e4; vertical-align: top; }
.qd-table tr:nth-child(even) td { background: #f8faf9; }
.qd-totals { display: flex; justify-content: flex-end; }
.qd-totals dl { display: grid; grid-template-columns: auto minmax(140px, auto); gap: 6px 24px; margin: 0; min-width: 300px; }
.qd-totals dt { color: #66756f; }
.qd-totals dd { margin: 0; text-align: end; font-weight: 600; }
.qd-totals .grand { font-size: 1.1rem; color: var(--g-700); border-top: 2px solid var(--g-600); padding-top: 8px; font-weight: 700; }
.qd-block { margin-top: 18px; }
.qd-block h4 { color: var(--g-700); margin-bottom: 4px; }
.qd-block p { color: #3d4a45; font-size: .85rem; }
.qd-foot { display: flex; justify-content: space-between; gap: 30px; margin-top: 40px; }
.qd-foot div { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.qd-foot small { color: #66756f; }
.qd-foot .sig { border-bottom: 1px dashed #9aa7a2; height: 40px; }
.print-body { background: #e9eeec; padding: 20px; }
.print-body .quote-doc { max-width: 210mm; margin: 0 auto; box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.print-bar { max-width: 210mm; margin: 0 auto 14px; display: flex; gap: 8px; }
@media print {
  .print-body { background: #fff; padding: 0; }
  .print-bar { display: none; }
  .print-body .quote-doc { box-shadow: none; padding: 0; max-width: none; }
  .qd-table th, .qd-totals .grand { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4; margin: 14mm; }
}
@media (max-width: 640px) {
  .quote-doc { padding: 18px; }
  .cal-day { min-height: 70px; padding: 3px; }
  .ev { font-size: .62rem; padding: 1px 3px; }
  .funnel-row.wide { grid-template-columns: 100px 1fr 24px 54px; }
  .crm-tasks li { grid-template-columns: auto 1fr auto; }
}

/* ---------- themed file picker (wraps native input[type=file], see app.js) ---------- */
.file-drop { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 6px; border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); transition: border-color .15s, background .15s; cursor: pointer; }
.file-drop:hover, .file-drop.drag, .file-drop:focus-within { border-color: var(--g-500); background: var(--g-50); }
.file-drop:focus-within { box-shadow: 0 0 0 3px rgba(34,160,107,.15); }
.file-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; margin: 0; border: 0; z-index: 1; }
.fd-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--g-100); color: var(--g-600); transition: transform .2s; }
.file-drop:hover .fd-ic, .file-drop.drag .fd-ic { transform: translateY(-2px); }
.fd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fd-text b { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-text small { color: var(--muted); font-size: .76rem; }
.file-drop.has-file { border-style: solid; border-color: var(--g-500); background: var(--g-50); }
.file-drop.has-file .fd-ic { background: var(--g-600); color: #fff; }
.demo-projects { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.demo-projects h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; }

/* ---------- ProjectFlow: costs (budget vs actual) & portfolio dashboard ---------- */
.card-head.pad, .empty-sm.pad { padding: 14px 16px 0; }
.card.p0 .card-head.pad { margin-bottom: 10px; }
.cost-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; white-space: nowrap; color: var(--text); }
.cost-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-filter a { font-size: .76rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); }
.chip-filter a:hover { border-color: var(--g-500); color: var(--text); }
.chip-filter a.active { background: var(--g-600); border-color: var(--g-600); color: #fff; }
.legend i.sw-budget { background: color-mix(in srgb, var(--muted) 28%, var(--surface)); }
.legend i.sw-actual { background: var(--g-600); }
.bva { display: flex; flex-direction: column; gap: 12px; }
.bva-row { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 12px; cursor: default; }
.bva-label { display: flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 600; }
.bva-bars { position: relative; height: 22px; }
.bva-budget, .bva-actual { position: absolute; inset-inline-start: 0; border-radius: 6px; transform-origin: right center; animation: growX .9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms); }
.bva-budget { top: 0; height: 22px; background: color-mix(in srgb, var(--muted) 18%, var(--surface)); }
.bva-actual { top: 5px; height: 12px; background: var(--c); }
.bva-actual.over { background: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 25%, transparent); }
.bva-row b { font-size: .85rem; text-align: end; font-variant-numeric: tabular-nums; }
.bva:hover .bva-row:not(:hover) { opacity: .45; }
.bva-row { transition: opacity .2s; }
.bars .bar-stack i.cost { flex: 1; background: linear-gradient(180deg, #2fb37c, var(--g-600)); }
.cost-bars { height: 190px; }
.mini-bar.over i { background: var(--danger); }
.budget-start { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 4px 0 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--border); }
.budget-start .inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.budget-start label { display: flex; align-items: center; gap: 6px; margin: 0; }
.dl.evm dt { cursor: help; }
@media (prefers-reduced-motion: reduce) { .bva-budget, .bva-actual { animation: none; } }
@media (max-width: 560px) { .bva-row { grid-template-columns: 86px 1fr 40px; gap: 8px; } }
.gbars .gstack { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 100%; transform-origin: 50% 100%; animation: growY .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 55ms + .1s); transition: opacity .2s; }
.gbars .gstack i { flex: 1; max-width: 16px; min-height: 2px; border-radius: 4px 4px 0 0; }
.gbars .bar-col { min-width: 0; }
.gbars .bar-col > .gstack + small { margin-top: 0; }
.gbars .bar-col { justify-content: flex-end; }
.gbars .bar-col .gstack { flex: 1; }
.gbars:hover .bar-col:not(:hover) .gstack { opacity: .4; }
.pd-row { color: inherit; border-radius: 8px; transition: background .15s; }
.pd-row:hover { background: var(--surface-2); color: inherit; }
.pd-row .phase-name > span { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.pd-row .phase-name > span { overflow: hidden; }
.pd-code { font-size: .72rem; color: var(--g-600); font-weight: 700; }
a.bva-row { color: inherit; }
.bva-eac { position: absolute; top: -3px; width: 3px; height: 28px; margin-inline-start: -1px; border-radius: 2px; background: var(--text); opacity: .55; }
.legend i.sw-eac { width: 3px; height: 12px; border-radius: 2px; background: var(--text); opacity: .55; }
@media (prefers-reduced-motion: reduce) { .gbars .gstack { animation: none; } }
.cost-meta { margin-top: 2px; } .cost-chip { font-weight: 500; color: var(--muted); }
.pf-table td:first-child { min-width: 210px; } .pf-table td:first-child b { white-space: nowrap; }
@media (max-width: 560px) { .cost-bars .bar-val { font-size: .58rem; white-space: nowrap; } .cost-bars { gap: 4px; } }
/* project tabs: wrap on wide screens so the last tabs (costs, documents...) are never hidden; scroll on phones */
@media (min-width: 900px) { .tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; } .tabs a { padding: 10px 12px; } }
.cost-hint p { margin: 0 0 12px; color: var(--muted); } .cost-hint-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .kpis.kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kpis.kpis-3 { grid-template-columns: 1fr; } }
.src-lead { display: inline-flex; align-items: center; gap: 6px; }
.src-lead i.crm-pill { font-style: normal; }
/* landing roadmap: phase 1 delivered, phase 2 under way */
.phase.done { border-color: rgba(140,198,63,.55); background: rgba(140,198,63,.05); }
.phase.done b { background: var(--lime); color: var(--g-900); }
.phase .pill-live { background: var(--lime); color: var(--g-900); font-size: .68rem; padding: 2px 9px; vertical-align: middle; }

/* ---------- ECO ProcureFlow: vendors & material requests ---------- */
.tag { display: inline-block; font-size: .72rem; padding: 1px 8px; margin: 1px 0 1px 4px; border-radius: 99px; background: var(--g-50); color: var(--g-700); border: 1px solid var(--g-100); white-space: nowrap; }
.stars { color: #e0a800; letter-spacing: 1px; } .stars i { font-style: normal; color: color-mix(in srgb, var(--muted) 30%, transparent); }
.cat-picks { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin: 0 0 12px; }
.cat-picks legend { font-size: .85rem; color: var(--muted); padding: 0 6px; }
.cat-picks label.check { margin: 0; font-size: .85rem; }
.card.narrow { max-width: 620px; }
.mr-items select, .mr-items input { min-width: 0; }
.mr-items td:nth-child(2) { min-width: 180px; }
.mr-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mr-actions form { margin: 0; }
.pad-box { padding: 4px 16px 12px; }
.avail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.avail-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: .85rem; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.avail-list li:last-child { border-bottom: 0; }
.avail-list li small { grid-column: 1 / -1; }
.avail-list li.over b { color: var(--danger); }
/* editing a request: the items table needs the full width; status and budget cards sit below in two columns */
.mr-edit-layout > aside.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 18px; align-items: start; }
.demo-shortcut { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 16px 16px; }
/* ---------- ProcureFlow sprint 2: RFQ comparison, purchase orders ---------- */
.cmp-table th { vertical-align: top; min-width: 130px; }
.cmp-table .cmp-best { background: color-mix(in srgb, var(--g-500) 9%, transparent); }
.cmp-low { font-weight: 800; color: var(--g-700); }
.vendor-picks { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; max-height: 320px; overflow: auto; }
.vendor-picks legend { font-size: .85rem; color: var(--muted); padding: 0 6px; }
.vendor-picks label.check { margin: 0; align-items: flex-start; }
.award-opt { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 0 0 6px; }
.award-opt:has(input:checked) { border-color: var(--g-500); background: var(--g-50); }
.po-steps { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.po-steps li { display: flex; flex-direction: column; gap: 2px; padding-inline-start: 14px; border-inline-start: 3px solid var(--border); }
.po-steps li.approved { border-color: var(--g-500); }
.po-steps li.rejected { border-color: var(--danger); }
.po-steps li.current { border-color: var(--warning); }
.po-doc { position: relative; }
.po-doc .draft-mark { position: absolute; top: 40%; inset-inline: 0; text-align: center; font-size: 3.2rem; font-weight: 800; color: rgba(208,69,63,.12); transform: rotate(-18deg); pointer-events: none; }
.row-actions { display: inline-flex; gap: 6px; margin-inline-start: 10px; flex-wrap: wrap; vertical-align: middle; }

/* ---------- sidebar: one colored, collapsible group per product (like the ERP) ---------- */
.nav-top { padding: 4px 0 6px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.07); }
.nav-group { margin: 0 0 2px; border-radius: 12px; border-inline-start: 3px solid transparent; transition: background .2s, border-color .2s; }
.nav-group.is-current, .nav-group[open] { background: rgba(255,255,255,.025); }
.nav-group.is-current { border-inline-start-color: var(--grp-c); }
.nav-group-head { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 10px; cursor: pointer;
  color: #d7ebe2; font-size: .8rem; font-weight: 700; letter-spacing: .2px; user-select: none; transition: background .15s, color .15s; }
.nav-group-head::-webkit-details-marker { display: none; }
.nav-group-head::marker { content: ''; }
.nav-group-head:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-group-head:focus-visible { outline: 2px solid var(--grp-c); outline-offset: 1px; }
.grp-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--grp-c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 3px rgba(0,0,0,.35); transition: transform .15s, box-shadow .2s; }
.nav-group-head:hover .grp-ic { transform: scale(1.06); }
.nav-group.is-current .grp-ic { box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 14px color-mix(in srgb, var(--grp-c) 65%, transparent); }
.grp-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-chev { flex: none; display: grid; place-items: center; color: #8fb3a4; transition: transform .2s; }
.nav-group[open] .grp-chev { transform: rotate(-90deg); }
.nav-group[open] .grp-badge { display: none; }   /* item badges take over once the group is open */
.nav-group-items { padding: 2px 0 6px; }
.nav-group-items .nav-item { padding: 8px 12px 8px 12px; padding-inline-start: 22px; font-size: .9rem; }
.nav-group-items .nav-item .ic { opacity: .85; }
.nav-group-items .nav-item.active { background: linear-gradient(to left, color-mix(in srgb, var(--grp-c) 28%, transparent), transparent); box-shadow: inset -3px 0 0 var(--grp-c); }
.nav-group-items .nav-item.active .ic { color: color-mix(in srgb, var(--grp-c) 55%, #fff); opacity: 1; }
.nav-group[open] .nav-group-items { animation: navGroupIn .18s ease-out; }
@keyframes navGroupIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nav-group[open] .nav-group-items { animation: none; } .grp-chev, .grp-ic { transition: none; } }
/* icon rail (collapsed sidebar): group tiles stay, item icons show under an open group */
@media (min-width: 961px) {
  body.sidebar-collapsed .nav-top { border: 0; margin: 0; padding: 0; }
  body.sidebar-collapsed .nav-group { border-inline-start: 0; border-radius: 12px; }
  body.sidebar-collapsed .nav-group-head { justify-content: center; padding: 8px 0; position: relative; }
  body.sidebar-collapsed .grp-label, body.sidebar-collapsed .grp-chev { display: none; }
  body.sidebar-collapsed .grp-badge { position: absolute; top: 2px; inset-inline-start: 6px; line-height: 16px; min-width: 16px; padding: 0 4px; font-size: .65rem; text-align: center; }
  body.sidebar-collapsed .nav-group-items { padding: 0 0 4px; }
  body.sidebar-collapsed .nav-group-items .nav-item { padding: 9px 0; justify-content: center; }
  body.sidebar-collapsed .nav-group.is-current { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--grp-c) 45%, transparent); }
}
.grp-label { display: flex; flex-direction: column; line-height: 1.25; }
.grp-label b { font-size: .88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.grp-label small { font-size: .66rem; font-weight: 600; color: color-mix(in srgb, var(--grp-c) 45%, #b9d6ca); letter-spacing: .3px; text-align: start; overflow: hidden; text-overflow: ellipsis; }
/* ---------- ProcureFlow sprint 3: receiving & vendor invoices ---------- */
.recv-meter { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.recv-meter b { color: var(--text); }
.recv-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.recv-form label { flex: 1 1 160px; margin: 0; }
.recv-form .btn { flex: none; }
.recv-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 22px; padding: 14px 16px; border-top: 1px solid var(--border); }
.recv-split h4 { margin: 0 0 8px; font-size: .9rem; }
.recv-split .list li.is-void { opacity: .55; text-decoration: line-through; }
.link-btn { background: none; border: 0; padding: 0; color: var(--danger); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }
.issue-list { margin: 6px 0 0; padding-inline-start: 20px; }
.match-table td.text-danger b { text-decoration: underline wavy color-mix(in srgb, var(--danger) 50%, transparent); }
/* ---------- BidFlow: tender study before the Go / No-Go decision ---------- */
.study-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.study-head h3 { margin: 0 0 4px; }
.study-head p { margin: 0; max-width: 640px; }
.study-progress { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.study-progress .pt-bars { flex: 1; }
.study-progress b { font-size: 1.15rem; }
.pt-actual.warning { background: var(--warning); }
.study-table td { vertical-align: top; }
.study-table tr.is-ok td:first-child b { color: var(--g-700); }
.study-table tr.is-ok td:first-child b::before { content: "✓ "; color: var(--g-600); }
.study-table td:last-child input { min-width: 170px; }
.study-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.study-seg label { margin: 0 !important; }
.study-seg input { display: none; }
.study-seg span { display: block; padding: 5px 10px; font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--muted); border-inline-start: 1px solid var(--border); }
.study-seg label:first-child span { border-inline-start: 0; }
.study-seg input:checked + span { background: var(--g-600); color: #fff; }
.study-seg input[value="na"]:checked + span { background: var(--info); }
.study-seg input[value="pending"]:checked + span { background: var(--surface-2); color: var(--text); }
.override-box summary { cursor: pointer; font-weight: 600; color: var(--warning); display: flex; align-items: center; gap: 6px; }
.study-summary .ss-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.study-summary .ss-row span:first-child { flex: 1; color: var(--muted); }
.study-summary .ss-notes { margin: 8px 0 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.study-layout { display: flex; flex-direction: column; }
.study-layout > aside { order: -1; }
.study-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 18px; align-items: end; margin-bottom: 10px; }
.study-sum label { margin: 0; }
.ss-fig { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.ss-fig small { color: var(--muted); font-size: .78rem; }
.ss-fig b { font-size: 1.05rem; }
.study-sum-card textarea { min-height: 60px; }
.study-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.study-table td:first-child { min-width: 260px; }
.audit-details { line-height: 1.7; } .audit-details b { font-weight: 600; }

/* ---------- management plans: quality, risk, stakeholders ---------- */
.text-warning { color: var(--warning) !important; }
.sub-nav { margin: 0 0 14px; }
.plan-card .card-head h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-sections { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.plan-sections.edit { gap: 0 14px; }
.plan-sections.edit textarea { min-height: 96px; }
.plan-sec { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.plan-sec h4 { margin: 0 0 6px; font-size: .9rem; color: var(--g-600); }
.plan-sec p { margin: 0; font-size: .86rem; line-height: 1.75; }
.plan-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.inline-add { display: grid; grid-template-columns: 2fr 2fr 2fr 1fr 1fr 1fr auto; gap: 8px; align-items: end; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.inline-add label { margin: 0; font-size: .76rem; }
.mini-form summary { cursor: pointer; list-style: none; }
.mini-form[open] { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-top: 4px; min-width: 240px; }
.mini-form form { display: grid; gap: 6px; margin-top: 6px; }
.mini-form input, .mini-form select, .mini-form textarea { font-size: .8rem; padding: 5px 8px; }
.risk-score { display: inline-grid; place-items: center; min-width: 32px; height: 28px; border-radius: 7px; font-weight: 700; font-size: .85rem; color: #fff; }
.risk-score.sm { min-width: 26px; height: 22px; font-size: .74rem; }
.bg-danger { background: var(--danger); color: #fff; } .bg-warning { background: var(--warning); color: #fff; } .bg-success { background: var(--success); color: #fff; }
.risk-table td { vertical-align: top; }
.risk-del { display: flex; justify-content: flex-end; margin: -6px 0 14px; }
.table tr.is-void td { opacity: .5; }
.pair { display: flex; gap: 6px; }
.heatmap { display: grid; grid-template-columns: 22px repeat(5, 1fr); gap: 4px; margin: 10px 0 4px; direction: ltr; position: relative; padding-inline-start: 18px; }
.hm-cell { aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: .9rem; opacity: .28; }
.hm-cell.has { opacity: 1; cursor: default; box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }
.hm-lbl { display: grid; place-items: center; font-size: .72rem; color: var(--muted); }
.hm-axis { font-size: .72rem; color: var(--muted); }
.hm-y { position: absolute; left: -14px; top: 45%; transform: rotate(-90deg); }
.hm-x { grid-column: 2 / -1; text-align: center; direction: rtl; }
.sh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; padding-inline-start: 26px; margin-top: 8px; }
.sh-quad { min-height: 110px; border-radius: 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; border: 1px solid var(--border); }
.sh-quad > small { width: 100%; font-weight: 700; font-size: .74rem; }
.q-danger { background: var(--danger-bg); } .q-danger > small { color: var(--danger); }
.q-warning { background: var(--warning-bg); } .q-warning > small { color: var(--warning); }
.q-info { background: var(--info-bg); } .q-info > small { color: var(--info); }
.q-muted { background: var(--surface-2); } .q-muted > small { color: var(--muted); }
.sh-chip { font-size: .74rem; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 2px 9px; color: var(--text); }
.sh-chip:hover { border-color: var(--g-500); }
.sh-axis { font-size: .72rem; color: var(--muted); }
.sh-y { position: absolute; inset-inline-start: -10px; top: 45%; transform: rotate(-90deg); }
.sh-x { grid-column: 1 / -1; text-align: center; }
.plans-card .plan-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .86rem; }
.plans-card .plan-row:last-child { border-bottom: 0; }
.plan-doc .qd-block h4 { color: var(--g-800); }
.plan-doc .qd-table { font-size: .76rem; }
@media (max-width: 900px) { .plan-sections { grid-template-columns: 1fr; } .inline-add { grid-template-columns: 1fr 1fr; } }

/* ---------- help & workflow guides ---------- */
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.help-card { display: flex; gap: 14px; align-items: flex-start; color: var(--text); border-top: 4px solid var(--gd-c); transition: transform .15s, box-shadow .15s; }
.help-card:not(.is-soon):hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.help-card h3 a { color: inherit; } .help-card h3 a:hover { color: var(--gd-c); }
.hc-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.hc-video { display: inline-flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface, #fff); color: var(--text); font: inherit; cursor: pointer; text-align: start; transition: border-color .15s, box-shadow .15s; }
.hc-video:hover { border-color: var(--gd-c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gd-c) 15%, transparent); }
.hc-video b { display: block; font-size: .86rem; } .hc-video small { display: block; color: var(--muted); font-size: .74rem; }
.hv-thumb { flex: none; width: 84px; height: 47px; border-radius: 8px; background: #0d2a20 center / cover; display: grid; place-items: center; color: #fff; position: relative; overflow: hidden; }
.hv-thumb::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.28); }
.hv-thumb svg { position: relative; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); transition: transform .15s; }
.hc-video:hover .hv-thumb svg { transform: scale(1.12); }
.video-dlg { padding: 0; border: 0; background: transparent; width: min(1180px, 94vw); max-width: none; max-height: none; overflow: visible; }
.video-dlg::backdrop { background: rgba(5, 15, 12, .82); backdrop-filter: blur(3px); }
.vd-box { background: #0b1712; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.vd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; color: #e8f5ee; }
.vd-head .icon-btn { color: #e8f5ee; background: transparent; border-color: transparent; }
.vd-head .icon-btn:hover, .vd-head .icon-btn:focus-visible { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.2); }
.video-dlg video { display: block; width: 100%; max-height: calc(100vh - 120px); background: #000; aspect-ratio: 16 / 9; }
.help-card h3 { margin: 0 0 6px; } .help-card p { margin: 0 0 10px; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.hc-ic { flex: none; width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--gd-c); }
.help-card.is-soon { opacity: .75; }
.guide { display: grid; gap: 16px; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; position: sticky; top: 64px; z-index: 5; }
.guide-toc a { font-size: .8rem; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); }
.guide-toc a:hover { border-color: var(--gd-c); color: var(--text); }
.guide-card h2, .guide-h { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin: 0 0 12px; color: var(--text); }
.guide-card h2 svg, .guide-h svg { color: var(--gd-c); }
.guide-card h2 small { font-size: .72rem; color: var(--muted); font-weight: 500; }
.guide-intro { border-inline-start: 4px solid var(--gd-c); }
.guide-intro p { line-height: 1.9; margin: 0 0 8px; }
.guide-intro .chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: .82rem; }
.guide-intro .chain span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px 10px; }
.guide-intro .chain i { color: var(--muted); font-style: normal; }
.guide-legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: .74rem; margin-bottom: 10px; }
.guide-legend span { padding: 2px 10px; border-radius: 6px; border: 1px solid; }
.lg-start { background: #d1f0e0; border-color: #1f8a64 !important; color: #0f3d2c; } .lg-step { background: #e8f2fc; border-color: #1d6fb8 !important; color: #0f2c4a; }
.lg-gate { background: #fff3d6; border-color: #c98a0b !important; color: #4a3305; } .lg-stop { background: #fdecea; border-color: #d0453f !important; color: #5c1714; }
.guide-diagram { overflow-x: auto; text-align: center; min-height: 200px; direction: ltr; }
.guide-diagram svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: none; }
.guide-step { display: flex; gap: 14px; align-items: flex-start; }
.gs-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--gd-c); }
.guide-step h3 { margin: 4px 0 6px; font-size: 1rem; }
.gs-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .76rem; color: var(--muted); margin-bottom: 6px; }
.gs-meta span { display: inline-flex; align-items: center; gap: 4px; }
.gs-body { font-size: .9rem; line-height: 1.85; }
.gs-body p { margin: 0 0 6px; } .gs-body ul { margin: 4px 0; padding-inline-start: 20px; }
.gs-body b, .guide-list b { color: var(--text); }
.guide-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.guide-list ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: .88rem; line-height: 1.75; }
.gl-rules { border-top: 3px solid var(--danger); } .gl-notices { border-top: 3px solid var(--info); } .gl-tips { border-top: 3px solid var(--warning); }
.guide-foot { text-align: center; }
kbd.ui { font-family: inherit; font-size: .8em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
@media print { .guide-toc, .page-actions, .sidebar, .topbar { display: none !important; } .guide-step, .guide-card { break-inside: avoid; } }
.guide-diagram foreignObject { overflow: visible; }

/* ---------- project closing ---------- */
.close-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.close-steps a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); height: 100%; position: relative; }
.close-steps a:hover { border-color: var(--g-500); }
.close-steps .cs-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin-bottom: 4px; }
.close-steps b { font-size: .88rem; } .close-steps small { font-size: .74rem; color: var(--muted); }
.close-steps li.current .cs-n { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.close-steps li.done .cs-n { background: var(--success); border-color: var(--success); color: #fff; }
.close-steps li.active a { border-color: var(--g-600); box-shadow: inset 0 -3px 0 var(--g-600); }
.close-checks { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; font-size: .86rem; }
.close-checks li { display: flex; gap: 8px; align-items: flex-start; }
.close-checks li.ok svg { color: var(--success); flex: none; margin-top: 3px; } .close-checks li.no svg { color: var(--danger); flex: none; margin-top: 3px; }
.release-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border); }
.inline-pay { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.inline-pay input { width: auto; flex: 1 1 140px; }
.reject-form { display: inline-flex; gap: 6px; align-items: center; } .reject-form input { width: 220px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.account-grid h4 { margin: 0 0 6px; color: var(--g-600); font-size: .9rem; }
.fin-mini .fm-row.total { border-bottom: 0; border-top: 2px solid var(--border); margin-top: 4px; padding-top: 8px; font-weight: 700; }
.lesson-row { border-bottom: 1px dashed var(--border); padding: 10px 0; font-size: .88rem; }
.lesson-row p { margin: 4px 0; }
.lesson-add { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
@media (max-width: 900px) { .close-steps { grid-template-columns: repeat(2, 1fr); } }

/* dashboard masonry (app.js sets each card's row span) */
.grid-dash.is-masonry { grid-auto-rows: 6px; }
.more-list > summary { cursor: pointer; list-style: none; font-size: .82rem; font-weight: 600; color: var(--g-600); padding: 8px 0 0; }
.more-list > summary::-webkit-details-marker { display: none; }
.more-list[open] > summary { display: none; }

/* completed tasks: a check mark on the bar, so completion does not depend on the phase colour */
.g-row.done .g-bar::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; text-shadow: 0 0 2px rgba(0,0,0,.35); }
.g-row.done .g-milestone::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .62rem; font-weight: 700; transform: rotate(-45deg); }
/* milestones: light while pending, solid with a ✓ once achieved (above), red outline when overdue */
.g-row:not(.done) .g-milestone { background: color-mix(in srgb, var(--c) 22%, var(--surface)); border: 2px solid var(--c); }
.g-row.late:not(.done) .g-milestone { border-color: var(--danger); }
.ps-stat em { display: block; font-style: normal; margin-top: 2px; }
/* the chevron expands a section without leaving the page, so it gets its own hit area */
.grp-chev { padding: 6px; margin: -6px; border-radius: 6px; cursor: pointer; }
.grp-chev:hover { background: rgba(255,255,255,.1); color: #fff; }

/* sidebar: the selected page sits apart from its section's colour line, and the current section's header glows softly */
.nav-group-items .nav-item { margin-inline: 8px 6px; }
.nav-group-items .nav-item.active { box-shadow: inset -3px 0 0 var(--grp-c), 0 0 0 1px color-mix(in srgb, var(--grp-c) 22%, transparent); }
[dir="ltr"] .nav-group-items .nav-item.active { box-shadow: inset 3px 0 0 var(--grp-c), 0 0 0 1px color-mix(in srgb, var(--grp-c) 22%, transparent); }
.nav-group.is-current > .nav-group-head { background: color-mix(in srgb, var(--grp-c) 12%, transparent); animation: grpHeadPulse 2.8s ease-in-out infinite; }
.nav-group.is-current > .nav-group-head:hover { background: color-mix(in srgb, var(--grp-c) 22%, transparent); animation: none; }
@keyframes grpHeadPulse {
  0%, 100% { background: color-mix(in srgb, var(--grp-c) 8%, transparent); }
  50%      { background: color-mix(in srgb, var(--grp-c) 20%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .nav-group.is-current > .nav-group-head { animation: none; } }
@media (min-width: 961px) { body.sidebar-collapsed .nav-group-items .nav-item { margin-inline: 4px; } }

/* settings: one topic per tab, full-width cards */
.settings-tabs { margin-bottom: 16px; }
.settings-body { max-width: 1100px; }
.settings-body td select { min-width: 160px; }

/* Hijri date shown beside a Gregorian one, and the Hijri field under a date input */
.hijri { font-size: .85em; opacity: .75; margin: 0 8px; white-space: nowrap; }
.hijri-input { margin-top: 6px; }
