/* ═══════════════════════════════════════════════════════════════════════════
   OKCurbs — Admin Dashboard
   Reuses the neon-dark theme tokens from css/styles.css (:root vars).
   ═══════════════════════════════════════════════════════════════════════════ */

.admin-body { background: var(--bg-dark); color: var(--text-light); font-family: var(--font); min-height: 100vh; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.adm-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: var(--bg-panel);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 500;
}
.adm-header .logo-img { height: 34px; width: auto; }
.adm-title { font-size: 18px; font-weight: 900; letter-spacing: 0.3px; }
.adm-title small { display: block; font-size: 11px; font-weight: 600; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.adm-header .spacer { margin-left: auto; }
.adm-refresh, .adm-signout {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  font-size: 12px; font-weight: 700; padding: 8px 14px; border-radius: 20px;
  cursor: pointer; font-family: var(--font); transition: .15s;
}
.adm-refresh:hover { border-color: var(--neon-blue); color: var(--neon-blue); }
.adm-signout:hover { border-color: #ff5050; color: #ff5050; }

.adm-wrap { max-width: 1120px; margin: 0 auto; padding: 22px 18px 80px; }

/* ── Gate / loading ─────────────────────────────────────────────────────── */
.adm-gate { max-width: 420px; margin: 12vh auto; text-align: center; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: 18px; padding: 40px 28px; }
.adm-gate .icon { font-size: 42px; margin-bottom: 12px; }
.adm-gate h2 { font-size: 20px; margin: 0 0 8px; }
.adm-gate p { color: var(--text-dim); font-size: 14px; margin: 0 0 22px; }
.adm-gate a { display: inline-block; background: var(--neon-yellow); color: #000; font-weight: 800;
  padding: 12px 22px; border-radius: 10px; text-decoration: none; }

/* ── KPI cards ──────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
.kpi {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 16px 14px; position: relative; overflow: hidden;
}
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: .8; }
.kpi.green::before  { background: var(--neon-green); }
.kpi.blue::before   { background: var(--neon-blue); }
.kpi.orange::before { background: var(--neon-orange); }
.kpi.purple::before { background: var(--neon-purple); }
.kpi .k-label { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-dim); font-weight: 700; }
.kpi .k-val   { font-size: 26px; font-weight: 900; margin-top: 6px; line-height: 1; }
.kpi .k-sub   { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* ── Section shell ──────────────────────────────────────────────────────── */
.adm-section { margin-bottom: 22px; }
.section-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; cursor: pointer; font-family: var(--font); color: var(--text-light);
  transition: border-color .15s, box-shadow .15s; margin: 0;
}
.section-btn:hover { border-color: var(--accent); }
.section-btn .s-icon { font-size: 24px; line-height: 1; }
.section-btn .s-text { flex: 1; }
.section-btn .s-title { font-size: 16px; font-weight: 800; }
.section-btn .s-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.section-btn .s-count { font-size: 13px; font-weight: 800; color: var(--accent); background: rgba(240,255,32,.08);
  border: 1px solid rgba(240,255,32,.25); padding: 4px 10px; border-radius: 20px; }
.section-btn .s-chevron { font-size: 15px; color: var(--text-dim); transition: transform .25s; }
.adm-section.open .section-btn { border-color: var(--accent); box-shadow: var(--glow-yellow); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.adm-section.open .s-chevron { transform: rotate(180deg); }

.section-body {
  display: none; border: 1px solid var(--accent); border-top: none;
  border-radius: 0 0 14px 14px; background: var(--bg-panel2); padding: 16px;
}
.adm-section.open .section-body { display: block; }

/* ── Filter chips ───────────────────────────────────────────────────────── */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  font-size: 12px; font-weight: 700; padding: 6px 13px; border-radius: 20px; cursor: pointer; font-family: var(--font); transition: .15s; }
.chip:hover { border-color: var(--text-dim); color: var(--text-light); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #000; }

/* ═══ JOBS CAROUSEL ═════════════════════════════════════════════════════════ */
.carousel { position: relative; }
.carousel-viewport { overflow: hidden; border-radius: 14px; touch-action: pan-y; }
.carousel-track { display: flex; transition: transform .35s cubic-bezier(.22,.61,.36,1); will-change: transform; }
.carousel-track.dragging { transition: none; }
.slide { flex: 0 0 100%; min-width: 100%; box-sizing: border-box; padding: 2px; }

.job-card2 {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
}
@media (max-width: 720px) { .job-card2 { grid-template-columns: 1fr; } }

/* media / map side */
.jc-media { position: relative; background: #0a0a0a; min-height: 260px; display: flex; flex-direction: column; }
.jc-map { flex: 1; min-height: 200px; background: #111; }
.jc-map .leaflet-container { background: #111; }
.jc-dir-btn {
  position: absolute; right: 12px; bottom: 12px; z-index: 450;
  background: var(--neon-blue); color: #000; font-weight: 800; font-size: 13px;
  padding: 9px 14px; border-radius: 10px; text-decoration: none; box-shadow: var(--glow-blue);
  display: inline-flex; align-items: center; gap: 6px;
}
.jc-photos { display: flex; gap: 0; }
.jc-photo { flex: 1; position: relative; aspect-ratio: 4/3; background: #0d0d0d; overflow: hidden; }
.jc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jc-photo .ph-tag { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px; background: rgba(0,0,0,.65); color: #fff; padding: 2px 7px; border-radius: 5px; }
.jc-photo.empty { display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 12px; flex-direction: column; gap: 4px; }

/* details side */
.jc-body { padding: 16px 18px; display: flex; flex-direction: column; }
.jc-addr { font-size: 16px; font-weight: 800; }
.jc-city { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.jc-order { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.jc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 6px; text-transform: uppercase; letter-spacing: .4px; }
.badge.status-scheduled { background: rgba(0,200,255,.12); color: var(--neon-blue); border: 1px solid rgba(0,200,255,.35); }
.badge.status-completed { background: rgba(0,255,102,.12); color: var(--neon-green); border: 1px solid rgba(0,255,102,.35); }
.badge.status-cancelled { background: rgba(255,80,80,.12); color: #ff5b5b; border: 1px solid rgba(255,80,80,.35); }
.badge.money { background: rgba(240,255,32,.1); color: var(--neon-yellow); border: 1px solid rgba(240,255,32,.3); }
.badge.plain { background: rgba(255,255,255,.05); color: var(--text-light); border: 1px solid var(--border); }

.jc-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.jc-row .r-ico { width: 20px; text-align: center; opacity: .85; }
.jc-row .r-key { color: var(--text-dim); min-width: 82px; font-weight: 600; }
.jc-row .r-val { flex: 1; word-break: break-word; }
.jc-row a { color: var(--neon-blue); text-decoration: none; }
.jc-row a:hover { text-decoration: underline; }
.jc-note { background: rgba(255,140,0,.07); border: 1px solid rgba(255,140,0,.25); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; color: var(--text-light); margin-top: 4px; white-space: pre-wrap; }
.addon-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.addon-chip { font-size: 11px; background: rgba(255,255,255,.06); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; }

/* ── Pipeline stepper ───────────────────────────────────────────────────── */
.pipeline { margin-top: auto; padding-top: 14px; }
.pipeline-label { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-dim); font-weight: 700; margin-bottom: 8px; }
.steps { display: flex; align-items: flex-start; }
.step-node { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.step-node .dot {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; border: 2px solid var(--border); background: var(--bg-panel); color: var(--text-dim); z-index: 2;
}
.step-node.done .dot { background: var(--neon-green); border-color: var(--neon-green); color: #000; }
.step-node.current .dot { background: var(--neon-yellow); border-color: var(--neon-yellow); color: #000; box-shadow: var(--glow-yellow); }
.step-node.cancelled .dot { background: #ff5b5b; border-color: #ff5b5b; color: #fff; }
.step-node .lbl { font-size: 9.5px; color: var(--text-dim); margin-top: 5px; line-height: 1.2; max-width: 62px; }
.step-node.done .lbl, .step-node.current .lbl { color: var(--text-light); }
.step-node::before {
  content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: 1;
}
.step-node:first-child::before { display: none; }
.step-node.done::before, .step-node.current::before { background: var(--neon-green); }

/* carousel controls */
.car-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 12px; }
.car-arrow { background: var(--bg-panel); border: 1px solid var(--border); color: var(--text-light);
  width: 42px; height: 42px; border-radius: 50%; font-size: 18px; cursor: pointer; transition: .15s; flex: 0 0 auto; }
.car-arrow:hover { border-color: var(--accent); color: var(--accent); }
.car-arrow:disabled { opacity: .3; cursor: not-allowed; }
.car-counter { font-size: 13px; color: var(--text-dim); font-weight: 700; }
.car-hint { text-align: center; font-size: 11px; color: var(--text-dim); margin-top: 8px; }

/* ── Tables (reps / customers / marketing) ──────────────────────────────── */
.adm-table-wrap { overflow-x: auto; }
table.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.adm-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim);
  font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); position: sticky; }
.adm-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.adm-table tr:hover td { background: rgba(255,255,255,.02); }
.adm-table td.num, .adm-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 12px; text-transform: uppercase; }
.pill.ok  { background: rgba(0,255,102,.12); color: var(--neon-green); }
.pill.warn{ background: rgba(255,140,0,.14); color: var(--neon-orange); }
.pill.owed{ background: rgba(240,255,32,.12); color: var(--neon-yellow); }

/* marketing bars */
.mkt-row { margin-bottom: 12px; }
.mkt-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.mkt-head .m-src { font-weight: 700; }
.mkt-head .m-rev { color: var(--neon-green); font-weight: 800; }
.mkt-bar { height: 10px; background: rgba(255,255,255,.05); border-radius: 6px; overflow: hidden; }
.mkt-bar-fill { height: 100%; background: linear-gradient(90deg, var(--neon-blue), var(--neon-green)); border-radius: 6px; }
.mkt-sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

.adm-empty { text-align: center; color: var(--text-dim); font-size: 13px; padding: 30px 10px; }
.adm-loading { text-align: center; color: var(--text-dim); font-size: 14px; padding: 40px 10px; }
