/* ============================================================
   Class-Action Auditor — UI implemented from the approved
   Claude Design dashboard (navy sidebar + blue, RTL).
   ============================================================ */
:root {
  --navy:#0f1d3a; --navy-2:#16264a; --navy-active:#1e3157; --navy-border:#26365a;
  --blue:#2756c3; --blue-700:#1f47a0;
  --ink:#11203b; --ink-2:#33425c; --muted:#5d6b82; --faint:#8693a8;
  --page:#eef1f6; --surface:#ffffff; --border:#e4e9f0; --soft:#f2f5f9;
  --red:#c2293a; --red-bg:#fdecec; --orange:#e8702a; --orange-bg:#fdeede;
  --amber:#d99e1a; --amber-bg:#fbf3da; --green:#1f9d54; --green-bg:#e7f6ee; --blue-bg:#e9eefb;
  --sidebar-text:#c9d3e2; --sidebar-muted:#8693a8;
  --r:12px; --r-sm:9px; --r-lg:16px;
  --sh-1:0 1px 2px rgba(17,32,59,.05), 0 1px 3px rgba(17,32,59,.06);
  --sh-2:0 8px 24px rgba(17,32,59,.10);
  --sh-3:0 20px 56px rgba(15,29,58,.28);
  --ring:0 0 0 3px rgba(39,86,195,.22);
}
* { box-sizing: border-box; }
body { margin:0; font-family:"Assistant", system-ui, Arial, sans-serif; background:var(--page); color:var(--ink); line-height:1.5; -webkit-font-smoothing:antialiased; }
.mono, code { font-family:"JetBrains Mono", ui-monospace, Consolas, monospace; }
h1 { margin:0; font-size:24px; font-weight:800; letter-spacing:-.01em; }
h2 { margin:0; font-size:16px; font-weight:700; }
h3 { font-size:15px; font-weight:700; margin:20px 0 10px; }
a { color:var(--blue); text-decoration:none; }
a:hover { text-decoration:underline; }
code { background:var(--soft); border:1px solid var(--border); padding:1px 6px; border-radius:6px; font-size:.86em; direction:ltr; display:inline-block; }
.empty { color:var(--faint); font-size:14px; padding:8px 2px; }

/* ---------- Login ---------- */
.login-screen { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:24px;
  background: radial-gradient(900px 560px at 85% -10%, rgba(39,86,195,.30), transparent 60%), linear-gradient(165deg, #0c1830, #14264b); }
.login-card { background:var(--surface); padding:38px 40px; border-radius:var(--r-lg); box-shadow:var(--sh-3); width:100%; max-width:440px; }
.brand-mark { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.logo-badge { display:flex; align-items:center; justify-content:center; width:42px; height:42px; border-radius:12px; background:var(--blue); flex:none; box-shadow:0 6px 16px rgba(39,86,195,.4); }
.brand-text { display:flex; flex-direction:column; line-height:1.2; }
.brand-text strong { font-size:18px; font-weight:800; }
.brand-text span { font-size:12px; color:var(--faint); font-family:"JetBrains Mono", monospace; }
.login-tagline { color:var(--muted); font-size:13.5px; margin:0 0 18px; }
.login-card form { background:none; padding:0; box-shadow:none; border:none; }
.login-card button { width:100%; margin-top:10px; }
.login-card .error { color:var(--red); font-size:13px; margin-top:12px; min-height:18px; font-weight:600; }

/* ---------- App shell ---------- */
#app { display:flex; min-height:100vh; }
.sidebar { width:266px; flex:none; background:var(--navy); color:var(--sidebar-text); display:flex; flex-direction:column; padding:22px 16px; position:sticky; top:0; height:100vh; }
.sidebar .brand { display:flex; align-items:center; gap:11px; padding:4px 6px 18px; }
.sidebar .brand .brand-text strong { color:#fff; font-size:16px; }
.nav-label { font-size:11px; color:var(--sidebar-muted); font-weight:700; letter-spacing:.08em; padding:8px 10px 6px; }
nav { display:flex; flex-direction:column; gap:3px; }
nav a { display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:var(--r-sm); color:var(--sidebar-text); font-size:14.5px; font-weight:500; transition:background .14s, color .14s; }
nav a span { order:1; flex:1; }
nav a .ic { order:2; margin-inline-start:auto; width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; opacity:.85; }
nav a:hover { background:rgba(255,255,255,.06); color:#fff; text-decoration:none; }
nav a.active { background:var(--navy-active); color:#fff; box-shadow:inset 2px 0 0 var(--blue); }
nav a.active .ic { opacity:1; }
.sidebar-foot { margin-top:auto; display:flex; flex-direction:column; gap:14px; }
.quota-card { background:var(--navy-2); border:1px solid var(--navy-border); border-radius:var(--r); padding:14px; }
.quota-top { display:flex; justify-content:space-between; align-items:center; font-size:12.5px; color:var(--sidebar-muted); }
.quota-top strong { color:#fff; font-family:"JetBrains Mono", monospace; font-size:13px; }
.quota-bar { background:rgba(255,255,255,.12); height:6px; border-radius:999px; overflow:hidden; margin:10px 0; }
.quota-bar.slim { margin:10px 0 0; background:#e6eaf1; }
#quota-fill, #ov-quota-fill { height:100%; background:var(--blue); border-radius:999px; width:0; }
.upgrade-btn { width:100%; background:#fff; color:var(--ink); border:none; padding:9px; border-radius:var(--r-sm); font-weight:700; font-size:13.5px; cursor:pointer; font-family:inherit; }
.upgrade-btn:hover { background:#eef1f6; }
.user-chip { display:flex; align-items:center; gap:10px; padding-top:14px; border-top:1px solid var(--navy-border); }
.avatar { width:38px; height:38px; border-radius:10px; background:var(--blue); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; flex:none; }
.user-meta { display:flex; flex-direction:column; line-height:1.25; min-width:0; flex:1; }
.user-meta strong { color:#fff; font-size:13.5px; }
.user-meta span { color:var(--sidebar-muted); font-size:11.5px; font-family:"JetBrains Mono", monospace; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.logout { background:var(--navy-2); border:1px solid var(--navy-border); color:var(--sidebar-text); width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; cursor:pointer; flex:none; }
.logout:hover { color:#fff; background:var(--navy-active); }

main { flex:1; padding:26px 30px 50px; max-width:1180px; }

/* ---------- Page head ---------- */
.page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:22px; }
.page-head .sub { color:var(--muted); font-size:13.5px; margin:5px 0 0; }
.head-actions { display:flex; align-items:center; gap:12px; }
.status-pill { display:inline-flex; align-items:center; gap:7px; background:#fff; border:1px solid var(--border); border-radius:999px; padding:7px 14px; font-size:13px; font-weight:600; color:var(--ink-2); }
.status-pill .dot { width:8px; height:8px; border-radius:50%; background:var(--green); }

/* ---------- Buttons ---------- */
button, button.primary { background:var(--blue); color:#fff; border:none; padding:11px 20px; font-size:14.5px; border-radius:var(--r-sm); cursor:pointer; font-weight:700; font-family:inherit; transition:filter .14s, transform .05s; box-shadow:0 2px 6px rgba(39,86,195,.28); }
button:hover { filter:brightness(1.06); }
button:active { transform:translateY(1px); }
button:focus-visible { outline:none; box-shadow:var(--ring); }
button:disabled { background:#a9b8d6; box-shadow:none; cursor:not-allowed; filter:none; }
button.primary span { font-weight:800; margin-inline-start:4px; }
button.secondary { background:var(--soft); color:var(--ink); box-shadow:inset 0 0 0 1px var(--border); }
button.secondary:hover { background:#e7ecf3; filter:none; }

/* ---------- Stat cards ---------- */
.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:18px; }
.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:18px 20px; box-shadow:var(--sh-1); display:flex; flex-direction:column; gap:8px; min-height:120px; }
.stat-label { color:var(--faint); font-size:13px; font-weight:600; }
.stat-num { display:flex; align-items:baseline; gap:6px; font-family:"JetBrains Mono", monospace; font-size:34px; font-weight:700; color:var(--ink); }
.stat-den { font-size:15px; color:var(--faint); font-weight:500; }
.stat-foot { font-size:12.5px; font-weight:600; color:var(--muted); margin-top:auto; }
.stat-foot.danger, .stat-num .danger { color:var(--red); }
.stat-foot.ok { color:var(--green); }
.stat-foot.warn { color:var(--amber); }

/* ---------- Panels ---------- */
.panel-grid { display:grid; grid-template-columns:1fr 1.25fr; gap:16px; }
.panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:18px 20px; box-shadow:var(--sh-1); }
.panel-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.link-arrow { font-size:13px; font-weight:600; color:var(--blue); cursor:pointer; }

/* exposure-by-category bars */
.cat-row { margin:13px 0; }
.cat-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.cat-top .label { font-size:13.5px; color:var(--ink-2); font-weight:600; }
.cat-top .num { font-size:13px; color:var(--muted); font-family:"JetBrains Mono", monospace; }
.cat-bar { background:var(--soft); height:7px; border-radius:999px; overflow:hidden; }
.cat-fill { height:100%; border-radius:999px; }

/* recent scans */
.recent-list { display:flex; flex-direction:column; }
.recent-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:13px 0; border-top:1px solid var(--soft); }
.recent-row:first-child { border-top:none; }
.recent-row .r-right { text-align:right; min-width:0; }
.recent-row .domain { font-family:"JetBrains Mono", monospace; font-size:13.5px; color:var(--ink); font-weight:500; }
.recent-row .meta { font-size:12px; color:var(--faint); margin-top:3px; }
.recent-row .r-left { display:flex; align-items:center; gap:10px; }
.recent-row .score { font-family:"JetBrains Mono", monospace; font-weight:700; font-size:16px; color:var(--ink); }
.recent-row .sdot { width:8px; height:8px; border-radius:50%; flex:none; }

.rep-link { font-size:12px; color:var(--blue); background:none; border:none; box-shadow:none; padding:0; margin-inline-start:8px; cursor:pointer; font-family:inherit; font-weight:600; }
.rep-link:hover { text-decoration:underline; filter:none; }
.badge.tier-technical { background:#eef1f6; color:var(--muted); border:1px solid var(--border); font-weight:600; }

/* severity pills */
.pill { display:inline-block; padding:3px 10px; border-radius:999px; font-size:11.5px; font-weight:700; }
.pill.high, .pill.sev-high { background:var(--red-bg); color:var(--red); }
.pill.mid, .pill.sev-medium { background:var(--amber-bg); color:var(--amber); }
.pill.low, .pill.sev-low { background:var(--green-bg); color:var(--green); }
.pill.orange { background:var(--orange-bg); color:var(--orange); }

/* ---------- Tabs ---------- */
.tab { display:none; animation:fade .18s ease; }
.tab.visible { display:block; }
@keyframes fade { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* ---------- Forms ---------- */
form { background:var(--surface); padding:22px 24px; border-radius:var(--r); box-shadow:var(--sh-1); border:1px solid var(--border); }
form.inline { display:flex; gap:10px; flex-wrap:wrap; padding:16px 18px; margin-bottom:16px; align-items:center; }
form.inline input { flex:1; min-width:140px; }
form.inline button { width:auto; }
fieldset { border:1px solid var(--border); border-radius:var(--r-sm); padding:8px 18px 16px; margin:0 0 18px; background:var(--soft); }
legend { font-weight:700; padding:0 8px; color:var(--ink); font-size:13px; }
label { display:block; margin:12px 0; font-size:13.5px; color:var(--ink-2); font-weight:600; }
input, textarea, select { display:block; width:100%; margin-top:6px; padding:10px 12px; border:1px solid #cfd8e6; border-radius:var(--r-sm); font-size:14px; font-family:inherit; color:var(--ink); background:#fff; transition:border-color .14s, box-shadow .14s; }
input[type="url"], #diff-form input, #scans-list .domain { font-family:"JetBrains Mono", monospace; }
input::placeholder, textarea::placeholder { color:#9aa7bd; }
input:focus, textarea:focus, select:focus { outline:none; border-color:var(--blue); box-shadow:var(--ring); }
label.cb { display:flex; align-items:center; gap:9px; }
label.cb input { width:auto; margin:0; accent-color:var(--blue); }
.row { display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
.row label { margin:8px 0; }
.perms { display:grid; grid-template-columns:1fr 1fr; gap:6px 18px; margin:6px 0 14px; }
.perms label { margin:6px 0; display:flex; align-items:center; gap:9px; }
.perms label input { width:auto; margin:0; accent-color:var(--blue); }

/* ---------- Scan progress ---------- */
#progress { background:var(--surface); margin-top:20px; padding:22px 24px; border-radius:var(--r); box-shadow:var(--sh-1); border:1px solid var(--border); }
.progress-bar { background:#e6eaf1; height:9px; border-radius:999px; overflow:hidden; margin:12px 0; }
#bar { background:var(--blue); height:100%; transition:width .35s ease; border-radius:999px; }
#stage-line { font-size:13.5px; color:var(--ink-2); font-weight:600; }
#log { max-height:240px; overflow:auto; font-size:12.5px; color:#b9c4d6; direction:ltr; text-align:left; background:var(--navy); border-radius:var(--r-sm); padding:12px 14px; list-style:none; margin:14px 0 0; }
#log li { margin:3px 0; font-family:"JetBrains Mono", monospace; }
#result { background:var(--green-bg); color:var(--green); border:1px solid #bde5cf; padding:16px 18px; border-radius:var(--r-sm); margin-top:16px; }
#result h3 { margin:0 0 6px; color:var(--green); }
#pdf-link { display:inline-block; margin-top:8px; font-weight:700; }

/* ---------- Lists ---------- */
#scans-list, #schedules-list, #keys-list, #webhooks-list { list-style:none; padding:0; margin:0; }
#scans-list li, #schedules-list li { background:var(--surface); padding:14px 18px; margin:10px 0; border-radius:var(--r); display:flex; justify-content:space-between; align-items:center; gap:12px; box-shadow:var(--sh-1); border:1px solid var(--border); transition:box-shadow .14s, transform .1s; }
#scans-list li:hover, #schedules-list li:hover { box-shadow:var(--sh-2); transform:translateY(-1px); }
#scans-list li strong { font-family:"JetBrains Mono", monospace; font-weight:600; font-size:14px; }
#keys-list li, #webhooks-list li { background:var(--surface); padding:12px 16px; margin:8px 0; border-radius:var(--r-sm); border:1px solid var(--border); display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
#scans-list .hint, #schedules-list .hint, .hint { color:var(--muted); font-size:12.5px; }

/* ---------- Badges ---------- */
.badge { display:inline-block; padding:3px 10px; border-radius:999px; font-size:11.5px; font-weight:700; margin-left:6px; vertical-align:middle; }
.badge.queued { background:var(--amber-bg); color:var(--amber); }
.badge.running { background:var(--blue-bg); color:var(--blue); }
.badge.done { background:var(--green-bg); color:var(--green); }
.badge.error { background:var(--red-bg); color:var(--red); }
.badge.sev-high { background:var(--red-bg); color:var(--red); }
.badge.sev-medium { background:var(--amber-bg); color:var(--amber); }
.badge.sev-low { background:var(--green-bg); color:var(--green); }
.badge.conf-high { background:#eef2f9; color:var(--ink-2); }
.badge.conf-medium { background:var(--soft); color:var(--muted); }
.badge.conf-low { background:#f7f8fb; color:var(--faint); }

/* ---------- Modal + findings ---------- */
.modal-bg { position:fixed; inset:0; background:rgba(15,29,58,.55); backdrop-filter:blur(2px); display:flex; align-items:center; justify-content:center; z-index:1000; padding:24px; }
.modal-card { background:var(--surface); border-radius:var(--r-lg); max-width:940px; width:100%; max-height:90vh; overflow:auto; padding:28px 30px; position:relative; box-shadow:var(--sh-3); }
.modal-close { position:absolute; top:16px; left:16px; background:none; color:var(--muted); border:none; font-size:26px; line-height:1; cursor:pointer; padding:4px 8px; width:auto; box-shadow:none; }
.modal-close:hover { color:var(--ink); filter:none; }
.finding-card { border:1px solid var(--border); border-radius:var(--r); padding:14px 18px; margin:12px 0; background:var(--surface); }
.finding-card.sev-high { border-right:4px solid var(--red); }
.finding-card.sev-medium { border-right:4px solid var(--amber); }
.finding-card.sev-low { border-right:4px solid var(--green); }
.finding-card header { display:flex; gap:8px; align-items:center; margin-bottom:8px; flex-wrap:wrap; }
.finding-card p { margin:6px 0; color:var(--ink-2); font-size:14px; }
.feedback-row { display:flex; gap:8px; align-items:center; margin-top:12px; padding-top:12px; border-top:1px dashed var(--border); flex-wrap:wrap; }
.feedback-row button { font-size:13px; padding:6px 12px; background:var(--soft); color:var(--ink-2); box-shadow:inset 0 0 0 1px var(--border); }
.feedback-row button:hover { background:#e7ecf3; filter:none; }
.feedback-row button:disabled { background:var(--green-bg); color:var(--green); box-shadow:inset 0 0 0 1px #bde5cf; cursor:default; }

/* ---------- Analytics / billing ---------- */
#trend-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:8px; }
#trend-summary > div { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:18px; box-shadow:var(--sh-1); font-size:14px; color:var(--muted); }
#trend-summary > div strong { display:block; font-size:28px; color:var(--ink); font-weight:800; margin-top:4px; font-family:"JetBrains Mono", monospace; }
#trend-summary h3, #trend-summary ul { grid-column:1 / -1; }
#trend-summary ul { list-style:none; padding:0; margin:0; }
#trend-summary li { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); padding:10px 14px; margin:6px 0; font-size:13.5px; }
#diff-output { background:var(--navy); color:#b9c4d6; padding:16px; border-radius:var(--r-sm); direction:ltr; text-align:left; overflow:auto; font-size:12.5px; font-family:"JetBrains Mono", monospace; }
#new-key { background:var(--amber-bg); border:1px solid #f0d9a6; border-radius:var(--r-sm); padding:12px 16px; margin:10px 0; }
#plan-info { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:16px 20px; box-shadow:var(--sh-1); }
#plans-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:20px; }
.plan-card { background:var(--surface); padding:24px 22px; border-radius:var(--r-lg); box-shadow:var(--sh-1); border:1px solid var(--border); position:relative; display:flex; flex-direction:column; }
.plan-card h3 { margin:0 0 8px; text-transform:capitalize; }
.plan-card .price { font-size:28px; font-weight:800; color:var(--blue); margin:2px 0 10px; font-family:"JetBrains Mono", monospace; }
.plan-card p { color:var(--muted); font-size:13.5px; flex:1; }
.plan-card button { margin-top:14px; }
.plan-card.current { border:2px solid var(--blue); box-shadow:var(--sh-2); }
.plan-card.current::after { content:"המנוי שלך"; position:absolute; top:-11px; right:18px; background:var(--blue); color:#fff; font-size:11px; font-weight:700; padding:3px 10px; border-radius:999px; }

/* ---------- Consent ---------- */
.consent-banner { position:fixed; bottom:0; left:0; right:0; background:var(--navy); color:#fff; padding:16px 24px; display:flex; align-items:center; gap:16px; z-index:999; box-shadow:0 -6px 24px rgba(15,29,58,.3); }
.consent-banner .text { flex:1; font-size:13.5px; color:var(--sidebar-text); }
.consent-banner .text a { color:#8fb0ff; }
.consent-banner button { padding:9px 18px; font-size:13.5px; }

/* ---------- Responsive ---------- */
@media (max-width:900px) {
  #app { flex-direction:column; }
  .sidebar { width:100%; height:auto; position:static; flex-direction:column; }
  nav { flex-direction:row; flex-wrap:wrap; }
  nav a span { flex:none; }
  nav a .ic { margin-inline-start:6px; }
  .sidebar-foot { margin-top:14px; }
  main { padding:20px 16px 44px; }
  .stat-grid, .panel-grid, #trend-summary, #plans-grid, .row, .perms { grid-template-columns:1fr; }
}
