:root {
  --bg: #e8efe8;
  --bg-deep: #d7e4d8;
  --bg-mist: #f4f7f3;
  --ink: #1a2a22;
  --muted: #5d7166;
  --line: #c9d6cb;
  --card: rgba(250, 252, 249, 0.88);
  --card-solid: #fafcf9;
  --available: #2f6b48;
  --available-bg: #e2f0e7;
  --call: #2a6f7a;
  --call-bg: #e3f1f3;
  --offline: #6b756f;
  --offline-bg: #e8ebe9;
  --away: #8a6a2f;
  --away-bg: #f4ecd8;
  --wrap: #4d6b58;
  --wrap-bg: #e5eee8;
  --other: #3d5347;
  --other-bg: #e7eee9;
  --danger: #9b3b32;
  --danger-bg: #f6e4e2;
  --waiting-accent: #3d6b52;
  --shadow: 0 10px 28px rgba(28, 52, 38, 0.07);
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(980px 520px at 8% -8%, rgba(120, 158, 128, 0.28), transparent 58%),
    radial-gradient(900px 480px at 96% 4%, rgba(90, 130, 105, 0.18), transparent 52%),
    linear-gradient(165deg, #eef4ee 0%, #e2ebe3 42%, #d8e4da 100%);
}

.shell {
  width: min(1100px, calc(100% - 1.25rem));
  margin: 0.45rem auto 1rem;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  min-height: 1.2rem;
}

h1 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #20362a;
}

h1 span {
  font-weight: 550;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.error {
  margin: 0 0 0.55rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.84rem;
}

/* Compact KPI strip */
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.stat {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 75%, white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.42rem 0.55rem 0.38rem;
  min-height: 52px;
  backdrop-filter: blur(6px);
}

.stat .label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 0.12rem;
}

.stat .value {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat.stat-available .value { color: var(--available); }
.stat.stat-call .value { color: var(--call); }
.stat.stat-offline .value { color: var(--offline); }
.stat.stat-waiting .value { color: var(--waiting-accent); }

/* Compact waiting band */
.waiting {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 75%, white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 0.55rem;
  overflow: hidden;
  backdrop-filter: blur(6px);
}

.waiting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, #e7f0e9 70%, white);
}

.waiting-head h2 {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.waiting-count {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--waiting-accent);
  font-variant-numeric: tabular-nums;
}

.waiting .table-wrap {
  max-height: 7.5rem;
  overflow: auto;
}

.waiting table {
  font-size: 0.8rem;
}

.waiting th,
.waiting td {
  padding: 0.28rem 0.6rem;
}

.waiting th {
  font-size: 0.62rem;
  background: color-mix(in srgb, var(--card-solid) 88%, #e4ede6);
}

.waiting .empty-wait td {
  text-align: left;
  color: var(--muted);
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
}

.board {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 75%, white);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(6px);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.48rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, white);
  white-space: nowrap;
}

th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
  background: color-mix(in srgb, var(--card-solid) 86%, #e4ede6);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: color-mix(in srgb, #e8f1ea 55%, white);
}

tr.is-offline td {
  color: color-mix(in srgb, var(--ink) 55%, var(--muted));
}

tr.is-offline .name {
  opacity: 0.8;
}

.name {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.14rem 0.48rem;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.2;
}

.status::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.st-available {
  color: var(--available);
  background: var(--available-bg);
}

.st-call {
  color: var(--call);
  background: var(--call-bg);
}

.st-offline {
  color: var(--offline);
  background: var(--offline-bg);
}

.st-away {
  color: var(--away);
  background: var(--away-bg);
}

.st-wrap {
  color: var(--wrap);
  background: var(--wrap-bg);
}

.st-other {
  color: var(--other);
  background: var(--other-bg);
}

.empty td {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 1rem;
}

@media (max-width: 820px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
    gap: 0.15rem 0.6rem;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  th,
  td {
    padding: 0.42rem 0.55rem;
  }
}
