/* Company dashboard (admin.html). Builds on styles.css. */
.admin-page {
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --gridline: #e1e0d9;
  --baseline: #c3c2b7;
  --series-1: #2a78d6;
  --track: #eef3fa;
  --good: #0ca30c;
  --good-text: #006300;
  --critical: #d03b3b;
}
.admin-page .admin-inner, .admin-wrap { max-width: 1120px; }
.admin-wrap { margin: 0 auto; padding: 16px 16px 48px; }
.top-link { color: #fff; border-color: rgba(255, 255, 255, .35); text-decoration: none; display: inline-flex; align-items: center; }
.admin-h1 { margin: 0 0 8px; font-size: 22px; }

.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.demo-actions { display: flex; gap: 8px; }

/* Filters: one row */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.seg-group { display: inline-flex; background: #e4e9ef; border-radius: 10px; padding: 3px; gap: 2px; }
.seg-group button {
  border: 0; background: transparent; border-radius: 8px; min-height: 38px; padding: 0 12px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg-group button[aria-pressed="true"] { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.filters select, .table-tools select, .table-tools input {
  min-height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; font-size: 15px; background: #fff; color: var(--text);
}
.rep-filter select { min-width: 190px; }

.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.admin-tabs button {
  border: 0; background: none; font: inherit; font-weight: 700; font-size: 16px; color: var(--muted);
  padding: 10px 12px; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
}
.admin-tabs button[aria-pressed="true"] { color: var(--brand); border-bottom-color: var(--brand-2); }
.load-msg { margin: 8px 0; }

/* Stat tiles */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi-label { font-size: 14px; color: var(--text-secondary); }
.kpi-value { font-size: 30px; font-weight: 650; color: var(--text-primary); line-height: 1.15; margin: 2px 0; }
.kpi-hero .kpi-value { font-size: 48px; }
.kpi-note { font-size: 13px; color: var(--text-muted); }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-hero { grid-column: 1 / -1; order: -1; }
}

/* Charts */
.viz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .viz-grid { grid-template-columns: 1fr; } }
.viz-card { background: var(--surface-1); min-width: 0; }
.viz-title { margin: 0; font-size: 17px; color: var(--text-primary); }
.viz-sub { margin: 2px 0 12px; font-size: 14px; color: var(--text-secondary); }
.chart { width: 100%; min-height: 40px; position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .bar { fill: var(--series-1); }
.chart .track { fill: var(--track); }
.chart .grid { stroke: var(--gridline); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis { stroke: var(--baseline); stroke-width: 1; shape-rendering: crispEdges; }
.chart .t-label { font-size: 14px; font-weight: 600; fill: var(--text-primary); }
.chart .t-muted { font-size: 13px; font-weight: 400; fill: var(--text-secondary); }
.chart .t-value { font-size: 14px; font-weight: 600; fill: var(--text-primary); font-variant-numeric: tabular-nums; }
.chart .t-tick { font-size: 12px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.viz-tip {
  position: fixed; z-index: 60; pointer-events: none; background: #fff; color: var(--text-primary);
  border: 1px solid rgba(11, 11, 11, .10); border-radius: 8px; padding: 8px 10px; font-size: 14px; line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14); max-width: 260px;
}
.viz-table { margin-top: 10px; font-size: 14px; }
.viz-table summary { cursor: pointer; color: var(--brand-2); font-weight: 600; }
.viz-table table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.viz-table th, .viz-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }

/* Tables */
.table-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.table-tools input[type="search"] { flex: 1 1 240px; min-width: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th {
  text-align: left; font-size: 13px; font-weight: 600; color: var(--text-secondary); padding: 8px 10px;
  border-bottom: 1px solid var(--baseline); white-space: nowrap; position: sticky; top: 0; background: #fff;
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--gridline); vertical-align: top; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .nowrap { white-space: nowrap; }
.data-table .wrap-cell { min-width: 160px; max-width: 280px; }
.data-table .sub { color: var(--text-muted); font-size: 13px; }
.data-table .empty-cell { text-align: center; color: var(--muted); padding: 24px; }
.data-table a { color: var(--brand-2); }
.status-select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; }

/* Status: icon + label, never color alone */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: #eef0f3; color: var(--text-secondary); }
.pill-approved { background: #e7f0fb; color: #1c5cab; }
.pill-sent { background: #e7f0fb; color: #1c5cab; }
.pill-signed { background: #e3f4e3; color: var(--good-text); }
.pill-lost { background: #fbeaea; color: #a02c2c; }

/* Team map (Map tab) */
.map-tools { align-items: center; }
.team-map { height: min(68vh, 620px); min-height: 360px; border-radius: 12px; border: 1px solid var(--gridline); margin-top: 10px; z-index: 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--text-secondary); margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.map-pop { font-size: 14px; line-height: 1.4; }
.map-pop ul { margin: 6px 0; padding-left: 18px; }
.map-pop .sub { color: var(--text-muted); font-size: 13px; }
