/*
 * This is a manifest file that'll be compiled into application.css.
 */

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
form { display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font: inherit; }

/* ── Variables ──────────────────────────────────────────── */
:root {
  --ink: #16201f;
  --muted: #62706d;
  --line: #e3ebe7;
  --paper: #f4f7f5;
  --panel: #ffffff;
  --accent: #197b5b;
  --accent-strong: #0f5f45;
  --accent-soft: #e8f5ef;
  --danger: #b42318;
  --warning: #a15c07;
  --success: #067647;
  --sidebar-w: 268px;
  --sidebar-bg: #0f1a17;
  --sidebar-ink: #e8f2ed;
  --sidebar-muted: #8fa59c;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(25, 123, 91, 0.22);
  --shadow-sidebar: 4px 0 24px rgba(15, 26, 23, 0.12);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--accent); }

h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

/* ── App Shell ──────────────────────────────────────────── */
.app-shell { margin-left: var(--sidebar-w); min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, #12231e 0%, var(--sidebar-bg) 42%, #0c1512 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  bottom: 0;
  box-shadow: var(--shadow-sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  left: 0;
  position: fixed;
  top: 0;
  width: var(--sidebar-w);
  z-index: 100;
}

.sidebar-top {
  border-bottom: 1px solid var(--sidebar-line);
  padding: 22px 18px 18px;
}

.sidebar-brand {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 12px;
  transition: opacity 0.15s ease;
}

.sidebar-brand:hover {
  color: inherit;
  opacity: 0.92;
}

.brand-icon {
  align-items: center;
  background: linear-gradient(145deg, #22a078 0%, var(--accent) 55%, #0f5f45 100%);
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(25, 123, 91, 0.35);
  color: #fff;
  display: flex;
  flex-shrink: 0;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-brand-name {
  color: #22c47d;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.25px;
  line-height: 1.2;
}

.sidebar-brand-name-sub {
  color: var(--sidebar-ink);
}

.sidebar-brand-tag {
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  scrollbar-width: thin;
}

.nav-section-label {
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 10px 8px;
  text-transform: uppercase;
}

.nav-section-label--spaced { margin-top: 22px; }

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-item {
  align-items: center;
  border-radius: 10px;
  color: var(--sidebar-muted);
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 11px;
  padding: 10px 12px;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-item::before {
  background: #3dd68c;
  border-radius: 0 3px 3px 0;
  bottom: 8px;
  content: "";
  left: 0;
  opacity: 0;
  position: absolute;
  top: 8px;
  transition: opacity 0.15s ease;
  width: 3px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-ink);
}

.nav-item--active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.nav-item--active::before { opacity: 1; }

.nav-item--active .nav-item-icon svg { stroke: #5ee9a8; }

.nav-item-icon {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.nav-item-label { flex: 1; line-height: 1.2; }

.nav-badge {
  background: rgba(25, 123, 91, 0.35);
  border: 1px solid rgba(94, 233, 168, 0.25);
  border-radius: 999px;
  color: #b8f5d8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-left: auto;
  min-width: 28px;
  padding: 3px 9px;
  text-align: center;
}

.nav-item--active .nav-badge {
  background: rgba(25, 123, 91, 0.55);
  border-color: rgba(94, 233, 168, 0.4);
  color: #fff;
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-line);
  padding: 14px;
}

.sidebar-user-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sidebar-line);
  border-radius: 12px;
  display: flex;
  gap: 11px;
  margin-bottom: 10px;
  padding: 11px 12px;
}

.user-avatar {
  align-items: center;
  background: linear-gradient(145deg, #1f9b72, #0f5f45);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.user-info { min-width: 0; }

.user-email {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-plan {
  align-items: center;
  color: var(--sidebar-muted);
  display: flex;
  font-size: 11px;
  gap: 6px;
  margin: 0;
}

.user-plan-dot {
  background: #3dd68c;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.2);
  flex-shrink: 0;
  height: 6px;
  width: 6px;
}

.signout-form { margin: 0; }

.signout-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--sidebar-line);
  border-radius: 10px;
  color: var(--sidebar-muted);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  gap: 8px;
  justify-content: center;
  padding: 9px 12px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 100%;
}

.signout-btn:hover {
  background: rgba(180, 35, 24, 0.12);
  border-color: rgba(252, 165, 165, 0.35);
  color: #fecaca;
}

.signout-btn:hover svg { stroke: #fecaca; }

/* ── Mobile bar ─────────────────────────────────────────── */
.mobile-bar {
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: none;
  gap: 10px;
  height: 58px;
  left: 0;
  padding: 0 14px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 120;
}

.mobile-brand-wrap {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 8px;
  justify-content: center;
  min-width: 0;
}

.mobile-brand-mark {
  align-items: center;
  border-radius: 9px;
  display: flex;
  filter: drop-shadow(0 2px 6px rgba(13, 69, 48, 0.28));
  flex-shrink: 0;
  height: 30px;
  justify-content: center;
  overflow: hidden;
  width: 30px;
}

.mobile-brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.sidebar-toggle {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 38px;
}

.sidebar-toggle:hover {
  background: #fff;
  border-color: #c5d5ce;
}

.sidebar-overlay {
  background: rgba(8, 16, 14, 0.55);
  backdrop-filter: blur(2px);
  display: none;
  inset: 0;
  position: fixed;
  z-index: 99;
}

.sidebar-overlay[hidden] { display: none !important; }

.overlay--visible { display: block; }

.wallet-chip-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
  text-transform: uppercase;
}

/* ── Page ───────────────────────────────────────────────── */
.page { margin: 0 auto; max-width: 1100px; padding: 28px 28px 48px; }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; margin: 0 0 4px; }
.page-header p { color: var(--muted); margin: 0; }

.workspace { display: grid; gap: 20px; }

/* ── Panels ─────────────────────────────────────────────── */
.toolbar-band, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.panel-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 16px; }
.panel-head h1, .panel-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.1px; margin: 0; }

/* ── Forms ──────────────────────────────────────────────── */
.search-form, .filter-form, .auth-form { display: grid; gap: 10px; }
.search-form { grid-template-columns: 1fr 1fr auto; }
.filter-form { grid-template-columns: repeat(4, minmax(0,1fr)) auto auto; }

.input {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font: inherit; min-height: 40px; padding: 8px 12px;
  transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(25,123,91,0.12); outline: none; }
.input.input-error { border-color: #d92d20; box-shadow: 0 0 0 3px rgba(217,45,32,0.12); }
.input-error-text { color: var(--danger); display: block; font-size: 12px; font-weight: 600; margin-top: 2px; }

/* ── Buttons ────────────────────────────────────────────── */
.primary-button, .secondary-button, .ghost-button, .ghost-link, .link-button {
  align-items: center; border-radius: 8px; cursor: pointer;
  display: inline-flex; font: inherit; font-size: 14px; font-weight: 600;
  justify-content: center; min-height: 40px; padding: 8px 16px;
  transition: opacity 0.12s, background 0.12s;
}

.primary-button { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.primary-button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.secondary-button { background: var(--accent-soft); border: 1px solid #b7d8ca; color: var(--accent-strong); }
.secondary-button:hover { background: #d1ede3; }

.ghost-button, .ghost-link { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.ghost-button:hover, .ghost-link:hover { background: var(--paper); }

.link-button { background: none; border: none; padding: 0; color: var(--accent-strong); }

/* ── Stats ──────────────────────────────────────────────── */
.stats-grid { display: grid; gap: 14px; grid-template-columns: repeat(5, minmax(0,1fr)); }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.stat span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.stat strong { color: var(--ink); display: block; font-size: 30px; font-weight: 800; letter-spacing: -1px; margin-top: 6px; }

/* ── Jobs ───────────────────────────────────────────────── */
.job-list { display: grid; gap: 10px; }

.job-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; transition: box-shadow 0.12s;
}
.job-row:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.06); }

.job-main, .job-meta, .job-actions { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.job-main h2 { font-size: 15px; font-weight: 700; margin: 0; }
.job-main p, .job-meta { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.job-actions { flex-wrap: wrap; justify-content: flex-start; margin-top: 12px; gap: 8px; }

.credit-banner {
  background: var(--accent-soft);
  border: 1px solid #b7d8ca;
  border-radius: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.credit-banner p { margin: 0 0 4px; }
.credit-banner-hint { font-size: 12px; margin: 0 !important; }

.credit-empty {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.credit-empty p { color: var(--muted); margin: 0; }

.job-credit-alert {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #92400e;
  font-size: 13px;
  margin-top: 10px;
  padding: 10px 12px;
}

.job-credit-alert-link {
  color: var(--accent-strong);
  font-weight: 700;
  margin-left: 6px;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge { border-radius: 999px; font-size: 11px; font-weight: 700; padding: 4px 9px; letter-spacing: 0.2px; }
.badge-muted   { background: #edf2ef; color: #41504c; }
.badge-running { background: #dbeafe; color: #1d4ed8; }
.badge-warning { background: #fef3c7; color: var(--warning); }
.badge-success { background: #dcfce7; color: var(--success); }
.badge-danger  { background: #fee2e2; color: var(--danger); }

/* ── Progress ───────────────────────────────────────────── */
.progress { background: #e8f0ec; border-radius: 999px; height: 6px; margin: 12px 0; overflow: hidden; }
.progress div { background: var(--accent); border-radius: 999px; height: 100%; transition: width 0.4s ease; }

/* ── Log ────────────────────────────────────────────────── */
.log-title { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.3px; margin: 10px 0 6px; text-transform: uppercase; }
.log-panel { background: #0d1714; border-radius: 10px; color: #7ee8b4; font-family: ui-monospace, monospace; font-size: 12px; height: 180px; overflow-y: auto; padding: 14px; }
.log-line span { color: #4a9e76; margin-right: 8px; }

/* ── Tables ─────────────────────────────────────────────── */
.desktop-table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 12px; text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
tbody tr:hover td { background: #fafcfb; }
tbody tr:last-child td { border-bottom: none; }
.mobile-cards { display: none; }

/* ── Business ───────────────────────────────────────────── */
.business-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; display: flex; gap: 12px; padding: 14px; transition: box-shadow 0.12s; }
.business-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.business-card h2 { font-size: 15px; font-weight: 700; margin: 0 0 5px; }
.business-card p { color: var(--muted); font-size: 13px; margin: 3px 0; }
.business-thumb { border-radius: 8px; flex-shrink: 0; height: 72px; max-width: none; min-height: 72px; min-width: 72px; object-fit: cover; width: 72px; }
.business-name-cell { align-items: center; display: flex; gap: 12px; min-width: 0; }
.business-name-text { min-width: 0; }
.business-table-thumb { flex-shrink: 0; height: 48px; min-width: 48px; width: 48px; }
.business-thumb--table { display: block; height: 48px; max-width: none; min-height: 48px; min-width: 48px; object-fit: cover; width: 48px; }
.business-thumb-placeholder { background: var(--paper); border: 1px dashed var(--line); display: block; flex-shrink: 0; }
.compact-action { font-size: 13px; min-height: 32px; padding: 5px 10px; white-space: nowrap; }

/* ── Detail ─────────────────────────────────────────────── */
.detail-header { align-items: flex-end; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 20px; }
.detail-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; margin: 12px 0 6px; }
.detail-header p, .muted-text { color: var(--muted); margin: 0; }
.detail-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.detail-grid { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list div { border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: 150px minmax(0,1fr); padding: 11px 0; }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.detail-list dd { font-size: 14px; margin: 0; }
.break-text { overflow-wrap: anywhere; }
.hours-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.hours-grid div { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.image-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); }
.detail-image { aspect-ratio: 4/3; border: 1px solid var(--line); border-radius: 8px; display: block; object-fit: cover; width: 100%; }
.review-list { display: grid; gap: 10px; }
.review-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.review-item div { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.review-item span, .review-item small { color: var(--muted); }
.review-item p { font-size: 14px; margin: 10px 0; }

/* ── Flash ──────────────────────────────────────────────── */
.flash { border-radius: 10px; font-size: 14px; font-weight: 500; margin-bottom: 16px; padding: 12px 16px; }
.flash-notice { background: #dcfce7; border: 1px solid #bbf7d0; color: var(--success); }
.flash-alert  { background: #fee2e2; border: 1px solid #fecaca; color: var(--danger); }

/* ── App notices (toast) ─────────────────────────────────── */
.app-notice-host {
  display: flex;
  flex-direction: column;
  gap: 10px;
  inset: 16px 16px auto auto;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
  position: fixed;
  z-index: 200;
}

.app-notice {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 26, 23, 0.14);
  display: flex;
  gap: 12px;
  opacity: 0;
  padding: 14px 14px 14px 16px;
  pointer-events: auto;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-notice--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-notice--leaving {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

.app-notice--notice {
  border-color: #bbf7d0;
  border-left: 4px solid var(--success);
}

.app-notice--alert {
  border-color: #fecaca;
  border-left: 4px solid var(--danger);
}

.app-notice--info {
  border-color: #bfdbfe;
  border-left: 4px solid #2563eb;
}

.app-notice-icon {
  align-items: center;
  border-radius: 8px;
  display: flex;
  flex-shrink: 0;
  height: 32px;
  justify-content: center;
  margin-top: 1px;
  width: 32px;
}

.app-notice--notice .app-notice-icon { background: #dcfce7; color: var(--success); }
.app-notice--alert .app-notice-icon { background: #fee2e2; color: var(--danger); }
.app-notice--info .app-notice-icon { background: #dbeafe; color: #2563eb; }

.app-notice-body { flex: 1; min-width: 0; }

.app-notice-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 4px;
}

.app-notice-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.app-notice-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
  margin: -2px -2px 0 0;
  padding: 2px 6px;
  transition: color 0.12s ease;
}

.app-notice-close:hover { color: var(--ink); }

@media (max-width: 900px) {
  .app-notice-host {
    inset: 72px 12px auto 12px;
    max-width: none;
  }
}

/* ── Auth ───────────────────────────────────────────────── */
.auth-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(19,41,33,0.08); margin: 48px auto; max-width: 420px; padding: 32px 28px; }
.auth-header { margin-bottom: 20px; }
.auth-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.3px; margin: 0 0 6px; }
.auth-header p { color: var(--muted); font-size: 14px; margin: 0; }
.field-group { display: grid; gap: 6px; }
.field-label { color: #2d3a37; font-size: 13px; font-weight: 600; }
.field-help { color: var(--muted); font-size: 12px; margin: -3px 0 4px; }
.auth-divider { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 10px; justify-content: center; margin: 14px 0; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { background: var(--line); content: ""; flex: 1; height: 1px; }
.auth-switch { color: var(--muted); font-size: 13px; margin: 14px 0 0; text-align: center; }
.auth-switch a { font-weight: 700; }
.google-oauth-button { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); cursor: pointer; display: inline-flex; font: inherit; font-weight: 600; gap: 10px; justify-content: center; min-height: 40px; padding: 8px 16px; transition: background 0.12s; width: 100%; }
.google-oauth-button:hover { background: var(--paper); }
.google-icon { display: block; height: 18px; width: 18px; }

/* ── Pagination ─────────────────────────────────────────── */
nav.pagination { align-items: center; display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; margin-top: 16px; }
nav.pagination span { display: inline-flex; }
nav.pagination a, nav.pagination .current, nav.pagination .gap { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); display: inline-flex; font-size: 13px; font-weight: 600; height: 34px; justify-content: center; min-width: 34px; padding: 0 10px; }
nav.pagination a:hover { background: var(--accent-soft); border-color: #b7d8ca; color: var(--accent-strong); }
nav.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }
nav.pagination .gap { color: var(--muted); }

/* ── Wallet ─────────────────────────────────────────────── */
.wallet-chip { align-items: center; background: var(--accent-soft); border: 1px solid #b7d8ca; border-radius: 20px; color: var(--accent-strong); display: inline-flex; font-size: 12px; font-weight: 700; gap: 5px; padding: 4px 11px; text-decoration: none; transition: background 0.12s; }
.wallet-chip:hover { background: #cceadb; color: var(--accent-strong); }

.wallet-hero {
  background: linear-gradient(135deg, #197b5b 0%, #0d5540 100%);
  border-radius: 16px; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; margin-bottom: 24px; padding: 32px 36px;
}
.wallet-hero-left { flex: 1; }
.wallet-hero-label { font-size: 12px; font-weight: 700; letter-spacing: 0.8px; margin: 0 0 8px; opacity: 0.75; text-transform: uppercase; }
.wallet-hero-amount { font-size: 56px; font-weight: 900; letter-spacing: -2px; line-height: 1; margin: 0 0 6px; }
.wallet-hero-sub { font-size: 13px; margin: 0; opacity: 0.65; }
.wallet-hero-right { text-align: right; }
.wallet-hero-right p { font-size: 13px; margin: 0 0 12px; opacity: 0.8; }

.wallet-pay-hint { font-size: 13px; margin: 0 0 14px; }

.plans-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }

.plan-card { background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; padding: 28px 22px 24px; position: relative; text-align: center; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.plan-card:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(25,123,91,0.12); transform: translateY(-2px); }
.plan-card--popular { border-color: var(--accent); box-shadow: 0 6px 20px rgba(25,123,91,0.15); }
.plan-badge { background: var(--accent); border-radius: 20px; color: #fff; font-size: 10px; font-weight: 800; left: 50%; letter-spacing: 0.5px; padding: 3px 12px; position: absolute; top: -13px; transform: translateX(-50%); text-transform: uppercase; white-space: nowrap; }
.plan-name { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.4px; margin: 0 0 10px; text-transform: uppercase; }
.plan-credits { color: var(--ink); font-size: 36px; font-weight: 900; letter-spacing: -1px; margin: 0 0 2px; }
.plan-credits span { color: var(--muted); font-size: 14px; font-weight: 500; }
.plan-price { color: var(--accent); font-size: 22px; font-weight: 800; margin: 10px 0 3px; }
.plan-unit { color: var(--muted); font-size: 12px; margin: 0 0 20px; }

.data-table { border-collapse: collapse; font-size: 14px; width: 100%; }
.data-table th { border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.4px; padding: 10px 14px; text-align: left; text-transform: uppercase; }
.data-table td { border-bottom: 1px solid var(--line); color: var(--ink); padding: 12px 14px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafcfb; }

.credit-amount { color: var(--success); font-weight: 700; }
.debit-amount  { color: var(--danger); font-weight: 600; }
.muted         { color: var(--muted); }
.mono          { font-family: ui-monospace, monospace; font-size: 12px; }

.status-badge { border-radius: 20px; font-size: 11px; font-weight: 700; padding: 3px 9px; }
.status-badge--completed { background: #dcfce7; color: var(--success); }
.status-badge--pending   { background: #fef3c7; color: var(--warning); }
.status-badge--failed    { background: #fee2e2; color: var(--danger); }

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

/* ── Admin ───────────────────────────────────────────────── */
.admin-subnav {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(22, 32, 31, 0.04);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 8px 10px;
}

.admin-subnav__tabs {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.admin-subnav-link {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 16px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.admin-subnav-link:hover {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.admin-subnav-link--active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(25, 123, 91, 0.22);
  color: #fff;
  font-weight: 700;
}

.admin-subnav-link--active:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.admin-subnav-link--external {
  background: var(--paper);
  border-color: var(--line);
  color: var(--muted);
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
}

.admin-subnav-link--external:hover {
  background: #fff;
  border-color: #c5d4ce;
  color: var(--accent-strong);
}

.workspace--admin { gap: 18px; }

.admin-stats-grid {
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-stat {
  align-items: center;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  min-height: 0;
  padding: 10px 12px;
}

.admin-stat__body { min-width: 0; }

.admin-stat span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.35px;
  line-height: 1.2;
  margin-top: 0;
}

.admin-stat strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-top: 3px;
}

.admin-stat__icon {
  align-items: center;
  border-radius: 8px;
  display: flex;
  flex-shrink: 0;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.admin-stat__icon--users   { background: #e8f0ec; color: var(--accent); }
.admin-stat__icon--leads   { background: #dbeafe; color: #1d4ed8; }
.admin-stat__icon--jobs    { background: #ede9fe; color: #6d28d9; }
.admin-stat__icon--running { background: #fef3c7; color: var(--warning); }
.admin-stat__icon--credits { background: #dcfce7; color: var(--success); }
.admin-stat__icon--revenue { background: #fce7f3; color: #be185d; }

.admin-panels-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 4px;
}

.panel--admin-table {
  padding: 16px 18px 10px;
}

.panel--admin-table .panel-head {
  gap: 12px;
  margin-bottom: 10px;
}

.panel--admin-table .panel-head h2 {
  font-size: 15px;
}

.panel--admin-table .ghost-link {
  font-size: 12px;
  padding: 6px 12px;
}

.table-scroll {
  margin: 0 -4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table--admin {
  font-size: 13px;
  table-layout: fixed;
  width: 100%;
}

.data-table--admin th {
  padding: 10px 16px 9px;
  white-space: nowrap;
}

.data-table--admin td {
  padding: 13px 16px;
  vertical-align: middle;
}

.data-table--admin .col-actions {
  padding-left: 8px;
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.data-table--admin .col-email { width: 34%; }
.data-table--admin .col-search { width: 26%; }
.data-table--admin .col-progress { min-width: 140px; width: 24%; }

.cell-truncate {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-cell {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 110px;
}

.progress--inline {
  flex: 1 1 auto;
  height: 7px;
  margin: 0;
  min-width: 52px;
}

.progress-label {
  flex-shrink: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .admin-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .admin-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-panels-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .admin-stat strong { font-size: 18px; }
  .admin-stat__icon { height: 30px; width: 30px; }
  .data-table--admin th,
  .data-table--admin td { padding-left: 12px; padding-right: 12px; }
}

/* ── Wallet ledger (grouped scrape debits) ───────────────── */
.wallet-ledger {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.wallet-ledger-head,
.wallet-ledger-row,
.wallet-ledger-row--summary {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 120px minmax(0, 1fr) 110px 80px 80px 24px;
  padding: 12px 16px;
}

.wallet-ledger-head {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wallet-ledger-row {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.wallet-ledger-row:last-child,
.wallet-ledger-group:last-child { border-bottom: none; }

.wallet-ledger-group {
  border-bottom: 1px solid var(--line);
}

.wallet-ledger-group[open] .wallet-ledger-chevron svg { transform: rotate(180deg); }

.wallet-ledger-row--summary {
  cursor: pointer;
  list-style: none;
  transition: background 0.12s ease;
}

.wallet-ledger-row--summary::-webkit-details-marker { display: none; }

.wallet-ledger-row--summary:hover { background: #fafcfb; }

.wallet-ledger-date {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 2px;
}

.wallet-ledger-date small { font-size: 11px; }

.wallet-ledger-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wallet-ledger-title strong {
  font-size: 14px;
  font-weight: 600;
}

.wallet-ledger-sub {
  color: var(--muted);
  font-size: 12px;
}

.wallet-ledger-num {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.wallet-ledger-chevron {
  align-items: center;
  color: var(--muted);
  display: flex;
  justify-content: center;
}

.wallet-ledger-chevron svg { transition: transform 0.15s ease; }

.wallet-ledger-chevron--spacer { visibility: hidden; }

.wallet-ledger-lines {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px 148px;
}

.wallet-ledger-lines-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.wallet-ledger-lines ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wallet-ledger-lines li {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.wallet-ledger-line-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wallet-ledger-line-name {
  font-size: 13px;
  font-weight: 600;
}

.wallet-ledger-line-meta { font-size: 11px; }

.wallet-ledger-line-side {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

.wallet-ledger-line-link {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
}

.wallet-ledger-line-link:hover { color: var(--accent); }

.wallet-ledger-lines-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .wallet-ledger-head { display: none; }

  .wallet-ledger-row,
  .wallet-ledger-row--summary {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
  }

  .wallet-ledger-date { grid-column: 1; }
  .wallet-ledger-title { grid-column: 1 / -1; }
  .wallet-ledger-row .badge { grid-column: 1; }
  .wallet-ledger-num { grid-column: 2; }
  .wallet-ledger-chevron { grid-column: 2; grid-row: 1; }

  .wallet-ledger-lines { padding-left: 16px; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-shell { margin-left: 0; padding-top: 58px; }
  .mobile-bar { display: flex; }
  .sidebar {
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.28);
    transform: translateX(calc(-1 * var(--sidebar-w) - 8px));
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 110;
  }
  .sidebar--open { transform: translateX(0); }
  .search-form { grid-template-columns: 1fr 1fr auto; }
  .filter-form { grid-template-columns: 1fr; }
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .desktop-table { display: none; }
  .mobile-cards  { display: grid; gap: 10px; }
  .detail-header { align-items: flex-start; flex-direction: column; }
  .detail-actions { justify-content: flex-start; width: 100%; }
  .detail-grid, .hours-grid { grid-template-columns: 1fr; }
  .detail-list div { gap: 2px; grid-template-columns: 1fr; }
  .auth-panel { border-radius: 0; box-shadow: none; margin: 0; max-width: 100%; min-height: 100vh; padding: 24px 16px; }
  .plans-grid { grid-template-columns: 1fr; }
  .wallet-hero { flex-direction: column; padding: 24px; }
  .wallet-hero-right { text-align: left; }
  nav.pagination { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .search-form { grid-template-columns: 1fr; }
  .page { padding: 16px; }
}
