/* ============================================================
   ECW NoteBot Web Dashboard – Dark Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Reset & base ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --card:     rgba(30, 34, 48, .85);
  --border:   rgba(255,255,255,.08);
  --accent:   #6c5ce7;
  --accent2:  #a29bfe;
  --green:    #00cec9;
  --red:      #ff7675;
  --yellow:   #fdcb6e;
  --blue:     #74b9ff;
  --text:     #e4e6eb;
  --muted:    #8b8fa3;
  --radius:   12px;
  --shadow:   0 8px 32px rgba(0,0,0,.35);
}

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- Login overlay --------------------------------- */
#login-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 1000;
  transition: opacity .4s ease;
}
#login-overlay.hidden { opacity: 0; pointer-events: none; }

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 380px;
  text-align: center;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 1.5rem; margin-bottom: .4rem; }
.login-card p  { color: var(--muted); font-size: .85rem; margin-bottom: 1.5rem; }

.login-card input {
  width: 100%; padding: .7rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .95rem;
  outline: none; transition: border .2s;
}
.login-card input:focus { border-color: var(--accent); }

.login-card button {
  margin-top: 1rem; width: 100%; padding: .7rem;
  background: var(--accent); border: none; border-radius: 8px;
  color: #fff; font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: background .2s;
}
.login-card button:hover { background: var(--accent2); }

.login-error {
  color: var(--red); font-size: .8rem; margin-top: .6rem;
  min-height: 1.2rem;
}

/* ---------- Main layout ----------------------------------- */
#app { display: none; }
#app.visible { display: flex; flex-direction: column; min-height: 100vh; }

header {
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header h1 { font-size: 1.2rem; font-weight: 700; }
header h1 span { color: var(--accent2); }

.header-badge {
  font-size: .7rem; padding: .25rem .65rem;
  border-radius: 20px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
}
.badge-idle    { background: rgba(139,143,163,.15); color: var(--muted); }
.badge-running { background: rgba(0,206,201,.15); color: var(--green); animation: pulse 2s infinite; }
.badge-paused  { background: rgba(253,203,110,.15); color: var(--yellow); animation: pulse 2s infinite; }

@keyframes pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: .5; }
}

.main-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  flex: 1;
}

/* ---------- Sidebar (config panel) ------------------------ */
.sidebar {
  padding: 1.5rem;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: calc(100vh - 60px);
  background: var(--surface);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.card h3 {
  font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin-bottom: .5rem;
}

.card-hint {
  font-size: .75rem; color: var(--muted); margin-bottom: .8rem;
  line-height: 1.4; opacity: .7;
}

.provider-count {
  color: var(--accent2); font-size: .75rem; font-weight: 400;
}

.field { margin-bottom: .8rem; }
.field label {
  display: block; font-size: .78rem; font-weight: 500;
  color: var(--muted); margin-bottom: .3rem;
}

.field input, .field select {
  width: 100%; padding: .55rem .8rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .9rem;
  outline: none; transition: border .2s;
}
.field input:focus, .field select:focus { border-color: var(--accent); }

.field select { cursor: pointer; }

/* Native date input styling */
.field input[type="date"] {
  color-scheme: dark;
  cursor: pointer;
}
.field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

.date-row { display: flex; gap: .6rem; }
.date-row .field { flex: 1; }

/* ---------- Provider Checklist ----------------------------- */
.provider-checklist {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.provider-toggle {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--border);
  font-size: .78rem; color: var(--accent2);
  cursor: pointer;
  user-select: none;
}

.provider-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .7rem;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.provider-item:hover { background: rgba(255,255,255,.04); }
.provider-item:last-child { border-bottom: none; }

.provider-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.provider-info {
  display: flex; align-items: center; gap: .4rem;
  flex: 1; min-width: 0;
}

.provider-name {
  font-size: .82rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.provider-initial {
  font-size: .7rem; padding: .1rem .4rem;
  background: rgba(108,92,231,.2); color: var(--accent2);
  border-radius: 4px; flex-shrink: 0;
  font-weight: 600;
}

.provider-sig {
  font-size: .7rem; flex-shrink: 0;
  opacity: .6;
}

.provider-error {
  padding: .8rem; font-size: .82rem; color: var(--red);
  text-align: center;
}

.loading-shimmer {
  padding: 1rem; text-align: center;
  color: var(--muted); font-size: .82rem;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

/* ---------- Buttons --------------------------------------- */
.btn-row { display: flex; gap: .6rem; margin-top: .2rem; }

.btn {
  flex: 1; padding: .65rem 1rem;
  border: none; border-radius: 8px;
  font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: all .2s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-start { background: var(--green); color: var(--bg); }
.btn-start:hover:not(:disabled) { filter: brightness(1.1); }

.btn-stop { background: var(--red); color: #fff; }
.btn-stop:hover:not(:disabled) { filter: brightness(1.1); }

.btn-pause { background: var(--yellow); color: var(--bg); }
.btn-pause:hover:not(:disabled) { filter: brightness(1.1); }

/* ---------- Right Panel ----------------------------------- */
.right-panel {
  display: flex; flex-direction: column;
  max-height: calc(100vh - 60px);
  overflow: hidden;
}

/* ---------- Running Bots Panel ----------------------------- */
.bots-panel {
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  max-height: 50%;
  overflow-y: auto;
}

.bots-header {
  padding: 1rem 1.5rem .4rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0;
  background: var(--bg); z-index: 5;
}
.bots-header h2 { font-size: 1rem; font-weight: 600; }
.bots-count {
  font-size: .75rem; color: var(--muted);
  background: rgba(139,143,163,.12); padding: .2rem .5rem;
  border-radius: 10px;
}

.bots-container {
  padding: .5rem 1.5rem 1rem;
  display: flex; flex-direction: column; gap: .5rem;
}

.bots-empty {
  text-align: center; color: var(--muted); font-size: .82rem;
  padding: 1.5rem 0;
  opacity: .6;
}

/* --- Individual bot card --- */
.bot-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .8rem 1rem;
  transition: opacity .3s;
  border-left: 3px solid var(--green);
}
.bot-card.finished {
  opacity: .55;
  border-left-color: var(--muted);
}

.bot-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  margin-bottom: .3rem;
}

.bot-provider-name {
  font-weight: 600; font-size: .85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.bot-card-actions {
  display: flex; align-items: center; gap: .4rem;
  flex-shrink: 0;
}

.bot-status-badge {
  font-size: .65rem; padding: .15rem .45rem;
  border-radius: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
}
.bot-status-badge.running {
  background: rgba(0,206,201,.15); color: var(--green);
}
.bot-status-badge.done {
  background: rgba(139,143,163,.15); color: var(--muted);
}
.bot-status-badge.paused {
  background: rgba(253,203,110,.15); color: var(--yellow);
}

.bot-stop-btn {
  width: 22px; height: 22px;
  border: none; border-radius: 6px;
  background: rgba(255,118,117,.15); color: var(--red);
  cursor: pointer; font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.bot-stop-btn:hover { background: rgba(255,118,117,.3); }

.bot-status-text {
  font-size: .78rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: .4rem;
}

.bot-progress-wrap {
  height: 3px; background: var(--border); border-radius: 3px;
  overflow: hidden;
}
.bot-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  width: 0%; transition: width .4s ease;
  border-radius: 3px;
}

/* ---------- Resize Handle --------------------------------- */
.resize-handle {
  flex-shrink: 0;
  height: 8px;
  background: var(--surface);
  cursor: row-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.resize-handle:hover,
.resize-handle.dragging {
  background: rgba(108,92,231,.15);
}
.resize-grip {
  width: 40px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,.15);
  transition: background .15s, width .15s;
}
.resize-handle:hover .resize-grip,
.resize-handle.dragging .resize-grip {
  background: var(--accent2);
  width: 60px;
}

/* ---------- Log panel ------------------------------------- */
.log-panel {
  display: flex; flex-direction: column;
  background: var(--bg);
  flex: 1;
  min-height: 80px;
  overflow: hidden;
}
.log-header {
  padding: 1rem 1.5rem .6rem;
  display: flex; align-items: center; justify-content: space-between;
}
.log-header h2 { font-size: 1rem; font-weight: 600; }
.log-header-actions {
  display: flex; align-items: center; gap: .6rem;
}
.log-header .log-count { font-size: .75rem; color: var(--muted); }

/* --- Log tabs (per-provider) --- */
.log-tabs {
  display: flex; align-items: center; gap: .35rem;
  padding: 0 1.5rem .4rem;
  overflow-x: auto; flex-shrink: 0;
}
.log-tabs::-webkit-scrollbar { height: 3px; }
.log-tab {
  padding: .25rem .7rem;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--muted);
  font-size: .72rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all .2s;
}
.log-tab:hover { background: rgba(108,92,231,.12); color: var(--accent2); }
.log-tab.active {
  background: rgba(108,92,231,.2);
  border-color: var(--accent);
  color: var(--accent2); font-weight: 600;
}

.log-clear-btn {
  padding: .25rem .6rem;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.log-clear-btn:hover {
  background: rgba(255,118,117,.12);
  border-color: rgba(255,118,117,.3);
  color: var(--red);
}

#log-output {
  flex: 1;
  padding: .5rem 1.5rem 1rem;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: .78rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--muted);
}
#log-output .log-line { padding: 1px 0; }
#log-output .log-line.error { color: var(--red); }
#log-output .log-line.warning { color: var(--yellow); }

/* ---------- Toast messages -------------------------------- */
.toast-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 900;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  padding: .8rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  box-shadow: var(--shadow);
  animation: slideIn .3s ease;
  max-width: 360px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.toast.error  { border-left: 3px solid var(--red); }
.toast.info   { border-left: 3px solid var(--green); }
.toast.warning{ border-left: 3px solid var(--yellow); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---------- Headless toggle ------------------------------ */
.headless-toggle {
  display: flex; align-items: center; gap: .6rem;
  cursor: pointer; margin-bottom: .8rem;
  user-select: none; font-size: .85rem;
}
.headless-toggle input { display: none; }
.toggle-slider {
  position: relative; width: 38px; height: 20px;
  background: rgba(255,255,255,.1); border-radius: 20px;
  transition: background .25s; flex-shrink: 0;
}
.toggle-slider::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; background: var(--muted);
  border-radius: 50%; transition: transform .25s, background .25s;
}
.headless-toggle input:checked + .toggle-slider {
  background: rgba(108,92,231,.4);
}
.headless-toggle input:checked + .toggle-slider::after {
  transform: translateX(18px); background: var(--accent2);
}
.toggle-label { color: var(--text); }
.toggle-label small { color: var(--muted); }

/* ---------- Bot card stats grid --------------------------- */
.bot-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .35rem .8rem; margin-top: .5rem;
  font-size: .75rem; color: var(--muted);
}
.bot-stat-item {
  display: flex; align-items: center; gap: .3rem;
}
.bot-stat-item .stat-icon { font-size: .7rem; opacity: .7; }
.bot-stat-item .stat-value { color: var(--text); font-weight: 500; }
.bot-headless-badge {
  display: inline-block; padding: .1rem .4rem;
  background: rgba(108,92,231,.2); color: var(--accent2);
  border-radius: 4px; font-size: .65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
}

/* ---------- Scrollbar ------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ---------- Responsive ------------------------------------ */
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
  .right-panel { max-height: 60vh; }
  .bots-panel { max-height: 30vh; }
}

/* ---------- Dashboard tool tabs -------------------------- */
.dashboard-tabs {
  display: flex;
  gap: .35rem;
  padding: .65rem 2rem 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.dashboard-tab {
  padding: .6rem 1rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.dashboard-tab:hover { color: var(--text); }
.dashboard-tab.active {
  background: var(--bg);
  border-color: var(--border);
  color: var(--accent2);
}
.dashboard-view[hidden] { display: none !important; }

/* ---------- Claim Recovery ------------------------------- */
.recovery-view {
  padding: 1.25rem 2rem 2rem;
  background: var(--bg);
  min-height: calc(100vh - 112px);
}
.recovery-heading,
.recovery-section-heading,
.recovery-export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.recovery-heading h2 { font-size: 1.25rem; }
.recovery-heading p { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
.recovery-gate {
  padding: .35rem .75rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.recovery-gate.locked { background: rgba(255,118,117,.14); color: var(--red); }
.recovery-gate.unlocked { background: rgba(253,203,110,.16); color: var(--yellow); }
.recovery-banner {
  margin: 1rem 0;
  padding: .8rem 1rem;
  border: 1px solid rgba(253,203,110,.3);
  border-left: 3px solid var(--yellow);
  border-radius: 8px;
  background: rgba(253,203,110,.07);
  color: var(--yellow);
  font-size: .8rem;
  line-height: 1.45;
}
.recovery-guidance {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(480px, 1.2fr);
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.recovery-next-action {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
}
.recovery-next-action > span {
  color: var(--accent2);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.recovery-next-action strong { font-size: .92rem; line-height: 1.35; }
.recovery-next-action small { color: var(--muted); line-height: 1.4; }
.recovery-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.recovery-steps li {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--card);
}
.recovery-steps li > span {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: rgba(139,143,163,.16);
  font-size: .72rem;
  font-weight: 700;
}
.recovery-steps li div { min-width: 0; }
.recovery-steps li strong,
.recovery-steps li small { display: block; }
.recovery-steps li strong { color: inherit; font-size: .75rem; }
.recovery-steps li small { margin-top: .15rem; font-size: .65rem; }
.recovery-steps li.active { border-color: rgba(116,185,255,.45); color: var(--blue); }
.recovery-steps li.active > span { background: rgba(116,185,255,.18); }
.recovery-steps li.done { border-color: rgba(0,206,201,.35); color: var(--green); }
.recovery-steps li.done > span { background: rgba(0,206,201,.15); }
.recovery-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.recovery-controls { min-width: 0; }
#recovery-manifest-input {
  width: 100%;
  resize: vertical;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: .73rem/1.45 'JetBrains Mono', 'Consolas', monospace;
  outline: none;
}
#recovery-manifest-input:focus { border-color: var(--accent); }
.recovery-manual-manifest {
  margin-top: .8rem;
  color: var(--muted);
  font-size: .75rem;
}
.recovery-manual-manifest summary { cursor: pointer; margin-bottom: .6rem; }
.recovery-manual-manifest .btn { margin-top: .55rem; }
.recovery-primary-button { margin-top: .8rem; padding: .7rem; }
.recovery-continue-button { margin-top: .55rem; }
.recovery-lock-note {
  margin: .2rem 0 .75rem;
  padding: .65rem .75rem;
  border: 1px solid rgba(255,118,117,.24);
  border-radius: 7px;
  color: var(--red);
  background: rgba(255,118,117,.07);
  font-size: .76rem;
  line-height: 1.4;
}
.recovery-lock-note.unlocked {
  border-color: rgba(253,203,110,.3);
  color: var(--yellow);
  background: rgba(253,203,110,.07);
}
.help-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: .2rem;
  border: 1px solid var(--muted);
  border-radius: 50%;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  cursor: help;
}
.help-tip::after {
  position: absolute;
  z-index: 20;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(240px, 70vw);
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #11131c;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  content: attr(data-tooltip);
  font-size: .7rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}
.help-tip:hover::after,
.help-tip:focus-visible::after { opacity: 1; transform: translateY(0); }
.recovery-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin-top: .7rem;
}
.recovery-control-grid .btn { padding: .55rem .45rem; font-size: .78rem; }
.btn.secondary {
  background: rgba(116,185,255,.13);
  border: 1px solid rgba(116,185,255,.22);
  color: var(--blue);
}
.btn.secondary:hover:not(:disabled) { background: rgba(116,185,255,.22); }
.recovery-operator-field,
.recovery-confirmation-field { margin-top: .75rem; }
.recovery-full-button { width: 100%; }
.recovery-export-row { margin-top: .8rem; justify-content: flex-start; }
.recovery-manifest-summary dl {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: .45rem .65rem;
  font-size: .73rem;
}
.recovery-manifest-summary dt { color: var(--muted); }
.recovery-manifest-summary dd {
  overflow-wrap: anywhere;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}
.recovery-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}
.metric-card {
  min-height: 82px;
  padding: .8rem;
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 9px;
  background: var(--card);
}
.metric-card span { display: block; color: var(--muted); font-size: .7rem; min-height: 2em; }
.metric-card strong { display: block; margin-top: .35rem; font-size: 1.15rem; }
.metric-card.success { border-top-color: var(--green); }
.metric-card.warning { border-top-color: var(--yellow); }
.metric-card.danger { border-top-color: var(--red); }
.recovery-section-heading { margin-bottom: .65rem; }
.recovery-section-heading h3 { margin-bottom: 0; }
.recovery-section-heading span { color: var(--muted); font-size: .72rem; }
.recovery-alerts {
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.recovery-alert {
  display: grid;
  grid-template-columns: 145px 110px 1fr;
  gap: .65rem;
  padding: .5rem .6rem;
  border-radius: 6px;
  background: rgba(255,255,255,.025);
  font: .72rem/1.4 'JetBrains Mono', 'Consolas', monospace;
}
.recovery-alert.warning { color: var(--yellow); }
.recovery-alert.error { color: var(--red); }
.recovery-table-card { padding-bottom: .7rem; }
.recovery-table-wrap { overflow: auto; max-height: 390px; }
.recovery-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.recovery-table th,
.recovery-table td {
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.recovery-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  text-transform: uppercase;
  font-size: .65rem;
  letter-spacing: .04em;
}
.recovery-table td { max-width: 250px; overflow-wrap: anywhere; }
.recovery-state {
  display: inline-block;
  padding: .16rem .4rem;
  border-radius: 10px;
  background: rgba(139,143,163,.14);
  white-space: nowrap;
}
.recovery-state.VERIFIED_SUCCESS { color: var(--green); background: rgba(0,206,201,.12); }
.recovery-state.INSURANCE_DETECTED,
.recovery-state.UNCERTAIN_SAVE { color: var(--red); background: rgba(255,118,117,.12); }
.recovery-state.NEEDS_REVIEW,
.recovery-state.FAILED_SAFE { color: var(--yellow); background: rgba(253,203,110,.12); }

@media (max-width: 1200px) {
  .recovery-metrics { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
}
@media (max-width: 900px) {
  .dashboard-tabs { padding-left: 1rem; padding-right: 1rem; }
  .recovery-view { padding: 1rem; }
  .recovery-layout { grid-template-columns: 1fr; }
  .recovery-guidance { grid-template-columns: 1fr; }
  .recovery-metrics { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
  .recovery-alert { grid-template-columns: 1fr; gap: .15rem; }
}
@media (max-width: 560px) {
  .recovery-steps { grid-template-columns: 1fr; }
}
