/* SCARP ERP — Premium Dark Design System v3.0 */

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

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg-base:        #090d16;
  --bg-surface:     #0f1623;
  --bg-card:        #141d2b;
  --bg-card-hover:  #182033;
  --bg-elevated:    #1d2638;
  --border:         rgba(255,255,255,0.07);
  --border-light:   rgba(255,255,255,0.12);

  --text-primary:   #f0f4ff;
  --text-secondary: #94a3b8;
  --text-subtle:    #5a6a82;

  --emerald:        #10b981;
  --emerald-dim:    rgba(16,185,129,0.12);
  --teal:           #14b8a6;
  --sky:            #0ea5e9;
  --blue:           #3b82f6;
  --violet:         #8b5cf6;
  --amber:          #f59e0b;
  --orange:         #f97316;
  --rose:           #f43f5e;
  --green:          #22c55e;
  --gray:           #64748b;

  --sidebar-w:      240px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-sm:      6px;
  --shadow:         0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 48px rgba(0,0,0,0.6);
}

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

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── App Shell ─────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: #000;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(16,185,129,0.3);
}

.brand-name { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.brand-sub  { font-size: 11px; color: var(--text-subtle); margin-top: 1px; }

.nav-menu { padding: 12px 8px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .15s ease;
  margin-bottom: 2px;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }

.nav-item.active {
  background: var(--emerald-dim);
  color: var(--emerald);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

/* ── Main Area ─────────────────────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title { font-size: 18px; font-weight: 700; }

.header-right { display: flex; align-items: center; gap: 12px; }

.user-badge {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated);
  padding: 6px 14px 6px 8px;
  border-radius: 40px;
  border: 1px solid var(--border);
}

.user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}

.user-name { font-size: 13px; font-weight: 600; }

.role-tag {
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .5px;
}
.role-admin   { background: rgba(139,92,246,.2); color: #a78bfa; }
.role-backend { background: rgba(14,165,233,.2); color: #38bdf8; }
.role-field   { background: rgba(245,158,11,.2); color: #fbbf24; }

.page-content { padding: 28px; flex: 1; }

/* ── Flash Messages ────────────────────────────────────────────────────── */
.flash {
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.flash-success { background: rgba(16,185,129,.12); color: var(--emerald); border-left: 3px solid var(--emerald); }
.flash-error   { background: rgba(244,63,94,.12);  color: var(--rose);    border-left: 3px solid var(--rose);    }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.card-title svg { width: 18px; height: 18px; color: var(--emerald); }

/* ── Stats Grid ────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.stat-card:hover { border-color: var(--border-light); box-shadow: var(--shadow); }
.stat-card-profit { border-color: rgba(16,185,129,.25); }
.stat-card-loss   { border-color: rgba(244,63,94,.25); }

.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon-blue    { background: rgba(59,130,246,.15);  color: var(--blue);    }
.stat-icon-emerald { background: rgba(16,185,129,.15);  color: var(--emerald); }
.stat-icon-rose    { background: rgba(244,63,94,.15);   color: var(--rose);    }
.stat-icon-amber   { background: rgba(245,158,11,.15);  color: var(--amber);   }

.stat-value { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.stat-sub   { font-size: 11px; color: var(--text-subtle); margin-top: 4px; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-subtle);
  font-size: 13px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s ease;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  color: #000;
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 16px rgba(16,185,129,.35); }

.btn-danger {
  background: rgba(244,63,94,.15);
  color: var(--rose);
  border: 1px solid rgba(244,63,94,.3);
}
.btn-danger:hover { background: rgba(244,63,94,.25); }

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border-light); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color .15s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.form-input::placeholder { color: var(--text-subtle); }

textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.form-hint { font-size: 11px; color: var(--text-subtle); margin-top: 3px; }

.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-sky     { background: rgba(14,165,233,.15);  color: var(--sky);     }
.badge-blue    { background: rgba(59,130,246,.15);  color: var(--blue);    }
.badge-emerald { background: rgba(16,185,129,.15);  color: var(--emerald); }
.badge-teal    { background: rgba(20,184,166,.15);  color: var(--teal);    }
.badge-violet  { background: rgba(139,92,246,.15);  color: var(--violet);  }
.badge-amber   { background: rgba(245,158,11,.15);  color: var(--amber);   }
.badge-orange  { background: rgba(249,115,22,.15);  color: var(--orange);  }
.badge-rose    { background: rgba(244,63,94,.15);   color: var(--rose);    }
.badge-green   { background: rgba(34,197,94,.15);   color: var(--green);   }
.badge-gray    { background: rgba(100,116,139,.15); color: var(--gray);    }

/* ── REGNO Tag ─────────────────────────────────────────────────────────── */
.regno-tag {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--sky);
  background: rgba(14,165,233,.1);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(14,165,233,.2);
  letter-spacing: 1px;
}

.mono { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.text-emerald { color: var(--emerald); }
.text-rose    { color: var(--rose);    }
.text-amber   { color: var(--amber);   }

/* ── Login Page ────────────────────────────────────────────────────────── */
.login-body {
  background: radial-gradient(ellipse at center, #1b263b 0%, var(--bg-base) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-screen { width: 100%; max-width: 440px; }

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.login-brand { text-align: center; margin-bottom: 32px; }

.login-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 900; color: #000;
  margin-bottom: 14px;
  box-shadow: 0 0 32px rgba(16,185,129,.3);
}

.login-brand h1 {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(90deg, #fff, #a7f3d0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.login-brand p { font-size: 13px; color: var(--text-subtle); margin-top: 4px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-quick-fill {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.login-quick-fill p {
  font-size: 12px;
  color: var(--text-subtle);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.quick-fill-buttons { display: flex; flex-direction: column; gap: 6px; }

.quick-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.quick-btn:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.quick-btn span  { font-weight: 600; }
.quick-btn code  { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--emerald); background: rgba(16,185,129,.1); padding: 2px 8px; border-radius: 4px; }

/* ── Lead Header ───────────────────────────────────────────────────────── */
.lead-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.lead-header-left { display: flex; align-items: center; gap: 16px; }

.lead-thumb {
  width: 90px; height: 64px;
  object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .2s;
}
.lead-thumb:hover { transform: scale(1.05); }

.lead-thumb-placeholder {
  width: 90px; height: 64px;
  background: var(--bg-elevated);
  border-radius: 10px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}

.regno-display {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 22px;
  color: var(--sky);
  letter-spacing: 2px;
}
.lead-vehicle-name { font-size: 15px; font-weight: 700; margin-top: 2px; }
.lead-header-right { display: flex; gap: 8px; flex-wrap: wrap; }

.gps-link { color: var(--emerald); font-size: 12px; }

/* ── Accordion ─────────────────────────────────────────────────────────── */
.accordion { display: flex; flex-direction: column; gap: 8px; }

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 12px;
  transition: background .15s;
}
.accordion-trigger:hover { background: var(--bg-elevated); }
.accordion-arrow { font-size: 16px; transition: transform .2s; }

.accordion-body {
  display: none;
  padding: 20px;
  border-top: 1px solid var(--border);
}
.accordion-body.open {
  display: block;
}

/* ── Price Split Box ───────────────────────────────────────────────────── */
.price-split-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.split-row {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-secondary);
}
.split-row.highlight strong { color: var(--emerald); font-size: 15px; }
.split-row.total { border-top: 1px solid var(--border); padding-top: 8px; font-weight: 700; color: var(--text-primary); }

.payout-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px;
}

/* ── Checklist Grid ────────────────────────────────────────────────────── */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.checklist-item:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.checklist-item input[type=checkbox]:checked + span { color: var(--emerald); }
.checklist-item input[type=checkbox] { accent-color: var(--emerald); width: 16px; height: 16px; cursor: pointer; }

/* ── CoD Steps ─────────────────────────────────────────────────────────── */
.cod-steps {
  display: flex; flex-direction: column; gap: 8px;
}

.cod-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.cod-step:hover { border-color: var(--border-light); }
.cod-step input[type=checkbox] { accent-color: var(--emerald); width: 16px; height: 16px; flex-shrink: 0; }

/* ── Step Progress Bar ─────────────────────────────────────────────────── */
.step-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  width: 100px;
}
.step-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--teal));
  border-radius: 2px;
  transition: width .4s ease;
}

/* ── Photo Gallery ─────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.photo-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.photo-card:hover { transform: scale(1.02); box-shadow: var(--shadow); }

.photo-card img {
  width: 100%; height: 120px;
  object-fit: cover; cursor: pointer;
  display: block;
}

.photo-caption {
  padding: 7px 10px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(0,0,0,.4);
}

.photo-delete {
  background: none; border: none;
  color: var(--rose); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 2px;
  opacity: 0.7; transition: opacity .15s;
}
.photo-delete:hover { opacity: 1; }

/* ── Lightbox ──────────────────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 500;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  padding: 20px;
}
.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 60px rgba(0,0,0,.8);
}

.lightbox p { color: #fff; font-size: 14px; font-weight: 600; }

/* ── Modal (dialog) ────────────────────────────────────────────────────── */
dialog.modal {
  background: none;
  border: none;
  padding: 0;
  max-width: 560px;
  width: 100%;
  margin: auto;
}

dialog::backdrop { background: rgba(0,0,0,.7); }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 16px;
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none;
  color: var(--text-subtle);
  font-size: 22px; cursor: pointer;
  transition: color .15s;
}
.modal-close:hover { color: var(--text-primary); }

.form-row { display: flex; align-items: center; }

/* ── Summary Box ───────────────────────────────────────────────────────── */
.summary-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; gap: 24px;
  font-size: 13px;
  flex-wrap: wrap;
}

/* ── Info Grid (read-only) ─────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.info-label { font-size: 11px; color: var(--text-subtle); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 3px; }
.info-value { font-size: 14px; font-weight: 600; }
.info-value.mono { font-family: 'JetBrains Mono', monospace; }

/* ── Document Thumbnails (Paperwork Checklist) ───────────────────────────── */
.checklist-item-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.doc-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--sky);
  background: rgba(14,165,233,.1);
  border: 1px dashed rgba(14,165,233,.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.doc-upload-btn:hover { background: rgba(14,165,233,.2); border-style: solid; }

.doc-thumb-wrap {
  position: relative;
  display: inline-block;
}

.doc-thumb-img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  cursor: zoom-in;
  transition: transform .2s, box-shadow .2s;
  display: block;
}
.doc-thumb-img:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}

.doc-thumb-pdf {
  width: 72px;
  height: 52px;
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--violet);
  cursor: pointer;
  text-align: center;
  padding: 4px;
}
.doc-thumb-pdf:hover { background: rgba(139,92,246,.2); }

.doc-thumb-label {
  position: absolute;
  top: -6px;
  right: -6px;
}

.doc-thumb-error {
  font-size: 11px;
  color: var(--rose);
  padding: 4px 0;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main-wrap { margin-left: 0; }
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .lead-header { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* OCR Image Hover Magnify */
.ocr-preview-img {
  height: 200px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: #000;
  cursor: zoom-in;
  transition: transform 0.05s linear;
  transform-origin: var(--x, 50%) var(--y, 50%);
}
.ocr-preview-img:hover {
  transform: scale(2.5);
  position: relative;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* OCR Tagging Studio */
.ocr-studio {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ocr-studio-header {
  padding: 12px 16px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ocr-studio-body {
  display: flex;
  height: 600px;
}
.ocr-sidebar {
  width: 250px;
  border-right: 1px solid var(--border);
  padding: 16px;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ocr-canvas-container {
  flex: 1;
  background: #222;
  position: relative;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ocr-tag-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}
.ocr-tag-btn.active {
  border-color: var(--primary);
  background: rgba(99,102,241,0.1);
  color: var(--primary);
  font-weight: 600;
}
.ocr-tag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
