/* ============================================================
   Renoja Marketing � Design System
   Brand: Ink Navy � Steel � Clinical Cyan � Paper
   Type: Libre Franklin (display) � Lato (body) � Open Sans (labels)
   ============================================================ */

:root {
  --ink: #15324A;
  --ink-soft: #3C4C58;
  --ink-mute: #5C6B77;
  --ink-faint: #9AA7B1;
  --steel: #3D6488;
  --logo: #507DA4;
  --accent: #0E9BB0;
  --accent-soft: #3AB0C2;
  --accent-wash: rgba(14, 155, 176, 0.10);
  --accent-line: rgba(14, 155, 176, 0.28);
  --paper: #F4F6F8;
  --mist: #E6ECF1;
  --white: #FFFFFF;
  --rule: rgba(12, 24, 32, 0.10);
  --rule-strong: rgba(12, 24, 32, 0.18);
  --success: #2A7A5C;
  --success-wash: rgba(42, 122, 92, 0.10);
  --warn: #C68B2D;
  --warn-wash: rgba(198, 139, 45, 0.12);
  --danger: #B04545;
  --danger-wash: rgba(176, 69, 69, 0.10);
  --shadow: 0 12px 40px rgba(21, 50, 74, 0.08), 0 2px 8px rgba(21, 50, 74, 0.04);
  --shadow-lg: 0 24px 64px rgba(21, 50, 74, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font-display: "Libre Franklin", system-ui, sans-serif;
  --font-body: "Lato", system-ui, sans-serif;
  --font-label: "Open Sans", system-ui, sans-serif;
  --sidebar-w: 248px;
  --topbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-soft); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(14, 155, 176, 0.22); }

/* �� Type �� */
.eyebrow {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}
.h1 { font-size: 28px; }
.h2 { font-size: 20px; }
.h3 { font-size: 16px; font-weight: 600; }
.muted { color: var(--ink-mute); }
.soft { color: var(--ink-soft); }
.mono {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}

/* �� Buttons �� */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 999px;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px var(--accent-wash);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-soft); color: #fff; }
.btn-ink {
  background: var(--ink);
  color: #fff;
}
.btn-ink:hover:not(:disabled) { background: var(--steel); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
}
.btn-ghost:hover:not(:disabled) { background: var(--mist); color: var(--ink); }
.btn-danger {
  background: #B04545;
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #8f3636; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-logout {
  margin-top: 10px;
  width: 100%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
}
.btn-logout:hover:not(:disabled) {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

/* �� Form �� */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.field .hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: -2px;
}

.input-nice,
.field input,
.field textarea,
.select-multi {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 1px 2px rgba(21, 50, 74, 0.04);
  color: var(--ink);
}
.input-nice::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-faint);
}
.input-nice:hover,
.field input:hover,
.field textarea:hover,
.select-wrap:hover select {
  border-color: rgba(14, 155, 176, 0.35);
}
.input-nice:focus,
.field input:focus,
.field textarea:focus,
.select-wrap select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
  background: #fff;
}
.field textarea,
.input-nice.textarea,
.select-multi { min-height: 112px; resize: vertical; }

/* Custom select */
.select-wrap {
  position: relative;
  width: 100%;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-mute);
  border-bottom: 2px solid var(--ink-mute);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}
.select-wrap select,
.field select:not([multiple]) {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--white);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  padding: 13px 44px 13px 16px;
  outline: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(21, 50, 74, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select-wrap select:focus,
.field select:not([multiple]):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.select-wrap select option,
.field select option {
  background: #fff;
  color: var(--ink);
  padding: 10px;
}

.select-multi {
  padding: 10px 12px;
  background:
    linear-gradient(180deg, #fff, #f7fafb);
}
.select-multi option {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 2px 0;
}
.select-multi option:checked {
  background: var(--accent-wash) linear-gradient(0deg, var(--accent-wash), var(--accent-wash));
  color: var(--ink);
}

/* �� Pills / badges �� */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill-accent { background: var(--accent-wash); color: var(--accent); }
.pill-ink { background: rgba(21, 50, 74, 0.08); color: var(--ink); }
.pill-success { background: var(--success-wash); color: var(--success); }
.pill-warn { background: var(--warn-wash); color: var(--warn); }
.pill-danger { background: var(--danger-wash); color: var(--danger); }
.pill-steel { background: rgba(61, 100, 136, 0.12); color: var(--steel); }

/* �� Cards �� */
.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* �� App shell �� */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 24px;
}
.sidebar-brand .word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: #fff;
}
.sidebar-brand .word span {
  opacity: 0.55;
  font-weight: 600;
  font-size: 10px;
  display: block;
  margin-top: 3px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.nav-section {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 14px 12px 8px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.72);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav a.active {
  background: rgba(14, 155, 176, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(14, 155, 176, 0.35);
}
.nav a .ico {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  flex-shrink: 0;
}
.nav a .badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 8px 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span { font-size: 11px; color: rgba(255,255,255,0.45); }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  grid-column: 2;
  background: var(--paper);
}
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(21, 50, 74, 0.45);
  z-index: 55;
}
.backdrop.show { display: block; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(244, 246, 248, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.location-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 8px 14px 8px 12px;
  box-shadow: var(--shadow);
  min-width: 180px;
}
.loc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
  flex-shrink: 0;
}
.loc-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.location-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(12,24,32,.04);
  border: 1px solid rgba(12,24,32,.08);
  min-width: 220px;
  max-width: min(360px, 42vw);
}
.location-switch .loc-meta {
  flex: 1;
  min-width: 0;
}
.location-switch label {
  font-family: var(--font-label);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
}
.location-switch .select-wrap,
.location-switch .select-wrap-loc {
  width: 100%;
}
.location-switch .loc-select,
.location-switch select {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 22px 4px 0 !important;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  color: var(--ink);
  min-height: 28px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235C6B77'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 2px center !important;
  text-overflow: ellipsis;
}
.nav-soon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--ink-faint);
  font-size: 13px;
  opacity: 0.75;
  cursor: default;
  text-decoration: none;
}
.nav-soon em,
.nav-soon-badge {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(14,155,176,.12);
  padding: 1px 5px;
  border-radius: 999px;
  line-height: 1.2;
  width: fit-content;
}
.nav-has-soon {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-label-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.nav-label-stack > span {
  line-height: 1.2;
}
.exec-select-field {
  max-width: min(420px, 100%);
  width: 100%;
  overflow: hidden;
}
.exec-select-field .select-wrap,
.exec-select-wrap {
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}
.exec-select-field select,
.exec-select-wrap select {
  max-width: 100%;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.exec-select-field select option {
  max-width: 100%;
}
.info-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.info-dot:hover { background: rgba(14,155,176,.1); }
.lib-suggest {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(14,155,176,.06);
  border: 1px dashed rgba(14,155,176,.35);
}
.lib-suggest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
}
.modal .soft { white-space: pre-wrap; }
#planPick {
  max-width: 100%;
  overflow: hidden;
}
.exec-a { background:#E8F4F7; color:#0E6B7A; }
.exec-b { background:#F3EEE6; color:#8A5A2B; }
.exec-c { background:#EEE8F7; color:#5B3A8C; }
.exec-d { background:#E8F0E8; color:#2F6B3A; }
.prov-line {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 8px;
  line-height: 1.4;
}
.page-body { display: block !important; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-body { display: block !important; visibility: visible !important; }
#page:not([hidden]) { display: block; }

.content {
  padding: 28px;
  width: min(1180px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - var(--topbar-h));
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head .eyebrow { margin-bottom: 6px; display: block; }

/* �� Guide / next-step strip �� */
.guide {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(14,155,176,0.08), rgba(61,100,136,0.06));
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  margin-bottom: 22px;
}
.guide-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--white);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.guide strong { display: block; font-size: 14px; margin-bottom: 2px; }
.guide p { font-size: 13px; color: var(--ink-soft); margin: 0; }

/* �� Grid helpers �� */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-sm { gap: 8px; }
.mt-0 { margin-top: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* �� Stat widgets �� */
.stat {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat .label {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.stat .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat .hint { font-size: 12px; color: var(--ink-mute); margin-top: 8px; }

/* �� Timeline (pipeline) �� */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--mist);
}
.tl-item {
  position: relative;
  padding: 0 0 22px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--mist);
  display: grid;
  place-items: center;
  z-index: 1;
}
.tl-item.done .tl-dot { border-color: var(--success); background: var(--success-wash); }
.tl-item.active .tl-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.tl-item.blocked .tl-dot { border-color: var(--warn); background: var(--warn-wash); }
.tl-item.failed .tl-dot { border-color: var(--danger); background: var(--danger-wash); }
.tl-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.tl-item.active .tl-card,
.tl-item.blocked .tl-card {
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
}
.tl-item.blocked .tl-card { border-color: rgba(198, 139, 45, 0.35); }
.tl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.tl-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.tl-body { font-size: 13px; color: var(--ink-soft); }
.tl-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 8px;
}
.detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  font-size: 12px;
}
.detail-row dt { color: var(--ink-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--font-label); font-size: 10px; padding-top: 2px; }
.detail-row dd { color: var(--ink-soft); }

/* �� Ad preview cards �� */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ad-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ad-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.ad-card .check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--mist);
  background: var(--white);
  display: grid;
  place-items: center;
  z-index: 2;
}
.ad-card.selected .check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ad-thumb {
  height: 140px;
  background: linear-gradient(145deg, var(--ink) 0%, var(--steel) 55%, var(--accent) 100%);
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
.ad-body { padding: 14px; }
.ad-body .hook { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.ad-body .copy { font-size: 13px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ad-foot { padding: 0 14px 14px; display: flex; gap: 6px; flex-wrap: wrap; }

/* �� QA issues �� */
.issue {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--paper);
  margin-bottom: 8px;
}
.issue.claim { border-color: rgba(176,69,69,0.25); background: var(--danger-wash); }
.issue.craft { border-color: rgba(198,139,45,0.25); background: var(--warn-wash); }
.issue.policy { border-color: rgba(61,100,136,0.25); background: rgba(61,100,136,0.08); }

/* �� Tabs �� */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button {
  border: 0;
  background: transparent;
  color: var(--ink-mute);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tabs button:hover { background: var(--mist); color: var(--ink); }
.tabs button.active { background: var(--ink); color: #fff; }

/* �� Tables �� */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.data th {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* �� Empty �� */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-mute);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.5);
}
.empty strong { display: block; color: var(--ink); margin-bottom: 6px; font-family: var(--font-display); }

/* �� Login �� */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--paper);
}
.login-hero {
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(14,155,176,0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(61,100,136,0.2), transparent 50%),
    var(--ink);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-hero .logo-row { display: flex; align-items: center; gap: 12px; }
.login-hero .logo-row img { height: 36px; filter: brightness(0) invert(1); }
.login-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 480px;
}
.login-hero h1 em {
  font-style: normal;
  color: var(--accent-soft);
}
.login-hero .tagline { color: rgba(255,255,255,0.65); max-width: 380px; font-size: 16px; margin-top: 16px; }
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}
.login-box {
  width: min(400px, 100%);
  background: var(--white);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--rule);
}
.login-box h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 6px; }
.login-box .sub { color: var(--ink-mute); font-size: 14px; margin-bottom: 24px; }

/* �� Toast �� */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* �� Mobile �� */
.menu-btn {
  display: none;
  border: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    z-index: 60;
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: grid; place-items: center; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { min-height: 280px; padding: 32px; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 0 16px; }
  .main { grid-column: 1; }
}

/* �� Utility split layouts �� */
.split {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}

.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.list-item:last-child { border-bottom: 0; }

.progress-bar {
  height: 6px;
  background: var(--mist);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--steel), var(--accent));
  border-radius: 999px;
}

.switch {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--mist);
  position: relative;
  cursor: pointer;
  border: 0;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: 0.15s;
}
.switch.on { background: var(--accent); }
.switch.on::after { left: 21px; }

.editor {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  min-height: 360px;
  background: #0f1a24;
  color: #d7e2ea;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 16px;
  width: 100%;
  resize: vertical;
}

/* �� Modals �� */
#rmModalRoot { position: fixed; inset: 0; z-index: 9999; display: none; }
#rmModalRoot.open { display: block; pointer-events: auto; }
.rm-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(12, 24, 32, 0.52);
  backdrop-filter: blur(2px);
}
.rm-modal {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(12,24,32,.08);
  box-shadow: 0 28px 80px rgba(12,24,32,.28);
  z-index: 1;
}

/* Native selects � visible & clickable */
.select-wrap {
  position: relative;
  width: 100%;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-mute);
  border-bottom: 2px solid var(--ink-mute);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
  z-index: 1;
}
.select-wrap select,
.field select:not([multiple]) {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(180deg, #fff, #f7fafb);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  padding: 12px 40px 12px 14px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  min-height: 46px;
  position: relative;
  z-index: 0;
}
.select-wrap select:hover,
.field select:not([multiple]):hover {
  border-color: rgba(14, 155, 176, 0.45);
}
.select-wrap select:focus,
.field select:not([multiple]):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}

/* Kill broken fancy-select overlay */
.fancy-select { border: 0 !important; background: transparent !important; box-shadow: none !important; min-height: 0 !important; cursor: default !important; }
.fancy-select select {
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 100% !important;
  height: auto !important;
}
.fancy-current, .fancy-panel { display: none !important; }

/* Page loader + floating job progress */
.rm-page-loader {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(244,246,248,.72);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.rm-page-loader.hidden { display: none; }
.rm-spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(14,155,176,.2);
  border-top-color: var(--accent);
  animation: rmspin .7s linear infinite;
}
@keyframes rmspin { to { transform: rotate(360deg); } }
.rm-loader-card {
  background: #fff; border-radius: 16px; padding: 22px 28px;
  box-shadow: 0 16px 48px rgba(12,24,32,.14);
  display: flex; align-items: center; gap: 14px;
  border: 1px solid rgba(12,24,32,.08);
}
.rm-loader-card strong { display:block; font-size:14px; }
.rm-loader-card span { font-size:12px; color: var(--ink-mute); }

.rm-progress {
  position: fixed; right: 20px; bottom: 20px; z-index: 9500;
  width: min(360px, calc(100vw - 32px));
  background: #15324A; color: #fff;
  border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 18px 48px rgba(12,24,32,.35);
  display: none;
}
.rm-progress.show { display: block; }
.rm-progress .rm-p-title { font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.rm-progress .rm-p-msg { font-size: 12px; opacity: .8; margin: 0 0 10px; }
.rm-progress .rm-p-bar {
  height: 6px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden;
}
.rm-progress .rm-p-bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #3AB0C2, #0E9BB0);
  border-radius: 99px; transition: width .35s ease;
}
.rm-progress.done .rm-p-bar > i { background: #3DDC97; }
.rm-progress.fail .rm-p-bar > i { background: #F07167; }
.rm-progress .rm-p-actions { display: flex; gap: 8px; margin-top: 12px; }
.rm-progress .rm-p-actions a,
.rm-progress .rm-p-actions button {
  border: 0; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.rm-progress .rm-p-actions .go { background: #0E9BB0; color: #fff; text-decoration: none; }
.rm-progress .rm-p-actions .dismiss { background: rgba(255,255,255,.12); color: #fff; }

.btn[disabled], .btn.is-busy {
  opacity: .65; pointer-events: none; cursor: wait;
}
.rm-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 8px; gap: 12px;
}
.rm-modal-head h3 {
  margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 600;
}
.rm-modal-x {
  border: 0; background: transparent; font-size: 24px; line-height: 1;
  cursor: pointer; color: var(--ink-mute); width: 36px; height: 36px; border-radius: 10px;
}
.rm-modal-x:hover { background: var(--paper); color: var(--ink); }
.rm-modal-body { padding: 8px 20px 6px; }
.rm-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px 18px;
}
.btn-danger { background: #B04545; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8f3636; color: #fff; }

/* Fancy dropdowns */
.fancy-select { position: relative; }
.fancy-select select {
  position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px;
}
.fancy-select::before {
  content: attr(data-label);
}
.fancy-select .fancy-trigger,
.fancy-select > .select-face {
  display: none;
}
.fancy-select::after { z-index: 2; }
.fancy-select {
  min-height: 46px;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f7fafb);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  cursor: pointer;
}
.fancy-select::before {
  content: "";
}
.fancy-select .fancy-current {
  display: block;
  padding: 12px 40px 12px 14px;
  font-size: 14px;
  color: var(--ink);
  pointer-events: none;
}
.fancy-select.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.fancy-panel {
  display: none;
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  background: #fff;
  border: 1px solid rgba(12,24,32,.1);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(12,24,32,.16);
  max-height: 260px;
  overflow: auto;
  z-index: 40;
  padding: 6px;
}
.fancy-select.open .fancy-panel { display: block; }
.fancy-opt {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent;
  padding: 10px 12px; border-radius: 10px;
  font: inherit; color: var(--ink); cursor: pointer;
}
.fancy-opt:hover { background: var(--accent-wash); }
.fancy-opt.active { background: rgba(14,155,176,.12); font-weight: 600; color: var(--accent-ink, #0a6f7e); }
.select-wrap-loc.fancy-select { min-width: 180px; }

/* Doctrine split editors */
.split-editors {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 980px) {
  .split-editors { grid-template-columns: 1fr; }
}
.split-editors .card { display: flex; flex-direction: column; min-height: 560px; }
.split-editors .editor,
.editor-tall {
  flex: 1;
  min-height: 480px !important;
  height: 100%;
}
.findings-list { list-style: none; padding: 0; margin: 10px 0 0; }
.findings-list li {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  font-size: 13px;
}
.findings-list a { color: var(--accent); font-weight: 600; word-break: break-all; }
.looked-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.looked-chips a {
  display: inline-flex; align-items: center;
  padding: 6px 10px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--rule);
  font-size: 12px; color: var(--ink); text-decoration: none;
}
.looked-chips a:hover { border-color: var(--accent); color: var(--accent); }
.asset-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
