:root {
  --bg: #0f1115;
  --panel: #181b22;
  --line: #262b35;
  --text: #e6e8ec;
  --muted: #8b93a3;
  --accent: #4f8cff;
  --green: #2fbf71;
  --red: #e5484d;
  --amber: #f5a623;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
}

h1 { font-size: 1.1rem; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); margin: 2rem 0 .75rem; }
h1:first-child { margin-top: 0; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; color: var(--muted); }
.empty { color: var(--muted); }

/* Tables ------------------------------------------------------------------ */

.table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 8px; overflow: hidden; }
.table th {
  text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: .6rem .9rem; border-bottom: 1px solid var(--line);
}
.table td { padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table a { color: var(--accent); text-decoration: none; }
.table a:hover { text-decoration: underline; }

.pill { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem; background: var(--line); }
.pill--available, .pill--live { background: rgba(47,191,113,.15); color: var(--green); }
.pill--on_call, .pill--ringing { background: rgba(245,166,35,.15); color: var(--amber); }
.pill--missed, .pill--failed { background: rgba(229,72,77,.15); color: var(--red); }

/* Softphone --------------------------------------------------------------- */

.softphone { max-width: 24rem; margin: 0 auto; }
.softphone__header { text-align: center; margin-bottom: 1.5rem; }
.softphone__header h1 { color: var(--text); text-transform: none; font-size: 1.4rem; margin: 0; }
.softphone__status { color: var(--muted); font-size: .85rem; margin: .25rem 0 0; }
.softphone__status.error { color: var(--red); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}
.panel--ringing { border-color: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
.panel--active { border-color: var(--green); }
.panel__hint { color: var(--muted); margin: 0; }
.panel__label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .5rem; }
.panel__caller { font-size: 1.5rem; font-variant-numeric: tabular-nums; margin: 0 0 1.25rem; }
.panel__actions { display: flex; gap: .5rem; justify-content: center; }

.btn {
  flex: 1; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--line); color: var(--text); font-size: .9rem; cursor: pointer;
}
.btn:hover { filter: brightness(1.2); }
.btn--answer { background: var(--green); border-color: var(--green); color: #06210f; font-weight: 600; }
.btn--hangup { background: var(--red); border-color: var(--red); color: #2a0709; font-weight: 600; }

.btn--primary { background: var(--accent); border-color: var(--accent); color: #04122e; font-weight: 600; }

/* Dialer ------------------------------------------------------------------ */

.dialer { display: flex; gap: .5rem; margin-top: 1.25rem; }
.dialer__input {
  flex: 1; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.dialer__input:focus { outline: none; border-color: var(--accent); }
.dialer .btn { flex: 0 0 auto; padding-inline: 1.2rem; }
.dialer__error { color: var(--red); font-size: .85rem; margin: .6rem 0 0; }

.pill--outbound { background: rgba(79,140,255,.15); color: var(--accent); }
.pill--dialing { background: rgba(245,166,35,.15); color: var(--amber); }

/* Nav and flash --------------------------------------------------------- */

.nav {
  display: flex; justify-content: space-between; align-items: center;
  margin: -1rem 0 1.5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line);
}
.nav__who { color: var(--muted); font-size: .85rem; }
.nav__links { display: flex; align-items: center; gap: 1rem; }
.nav__links a { color: var(--accent); text-decoration: none; font-size: .85rem; }
.nav__links a:hover { text-decoration: underline; }
.nav__signout { background: none; border: 0; color: var(--muted); font-size: .85rem; cursor: pointer; padding: 0; }
.nav__signout:hover { color: var(--text); }

.flash { padding: .6rem .9rem; border-radius: 8px; margin: 0 0 1rem; font-size: .9rem; }
.flash--alert { background: rgba(229,72,77,.15); color: var(--red); }
.flash--notice { background: rgba(47,191,113,.15); color: var(--green); }

/* Sign in ----------------------------------------------------------------- */

.auth { max-width: 20rem; margin: 6rem auto 0; }
.auth__title { color: var(--text); text-transform: none; font-size: 1.6rem; text-align: center; margin: 0 0 1.5rem; }
.auth__form { display: flex; flex-direction: column; gap: .9rem; }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field__label { font-size: .8rem; color: var(--muted); }
.field__input {
  padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); font-size: .95rem;
}
.field__input:focus { outline: none; border-color: var(--accent); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,166,35,.35); }
  50%      { box-shadow: 0 0 0 .6rem rgba(245,166,35,0); }
}

/* Supervisor dashboard ---------------------------------------------------- */

.page-head { display: flex; align-items: baseline; justify-content: space-between; }
h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 2rem 0 .75rem; }

.range { display: flex; gap: .3rem; }
.range__opt {
  padding: .25rem .6rem; border-radius: 6px; font-size: .8rem;
  color: var(--muted); text-decoration: none; border: 1px solid var(--line);
}
.range__opt:hover { color: var(--text); }
.range__opt--on { background: var(--line); color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; }
.stat__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0; }
.stat__value { font-size: 1.9rem; font-variant-numeric: tabular-nums; margin: .3rem 0 .15rem; }
.stat__sub { font-size: .78rem; color: var(--muted); margin: 0; }
.stat--good .stat__value { color: var(--green); }
.stat--warn .stat__value { color: var(--amber); }

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

/* Daily volume ------------------------------------------------------------ */

.chart { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.chart__bars { display: flex; align-items: flex-end; gap: 2px; height: 9rem; }
.chart__col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart__stack { width: 100%; min-height: 2px; display: flex; flex-direction: column; border-radius: 3px 3px 0 0; overflow: hidden; }
.chart__seg--in { background: var(--green); }
.chart__seg--out { background: var(--accent); }
.chart__col:hover .chart__stack { filter: brightness(1.3); }

.chart__legend { display: flex; gap: 1rem; align-items: center; margin-top: .7rem; font-size: .78rem; color: var(--muted); }
.chart__range { margin-left: auto; }
.swatch { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; margin-right: .3rem; }
.swatch--in { background: var(--green); }
.swatch--out { background: var(--accent); }
