/* NST Construction AI — app styles (LTR + RTL via logical properties) */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #e3e6eb;
  --line-strong: #cfd4dc;
  --text: #15181d;
  --text-2: #4b5360;
  --muted: #7a8391;
  --ink: #14171c;
  --ink-2: #1d2128;
  --ink-line: #2a2f38;
  --ink-text: #c9ced6;
  --accent: #d8641a;
  --accent-2: #b9530f;
  --accent-soft: #fdf0e6;
  --blue: #1f5fbf;
  --ok: #1d7a46;   --ok-bg: #e6f4ec;
  --warn: #9a6200; --warn-bg: #fdf3dc;
  --bad: #b42318;  --bad-bg: #fdecea;
  --info: #1f5fbf; --info-bg: #e8f0fc;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16,24,40,.05);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);
  --sb: 236px;
  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
html[dir="rtl"] { --font: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif; }
html.sb-collapsed { --sb: 64px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.01em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sb) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .15s; }
.sidebar { background: var(--ink); color: var(--ink-text); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; border-inline-end: 1px solid #000; z-index: 40; }
.sb-brand { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 14px 12px 10px 14px; }
.brand-mark { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; min-width: 0; }
.brand-mark img { border-radius: 7px; flex: none; }
.brand-text { font-size: 13.5px; white-space: nowrap; color: #e9ecf1; }
.brand-text strong { color: #fff; letter-spacing: .04em; }
.sb-toggle { color: #8d95a3; }
.sb-company { padding: 2px 12px 10px; }
.sb-company select, .sb-company-name { width: 100%; display: block; background: var(--ink-2); color: #e9ecf1; border: 1px solid var(--ink-line); border-radius: var(--radius-sm); padding: 7px 9px; font: inherit; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 8px; display: flex; flex-direction: column; gap: 2px; }
.sb-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-text); text-decoration: none !important; white-space: nowrap; font-size: 13.5px; }
.sb-link:hover { background: var(--ink-2); color: #fff; }
.sb-link.active { background: #262b33; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
html[dir="rtl"] .sb-link.active { box-shadow: inset -3px 0 0 var(--accent); }
.sb-link .ic { color: #9aa3b1; }
.sb-link.active .ic { color: var(--accent); }
.sb-foot { padding: 8px; border-top: 1px solid var(--ink-line); }
.sb-version { font-size: 11px; color: #6c7482; padding: 6px 10px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.sb-collapsed .brand-text, html.sb-collapsed .sb-link span, html.sb-collapsed .sb-company, html.sb-collapsed .sb-version { display: none; }
html.sb-collapsed .sb-brand { flex-direction: column; padding-inline: 8px; }
html.sb-collapsed .sb-link { justify-content: center; padding: 10px 0; }
html.sb-collapsed .sb-link:hover::after { content: attr(data-tip); position: fixed; inset-inline-start: 70px; background: var(--ink); color: #fff; padding: 5px 9px; border-radius: 5px; font-size: 12px; box-shadow: var(--shadow-lg); pointer-events: none; z-index: 99; margin-top: 0; }
.sb-backdrop { display: none; }

.main { 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 22px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tb-search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; color: var(--muted); }
.tb-search:focus-within { border-color: var(--line-strong); background: #fff; }
.tb-search input[type=search] { border: 0; background: transparent; outline: 0; box-shadow: none; padding: 8px 0; min-height: 34px; width: 100%; font: inherit; color: var(--text); }
.tb-project select { max-width: 260px; }
.tb-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none !important; font: inherit; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.lang-btn span { font-size: 12.5px; font-weight: 600; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; height: auto; padding: 4px 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; }
.um-name { display: flex; flex-direction: column; line-height: 1.2; text-align: start; font-size: 13px; color: var(--text); }
.um-name small { color: var(--muted); font-size: 11.5px; }
.um-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; z-index: 50; }
.um-pop a, .um-pop button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 5px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none !important; }
.um-pop a:hover, .um-pop button:hover { background: var(--surface-2); }

.content { padding: 22px 26px 60px; max-width: 1480px; width: 100%; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--text-2); }
.crumbs .sep { color: var(--line-strong); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: #fff; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-danger { color: var(--bad); border-color: #f1c4bf; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 16px; height: 16px; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=file], select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 10px; min-height: 36px; width: 100%; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { padding-inline-end: 28px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.req::after { content: " *"; color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-section { padding: 18px 20px 6px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section > h3 { margin-bottom: 4px; }
.form-section > p.muted { margin-bottom: 14px; font-size: 13px; }
.form-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; background: var(--surface-2); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.filters > * { width: auto; }
.filters input[type=search], .filters input[type=date], .filters select { width: auto; max-width: 100%; }
.filters input[type=search] { flex: 0 1 280px; min-width: 200px; }

/* ---------- Cards, tables, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .grid > .card { margin-top: 0; }
.grid > div > .card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 14.5px; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: start; font-weight: 500; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
html[dir="rtl"] .tbl th { letter-spacing: 0; text-transform: none; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fbfbfc; }
.tbl .actions { white-space: nowrap; text-align: end; }
.tbl .actions .btn { margin-inline-start: 4px; }
.tbl .group-row td { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--text-2); padding: 7px 14px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--text-2); background: #eef0f3; }
.badge-accent { color: var(--accent-2); background: var(--accent-soft); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; background: #eef0f3; color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.disc { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 4px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: #fff; background: #5b6472; }
.disc-architectural { background: #2f6db5; } .disc-structural { background: #8a4b2f; } .disc-civil { background: #5d6b2f; }
.disc-mechanical { background: #6a3fa0; } .disc-electrical { background: #b58a00; } .disc-plumbing { background: #1d7f8c; }
.disc-fire_protection { background: #b42318; } .disc-hvac { background: #3f7f5c; } .disc-landscape { background: #4a7a2b; }
.disc-interior { background: #a0527a; } .disc-infrastructure { background: #4a5568; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; font-size: 13.5px; }
.alert-success { background: var(--ok-bg); border-color: #bfe3cd; color: #12502e; }
.alert-error { background: var(--bad-bg); border-color: #f4c7c1; color: #7a1a12; }
.alert-info { background: var(--info-bg); border-color: #c6d8f5; color: #163f80; }
.alert-warn { background: var(--warn-bg); border-color: #f0dba7; color: #6b4600; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none !important; color: inherit; display: block; }
a.stat:hover { border-color: var(--line-strong); }
.stat .lbl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .num { font-size: 26px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .num small { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .ic { width: 15px; height: 15px; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 10px; background: #eef0f3; border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--ink); border-radius: 5px; min-width: 2px; }
.bar-row .v { text-align: end; font-variant-numeric: tabular-nums; color: var(--text-2); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; color: var(--text); }
.list .meta { font-size: 12px; color: var(--muted); }

.empty-state { text-align: center; padding: 38px 20px; color: var(--text-2); }
.empty-state .es-icon { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 12px; background: #eef0f3; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.empty-state .es-icon .ic { width: 22px; height: 22px; }
.empty-state h3 { margin-bottom: 4px; }
.empty-state p { color: var(--muted); max-width: 440px; margin: 0 auto 14px; }
.empty-state.big { padding: 80px 20px; }

.pager { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 13px; padding: 0 8px; text-decoration: none !important; }
.pager .cur { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .pager-total { border: 0; background: none; color: var(--muted); margin-inline-start: 8px; }

/* ---------- Projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.proj-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none !important; box-shadow: var(--shadow); transition: border-color .12s; }
.proj-card:hover { border-color: var(--line-strong); }
.proj-thumb { height: 120px; background: #e9ecf0 center/cover no-repeat; position: relative; }
.proj-thumb.blank { background-image: linear-gradient(#dfe3e8 1px, transparent 1px), linear-gradient(90deg, #dfe3e8 1px, transparent 1px); background-size: 20px 20px; background-color: #eef1f4; }
.proj-thumb .badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.proj-card .pc-body { padding: 13px 15px; flex: 1; }
.proj-card h3 { margin: 0 0 2px; }
.proj-card .pc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.proj-card .pc-foot { display: flex; gap: 16px; padding: 10px 15px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); background: var(--surface-2); }

.ws-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.ws-thumb { width: 64px; height: 64px; border-radius: 10px; background: #e9ecf0 center/cover no-repeat; flex: none; border: 1px solid var(--line); }
.ws-title { flex: 1; min-width: 220px; }
.ws-title h1 { margin: 0; }
.ws-title .sub { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; text-decoration: none !important; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: #eef0f3; color: var(--text-2); border-radius: 999px; padding: 0 7px; }

.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); padding: 7px 0; padding-inline-end: 10px; border-bottom: 1px dashed var(--line); }
.kv dd { margin: 0; padding: 7px 0; border-bottom: 1px dashed var(--line); font-weight: 500; }

/* ---------- Upload ---------- */
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 30px 20px; text-align: center; background: #fff; transition: all .12s; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone > .ic { width: 30px; height: 30px; color: var(--muted); }
.dropzone h3 { margin: 8px 0 4px; }
.dropzone .dz-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.uq-table td { vertical-align: top; }
.uq-table input, .uq-table select { min-height: 32px; padding: 5px 8px; font-size: 13px; }
.uq-table .fname { font-size: 12.5px; min-width: 150px; max-width: 220px; overflow-wrap: anywhere; }
.uq-table .w-num { width: 120px; } .uq-table .w-rev { width: 70px; } .uq-table .w-date { width: 140px; } .uq-table .w-scale { width: 90px; }
.uq-note { font-size: 11.5px; margin-top: 4px; }
.uq-note.new { color: var(--ok); } .uq-note.rev { color: var(--info); } .uq-note.err { color: var(--bad); }
.progress { height: 6px; background: #eef0f3; border-radius: 3px; overflow: hidden; margin-top: 6px; min-width: 90px; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.src-tag { font-size: 10.5px; color: var(--muted); }

/* ---------- Auth ---------- */
body.plain { background: #fff; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-side { position: relative; background: var(--ink); color: #e5e8ee; overflow: hidden; display: flex; align-items: flex-end; padding: 48px; }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px; }
.auth-side-text { position: relative; max-width: 440px; }
.auth-side-text h2 { font-size: 26px; color: #fff; margin: 16px 0 8px; }
.auth-side-text p { color: #aab2bf; }
.auth-side-text ul { padding: 0; list-style: none; margin: 18px 0 0; }
.auth-side-text li { padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); color: #c9cfd8; font-size: 13.5px; }
.auth-side-text li::before { content: "—"; color: var(--accent); margin-inline-end: 10px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; }
.auth-lang { position: absolute; top: 18px; inset-inline-end: 18px; }
.auth-card { width: 100%; max-width: 380px; }
.plain .auth-wrap:not(:has(.auth-side)) { grid-template-columns: 1fr; place-items: center; }
.plain .auth-wrap > .auth-card { padding: 40px; max-width: 520px; }

/* ---------- Misc ---------- */
.rev-current { box-shadow: inset 3px 0 0 var(--accent); }
html[dir="rtl"] .rev-current { box-shadow: inset -3px 0 0 var(--accent); }
.help-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.help-steps li { counter-increment: s; position: relative; padding: 10px 0 10px 40px; border-bottom: 1px solid var(--line); }
html[dir="rtl"] .help-steps li { padding: 10px 40px 10px 0; }
.help-steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12.5px; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: start; }
.yes { color: var(--ok); font-weight: 700; } .no { color: var(--line-strong); }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; }
.mobile-only { display: none; }
.json-diff { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); max-width: 420px; word-break: break-word; }
.search-group h2 { margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-main-side { grid-template-columns: 1fr; }
  .tb-project { display: none; }
}
@media (max-width: 860px) {
  :root, html.sb-collapsed { --sb: 0px; }
  .app { display: block; }
  .tb-search { min-width: 0; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 248px; transform: translateX(-100%); transition: transform .18s; }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  html.sb-collapsed .brand-text, html.sb-collapsed .sb-link span, html.sb-collapsed .sb-company, html.sb-collapsed .sb-version { display: initial; }
  html.sb-collapsed .sb-link { justify-content: flex-start; padding: 8px 10px; }
  .sb-toggle { display: none; }
  .mobile-only { display: inline-flex; }
  .content { padding: 16px 14px 60px; }
  .topbar { padding: 8px 12px; }
  .um-name { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .bar-row { grid-template-columns: 100px 1fr 36px; }
}
@media print {
  .sidebar, .topbar, .page-actions, .filters { display: none !important; }
  .app { display: block; }
}
