/* ══════════════════════════════════════════════════════════════
   Legal Ease IT — LinkedIn Automation Hub — Shared Design System
   ══════════════════════════════════════════════════════════════ */

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }

:root {
  --bg:           #0a0f1e;
  --bg2:          #111827;
  --bg3:          #131f35;
  --teal:         #00e5c8;
  --teal-dim:     rgba(0,229,200,0.10);
  --teal-border:  rgba(0,229,200,0.20);
  --text:         #d4dce8;
  --muted:        #8a96a8;
  --border:       rgba(255,255,255,0.07);
  --green:        #22c55e;
  --green-dim:    rgba(34,197,94,0.10);
  --amber:        #f59e0b;
  --amber-dim:    rgba(245,158,11,0.10);
  --red:          #ef4444;
  --red-dim:      rgba(239,68,68,0.10);
  --blue:         #60a5fa;
  --blue-dim:     rgba(96,165,250,0.10);
  --purple:       #a78bfa;
  --purple-dim:   rgba(167,139,250,0.10);
  --orange:       #fb923c;
  --orange-dim:   rgba(251,146,60,0.10);
  --radius:       12px;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
code {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85em;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--teal);
}

/* ── Header ──────────────────────────────────────────────────────── */
header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
header h1 .page-title-accent { color: var(--teal); }
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.back-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  transition: all .15s;
}
.back-link:hover { border-color: var(--teal-border); color: var(--teal); }
#last-update { font-size: 11px; color: var(--muted); }

/* ── Layout ──────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 28px 24px 60px; }
h2 { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); }

/* ── Section Title ───────────────────────────────────────────────── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-title:first-child { margin-top: 0; }

/* ── Stats Row ───────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
}
.stat-card:hover { border-color: var(--teal-border); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.green::before  { background: var(--green); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.teal::before   { background: var(--teal); }
.stat-card.red::before    { background: var(--red); }
.stat-card.amber::before  { background: var(--amber); }

.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.stat-lbl { font-size: 12px; font-weight: 600; color: var(--text); margin-top: 2px; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.card-header h2 { font-size: 14px; color: var(--text); }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* ── Control Grid ────────────────────────────────────────────────── */
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.control-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.control-item h3 { font-size: 12px; font-weight: 700; color: var(--teal); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.control-item p  { font-size: 13px; color: var(--text); font-weight: 500; }
.control-item .sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── Tables ──────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }
.loading-row {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(34,197,94,.2); }
.badge-red    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(239,68,68,.2); }
.badge-orange { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(251,146,60,.2); }
.badge-gray   { background: var(--bg3);        color: var(--muted);  border: 1px solid var(--border); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(96,165,250,.2); }
.badge-teal   { background: var(--teal-dim);   color: var(--teal);   border: 1px solid var(--teal-border); }
.badge-amber  { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(245,158,11,.2); }
.badge-purple { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(167,139,250,.2); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn-primary {
  background: var(--teal);
  color: #0a0f1e;
  border-color: var(--teal);
}
.btn-primary:hover { opacity: .85; }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost {
  background: var(--bg3);
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--teal-border); color: var(--teal); }
.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,.25);
}
.btn-danger:hover { background: rgba(239,68,68,.18); }
.btn-outline {
  background: transparent;
  color: var(--teal);
  border-color: var(--teal-border);
}
.btn-outline:hover { background: var(--teal-dim); }
.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(34,197,94,.25);
}
.btn-success:hover { background: rgba(34,197,94,.18); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(10,15,30,.3);
  border-top-color: #0a0f1e;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Flow Steps ──────────────────────────────────────────────────── */
.flow-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 80px;
}
.step-icon { font-size: 20px; }
.step-num  { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; color: var(--teal); }
.step-lbl  { font-size: 11px; color: var(--muted); font-weight: 600; text-align: center; }
.flow-arrow { color: var(--border); font-size: 18px; flex-shrink: 0; }

/* ── Progress/Meter ──────────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 4px;
  transition: width .4s;
}
.progress-fill.warn { background: var(--amber); }
.progress-fill.danger { background: var(--red); }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.form-card h3 { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
input, textarea, select {
  padding: 9px 12px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--teal-border);
  box-shadow: 0 0 0 3px var(--teal-dim);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a96a8' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--muted); }

/* ── Account Cards ───────────────────────────────────────────────── */
.accounts-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.account-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color .2s;
}
.account-card:hover { border-color: var(--teal-border); }
.account-card.inactive { opacity: .55; }
.card-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--teal-dim);
  border: 1.5px solid var(--teal-border);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 800; flex-shrink: 0;
}
.account-info { flex: 1; min-width: 0; }
.account-name { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.cookie-row { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Cookie Update Form (inline, collapsed by default) ───────────── */
.cookie-update-form {
  display: none;
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cookie-update-form.open { display: block; }
.cookie-row-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.cookie-chip {
  font-family: monospace; font-size: 11px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 5px; padding: 3px 8px; color: var(--muted);
}
.account-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }

/* ── Checkpoint UI ───────────────────────────────────────────────── */
.checkpoint-ui {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg3);
  border: 1.5px solid var(--teal-border);
  border-radius: 10px;
}
.checkpoint-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.checkpoint-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.checkpoint-title { font-size: 13px; font-weight: 700; color: var(--teal); margin-bottom: 3px; }
.checkpoint-desc { font-size: 12px; color: var(--muted); }
.checkpoint-input-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cp-input {
  padding: 9px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 18px;
  font-family: monospace;
  letter-spacing: 4px;
  width: 150px;
  text-align: center;
}
.cp-input:focus { border-color: var(--teal); outline: none; }

/* ── Toast ───────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 999;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn .25s ease;
  transition: opacity .3s;
}
.toast.success { border-color: rgba(34,197,94,.3); }
.toast.error   { border-color: rgba(239,68,68,.3); }
.toast.info    { border-color: var(--teal-border); }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h3 {
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
}
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── Empty State ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 13px;
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; opacity: .4; }
.empty-state h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* ── Info Box ────────────────────────────────────────────────────── */
.info-box {
  background: rgba(96,165,250,.06);
  border: 1px solid rgba(96,165,250,.15);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--blue);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ── Tabs (horizontal) ───────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--bg2);
  color: var(--teal);
  border: 1px solid var(--border);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .control-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .container, .container-narrow { padding: 16px 16px 60px; }
  header { padding: 0 16px; }
  .card-main { flex-wrap: wrap; }
  .account-actions { width: 100%; justify-content: flex-start; }
  h2 { font-size: 14px; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 22px; }
}
