:root {
  --mono: "IBM Plex Mono", ui-monospace, Consolas, "Courier New", monospace;
  --display: "Archivo", "Segoe UI", system-ui, sans-serif;
  font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  color: #10151c;
  background: #edf1f5;
  font-synthesis: none;
  --blue: #0b4f9e;
  --blue-dark: #07386f;
  --blue-soft: #eaf2fc;
  --orange: #e8701a;
  --teal: #12a5a5;
  --red: #c92a35;
  --ink: #10151c;
  --muted: #657284;
  --line: #d9e0e8;
  --panel: #fff;
  --canvas: #f5f7fa;
  --shadow: 0 10px 30px rgba(27, 47, 74, .07);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1180px; background: #edf1f5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, select, textarea {
  border: 1px solid #cbd5df;
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  padding: 9px 10px;
  outline: none;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,79,158,.12); }
textarea { resize: vertical; min-height: 70px; }
.mono, code { font-family: var(--mono), monospace; }

.platform { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  background: #092f5e;
  color: #fff;
  padding: 22px 14px 16px;
  position: fixed;
  inset-block: 0;
  width: 260px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
[dir="rtl"] .sidebar { right: 0; }
.brand-row { display: flex; gap: 12px; align-items: center; padding: 0 8px 18px; }
.brand-mark, .auth-logo {
  width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center;
  background: #fff; color: var(--blue); font-family: var(--display), sans-serif; font-weight: 700; letter-spacing: -.5px;
}
.brand-row strong { display: block; font: 700 16px var(--display), sans-serif; }
.brand-row small { color: #b9d2ef; display: block; font-size: 10px; margin-top: 3px; }
.version-strip { border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.06); border-radius: 8px; padding: 8px 10px; font-size: 11px; color: #d6e8fa; margin: 0 6px 15px; display: flex; align-items: center; gap: 7px; }
.version-strip b { margin-inline-start: auto; color: #7de1d9; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #31c48d; box-shadow: 0 0 0 4px rgba(49,196,141,.13); display: inline-block; }
.sidebar nav { display: grid; gap: 3px; overflow: auto; padding: 2px 0 10px; }
.nav-item { border: 0; background: transparent; color: #bfd4eb; border-radius: 8px; padding: 9px 10px; text-align: start; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 7px; font-size: 12px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.nav-glyph { font-family: var(--mono); text-align: center; font-size: 15px; }
.nav-item em { font-style: normal; font: 10px var(--mono); opacity: .8; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 13px; }
.runtime-state, .user-card { display: flex; align-items: center; gap: 10px; padding: 8px; }
.runtime-state strong, .user-card strong { display: block; font-size: 10px; }
.runtime-state small, .user-card small { color: #a9c5e1; font-size: 9px; display: block; margin-top: 2px; }
.user-card > span { width: 32px; height: 32px; display: grid; place-items: center; background: #e8701a; border-radius: 8px; font-size: 11px; font-weight: 700; }

.main-shell { grid-column: 2; min-width: 0; }
[dir="rtl"] .main-shell { grid-column: 2; margin-right: 0; }
.topbar { height: 82px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 28px; position: sticky; top: 0; z-index: 8; }
.breadcrumb { font-size: 10px; color: var(--muted); margin: 0 0 3px; }
.topbar h1 { margin: 0; font: 700 22px var(--display), "IBM Plex Sans", sans-serif; color: #17304c; }
.top-actions, .button-row { display: flex; align-items: center; gap: 8px; }
.button { border: 1px solid transparent; border-radius: 7px; padding: 9px 13px; font-weight: 600; font-size: 11px; }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { background: #fff; color: var(--blue); border-color: #b8c9dd; }
.button.ghost { background: #f4f7fa; color: #33465d; border-color: #e0e6ed; }
.button.wide { width: 100%; padding: 12px; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 600; padding: 4px; }
.icon-button { border: 1px solid #d9e0e8; background: #fff; border-radius: 6px; padding: 6px 8px; font-size: 10px; }
.danger-text { color: var(--red) !important; }

.page-content { padding: 22px 26px 48px; max-width: 1680px; margin: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 5px; color: var(--blue); font: 600 9px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 18px 13px; border-bottom: 1px solid #e7ebf0; }
.panel-head h3 { margin: 0; font: 700 16px var(--display), "IBM Plex Sans", sans-serif; }
.section-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 2px 0 18px; }
.section-intro h2 { margin: 0 0 5px; font: 700 25px var(--display), "IBM Plex Sans", sans-serif; color: #17304c; }
.section-intro p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; max-width: 820px; line-height: 1.55; }
.status { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 5px 9px; font: 600 9px var(--mono); white-space: nowrap; }
.status.good { background: #e6f7f1; color: #08775b; }
.status.warn { background: #fff4df; color: #9a5700; }
.status.danger { background: #fdecef; color: #ab1d2a; }
.status.info { background: #eaf2fc; color: var(--blue); }

.hero-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-panel:before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(var(--blue) 0 34%, var(--orange) 34% 67%, var(--teal) 67%); }
.hero-panel h2 { margin: 0 0 6px; font: 700 27px var(--display), sans-serif; color: #17304c; }
.hero-panel p:not(.eyebrow) { margin: 0; color: var(--muted); max-width: 780px; font-size: 12px; line-height: 1.5; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { background: #edf3f9; border: 1px solid #d6e1ec; color: #32516f; padding: 5px 8px; border-radius: 6px; font-size: 9px; font-weight: 600; }
.readiness-orbit { width: 118px; height: 118px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 10px solid #f2d7bb; outline: 1px solid #ebcaa8; background: #fff8f0; }
.readiness-orbit.ready { border-color: #b7e6d8; background: #f1fbf7; outline-color: #9ed7c7; }
.readiness-orbit strong { font: 700 15px var(--display); color: #9a5700; }
.readiness-orbit.ready strong { color: #08775b; }
.readiness-orbit span { font-size: 8px; color: var(--muted); margin-top: 3px; }
.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin: 14px 0; }
.metric-card { background: #fff; border: 1px solid var(--line); border-top: 3px solid #8795a5; border-radius: 9px; padding: 14px; box-shadow: 0 5px 14px rgba(27,47,74,.04); }
.metric-card.accent { border-top-color: var(--orange); }
.metric-card.good { border-top-color: var(--teal); }
.metric-card span { display: block; font-size: 9px; color: var(--muted); margin-bottom: 7px; }
.metric-card strong { font: 700 20px var(--display), sans-serif; color: #17304c; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) 390px; gap: 14px; }
.blockers { padding-bottom: 10px; }
.blocker { display: grid; grid-template-columns: 24px 1fr; gap: 9px; padding: 10px 16px; border-bottom: 1px solid #edf0f3; align-items: start; }
.blocker span { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; background: #fff0df; color: #a75505; font-weight: 700; }
.blocker p { margin: 2px 0 0; font-size: 10px; line-height: 1.45; color: #485668; }
.empty-success { margin: 16px; background: #eefaf6; color: #08775b; border: 1px solid #c8eadf; border-radius: 8px; padding: 14px; font-size: 11px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th { background: #f4f7fa; color: #506176; font: 600 9px var(--mono); letter-spacing: .04em; text-align: start; padding: 9px 11px; border-bottom: 1px solid var(--line); }
td { padding: 10px 11px; border-bottom: 1px solid #e9edf2; vertical-align: middle; }
td strong { display: block; }
td small { display: block; color: var(--muted); margin-top: 2px; font-size: 8px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfe; }
.editable-table input, .editable-table select { width: 100%; min-width: 75px; padding: 6px 7px; border-radius: 5px; font-size: 9px; }

.hierarchy-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 14px; align-items: start; }
.distributor-list { padding: 8px; max-height: calc(100vh - 155px); overflow: auto; position: sticky; top: 102px; }
.distributor-list button { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 10px; display: grid; grid-template-columns: 42px 1fr auto; gap: 9px; text-align: start; align-items: center; color: var(--ink); }
.distributor-list button:hover { background: #f4f7fa; }
.distributor-list button.selected { background: #edf4fc; border-color: #b8d0ea; }
.idf-symbol { height: 31px; display: grid; place-items: center; border-radius: 6px; background: var(--blue); color: #fff; font: 600 9px var(--mono); }
.distributor-list strong, .distributor-list small { display: block; }
.distributor-list small { color: var(--muted); font-size: 8px; margin-top: 3px; }
.distributor-list em { font-style: normal; font: 9px var(--mono); color: var(--blue); }
.editor-panel { padding-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; padding: 16px 18px 20px; }
.field > span { display: block; font-size: 9px; color: #556478; font-weight: 600; margin-bottom: 5px; }
.field input, .field select { width: 100%; }
.number-input { display: flex; border: 1px solid #cbd5df; border-radius: 7px; overflow: hidden; background: #fff; }
.number-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,79,158,.12); }
.number-input input { border: 0; width: 100%; border-radius: 0; box-shadow: none !important; }
.number-input b { background: #f1f4f7; color: #657284; padding: 10px 8px; font-size: 8px; white-space: nowrap; }

.formula-strip { display: grid; grid-template-columns: 1fr 25px 1fr 25px 1fr 25px 1.2fr; align-items: stretch; gap: 4px; margin-bottom: 14px; }
.formula-strip > span { display: grid; place-items: center; color: #8995a4; font: 700 20px var(--display); }
.formula { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
.formula.highlight { border-color: var(--orange); background: #fff8f2; }
.formula span, .formula small { display: block; color: var(--muted); font-size: 8px; }
.formula strong { display: block; font: 700 24px var(--display); color: var(--blue); margin: 4px 0; }
.formula.highlight strong { color: var(--orange); }
.capacity-layout { display: grid; grid-template-columns: minmax(0, 2fr) 390px; gap: 14px; }
.port-map-panel { padding-bottom: 16px; }
.port-legend { display: flex; gap: 14px; padding: 12px 18px; font-size: 9px; color: var(--muted); }
.port-legend span { display: flex; align-items: center; gap: 5px; }
.port-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.port-legend i.used, .port-grid .used { background: #e7f0fb; border-color: #6e9ac9; color: #0b4f9e; }
.port-legend i.growth, .port-grid .growth { background: #fff1e5; border-color: #e8a36a; color: #9a4d10; }
.port-legend i.spare, .port-grid .spare { background: #e9f8f6; border-color: #71c8c1; color: #087a76; }
.port-grid { display: grid; grid-template-columns: repeat(12, minmax(42px, 1fr)); gap: 5px; padding: 0 18px; }
.port-grid > span { border: 1px solid; border-radius: 5px; min-height: 39px; padding: 4px; display: flex; justify-content: space-between; flex-direction: column; }
.port-grid small { font: 8px var(--mono); opacity: .75; }
.port-grid b { font: 700 9px var(--mono); align-self: flex-end; }
.unit-strip { margin: 14px 18px 0; background: #f2f6fa; border: 1px solid #dce5ee; padding: 10px; border-radius: 7px; font-size: 9px; color: #45566b; }
.capacity-side { display: grid; gap: 14px; align-content: start; }
.metric-row { display: flex; justify-content: space-between; gap: 15px; padding: 10px 16px; border-bottom: 1px solid #edf0f3; font-size: 10px; }
.metric-row:last-child { border-bottom: 0; }
.metric-row span { color: var(--muted); }
.metric-row strong { text-align: end; font-size: 10px; }
.alert-row { border-radius: 8px; padding: 11px 13px; margin-top: 8px; font-size: 10px; }
.alert-row.danger { background: #fdecef; border: 1px solid #f2c6cd; color: #9e1f2b; }
.alert-row.warn { background: #fff6e8; border: 1px solid #f0d8b5; color: #8a5308; }

.recommendation-stack { display: grid; gap: 12px; }
.recommendation-card { padding: 14px; }
.recommendation-location { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; margin-bottom: 11px; }
.recommendation-location > span { width: 42px; height: 36px; border-radius: 7px; background: var(--blue); color: #fff; display: grid; place-items: center; font: 600 9px var(--mono); }
.recommendation-location strong, .recommendation-location small { display: block; }
.recommendation-location small { font-size: 9px; color: var(--muted); margin-top: 2px; }
.recommendation-location em { font-style: normal; font: 9px var(--mono); color: #52647a; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-card { border: 1px solid #c7d7e8; border-radius: 9px; padding: 14px; background: #fbfdff; }
.option-card.empty { border-style: dashed; background: #fafafa; color: #6c7888; }
.option-label { color: var(--blue); font: 600 8px var(--mono); letter-spacing: .12em; }
.option-card h3 { margin: 5px 0 2px; font: 700 17px var(--display); color: #17304c; }
.option-card p { margin: 0; font-size: 9px; color: var(--muted); line-height: 1.45; }
.option-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 11px 0; }
.option-metrics span { background: #edf3f8; border-radius: 6px; padding: 7px; }
.option-metrics small, .option-metrics strong { display: block; }
.option-metrics small { font-size: 7px; color: var(--muted); }
.option-metrics strong { font: 700 12px var(--display); margin-top: 2px; }
.option-why { border-top: 1px solid #e2e8ee; padding-top: 9px !important; }
details { margin-top: 10px; border-top: 1px solid #e7ebf0; padding-top: 9px; }
summary { color: var(--blue); font-size: 9px; font-weight: 600; cursor: pointer; }
.evaluation-list { display: grid; gap: 6px; margin-top: 8px; }
.evaluation-list > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; background: #f6f8fa; border-radius: 6px; padding: 8px; font-size: 9px; }
.evaluation-list p { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.layer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.layer-row { display: flex; justify-content: space-between; gap: 15px; padding: 12px 16px; border-bottom: 1px solid #edf0f3; font-size: 10px; }
.layer-row small, .layer-row b { display: block; font-size: 8px; color: var(--muted); margin-top: 2px; }
.layer-row > div:last-child { text-align: end; }
.core-option { padding: 24px; display: grid; justify-items: start; gap: 8px; }
.core-option strong { font: 700 21px var(--display); color: #17304c; }
.core-option span:not(.status) { color: var(--muted); font-size: 10px; }

.design-section { margin-bottom: 14px; padding-bottom: 12px; }
.validation-line { margin: 6px 14px 0; padding: 7px 9px; border-radius: 6px; background: #fff5e6; color: #8a5308; font-size: 9px; }
.design-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.narrative-editor { padding-bottom: 10px; }
.narrative-editor > div:not(.panel-head) { display: grid; grid-template-columns: 24px 1fr 30px; gap: 7px; align-items: start; padding: 8px 12px; }
.narrative-editor > div > span { width: 22px; height: 22px; border-radius: 5px; background: #edf3f8; display: grid; place-items: center; font: 8px var(--mono); color: var(--blue); }
.narrative-editor textarea { width: 100%; font-size: 9px; }
.risk-row { display: grid; grid-template-columns: 1fr auto 130px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid #edf0f3; font-size: 9px; }
.risk-row p { margin: 3px 0 0; color: var(--muted); }

.nca-hero { display: grid; grid-template-columns: 64px 1fr auto; gap: 18px; align-items: center; padding: 20px; margin-bottom: 14px; }
.nca-icon { width: 58px; height: 58px; border-radius: 12px; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 30px; }
.nca-hero h2 { margin: 0 0 4px; font: 700 23px var(--display); color: #17304c; }
.nca-hero p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; }
.nca-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) 390px; gap: 14px; }
.tri-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 12px 16px; border-bottom: 1px solid #edf0f3; }
.tri-row strong, .tri-row small { display: block; }
.tri-row strong { font-size: 10px; }
.tri-row small { color: var(--muted); font-size: 8px; margin-top: 2px; }
.tri-row select { width: 155px; font-size: 9px; }
.scope-panel { padding-bottom: 15px; }
.framework-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; }
.framework-grid span { border: 1px solid #d8e0e8; background: #f5f7f9; color: #8792a0; border-radius: 8px; padding: 17px; text-align: center; font: 700 14px var(--display); }
.framework-grid span.active { background: #edf4fc; color: var(--blue); border-color: #8eb3da; }
.scope-panel > p { margin: 0 16px 12px; color: var(--muted); font-size: 10px; }
.mandatory-note { margin: 0 16px; border: 1px solid #f0d0ac; background: #fff6eb; color: #84510f; border-radius: 7px; padding: 10px; font-size: 9px; line-height: 1.45; }

.scenario-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 20px; }
.scenario-controls label { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 10px; font-weight: 600; }
.scenario-controls input { grid-column: 1 / -1; width: 100%; box-shadow: none; }

.hld-cover { min-height: 280px; padding: 30px; position: relative; overflow: hidden; margin-bottom: 14px; }
.cover-strands { position: absolute; top: 0; right: 0; height: 100%; width: 22px; display: grid; grid-template-columns: repeat(3, 1fr); }
[dir="rtl"] .cover-strands { right: auto; left: 0; }
.cover-strands i:nth-child(1) { background: var(--blue); }
.cover-strands i:nth-child(2) { background: var(--orange); }
.cover-strands i:nth-child(3) { background: var(--teal); }
.hld-cover h2 { margin: 35px 0 5px; font: 700 35px var(--display); color: #17304c; }
.hld-cover > p:not(.eyebrow) { color: var(--muted); }
.cover-meta { display: flex; gap: 30px; margin-top: 30px; }
.cover-meta small, .cover-meta strong { display: block; }
.cover-meta small { color: var(--muted); font-size: 8px; }
.cover-meta strong { font-size: 10px; margin-top: 3px; }
.mandatory-disclaimer { margin-top: 25px; background: #fff4e7; border: 1px solid #efc89d; border-radius: 8px; padding: 12px; color: #7d4a0b; font-size: 9px; line-height: 1.55; max-width: 1000px; }
.export-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 14px; }
.export-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 13px; text-align: start; display: grid; grid-template-columns: 48px 1fr 20px; gap: 10px; align-items: center; color: var(--ink); box-shadow: 0 5px 14px rgba(27,47,74,.04); }
.export-card:hover { border-color: #83acd4; transform: translateY(-1px); }
.export-card > span { width: 45px; height: 36px; border-radius: 6px; background: var(--blue); color: #fff; display: grid; place-items: center; font: 600 8px var(--mono); }
.export-card strong, .export-card small { display: block; }
.export-card strong { font-size: 10px; }
.export-card small { color: var(--muted); font-size: 8px; margin-top: 3px; }
.section-coverage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.section-coverage > div { display: grid; grid-template-columns: 27px 1fr; padding: 10px 13px; border-bottom: 1px solid #edf0f3; border-inline-end: 1px solid #edf0f3; }
.section-coverage span { grid-row: 1 / 3; font: 8px var(--mono); color: var(--muted); }
.section-coverage strong { font-size: 9px; }
.section-coverage small { font-size: 7px; margin-top: 2px; color: var(--muted); }
.section-coverage .ready { background: #f6fbf9; }
.section-coverage .ready small { color: #08775b; }

.projects-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 14px; }
.project-row { width: 100%; border: 0; border-bottom: 1px solid #edf0f3; background: #fff; color: var(--ink); display: flex; justify-content: space-between; gap: 15px; text-align: start; padding: 13px 16px; }
.project-row:hover { background: #f7f9fb; }
.project-row strong, .project-row small { display: block; }
.project-row small { color: var(--muted); font: 8px var(--mono); margin-top: 3px; }
.project-row > span { color: var(--blue); font-size: 9px; }
.empty-state { padding: 20px; color: var(--muted); font-size: 10px; }

.qa-hero { display: grid; grid-template-columns: 110px 1fr auto; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.qa-score { width: 92px; height: 92px; border-radius: 50%; border: 9px solid #b8e7da; display: grid; place-content: center; text-align: center; }
.qa-score strong { font: 700 26px var(--display); color: #08775b; }
.qa-score span { font: 9px var(--mono); color: var(--muted); }
.qa-hero h2 { margin: 0 0 4px; font: 700 22px var(--display); }
.qa-hero p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; }

.admin-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.product-list { padding: 8px; position: sticky; top: 102px; max-height: calc(100vh - 135px); overflow: auto; }
.product-list button { width: 100%; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); text-align: start; padding: 9px; }
.product-list button:hover { background: #f4f7fa; }
.product-list button.selected { background: #edf4fc; border-color: #b8d0ea; }
.product-list strong, .product-list span, .product-list small { display: block; }
.product-list strong { font-size: 9px; color: var(--blue); }
.product-list span { font-size: 10px; margin-top: 2px; }
.product-list small { font-size: 7px; color: var(--muted); margin-top: 3px; }
.evidence-editor { overflow: hidden; }
.evidence-head, .evidence-row { display: grid; grid-template-columns: 135px 1fr 125px 1fr 1.2fr 125px 50px; gap: 5px; align-items: center; padding: 7px 9px; }
.evidence-head { background: #f4f7fa; color: var(--muted); font: 8px var(--mono); }
.evidence-row { border-top: 1px solid #e8edf2; }
.evidence-row code { font-size: 8px; color: var(--blue); }
.evidence-row input, .evidence-row select { width: 100%; padding: 6px; font-size: 8px; border-radius: 5px; }
.rules-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.rule-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #edf0f3; }
.rule-row strong, .rule-row small { display: block; }
.rule-row strong { font-size: 10px; }
.rule-row small { font-size: 8px; color: var(--muted); }
.rule-row .number-input { width: 145px; }
.weight-row { display: grid; grid-template-columns: 1fr 80px 15px; gap: 7px; align-items: center; padding: 7px 16px; border-bottom: 1px solid #edf0f3; font-size: 9px; }
.weight-row input { width: 100%; padding: 6px; }
.weight-total { display: flex; justify-content: space-between; padding: 13px 16px; font-size: 10px; }
.weight-total.valid { color: #08775b; background: #f0faf7; }
.weight-total.invalid { color: var(--red); background: #fff1f2; }

.toast { position: fixed; bottom: 22px; right: 22px; background: #15283d; color: #fff; border-radius: 8px; padding: 12px 15px; font-size: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.25); z-index: 100; max-width: 420px; }
[dir="rtl"] .toast { right: auto; left: 22px; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.2fr .8fr; background: #edf1f5; }
.auth-brand { background: #092f5e; color: #fff; padding: 9vh 9vw; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-brand:after { content: ""; position: absolute; inset-inline-end: 45px; top: 0; bottom: 0; width: 15px; background: linear-gradient(90deg, var(--blue) 0 33%, var(--orange) 33% 66%, var(--teal) 66%); opacity: .7; }
.auth-logo { margin-bottom: 28px; }
.auth-brand > p:first-of-type { color: #a9c9e8; font: 9px var(--mono); letter-spacing: .14em; }
.auth-brand h1 { margin: 8px 0 14px; font: 700 43px var(--display); max-width: 650px; }
.auth-brand > p:last-of-type { color: #c4d9ef; line-height: 1.65; max-width: 650px; font-size: 13px; }
.auth-feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 560px; margin-top: 25px; }
.auth-feature-grid span { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); border-radius: 7px; padding: 10px; font-size: 10px; }
.auth-card { align-self: center; margin: 8vw; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 30px; box-shadow: var(--shadow); position: relative; }
.auth-card h2 { margin: 7px 0 18px; font: 700 25px var(--display); color: #17304c; }
.auth-card > p:not(.eyebrow) { color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-card label { display: block; font-size: 9px; font-weight: 600; margin-bottom: 12px; }
.auth-card label input { display: block; width: 100%; margin-top: 5px; padding: 11px; }
.auth-card label small { display: block; color: var(--muted); margin-top: 3px; font-size: 7px; }
.language-link { position: absolute; top: 16px; inset-inline-end: 16px; border: 0; background: transparent; color: var(--blue); font-weight: 600; font-size: 10px; }
.form-error { background: #fdecef; color: #9e1f2b; border-radius: 7px; padding: 9px; font-size: 9px; margin-bottom: 10px; }
.loading-state { text-align: center; padding: 35px 0; }
.loading-state i { width: 32px; height: 32px; border: 3px solid #dce6f0; border-top-color: var(--blue); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

[dir="rtl"] { font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif; }
[dir="rtl"] .eyebrow, [dir="rtl"] .mono, [dir="rtl"] code { font-family: var(--mono), "IBM Plex Sans Arabic", monospace; }

@media (max-width: 1320px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid, .capacity-layout, .nca-layout { grid-template-columns: 1fr; }
  .port-grid { grid-template-columns: repeat(8, 1fr); }
  .evidence-head, .evidence-row { grid-template-columns: 110px 1fr 100px 1fr 1fr 110px 45px; }
}

@media print {
  .sidebar, .topbar, .top-actions, button { display: none !important; }
  body { min-width: 0; background: #fff; }
  .platform { display: block; }
  .main-shell, [dir="rtl"] .main-shell { margin: 0; display: block; }
  .page-content { padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
}


/* PHP edition additions */
.button.danger { background: #fdecef; color: #9e1f2b; border-color: #f2c6cd; }
.inline-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px; padding: 14px 16px; align-items: end; }
.inline-form label { display: grid; gap: 4px; font-size: 9px; font-weight: 600; color: #556478; }
.inline-form input, .inline-form select { width: 100%; }
.section-intro > .status { align-self: center; }
.toast.error { background: #7a1d27; }
.field-error { color: var(--red); font-size: 9px; margin-top: 4px; }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.admin-tabs button { border: 1px solid #d9e0e8; background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 10px; font-weight: 600; color: #33465d; }
.admin-tabs button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.data-table-wrap { padding-bottom: 8px; }
.data-table-wrap table { font-size: 9px; }
.assessment-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; padding: 16px 18px 20px; }
@media (max-width: 1320px) { .assessment-grid { grid-template-columns: repeat(2, 1fr); } .inline-form { grid-template-columns: 1fr 1fr; } }
.field > .number-input, .rule-row .number-input { display: flex; font-size: inherit; margin-bottom: 0; }
.diagram-grid { grid-template-columns: repeat(5, 1fr); padding: 14px 16px 4px; margin-bottom: 0; }
.import-note { margin: 12px 16px 0; display: grid; gap: 6px; }
.import-note small { color: var(--muted); font-size: 8px; font-family: var(--mono); }
.rule-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rule-form button { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 1320px) { .diagram-grid { grid-template-columns: repeat(3, 1fr); } }
.enrol-panel { display: grid; grid-template-columns: 200px 1fr; gap: 18px; padding: 16px; align-items: start; }
.enrol-panel.single { grid-template-columns: 1fr; }
.enrol-panel p { margin: 0 0 10px; font-size: 11px; color: #33465d; line-height: 1.5; }
.enrol-panel label { display: block; font-size: 9px; font-weight: 600; margin: 10px 0; }
.enrol-panel label input { display: block; width: 100%; margin-top: 5px; padding: 10px; font-size: 16px; letter-spacing: .2em; font-family: var(--mono); }
.enrol-qr { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px; }
.enrol-qr svg { width: 100%; height: auto; display: block; }
.secret-key { display: block; background: #f4f7fa; border: 1px solid var(--line); border-radius: 7px; padding: 10px; font-size: 12px; letter-spacing: .12em; word-break: break-all; }
.recovery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 16px; }
.recovery-grid code { background: #f4f7fa; border: 1px solid var(--line); border-radius: 6px; padding: 9px; text-align: center; font-size: 12px; }
.auth-card .enrol-panel { padding: 0; }
.auth-card .enrol-panel .button-row { margin-top: 6px; }
.role-card { padding-bottom: 12px; }
.role-meta { grid-template-columns: 2fr 1fr; align-items: center; }
.check-label { display: flex !important; align-items: center; gap: 8px; margin-top: 16px; }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 16px 8px; }
.permission-cell { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: #fff; cursor: pointer; }
.permission-cell.granted { background: #edf4fc; border-color: #b8d0ea; }
.permission-cell strong { display: block; font-size: 10px; font-family: var(--mono); }
.permission-cell small { display: block; color: var(--muted); font-size: 8px; margin-top: 2px; }
.data-table-wrap .button-row { gap: 4px; flex-wrap: wrap; }
@media (max-width: 1320px) { .permission-grid { grid-template-columns: repeat(2, 1fr); } .recovery-grid { grid-template-columns: repeat(2, 1fr); } .enrol-panel { grid-template-columns: 1fr; } }
