/* =====================================================================
   Biz-Pages — token system
   Palette sourced from the brand mark: deep blue as the anchor, a
   bright working blue for action, and a single lime signal color
   reserved for "approved / cleared / paid" states — the one accent that
   is allowed to feel alive in an otherwise disciplined console.
   ===================================================================== */

:root {
  --blue-900: #001F5C;
  --blue-800: #0037A8;   /* anchor: sidebar, headers */
  --blue-600: #0456FD;   /* action: buttons, links, active nav */
  --blue-100: #E6ECFF;
  --lime-500: #9EE900;   /* signal: verified / cleared / paid, used sparingly */
  --lime-100: #F2FBDD;
  --amber-500: #E8A200;
  --amber-100: #FCF1D9;
  --red-500: #E0453C;
  --red-100: #FBE6E4;
  --ink-900: #10182B;
  --ink-700: #3A4257;
  --ink-500: #667085;
  --ink-300: #98A2B3;
  --surface: #F5F6FA;
  --surface-alt: #EEF0F7;
  --white: #FFFFFF;
  --border: #E3E6EF;
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-card: 0 1px 2px rgba(16, 24, 43, 0.06), 0 1px 12px rgba(16, 24, 43, 0.04);
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink-900);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 4px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 12px; color: var(--ink-700); }
code, .mono { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }

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

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--blue-800);
  background-image: linear-gradient(180deg, var(--blue-800) 0%, var(--blue-900) 100%);
  color: #DCE5FF;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-brand img { width: 32px; height: 32px; display: block; object-fit: contain; }
.sidebar-brand .name { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.2; }
.sidebar-brand .sub { font-size: 10.5px; color: #9FB3EE; text-transform: uppercase; letter-spacing: 0.06em; }

.sidebar-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sidebar-nav .group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #7C93D6; padding: 14px 10px 6px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: #C9D6F7; font-size: 13.5px; font-weight: 500;
  text-decoration: none; margin-bottom: 2px;
  position: relative;
}
.sidebar-nav a svg { flex-shrink: 0; opacity: 0.85; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: var(--blue-600); color: #fff; }
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-nav a .nav-dot { display: none; }

.sidebar-foot { padding: 14px 20px 18px; border-top: 1px solid rgba(255,255,255,0.12); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--blue-600);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sidebar-user .who { font-size: 12.5px; line-height: 1.3; overflow: hidden; }
.sidebar-user .who .u-name { color: #fff; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sidebar-user .who .u-role { color: #9FB3EE; text-transform: capitalize; }
.sidebar-foot .logout { display: block; margin-top: 10px; font-size: 12.5px; color: #9FB3EE; }
.sidebar-foot .logout:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; flex-shrink: 0; background: var(--white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 17px; margin: 0; }
.topbar .crumbs { font-size: 12.5px; color: var(--ink-500); margin-bottom: 2px; }
.content { padding: 26px 28px 48px; max-width: 1220px; width: 100%; min-width: 0; overflow-x: hidden; }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px; box-shadow: var(--shadow-card);
  min-width: 0;
}
.card + .card { margin-top: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-header h3 { font-size: 14.5px; }
.card-header .muted { font-size: 12px; color: var(--ink-500); }

.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.kpi { padding: 18px 20px; }
.kpi .kpi-value { font-family: var(--font-mono); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .kpi-label { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }
.kpi .kpi-delta { font-size: 11.5px; margin-top: 8px; display: inline-block; padding: 2px 7px; border-radius: 20px; font-weight: 600; }
.kpi .kpi-delta.up { background: var(--lime-100); color: #4C7A00; }
.kpi .kpi-delta.down { background: var(--red-100); color: #A6291F; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.badge-lime  { background: var(--lime-100); color: #4C7A00; }
.badge-blue  { background: var(--blue-100); color: var(--blue-800); }
.badge-amber { background: var(--amber-100); color: #8A5A00; }
.badge-red   { background: var(--red-100); color: #A6291F; }
.badge-slate { background: var(--surface-alt); color: var(--ink-500); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-500); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--surface); }
tbody tr:last-child td { border-bottom: none; }
.ref-code { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-700); }
.row-link { color: var(--ink-900); font-weight: 600; }
.row-link:hover { text-decoration: underline; }
.text-muted { color: var(--ink-500); }
.text-sm { font-size: 12.5px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 5px; }
.field { margin-bottom: 16px; }
.field-hint { font-size: 11.5px; color: var(--ink-500); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=datetime-local], textarea, select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-ui); font-size: 13.5px; color: var(--ink-900); background: var(--white);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { border-color: var(--blue-600); outline: none; box-shadow: 0 0 0 3px var(--blue-100); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ---------- Service-area search (address lookup) ---------- */
.area-search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.area-search-row input[type=text] { flex: 1; min-width: 220px; }
.area-results { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.area-result-item {
  text-align: left; width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-900); cursor: pointer;
}
.area-result-item:hover { background: var(--surface-alt); border-color: var(--blue-600); }
.area-divider { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 11px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.05em; }
.area-divider::before, .area-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-800); }
.btn-lime { background: var(--lime-500); color: #234000; }
.btn-lime:hover { background: #8DD400; }
.btn-secondary { background: var(--white); border-color: var(--border); color: var(--ink-900); }
.btn-secondary:hover { background: var(--surface); }
.btn-danger { background: var(--white); border-color: var(--red-500); color: var(--red-500); }
.btn-danger:hover { background: var(--red-100); }
.btn-whatsapp { background: #25D366; color: #fff; border-color: #25D366; }
.btn-whatsapp:hover { background: #1EBE5A; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--lime-100); color: #4C7A00; border-color: #D3EFA0; }
.alert-error { background: var(--red-100); color: #A6291F; border-color: #F3C4C0; }
.alert-info { background: var(--blue-100); color: var(--blue-800); border-color: #C7D6FF; }

/* ---------- Verification ladder (signature element) ---------- */
.tier-ladder { display: flex; flex-direction: column; gap: 0; }
.tier-step { display: flex; gap: 14px; padding: 14px 0; position: relative; }
.tier-step:not(:last-child)::before {
  content: ''; position: absolute; left: 15px; top: 38px; bottom: -4px; width: 2px; background: var(--border);
}
.tier-step.done:not(:last-child)::before { background: var(--lime-500); }
.tier-dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt); border: 2px solid var(--border); color: var(--ink-500);
  font-weight: 700; font-size: 13px; z-index: 1;
}
.tier-step.done .tier-dot { background: var(--lime-500); border-color: var(--lime-500); color: #234000; }
.tier-step.pending .tier-dot { background: var(--amber-100); border-color: var(--amber-500); color: #8A5A00; }
.tier-step.failed .tier-dot { background: var(--red-100); border-color: var(--red-500); color: #A6291F; }
.tier-body h4 { font-size: 13.5px; margin-bottom: 2px; }
.tier-body p { font-size: 12.5px; margin-bottom: 6px; }
.tier-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.tier-check {
  font-size: 11px; padding: 3px 8px; border-radius: 5px; background: var(--surface-alt); color: var(--ink-700);
  display: inline-flex; align-items: center; gap: 4px;
}
.tier-check.ok { background: var(--lime-100); color: #4C7A00; }
.tier-check.bad { background: var(--red-100); color: #A6291F; }
.tier-check.wait { background: var(--amber-100); color: #8A5A00; }

/* ---------- Workflow timeline (Issue Intake > Matching > Execution > 3-Way Match) ---------- */
.workflow-rail { display: flex; margin: 4px 0 22px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.workflow-stage { flex: 1; padding: 12px 14px; background: var(--surface-alt); position: relative; }
.workflow-stage:not(:last-child) { border-right: 1px solid var(--border); }
.workflow-stage.active { background: var(--blue-100); }
.workflow-stage.complete { background: var(--lime-100); }
.workflow-stage .num { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }
.workflow-stage.complete .num, .workflow-stage.active .num { color: var(--ink-700); }
.workflow-stage .label { font-weight: 700; font-size: 13px; margin-top: 2px; }

.timeline { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 18px; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: ''; position: absolute; left: -23px; top: 3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--blue-600); border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--border);
}
.timeline-item .t-note { font-size: 13px; color: var(--ink-900); font-weight: 500; }
.timeline-item .t-meta { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }

/* ---------- Category / matrix table ---------- */
.category-icon {
  width: 34px; height: 34px; border-radius: 8px; background: var(--blue-100); color: var(--blue-800);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- Auth pages ---------- */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--blue-900); padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--white); border-radius: var(--radius-md); padding: 32px 30px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand img { width: 34px; height: 34px; }
.auth-brand .name { font-weight: 700; font-size: 17px; }
.auth-brand .sub { font-size: 11px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.05em; }
.auth-card h2 { font-size: 19px; margin-bottom: 4px; }
.auth-card .lead { font-size: 13px; color: var(--ink-500); margin-bottom: 22px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--ink-500); margin-top: 18px; }
.demo-box { margin-top: 18px; padding: 12px 14px; background: var(--surface); border-radius: var(--radius-sm); font-size: 11.5px; color: var(--ink-700); }
.demo-box .mono { display: block; margin-top: 3px; }

/* ---------- Landing / marketing header (public pages) ---------- */
.public-nav { background: var(--blue-800); color: #fff; }
.public-nav .wrap { max-width: 1100px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.public-nav .brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.public-nav .brand img { width: 30px; height: 30px; object-fit: contain; }
.public-nav .links { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 22px; }
.public-nav .links a { color: #C9D6F7; font-size: 13.5px; font-weight: 500; }
.public-nav .links a:hover { color: #fff; text-decoration: none; }
.hero { background: var(--blue-800); background-image: linear-gradient(160deg, var(--blue-800), var(--blue-900)); color: #fff; padding: 64px 24px 84px; }
.hero .wrap { max-width: 780px; margin: 0 auto; text-align: left; }
.hero .eyebrow { font-size: 12.5px; color: var(--lime-500); font-weight: 700; margin-bottom: 12px; }
.hero h1 { font-size: 38px; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 14px; }
.hero p { color: #C9D6F7; font-size: 16px; max-width: 560px; margin-bottom: 26px; }
.hero .cta-row { display: flex; gap: 12px; }
.section { max-width: 1100px; margin: 0 auto; padding: 56px 24px; }
.section h2 { font-size: 24px; margin-bottom: 8px; }
.section .lead { color: var(--ink-500); margin-bottom: 28px; max-width: 600px; }
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: -46px; position: relative; z-index: 2; max-width: 1100px; margin-left: auto; margin-right: auto; padding: 0 24px; }
.stat-strip .card { text-align: left; }
.stat-strip .stat-num { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--blue-800); }
.stat-strip .stat-num.lime { color: #4C7A00; }
.footer-public { border-top: 1px solid var(--border); padding: 24px; text-align: center; font-size: 12px; color: var(--ink-500); }

@media (max-width: 720px) {
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .stat-strip { grid-template-columns: 1fr; margin-top: 16px; }

  /* Side menu stays on screen as a slim icon rail instead of a hidden
     drawer — every section is always one tap away, even on phones. */
  .sidebar { width: 64px; }
  .sidebar-brand { padding: 14px 0; justify-content: center; }
  .sidebar-brand .name, .sidebar-brand .sub { display: none; }
  .sidebar-nav { padding: 10px 6px; }
  .sidebar-nav .group-label { display: none; }
  .sidebar-nav a { justify-content: center; padding: 12px 0; margin-bottom: 4px; }
  .sidebar-nav a .nav-label { display: none; }
  .sidebar-nav a .nav-dot {
    display: block; position: absolute; top: 6px; right: 12px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--red-500);
  }
  .sidebar-foot { padding: 12px 6px 16px; }
  .sidebar-user { flex-direction: column; gap: 6px; }
  .sidebar-user .who { display: none; }
  .sidebar-foot .logout {
    display: flex; align-items: center; justify-content: center;
    margin-top: 10px; padding: 8px 0; border-radius: var(--radius-sm);
  }
  .sidebar-foot .logout:hover { background: rgba(255,255,255,0.08); }
  .sidebar-foot .logout .nav-label { display: none; }

  .topbar { padding: 0 14px; }
  .topbar h1 { font-size: 15.5px; }

  /* Public marketing nav (index / providers / request / login pages):
     brand + links stop competing for one row and right-aligning off the
     edge of the screen — stack them and let the links wrap left-to-right
     instead. */
  .public-nav .wrap { flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 20px; }
  .public-nav .links { justify-content: flex-start; width: 100%; gap: 8px 16px; }
}

@media (max-width: 400px) {
  .sidebar { width: 56px; }

  .public-nav .links { gap: 8px 12px; }
  .public-nav .links a { font-size: 13px; }
}


/* =====================================================================
   Notifications bell + dropdown
   ===================================================================== */
.nav-count {
  display: inline-block;
  background: var(--red-500);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 6px;
  margin-left: 4px;
  line-height: 1.5;
}
.notif-bell { position: relative; }
.notif-bell summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink-700);
  position: relative;
}
.notif-bell summary::-webkit-details-marker { display: none; }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  min-width: 16px;
  height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.notif-dropdown {
  position: absolute;
  right: 0;
  top: 42px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 400px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 50;
}
.notif-dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-dropdown-head a { font-size: 12.5px; }
.notif-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-900);
  text-decoration: none;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--blue-100); }
.notif-item .notif-title { font-size: 12.5px; font-weight: 600; }
.notif-item .notif-msg { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }
.notif-item .notif-time { font-size: 11px; color: var(--ink-300); margin-top: 4px; }

/* =====================================================================
   Category icons — used on the homepage, request form, register form
   and admin category list so every category is visually distinct.
   ===================================================================== */
.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  color: var(--blue-600);
}
.cat-icon svg { width: 100%; height: 100%; }
.cat-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--white);
  transition: border-color .12s ease, background .12s ease;
}
.cat-card:hover { border-color: var(--blue-600); }
.cat-card.selected { border-color: var(--blue-600); background: var(--blue-100); }
.cat-card input { position: absolute; opacity: 0; pointer-events: none; }
.cat-card .cat-icon { width: 30px; height: 30px; flex-shrink: 0; background: var(--surface-alt); border-radius: 8px; padding: 6px; }
.cat-card .cat-name { font-size: 13.5px; font-weight: 600; }
.cat-card .cat-desc { font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
