:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* Cyberani identity: deep navy surfaces, ice-blue type (logo #D7E9FD), cyber-green accent */
  --navy-950: #060d16;
  --navy-900: #0a1420;
  --navy-800: #0d1f33;
  --navy-700: #123049;
  --ice: #d7e9fd;
  --green: #0fbf8f;
  --green-600: #0aa379;
  --green-050: rgba(15, 191, 143, 0.08);
  --bg: #f3f6fa;
  --card: #ffffff;
  --text: #16222f;
  --muted: #5d6b7c;
  --line: #e3e9f1;
  --red: #cf4436;
  --amber: #b7791f;
  --blue: #2f6fde;
  --strong: #0d1f33;            /* headings on cards */
  --price: #0aa379;             /* calculated price */
  --code-c: #0aa379;
  --soft: rgba(10,20,32,.04);   /* soft chip backgrounds */
  --pill-done-bg: rgba(15,191,143,.12);
  --pill-done-c: #0aa379;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(10, 20, 32, .05), 0 6px 20px rgba(10, 20, 32, .07);
  --shadow-lg: 0 8px 30px rgba(10, 20, 32, .14);
  --ring: 0 0 0 3px rgba(15, 191, 143, .3);
}
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1420; --card: #10202f; --text: #dce8f5; --muted: #8fa3b8;
    --line: #1d3045; --shadow: 0 1px 3px rgba(0,0,0,.45); --shadow-lg: 0 10px 34px rgba(0,0,0,.5);
    --strong: #d7e9fd; --price: #2fdcae; --code-c: #3ad9ac; --soft: rgba(215,233,253,.05);
    --pill-done-bg: rgba(47,220,174,.14); --pill-done-c: #2fdcae;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1420; --card: #10202f; --text: #dce8f5; --muted: #8fa3b8;
    --line: #1d3045; --shadow: 0 1px 3px rgba(0,0,0,.45); --shadow-lg: 0 10px 34px rgba(0,0,0,.5);
    --strong: #d7e9fd; --price: #2fdcae; --code-c: #3ad9ac; --soft: rgba(215,233,253,.05);
    --pill-done-bg: rgba(47,220,174,.14); --pill-done-c: #2fdcae;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Poppins', 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { margin: 0 0 6px; line-height: 1.3; letter-spacing: -0.01em; }
h2 { font-size: 23px; font-weight: 700; } h3 { font-size: 16.5px; } h4 { font-size: 14.5px; }
p { margin: 4px 0; }
code { background: var(--green-050); color: var(--code-c); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; }
.small { font-size: 12.5px; } .muted { color: var(--muted); } .center { text-align: center; }
.link { background: none; border: 0; color: var(--green-600); cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }
button { transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .06s ease; }
button:focus-visible, .input:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- top bar & layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(90deg, var(--navy-950) 0%, var(--navy-800) 100%);
  border-bottom: 1px solid rgba(215, 233, 253, .08);
  color: var(--ice); display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 22px 10px;
}
.brand svg { height: 36px; width: auto; display: block; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar .btn-ghost { color: var(--ice); border-color: rgba(215, 233, 253, .22); }
.topbar .btn-ghost:hover { background: rgba(215, 233, 253, .1); }
.userbox { display: flex; align-items: center; gap: 9px; padding-inline-start: 10px; border-inline-start: 1px solid rgba(215,233,253,.14); }
.avatar { width: 35px; height: 35px; border-radius: 50%; background: linear-gradient(135deg, var(--green), #0a8c6b); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.uname { font-size: 13px; font-weight: 600; color: #fff; } .urole { font-size: 11.5px; color: var(--ice); opacity: .72; }
.topbar-btn { color: var(--ice); position: relative; font-size: 16px; }
.notif-dot { position: absolute; top: -4px; inset-inline-end: -6px; background: var(--green); color: #04110c; border-radius: 10px; font-size: 10px; font-weight: 700; padding: 0 5px; }
.notif-pop { position: fixed; top: 60px; inset-inline-end: 20px; z-index: 60; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; width: 330px; }
.notif-pop ul { margin: 6px 0 0; padding-inline-start: 18px; }
.notif-pop li { margin: 5px 0; font-size: 13px; } .notif-pop li.read { color: var(--muted); }

.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 246px; background: var(--card); border-inline-end: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; text-align: start; background: none; border: 0; border-radius: 10px; padding: 10px 13px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.nav-item:hover { background: var(--green-050); color: var(--green-600); }
.nav-active, .nav-active:hover { background: linear-gradient(90deg, var(--navy-800), var(--navy-700)); color: #fff; font-weight: 600; box-shadow: var(--shadow); }
.nav-active::before { content: ''; position: absolute; inset-inline-start: 0; top: 9px; bottom: 9px; width: 3.5px; border-radius: 3px; background: var(--green); }
.nav-icon { width: 18px; text-align: center; opacity: .9; }
.main { flex: 1; padding: 24px 28px 64px; max-width: 1200px; }

/* ---------- common ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-accent { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), var(--shadow); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 17px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--green), var(--green-600)); color: #fff; box-shadow: 0 3px 10px rgba(15,191,143,.3); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--green-050); border-color: var(--green); color: var(--green-600); }
.btn-danger { background: rgba(207,68,54,.08); color: var(--red); border-color: rgba(207,68,54,.3); }
.btn-danger:hover { background: rgba(207,68,54,.15); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; } .btn-block { width: 100%; margin-top: 12px; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 15px; color: inherit; padding: 4px 7px; border-radius: 7px; }
.icon-btn:hover { background: rgba(93,107,124,.12); }
.input { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 13px; font: inherit; background: var(--card); color: var(--text); transition: border-color .15s; }
.input:hover { border-color: #c3cfdd; }
.input:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
.input-sm { padding: 6px 9px; font-size: 13px; width: auto; border-radius: 8px; }
.w-70 { width: 70px; } .w-90 { width: 90px; } .w-120 { width: 120px; } .grow { flex: 1; }
textarea.input { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 16px; margin: 10px 0; }
.form-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field-help { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.switch { display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; }

.badge { display: inline-block; border-radius: 999px; padding: 3.5px 12px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-050); color: var(--green-600); border: 1px solid rgba(15,191,143,.35); }
.badge-amber { background: rgba(183,121,31,.1); color: var(--amber); border: 1px solid rgba(183,121,31,.3); }
.badge-red { background: rgba(207,68,54,.09); color: var(--red); border: 1px solid rgba(207,68,54,.3); }
.badge-gray { background: rgba(93,107,124,.1); color: var(--muted); border: 1px solid rgba(93,107,124,.25); }
.badge-blue { background: rgba(47,111,222,.09); color: var(--blue); border: 1px solid rgba(47,111,222,.3); }
.badge-purple { background: rgba(124,92,214,.1); color: #7c5cd6; border: 1px solid rgba(124,92,214,.35); }
.badge-win { background: var(--green); color: #fff; border: 1px solid var(--green); }
.chip { display: inline-block; background: rgba(47,111,222,.08); color: var(--blue); border-radius: 999px; padding: 2.5px 11px; font-size: 11.5px; font-weight: 500; }
.chip-btn { border: 0; cursor: pointer; font: inherit; }
.chip-btn:hover { background: rgba(47,111,222,.18); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px; box-shadow: var(--shadow); overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.kpi-accent::after { background: var(--green); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; } .kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; } .kpi-sub { font-size: 11.5px; color: var(--muted); }
.hero-kpi { background: linear-gradient(120deg, var(--navy-900) 0%, var(--navy-700) 65%, #0e5c48 130%); color: #fff; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow-lg); border: 1px solid rgba(215,233,253,.1); }
.hero-value { font-size: 32px; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.kpi-label-light { font-size: 13px; color: var(--ice); opacity: .9; } .kpi-sub-light { font-size: 12px; color: var(--ice); opacity: .72; }

.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: start; background: var(--navy-900); color: var(--ice); padding: 10px 13px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
td { padding: 10px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--green-050); }
.empty-cell { text-align: center; color: var(--muted); padding: 24px; }

.note { border-radius: 10px; padding: 11px 15px; margin: 10px 0; font-size: 13px; }
.note-blue { background: rgba(47,111,222,.06); border: 1px solid rgba(47,111,222,.2); }
.note-amber { background: rgba(183,121,31,.07); border: 1px solid rgba(183,121,31,.25); }

.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); inset-inline-start: 50%; transform: translate(-50%, 20px); background: var(--navy-900); color: var(--ice); border: 1px solid rgba(215,233,253,.15); padding: 12px 22px; border-radius: 12px; box-shadow: var(--shadow-lg); opacity: 0; transition: .25s; z-index: 90; max-width: min(520px, 90vw); }
[dir="rtl"] .toast { transform: translate(50%, 20px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[dir="rtl"] .toast.show { transform: translate(50%, 0); }
.toast-err { background: var(--red); color: #fff; border-color: transparent; }

.modal-wrap { position: fixed; inset: 0; background: rgba(6,13,22,.55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 80; padding: 18px; }
.modal { background: var(--card); color: var(--text); border-radius: 16px; width: min(880px, 96vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.4); border: 1px solid var(--line); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: rgba(93,107,124,.04); border-radius: 0 0 16px 16px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative;
  background:
    radial-gradient(1000px 540px at 88% -8%, rgba(15,191,143,.18), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(47,111,222,.14), transparent 55%),
    linear-gradient(145deg, var(--navy-950) 0%, var(--navy-900) 45%, var(--navy-800) 100%);
}
.login-wrap::before { content: ''; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(rgba(215,233,253,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(215,233,253,.05) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(640px 420px at 50% 42%, #000, transparent); mask-image: radial-gradient(640px 420px at 50% 42%, #000, transparent); }
.login-card { position: relative; background: rgba(13, 31, 51, .78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(215,233,253,.14); border-radius: 20px; padding: 32px 36px; width: min(470px, 94vw); box-shadow: 0 30px 90px rgba(0,0,0,.5); color: var(--ice); }
.login-brand svg { height: 44px; width: auto; margin-bottom: 12px; }
.login-card h1 { font-size: 20px; color: #fff; }
.login-sub { color: var(--green); font-weight: 600; margin-bottom: 14px; letter-spacing: .02em; }
.login-label { display: block; font-size: 11.5px; font-weight: 600; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--ice); opacity: .85; }
.login-lang { position: absolute; top: 18px; inset-inline-end: 18px; }
.login-lang .btn-ghost { color: var(--ice); border-color: rgba(215,233,253,.25); }
.login-card .input { background: rgba(6,13,22,.5); border-color: rgba(215,233,253,.18); color: #fff; }
.login-card .input::placeholder { color: rgba(215,233,253,.4); }
.login-card .input:focus { border-color: var(--green); }
.login-card .muted { color: rgba(215,233,253,.55); }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-card { border: 1.5px solid rgba(215,233,253,.18); background: rgba(6,13,22,.35); color: var(--ice); border-radius: 12px; padding: 13px 8px; font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.role-card:hover { border-color: rgba(15,191,143,.6); }
.role-active { border-color: var(--green); background: rgba(15,191,143,.14); color: #fff; box-shadow: 0 0 0 1px var(--green) inset; }
.login-foot { position: relative; color: rgba(215,233,253,.6); font-size: 12px; margin-top: 18px; }

/* ---------- wizard ---------- */
.steps { display: flex; gap: 5px; margin-bottom: 16px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-weight: 700; font-size: 11.5px; }
.step-active { border-color: var(--green); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.step-active .step-num { background: var(--green); color: #fff; }
.step-done { border-color: rgba(10,20,32,.2); }
.step-done .step-num { background: var(--navy-800); color: var(--ice); }
.wizard-body { padding: 22px 24px; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; }
.wizard-nav > div { display: flex; gap: 8px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 14px 0; }
.cat-card { text-align: start; border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 14px; padding: 18px; font: inherit; cursor: pointer; transition: all .15s; }
.cat-card:hover, .cat-active { border-color: var(--green); background: var(--green-050); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-card h4 { color: var(--strong); }
.cat-card p { color: var(--muted); font-size: 12.5px; }
.svc-group { margin: 14px 0; } .svc-cat { color: var(--green-600); margin-bottom: 8px; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.svc-card { display: flex; gap: 11px; align-items: flex-start; text-align: start; border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 13px; padding: 13px 15px; font: inherit; cursor: pointer; transition: all .14s; }
.svc-card:hover { border-color: rgba(15,191,143,.5); }
.svc-active { border-color: var(--green); background: var(--green-050); }
.svc-check { width: 20px; height: 20px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; color: #fff; flex: none; margin-top: 2px; font-size: 12px; }
.svc-active .svc-check { background: var(--green); border-color: var(--green); }
.svc-config { margin: 12px 0; }
.config-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.calc-price { display: flex; flex-direction: column; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.price-ok { color: var(--price); font-size: 23px; font-weight: 700; letter-spacing: -.01em; }
.price-err { color: var(--red); font-size: 13px; font-weight: 600; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 22px; margin: 10px 0; }
.review-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding: 7px 0; }
.total-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 14px 16px; background: linear-gradient(90deg, var(--green-050), transparent); border: 1px solid rgba(15,191,143,.3); border-radius: 12px; font-size: 17px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mini-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 15px; box-shadow: var(--shadow); }
.trail { margin: 4px 0; padding-inline-start: 20px; } .trail li { margin: 6px 0; }

/* ---------- builder & admin ---------- */
.tab-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 17px; font: inherit; font-size: 13px; cursor: pointer; }
.tab:hover { border-color: var(--green); color: var(--green-600); }
.tab-active, .tab-active:hover { background: var(--navy-900); color: var(--ice); border-color: var(--navy-900); font-weight: 600; }
.svc-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 14px; }
.svc-admin-card { margin-bottom: 0; transition: box-shadow .15s, transform .15s; }
.svc-admin-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.formula-chip { background: var(--soft); border: 1px dashed var(--line); border-radius: 9px; padding: 7px 11px; margin: 9px 0; overflow-x: auto; }
.builder-h { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--green-600); text-transform: uppercase; font-size: 12px; letter-spacing: .07em; }
.fields-editor { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.field-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: rgba(93,107,124,.05); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.req-box { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.var-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 7px; }
.preview-card { background: var(--green-050); border-color: rgba(15,191,143,.3); }
.mini-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.mini-line.total { font-weight: 700; border-bottom: 0; }
.stage-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { font-size: 10.5px; border-radius: 999px; padding: 2.5px 9px; background: rgba(93,107,124,.1); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; }
.pill-dot { width: 15px; height: 15px; border-radius: 50%; background: rgba(93,107,124,.25); color: var(--text); display: grid; place-items: center; font-size: 9.5px; font-weight: 700; }
.pill-tick { width: 15px; height: 15px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; }
.pill-done { background: var(--pill-done-bg); color: var(--pill-done-c); border: 1px solid rgba(15,191,143,.3); }
.pill-next { opacity: .65; border: 1px dashed var(--line); background: transparent; color: var(--muted); }
.pill-now { background: var(--green); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(15,191,143,.35); }
.pill-now .pill-dot { background: rgba(255,255,255,.3); color: #fff; }

/* ---------- security configuration ---------- */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sec-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; background: var(--soft); transition: border-color .15s, transform .15s; }
.sec-card:hover { border-color: var(--green); transform: translateY(-2px); }
.sec-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--green-050); border: 1px solid rgba(15,191,143,.3); display: grid; place-items: center; font-size: 17px; }
.sec-name { font-weight: 600; font-size: 13px; }
.sec-val { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- quotation / print ---------- */
.quote { background: #ffffff; color: #16222f; border-radius: 12px; padding: 18px 20px; }
.quote .muted { color: #5d6b7c; }
.quote td { border-bottom-color: #e3e9f1; }
.quote .review-row { border-bottom-color: #e3e9f1; }
.quote .table-wrap { border-color: #e3e9f1; }

.quote-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--green); padding-bottom: 12px; margin-bottom: 14px; }
.q-brand svg { height: 42px; width: auto; }
.quote-totals { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.q-grand { font-size: 17px; background: var(--green-050); border: 1px solid rgba(15,191,143,.3); padding: 9px 15px; border-radius: 10px; }
@media print {
  body.print-quote > *:not(.modal-wrap) { display: none !important; }
  body.print-quote .modal-wrap { position: static; background: #fff; padding: 0; backdrop-filter: none; }
  body.print-quote .modal { box-shadow: none; width: 100%; max-height: none; border: 0; }
  body.print-quote .modal-head, body.print-quote .modal-foot { display: none; }
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 10px; }
  .nav-item { white-space: nowrap; }
  .nav-active::before { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .main { padding: 16px 14px 60px; }
}

[dir="rtl"] .mono, [dir="rtl"] .price-ok, [dir="rtl"] .hero-value, [dir="rtl"] .kpi-value { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] th, [dir="rtl"] td { text-align: start; }
[dir="rtl"] body, [dir="rtl"] input, [dir="rtl"] button, [dir="rtl"] select, [dir="rtl"] textarea { font-family: 'Tajawal', 'Poppins', 'Segoe UI', Tahoma, Arial, sans-serif; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 { letter-spacing: 0; }

/* ---------- outcome & reports ---------- */
.closure-card { border-inline-start: 4px solid var(--green); }
.closure-lost { border-inline-start-color: var(--red); }
.closure-won { border-inline-start-color: var(--green); }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(130px, 1fr) 2.2fr auto; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--soft); border: 1px solid var(--line); border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.bar-val { font-weight: 700; min-width: 56px; text-align: end; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { width: 130px; flex: none; }
.legend { display: flex; flex-direction: column; gap: 7px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-row strong { margin-inline-start: auto; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
