/* ═══════════════════════════════════════════════════════
   JunkHive Pros — Portal / Admin redesign layer (2026-11)
   Token-only re-theme: swaps the navy surfaces for the
   brand's green-ink palette so the contractor portal, admin
   and agreement pages match the public site. Load after
   portal.css (and admin.css). Delete the <link> to roll back.
   ═══════════════════════════════════════════════════════ */
:root {
  --p-bg:       #07110B;
  --p-surface:  #0C1912;
  --p-surface2: #12231A;
  --p-surface3: #1A2F23;
  --p-border:   rgba(255, 255, 255, 0.11);
  --p-text:     #EEF5F0;
  --p-muted:    #9AB0A2;
  --p-muted2:   #6B8475;
  --radius:     12px;
  --radius-lg:  18px;
  --shadow:     0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px -16px rgba(0, 0, 0, 0.6);
}

body { font-family: 'Inter', system-ui, sans-serif; }

.lc-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(22, 163, 74, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(245, 158, 11, 0.09) 0%, transparent 50%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(135deg, #050C08 0%, #0B1A11 100%);
}

.login-card {
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

/* shadcn-style focus ring on every form control */
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.35);
}

/* Admin login keeps its gold accent, on the green-ink base */
.lc-bg.adm-bg, .adm-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(245, 158, 11, 0.11) 0%, transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(135deg, #050C08 0%, #0B1A11 100%) !important;
}

/* ═══════════════ Dashboard polish (2026-11-12) ═══════════════ */

/* Lucide icons */
.ico { width: 1em; height: 1em; display: inline-block; flex-shrink: 0; vertical-align: -0.14em; }
.ico-inline { margin-right: 4px; }

/* Headings use the public site's display face */
.pg-h, .hdr-title, .card-title, .kpi-num, .lc-title, .login-card h2 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}
.pg-h { font-size: 1.6rem; }
.pg-sub { font-size: .88rem; }
.portal-hdr {
  background: rgba(7, 17, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Sidebar: rounded pills, left accent */
.sidebar {
  background-color: var(--p-surface);
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
}
.sb-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.sb-link {
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--p-muted);
  border-right: none !important;
}
.sb-link:hover { background: var(--p-surface2); color: var(--p-text); }
.sb-link.active {
  color: var(--p-green2);
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.14), rgba(74, 222, 128, 0.04));
  box-shadow: inset 3px 0 0 var(--p-green2);
}
.adm-sidebar .sb-link.active {
  color: var(--adm-gold, #f59e0b);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.04));
  box-shadow: inset 3px 0 0 var(--adm-gold, #f59e0b);
}
.sb-icon { width: 20px; display: inline-flex; justify-content: center; font-size: 1.05rem; }
.adm-role-badge, .adm-hdr-badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }

/* Header buttons */
.hdr-menu-btn { font-size: 1.35rem; line-height: 1; padding: 6px; border-radius: 8px; }
.hdr-menu-btn:hover { background: var(--p-surface2); color: var(--p-text); }
.notif-btn { display: inline-flex; align-items: center; font-size: 1.05rem; }

/* KPI cards: fluid grid (no orphaned 5th card), lift on hover */
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi-grid:has(> .kpi-card:nth-child(5)) { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi-grid:has(> .kpi-card:nth-child(5)) .kpi-card { gap: 12px; padding: 18px 16px; }
.kpi-card {
  position: relative;
  overflow: hidden;
  border-color: var(--p-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 60%), var(--p-surface);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); border-color: rgba(74, 222, 128, 0.3); box-shadow: var(--shadow); }
.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}
.kpi-icon { font-size: 1.35rem; border: 1px solid rgba(255, 255, 255, 0.06); }
.kpi-num { font-size: 1.75rem; }
.kpi-lbl { color: var(--p-muted); text-transform: uppercase; letter-spacing: .06em; font-size: .66rem; font-weight: 600; }

/* Cards */
.dash-chart-card, .dash-activity-card, .dash-card, .login-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%), var(--p-surface);
}
.card-title { font-size: .95rem; }

/* Empty states for lists the JS leaves blank */
#dash-recent-contractors:empty::before, #dash-job-activity:empty::before,
#dash-automation-health:empty::before, #contractors-list:empty::before,
#documents-list:empty::before, #jobs-list:empty::before, #payouts-list:empty::before,
#job-board-list:empty::before, #myjobs-list:empty::before, #docs-list:empty::before {
  content: 'Nothing to show yet';
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin-top: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--p-muted2);
  font-size: .82rem;
  background: rgba(255, 255, 255, 0.015);
}
.empty-msg {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
}

/* Phones: compact two-column stats */
@media (max-width: 540px) {
  .portal-main { padding: 20px 14px 32px; }
  .kpi-grid, .kpi-grid:has(> .kpi-card:nth-child(5)) { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-grid > .kpi-card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .kpi-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .kpi-icon { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 10px; }
  .kpi-num { font-size: 1.35rem; }
  .pg-h { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .kpi-card, .kpi-card:hover { transition: none; transform: none; }
}

/* Forgot-password flow (js/password-reset.js) */
.pr-link { display: block; width: 100%; margin-top: 14px; text-align: center; font-size: .82rem; font-weight: 600; background: none; border: none; cursor: pointer; }
.pr-link:hover { text-decoration: underline; }
.adm-sidebar ~ * .pr-link, #login-screen .adm-btn ~ .pr-link { color: var(--adm-gold, #f59e0b); }
.pr-panel[hidden], .pr-panel form[hidden] { display: none; }
