/* ═══════════════════════════════════════════════════════════
   Regulatory Studio — Clean Client-Facing UI
   ═══════════════════════════════════════════════════════════ */

:root {
  /* VAIN warm editorial system — matches homepage (index.html) */
  --rs-accent: #e9913a;                       /* VAIN orange */
  --rs-accent-soft: rgba(233,145,58,0.12);
  --rs-accent-hover: #c9741f;
  --rs-accent-light: rgba(233,145,58,0.08);
  --rs-danger: #b23b2e;
  --rs-danger-soft: rgba(178,59,46,0.09);
  --rs-warning: #8a6d00;
  --rs-warning-soft: rgba(233,187,51,0.16);
  --rs-success: #4e7d2e;
  --rs-success-soft: rgba(120,170,70,0.14);
  --rs-bg: #fafaf8;                            /* cream */
  --rs-card: #ffffff;
  --rs-border: #e8e5db;                        /* warm gray-200 */
  --rs-text: #22201b;                          /* warm charcoal ink */
  --rs-text-secondary: #7a766c;                /* warm gray-500 */
  --rs-radius: 0;                              /* square — flat editorial, matches homepage */
  --rs-radius-sm: 0;                            /* square inner rows / chips */
  --rs-hair: 1.5px;                             /* hairline border weight, like homepage */
  --rs-shadow: none;
  --rs-shadow-hover: none;
  --rs-grad-warm: linear-gradient(135deg, #e9913a, #e9bb33);
  --rs-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: var(--rs-font); background: var(--rs-bg); color: var(--rs-text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

a { color: var(--rs-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login (flat editorial, asymmetric split) ───────────── */
:root {
  --rs-ink: #1c1a15;
  --rs-orange: #e9913a;
  --rs-green: #97b556;
  --rs-paper: #f4f1ea;
}
.rs-login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--rs-paper); }

/* Left: full-bleed orange brand panel, type + live proof */
.rs-login-brand { background: var(--rs-orange); color: var(--rs-ink); padding: 56px clamp(40px, 5vw, 88px); display: flex; flex-direction: column; }
.rs-login-brand-home { display: inline-flex; margin-bottom: auto; transition: opacity 0.15s; }
.rs-login-brand-home:hover { opacity: 0.72; }
.rs-login-brand-logo { height: 30px; display: block; }
.rs-login-brand-kick { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 20px; }
.rs-login-brand h2 { font-size: clamp(2.4rem, 4.5vw, 3.6rem); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 28px; }
.rs-login-brand h2 em { font-style: normal; display: block; }
.rs-login-proof { border-top: 1px solid var(--rs-ink); }
.rs-login-proof-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(28,26,21,0.28); }
.rs-login-proof-row .ing { font-weight: 600; font-size: 15px; }
.rs-login-proof-row .src { font-size: 12px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; opacity: 0.75; }

/* Right: flat form column */
.rs-login-form-col { display: flex; align-items: center; justify-content: center; padding: 56px clamp(28px, 4vw, 64px); }
.rs-login-card { width: 100%; max-width: 380px; }
.rs-login-card h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.rs-login-card .rs-subtitle { font-size: 14px; color: var(--rs-text-secondary); margin-bottom: 32px; }
.rs-login-form { display: flex; flex-direction: column; gap: 12px; }
.rs-input { width: 100%; background: #fff; border: 1.5px solid var(--rs-ink); border-radius: 0; padding: 13px 15px; font-size: 14px; font-family: var(--rs-font); color: var(--rs-ink); outline: none; transition: box-shadow 0.15s; }
.rs-input:focus { border-color: var(--rs-orange); box-shadow: inset 0 -3px 0 var(--rs-orange); }
.rs-input::placeholder { color: #8a8578; }
.rs-login-btn { width: 100%; padding: 14px; background: var(--rs-ink); color: #fff; border: 1.5px solid var(--rs-ink); border-radius: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; font-family: var(--rs-font); cursor: pointer; transition: background 0.15s, color 0.15s; }
.rs-login-btn:hover { background: var(--rs-orange); border-color: var(--rs-orange); color: var(--rs-ink); }
.rs-login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.rs-login-error { background: var(--rs-danger-soft); color: var(--rs-danger); padding: 10px 14px; border-radius: 0; border-left: 3px solid var(--rs-danger); font-size: 13px; }
.rs-link { color: var(--rs-ink); font-size: 13px; text-align: center; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rs-link:hover { color: var(--rs-orange); }
.rs-login-demo { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(28,26,21,0.14); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; }
.rs-login-demo span { color: var(--rs-text-secondary); }
.rs-login-demo a { color: var(--rs-orange); font-weight: 700; text-decoration: none; }
.rs-login-demo a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 780px) {
  .rs-login { grid-template-columns: 1fr; }
  .rs-login-brand { padding: 40px 28px; }
  .rs-login-brand-logo { margin-bottom: 40px; }
  .rs-login-proof { display: none; }
}

/* ── Shell ──────────────────────────────────────────────── */
.rs-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Nav ────────────────────────────────────────────────── */
.rs-nav { display: flex; align-items: center; gap: 16px; padding: 0 28px; height: 58px; background: #22201b; color: #fff; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(255,255,255,0.06); }
.rs-nav-home { display: inline-flex; align-items: center; transition: opacity 0.15s; }
.rs-nav-home:hover { opacity: 0.7; }
.rs-nav-logo { height: 20px; opacity: 0.95; display: block; filter: invert(1) brightness(1.8); }
.rs-nav-title { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--rs-accent); opacity: 0.9; }
.rs-nav-spacer { flex: 1; }
.rs-nav-user { font-size: 13px; opacity: 0.55; }
.rs-nav-signout { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; padding: 6px 16px; font-size: 12px; font-weight: 600; font-family: var(--rs-font); cursor: pointer; transition: all 0.15s; }
.rs-nav-signout:hover { background: var(--rs-accent); border-color: var(--rs-accent); color: #22201b; }

/* ── Layout ─────────────────────────────────────────────── */
.rs-main { max-width: 1320px; margin: 0 auto; padding: 28px 24px; flex: 1; }
.rs-page-header { margin-bottom: 28px; }
.rs-page-header h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.rs-page-header p { font-size: 14px; color: var(--rs-text-secondary); margin-top: 4px; }
.rs-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

/* ── Stats bar ─────────────────────────────────────────── */
.rs-stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.rs-stat-card { background: var(--rs-card); border-radius: 0; padding: 20px; border: var(--rs-hair) solid var(--rs-text); }
.rs-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--rs-text-secondary); }
.rs-stat-value { font-size: 32px; font-weight: 700; margin-top: 6px; letter-spacing: -1px; }
.rs-stat-sub { font-size: 12px; color: var(--rs-text-secondary); margin-top: 4px; }
.rs-stat-accent { color: var(--rs-accent); }
.rs-stat-danger { color: var(--rs-danger); }
.rs-stat-success { color: var(--rs-success); }

/* ── Sidebar nav / Tabs ────────────────────────────────── */
.rs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.rs-sidebar { position: sticky; top: 76px; align-self: start; }
.rs-sidebar-nav { display: flex; flex-direction: column; background: var(--rs-card); border-radius: 0; border: var(--rs-hair) solid var(--rs-text); }
.rs-sidebar-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 0; font-size: 13px; font-weight: 500; color: var(--rs-text-secondary); cursor: pointer; transition: all 0.15s; border: none; border-bottom: 1px solid var(--rs-border); background: none; text-align: left; width: 100%; font-family: var(--rs-font); }
.rs-sidebar-item:last-child { border-bottom: none; }
.rs-sidebar-item:hover { background: var(--rs-bg); color: var(--rs-text); }
.rs-sidebar-item.active { background: var(--rs-accent-soft); color: var(--rs-accent-hover); font-weight: 700; box-shadow: inset 3px 0 0 var(--rs-accent); }
.rs-sidebar-icon { width: 18px; text-align: center; font-size: 15px; }

/* ── Cards ─────────────────────────────────────────────── */
.rs-card { background: var(--rs-card); border-radius: 0; padding: 24px; border: var(--rs-hair) solid var(--rs-text); }
.rs-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.rs-card-head h2 { font-size: 16px; font-weight: 700; }
.rs-card-head h3 { font-size: 14px; font-weight: 600; }

/* ── Action cards (dashboard) ──────────────────────────── */
.rs-action-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--rs-card); border-radius: 0; border: var(--rs-hair) solid var(--rs-text); cursor: pointer; transition: background 0.15s; }
.rs-action-card:hover { background: var(--rs-bg); }
.rs-action-icon { width: 40px; height: 40px; border-radius: 0; border: 1px solid var(--rs-border); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.rs-action-icon.blue { background: var(--rs-accent-soft); }
.rs-action-icon.green { background: var(--rs-success-soft); }
.rs-action-icon.orange { background: var(--rs-warning-soft); }
.rs-action-icon.red { background: var(--rs-danger-soft); }
.rs-action-body { flex: 1; }
.rs-action-title { font-size: 14px; font-weight: 600; }
.rs-action-desc { font-size: 12px; color: var(--rs-text-secondary); margin-top: 2px; }
.rs-action-arrow { color: var(--rs-text-secondary); font-size: 16px; }

/* ── Grids ─────────────────────────────────────────────── */
.rs-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.rs-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.rs-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.rs-section { margin-bottom: 24px; }
.rs-gap-16 { gap: 16px; }

/* ── Buttons ───────────────────────────────────────────── */
/* Square, flat, bordered — matches homepage .sqbtn */
.rs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 0; font-size: 13px; font-weight: 700; font-family: var(--rs-font); border: 1.5px solid var(--rs-text); background: var(--rs-text); color: #fff; cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.rs-btn:hover { background: var(--rs-accent); border-color: var(--rs-accent); color: #22201b; }
.rs-btn-primary { background: var(--rs-accent); border-color: var(--rs-accent); color: #22201b; }
.rs-btn-primary:hover { background: #f19f4d; border-color: #f19f4d; color: #22201b; }
.rs-btn-secondary { background: transparent; color: var(--rs-text); border-color: var(--rs-text); }
.rs-btn-secondary:hover { background: var(--rs-text); color: #fff; }
.rs-btn-danger { background: transparent; color: var(--rs-danger); border-color: var(--rs-danger); }
.rs-btn-danger:hover { background: var(--rs-danger); color: #fff; }
.rs-btn-success { background: transparent; color: var(--rs-success); border-color: var(--rs-success); }
.rs-btn-success:hover { background: var(--rs-success); color: #fff; }
.rs-btn-ghost { background: none; color: var(--rs-accent-hover); border-color: transparent; padding: 8px 12px; }
.rs-btn-ghost:hover { background: none; color: var(--rs-text); text-decoration: underline; text-underline-offset: 3px; }
.rs-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rs-btn-lg { padding: 14px 26px; font-size: 14px; border-radius: 0; }
.rs-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 0; }

/* ── Forms ─────────────────────────────────────────────── */
.rs-form { display: flex; flex-direction: column; gap: 14px; }
.rs-form-group { display: flex; flex-direction: column; gap: 5px; }
.rs-form-group label { font-size: 12px; font-weight: 600; color: var(--rs-text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.rs-form-row { display: flex; gap: 12px; }
.rs-form-row > * { flex: 1; }
.rs-form input, .rs-form select, .rs-form textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--rs-text); border-radius: 0; font-size: 14px; font-family: var(--rs-font); background: #fff; outline: none; transition: all 0.2s; color: var(--rs-text); }
.rs-form input:focus, .rs-form select:focus, .rs-form textarea:focus { border-color: var(--rs-accent); }
.rs-form textarea { resize: vertical; min-height: 80px; }
.rs-form input::placeholder, .rs-form textarea::placeholder { color: #94a3b8; }

/* ── Tables ────────────────────────────────────────────── */
.rs-table-wrap { overflow-x: auto; margin: 0 -4px; }
.rs-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rs-table th { text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--rs-text-secondary); border-bottom: 1px solid var(--rs-border); background: var(--rs-bg); position: sticky; top: 0; }
.rs-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--rs-border); vertical-align: middle; }
.rs-table tbody tr { transition: background 0.1s; }
.rs-table tbody tr:hover { background: var(--rs-accent-light); }
.rs-table tbody tr:last-child td { border-bottom: none; }

/* ── Pills / Badges ───────────────────────────────────── */
.rs-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 0; padding: 3px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.rs-pill-pass { background: var(--rs-success-soft); color: var(--rs-success); }
.rs-pill-warning { background: var(--rs-warning-soft); color: var(--rs-warning); }
.rs-pill-violation { background: var(--rs-danger-soft); color: var(--rs-danger); }
.rs-pill-info { background: var(--rs-accent-soft); color: var(--rs-accent); }
.rs-pill-draft { background: var(--rs-bg); color: var(--rs-text-secondary); border: 1px solid var(--rs-border); }
.rs-pill-submitted { background: var(--rs-accent-soft); color: var(--rs-accent); }
.rs-pill-approved { background: var(--rs-success-soft); color: var(--rs-success); }

/* ── Market heat map cells ─────────────────────────────── */
.rs-market-cell { width: 36px; height: 36px; border-radius: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.rs-market-cell:hover { transform: scale(1.1); }
.rs-market-cell.compliant { background: rgba(120,170,70,0.22); color: #3c611f; }
.rs-market-cell.partial { background: rgba(233,187,51,0.28); color: #7a5c00; }
.rs-market-cell.blocked { background: rgba(178,59,46,0.18); color: #8f2c21; }
.rs-market-cell.unknown { background: #ece9df; color: #7a766c; }

/* ── Compliance result cards ───────────────────────────── */
/* Flat editorial rows like the homepage's .flag-row: white, thin warm
   border, small radius. Severity lives only in the pill — no colored
   left-bar, no tinted fill. */
.rs-result-card { border-radius: var(--rs-radius-sm); padding: 14px 16px; margin-bottom: 9px; border: 1px solid var(--rs-border); background: var(--rs-card); transition: border-color 0.15s; }
.rs-result-card:hover { border-color: var(--rs-text-secondary); }
.rs-result-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.rs-result-finding { font-size: 14px; line-height: 1.6; }
.rs-result-rec { font-size: 13px; color: var(--rs-text-secondary); margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,0.05); }
.rs-result-citations { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.rs-citation-link { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--rs-accent); background: var(--rs-accent-light); padding: 2px 8px; border-radius: 0; transition: all 0.15s; text-decoration: none; }
.rs-citation-link:hover { background: var(--rs-accent-soft); text-decoration: none; }

/* ── Search ────────────────────────────────────────────── */
.rs-search-wrap { position: relative; }
.rs-search-input { width: 100%; padding: 10px 14px 10px 36px; border: 1.5px solid var(--rs-text); border-radius: 0; font-size: 14px; font-family: var(--rs-font); background: #fff; outline: none; transition: all 0.2s; }
.rs-search-input:focus { border-color: var(--rs-accent); }
.rs-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--rs-text-secondary); font-size: 14px; pointer-events: none; }

/* ── Empty state ───────────────────────────────────────── */
.rs-empty { text-align: center; padding: 48px 24px; color: var(--rs-text-secondary); }
.rs-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.rs-empty h3 { font-size: 16px; font-weight: 600; color: var(--rs-text); margin-bottom: 6px; }
.rs-empty p { font-size: 14px; max-width: 360px; margin: 0 auto 16px; }

/* ── Modal ─────────────────────────────────────────────── */
.rs-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(34,32,27,0.5); backdrop-filter: blur(4px); z-index: 200; align-items: center; justify-content: center; padding: 24px; }
.rs-modal-overlay.open { display: flex; }
.rs-modal { background: #fff; border-radius: 0; padding: 32px; width: 100%; max-width: 640px; max-height: 85vh; overflow-y: auto; border: 1.5px solid var(--rs-text); }
.rs-modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.rs-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rs-border); }

/* ── Toast ─────────────────────────────────────────────── */
.rs-toast { position: fixed; right: 20px; bottom: 20px; background: var(--rs-text); color: #fff; border-radius: 0; padding: 12px 18px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: all 0.25s; z-index: 999; font-size: 13px; font-weight: 500; max-width: 400px; }
.rs-toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.rs-toast.error { background: var(--rs-danger); }
.rs-toast.success { background: var(--rs-success); }

/* ── Deadline indicator ────────────────────────────────── */
.rs-deadline { font-size: 13px; font-weight: 700; }
.rs-deadline.urgent { color: var(--rs-danger); }
.rs-deadline.approaching { color: var(--rs-warning); }
.rs-deadline.ok { color: var(--rs-success); }

/* ── Loading ───────────────────────────────────────────── */
.rs-loading { display: flex; align-items: center; justify-content: center; padding: 48px; color: var(--rs-text-secondary); font-size: 14px; gap: 10px; }
.rs-spinner { width: 20px; height: 20px; border: 2px solid var(--rs-border); border-top-color: var(--rs-accent); border-radius: 50%; animation: rs-spin 0.6s linear infinite; }
@keyframes rs-spin { to { transform: rotate(360deg); } }

/* ── Misc ──────────────────────────────────────────────── */
.rs-muted { color: var(--rs-text-secondary); font-size: 13px; }
.rs-divider { height: 1px; background: var(--rs-border); margin: 20px 0; }
.rs-text-right { text-align: right; }
.rs-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-clickable { cursor: pointer; }
.rs-clickable:hover { opacity: 0.85; }
strong { font-weight: 600; }

/* product list cards */
.rs-product-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--rs-card); border-radius: 0; border: var(--rs-hair) solid var(--rs-text); cursor: pointer; transition: all 0.2s; }
.rs-product-card:hover { border-color: var(--rs-accent); }
.rs-product-avatar { width: 44px; height: 44px; border-radius: 0; background: var(--rs-accent-light); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: var(--rs-accent); flex-shrink: 0; }
.rs-product-info { flex: 1; min-width: 0; }
.rs-product-name { font-size: 14px; font-weight: 600; }
.rs-product-meta { font-size: 12px; color: var(--rs-text-secondary); margin-top: 2px; }
.rs-product-markets { display: flex; gap: 3px; }

/* Chart containers */
.rs-chart-wrap { position: relative; height: 240px; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .rs-layout { grid-template-columns: 1fr; }
  .rs-sidebar { display: none; }
  .rs-tabs-mobile { display: flex !important; }
}
@media (max-width: 900px) { .rs-stats-bar, .rs-grid-4 { grid-template-columns: 1fr 1fr; } .rs-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .rs-stats-bar { grid-template-columns: 1fr; }
  .rs-grid-2 { grid-template-columns: 1fr; }
  .rs-main { padding: 16px; }
  .rs-form-row { flex-direction: column; }
  .rs-nav { padding: 0 16px; }
  .rs-page-header h1 { font-size: 22px; }
}

/* hide mobile tabs on desktop */
.rs-tabs-mobile { display: none; overflow-x: auto; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--rs-border); }
.rs-tab-mobile { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--rs-text-secondary); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; font-family: var(--rs-font); }
.rs-tab-mobile.active { color: var(--rs-accent); border-bottom-color: var(--rs-accent); }
