/* ==========================================================================
   Aggelakakis 360 CRM — internal dashboard
   Locked palette, copied from the Aggelakakis 360 production spec so the two
   properties read as one family: #024263 petrol · #b63626 brick. Spacing and
   type snap to the WIZSP design system's 4pt grid / Major Third scale — run
   through scripts/check-tokens.py before every commit.

   Stage-pill colours below add teal/blue/green/amber roles beyond that locked
   brand set. That is deliberate, not drift: the marketing site never needed
   status semantics, and a pipeline board that cannot visually tell "won" from
   "lost" from "in progress" at a glance has failed at the one thing a CRM is
   for. The brand chrome (app bar, buttons, headings) stays inside the locked
   palette; only the seven stage pills use the wider set.
   ========================================================================== */

:root {
  --navy: #024263;
  --brand: #024263;
  --brand-deep: #012c3f;
  --btn-main: #064264;
  --btn-main-hover: #0a5a7d;
  --brick: #b63626;

  --white: #ffffff;
  --elevated: #ffffff;
  --surface: #eef4f8;
  --neutral: #c2d2da;
  --tint: #d9e6ef;
  --blue: #0067c8;
  --teal: #00617f;

  --ink: var(--navy);
  --ink-soft: rgba(2, 66, 99, .86);
  --ink-muted: rgba(2, 66, 99, .78);
  --ink-faint: rgba(2, 66, 99, .6);
  --hairline: rgba(2, 66, 99, .16);
  --hairline-strong: rgba(2, 66, 99, .4);

  --success: #15803d;
  --success-tint: #e3f3ea;
  --warning: #9a5b12;
  --warning-tint: #fdf1e4;
  --error: #b63626;
  --error-tint: #fbe9e7;

  --ease: cubic-bezier(.2, 0, 0, 1);
  --r-btn: 6px;
  --r-card: 16px;
  --r-pill: 999px;

  --sh-1: 0 1px 3px rgba(0, 0, 0, .08), 0 6px 20px -6px rgba(0, 0, 0, .12);

  --gutter: 24px;
  --pad-card: 24px;
  --control: 40px;
  --shell-max: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; margin: 0; }
table { border-collapse: collapse; width: 100%; }

/* Standard WordPress visually-hidden-until-focused pattern: clip the element
   to a point rather than pushing it off-screen, so no arbitrary offset is
   needed and horizontal scroll containers can't reveal it early. */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto !important;
  clip-path: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
  display: block;
  height: auto;
  width: auto;
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  border-radius: 0 0 var(--r-btn) 0;
}

.shell { max-width: var(--shell-max); margin-inline: auto; padding: var(--gutter); }

/* ---------- app bar ---------- */
.app-bar { background: var(--white); border-bottom: 1px solid var(--hairline); position: sticky; top: 0; z-index: 10; }
.app-bar__inner {
  max-width: var(--shell-max); margin-inline: auto; padding: 12px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; color: var(--navy); }
.brand__logo { display: block; width: auto; height: 30px; }
.brand__badge {
  font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--brick); background: var(--error-tint); padding: 4px 8px; border-radius: var(--r-btn);
}
.app-bar__actions { display: flex; align-items: center; gap: 12px; }
.app-bar__user { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.app-bar__logout { font-size: 13px; color: var(--ink-faint); }
.app-bar__logout:hover { color: var(--brick); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: var(--control); padding: 0 16px; border-radius: var(--r-btn);
  font-size: 13px; font-weight: 500; border: 1px solid transparent; cursor: pointer;
  transition: background var(--ease) 150ms, box-shadow var(--ease) 150ms;
}
.btn--sm { padding: 0 12px; font-size: 12px; }
.btn--main { background: var(--btn-main); color: #fff; box-shadow: var(--sh-1); }
.btn--main:hover { background: var(--btn-main-hover); }
.btn--ghost { background: transparent; border-color: var(--hairline-strong); color: var(--navy); }
.btn--ghost:hover { background: var(--surface); }

/* ---------- main ---------- */
.app-main { min-height: calc(100vh - 64px); }

.dash-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.dash-head h1 { font-size: 25px; }
.dash-search { display: flex; gap: 8px; }
.dash-search input[type="search"] {
  height: var(--control); padding: 0 12px; border: 1px solid var(--hairline-strong); border-radius: var(--r-btn);
  font-size: 13px; font-family: inherit; min-width: 260px; background: var(--white);
}

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: var(--pad-card); box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 4px;
}
.stat-card__value { font-size: 27px; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }
.stat-card__label { font-size: 12px; color: var(--ink-muted); font-weight: 500; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
  color: var(--ink-soft); background: var(--white); border: 1px solid var(--hairline);
}
.tab:hover { border-color: var(--hairline-strong); }
.tab.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab__count { font-size: 12px; opacity: .75; }

.table-wrap {
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-card);
  overflow: hidden; box-shadow: var(--sh-1);
}
.leads-table th, .leads-table td { padding: 12px 16px; text-align: left; font-size: 13px; }
.leads-table thead th {
  background: var(--surface); color: var(--ink-muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--hairline);
}
.leads-table tbody tr + tr { border-top: 1px solid var(--hairline); }
.leads-table tbody tr:hover { background: var(--surface); }
.leads-table a { color: var(--navy); font-weight: 600; }
.leads-table a:hover { color: var(--blue); }
.muted { color: var(--ink-faint); font-size: 12px; }

.pill {
  display: inline-block; padding: 4px 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill--new { background: var(--surface); color: var(--navy); }
.pill--screened { background: var(--tint); color: var(--navy); }
.pill--brief { background: #e2eef1; color: var(--teal); }
.pill--call { background: var(--warning-tint); color: var(--warning); }
.pill--mandate { background: var(--navy); color: #fff; }
.pill--won { background: var(--success-tint); color: var(--success); }
.pill--lost { background: var(--error-tint); color: var(--error); }

.empty-state { padding: 48px 16px; text-align: center; color: var(--ink-muted); font-size: 14px; }
.empty-state a { color: var(--btn-main); font-weight: 600; }
.empty-state--page { background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-card); }
.empty-state--page h1 { font-size: 23px; margin-bottom: 8px; }

@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .app-bar__actions .app-bar__user { display: none; }
}

@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; }
  .dash-search input[type="search"] { min-width: 0; flex: 1; }
  .table-wrap { overflow-x: auto; }
  .leads-table { min-width: 720px; }
  .app-bar__actions .btn--ghost { display: none; }
}
