/* Agent portal v2 - the white professional dashboard.
   Every rule is scoped under .apv2-dash. Mobile first: 390px is the target. */

.apv2-dash {
  --navy: #1D3270;
  --orange: #F47C20;
  --page: #FAF7F2;
  --card: #FFFFFF;
  --line: #E7DFD3;
  --track: #EFE7DC;
  --muted: #6B7280;
  background: var(--page);
  color: var(--navy);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  padding: 12px;
  margin: 0;
  -webkit-text-size-adjust: 100%;
}

.apv2-dash *,
.apv2-dash *::before,
.apv2-dash *::after { box-sizing: border-box; }

/* House look: headings in Book Antiqua serif. */
.apv2-dash .apv2-h2,
.apv2-dash .apv2-tile-value,
.apv2-dash .apv2-chart-title,
.apv2-dash .apv2-table-title {
  font-family: "Book Antiqua", Palatino, "Palatino Linotype", Georgia, serif;
}

.apv2-dash .apv2-section { margin: 0 0 16px; }
.apv2-dash .apv2-section:last-child { margin-bottom: 0; }

.apv2-dash .apv2-h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--navy);
}

/* ---------- tiles ---------- */
.apv2-dash .apv2-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.apv2-dash .apv2-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: 12px;
  padding: 10px 12px 12px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 2px rgba(29, 50, 112, 0.06);
}

.apv2-dash .apv2-tile:nth-child(even) { border-top-color: var(--orange); }

.apv2-dash .apv2-tile-label {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.apv2-dash .apv2-tile-value {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--navy);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.apv2-dash .apv2-tile-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
  overflow-wrap: anywhere;
}

/* ---------- charts ---------- */
.apv2-dash .apv2-charts { display: grid; grid-template-columns: 1fr; gap: 10px; }

.apv2-dash .apv2-chart {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(29, 50, 112, 0.06);
}

.apv2-dash .apv2-chart-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.apv2-dash .apv2-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 4px;
}

.apv2-dash .apv2-bar-col {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* the value in a small ring on top of each bar */
.apv2-dash .apv2-ring {
  display: inline-block;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  background: var(--card);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

/* pale track, rounded pill bar inside it */
.apv2-dash .apv2-track {
  width: 18px;
  height: 96px;
  border-radius: 999px;
  background: var(--track);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.apv2-dash .apv2-fill {
  display: block;
  width: 100%;
  min-height: 6px;
  border-radius: 999px;
  background: var(--navy);
}

.apv2-dash .apv2-bar-label {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apv2-dash .apv2-empty { margin: 0; font-size: 12px; color: var(--muted); }

/* ---------- tables ---------- */
.apv2-dash .apv2-tables { display: grid; grid-template-columns: 1fr; gap: 10px; }

.apv2-dash .apv2-table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(29, 50, 112, 0.06);
}

.apv2-dash .apv2-table-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

/* tables scroll sideways inside their own card */
.apv2-dash .apv2-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.apv2-dash .apv2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.apv2-dash .apv2-table th,
.apv2-dash .apv2-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #F1EADF;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

.apv2-dash .apv2-table th {
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: #FBF8F3;
  border-bottom: 2px solid var(--navy);
}

.apv2-dash .apv2-table td { color: var(--navy); }
.apv2-dash .apv2-table tbody tr:nth-child(even) { background: #FCFAF7; }
.apv2-dash .apv2-table tbody tr:last-child td { border-bottom: none; }
.apv2-dash .apv2-table .apv2-num { text-align: right; font-variant-numeric: tabular-nums; }

.apv2-dash .apv2-no-rows { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- wider screens ---------- */
@media (min-width: 720px) {
  .apv2-dash { padding: 18px; }
  .apv2-dash .apv2-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .apv2-dash .apv2-tile-value { font-size: 22px; }
  .apv2-dash .apv2-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .apv2-dash .apv2-tables { gap: 12px; }
}
