/* ============================================================
   Dialer — "Aurora Glass" theme.
   An Apple-grade dark design language: near-black canvas, frosted
   glass surfaces, layered 3D depth, and a single confident blue.
   Plain CSS, no frameworks. Shared by login.html and app.html.
   ============================================================ */

:root {
  --bg: #060609;
  --bg-2: #0a0a10;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(255, 255, 255, 0.18);
  --text: #f5f7fa;
  --muted: #a1a7b8;
  --muted-2: #6d7385;
  --blue: #0a84ff;
  --blue-deep: #0060d4;
  --blue-soft: rgba(10, 132, 255, 0.14);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, 0.13);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, 0.12);
  --amber: #ffd60a;
  --amber-soft: rgba(255, 214, 10, 0.12);
  --purple: #bf5af2;
  --radius: 20px;
  --radius-s: 13px;
  --shadow-3d:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.4);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(10, 132, 255, 0.13), transparent 60%),
    radial-gradient(760px 420px at 88% -6%, rgba(191, 90, 242, 0.09), transparent 60%),
    radial-gradient(1000px 700px at 50% 115%, rgba(10, 132, 255, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(10, 132, 255, 0.4); }

a { color: #5aa9ff; }

/* Slim, quiet scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); background-clip: content-box; border: 2px solid transparent; }

/* ---------------- Top bar: floating frosted pill ---------------- */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 50;
  margin: 14px auto 0;
  max-width: 1240px;
  width: calc(100% - 28px);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  background: rgba(14, 14, 20, 0.62);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 44px rgba(0, 0, 0, 0.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand .dot {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  border-radius: 11px;
  background: linear-gradient(145deg, #2ea0ff, #0058d1);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 6px 18px rgba(10, 132, 255, 0.45);
  transform: translateZ(0);
}

/* Segmented-control tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  overflow-x: auto;
  flex: 1;
  min-width: 0;
}

.tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  padding: 8px 16px;
  border-radius: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease,
    transform 0.12s ease;
}

.tabs button:hover { color: var(--text); }

.tabs button.active {
  color: #fff;
  background: linear-gradient(180deg, #2f9bff, #0a6fe0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 6px 16px rgba(10, 132, 255, 0.4);
}

.tabs button:active { transform: scale(0.97); }

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.who { color: var(--muted); font-size: 13px; }
.who strong { color: var(--text); font-weight: 600; }

.ws-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
  transition: background 0.3s, box-shadow 0.3s;
}
.ws-dot.on {
  background: var(--green);
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.9);
}

/* ---------------- Layout ---------------- */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 14px 60px;
}

.tab { display: none; }
.tab.active {
  display: block;
  animation: tabIn 0.32s cubic-bezier(0.22, 0.9, 0.3, 1);
}

@keyframes tabIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Cards: layered 3D glass ---------------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), var(--glass));
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-3d);
  transform: translateZ(0);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card::before {
  /* top edge light-catch: the "milled glass" highlight */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 18%);
}

.card:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 30px 70px rgba(0, 0, 0, 0.6),
    0 4px 14px rgba(0, 0, 0, 0.4);
}

.card h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card h3 {
  margin: 18px 0 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

/* ---------------- Buttons ---------------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(180deg, #2f9bff, #0a6fe0);
  padding: 9px 18px;
  border-radius: var(--radius-s);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2),
    0 8px 20px rgba(10, 132, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; filter: none; }

.btn.ghost {
  background: var(--glass-2);
  border-color: var(--border);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.3);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.11); filter: none; }

.btn.danger {
  background: linear-gradient(180deg, #ff6a5e, #d62f26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2),
    0 8px 20px rgba(255, 69, 58, 0.3);
}

.btn.small { padding: 6px 13px; font-size: 12.5px; border-radius: 10px; }

/* ---------------- Inputs ---------------- */
input[type="text"], input[type="tel"], input[type="password"],
input[type="number"], input[type="email"], select, textarea {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 12px;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.4),
    0 0 0 4px rgba(10, 132, 255, 0.22);
}

select option { background: #14141c; color: var(--text); }

textarea { resize: vertical; min-height: 70px; width: 100%; }

input[type="file"] { font: inherit; font-size: 13px; color: var(--muted); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select { width: 100%; }

.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hint { color: var(--muted-2); font-size: 12.5px; margin: 10px 0 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }

/* ---------------- Tables ---------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.35);
}

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

table.data th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}

table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
}

table.data tbody tr { transition: background 0.15s ease; }
table.data tbody tr:hover { background: rgba(10, 132, 255, 0.06); }
table.data tbody tr:last-child td { border-bottom: 0; }

/* ---------------- Pills & badges ---------------- */
.pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill.queued { background: var(--blue-soft); color: #6fb3ff; border-color: rgba(10, 132, 255, 0.3); }
.pill.in_progress, .pill.on_call { background: var(--green-soft); color: #5fe08a; border-color: rgba(48, 209, 88, 0.3); }
.pill.done { background: rgba(255, 255, 255, 0.07); color: var(--muted); border-color: var(--border); }
.pill.info { background: var(--blue-soft); color: #6fb3ff; border-color: rgba(10, 132, 255, 0.3); }

.type-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ---------------- Stats ---------------- */
.stat-row { display: flex; gap: 26px; flex-wrap: wrap; }
.stat { min-width: 120px; }
.stat .label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.stat .value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff, #b9c2d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* My Desk stat cards — 3D glass tiles */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  padding: 16px 18px;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.45);
  transform: translateZ(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 20px 44px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(10, 132, 255, 0.12);
}

.stat-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff, #aeb8cc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-card.accent .stat-card-value {
  background: linear-gradient(180deg, #7dbcff, #0a84ff);
  -webkit-background-clip: text;
  background-clip: text;
}
.stat-card.green .stat-card-value {
  background: linear-gradient(180deg, #7bf0a4, #30d158);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Disposition chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 8px 8px 15px;
  border-radius: 999px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 13px;
}
.chip-label { color: var(--muted); font-weight: 600; }
.chip-count {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #2f9bff, #0a6fe0);
  border-radius: 999px;
  padding: 2px 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ---------------- Status / feedback boxes ---------------- */
.loading { color: var(--muted-2); padding: 18px; text-align: center; font-size: 13px; }
.empty { color: var(--muted-2); padding: 22px; text-align: center; font-size: 13.5px; }

.error-box, .ok-box, .info-box {
  border-radius: var(--radius-s);
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 13px;
  border: 1px solid;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.error-box { background: var(--red-soft); border-color: rgba(255, 69, 58, 0.35); color: #ff9d97; }
.ok-box { background: var(--green-soft); border-color: rgba(48, 209, 88, 0.35); color: #7bf0a4; }
.info-box { background: var(--blue-soft); border-color: rgba(10, 132, 255, 0.35); color: #8fc2ff; }
.error { color: var(--red); }

.pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; justify-content: flex-end; }
.page-info { color: var(--muted-2); font-size: 12.5px; }

/* ---------------- Login: 3D aurora stage ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-wrap::before, .login-wrap::after {
  /* floating 3D orbs */
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: orbFloat 14s ease-in-out infinite alternate;
}
.login-wrap::before {
  width: 480px; height: 480px;
  left: -120px; top: -100px;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.55), transparent 65%);
}
.login-wrap::after {
  width: 420px; height: 420px;
  right: -110px; bottom: -90px;
  background: radial-gradient(circle, rgba(191, 90, 242, 0.4), transparent 65%);
  animation-delay: -7s;
}

@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 30px, 0) scale(1.12); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 390px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid var(--border-hi);
  border-radius: 26px;
  padding: 38px 32px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 40px 100px rgba(0, 0, 0, 0.65),
    0 0 80px rgba(10, 132, 255, 0.08);
  transform: perspective(900px) rotateX(1.5deg);
  transition: transform 0.3s ease;
}
.login-card:hover { transform: perspective(900px) rotateX(0deg); }

.login-card h1 {
  margin: 0 0 6px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.login-card .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }

/* ---------------- Dial tab ---------------- */
.dial-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.line-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.line-row:hover { border-color: var(--border-hi); }
.line-row .grow { flex: 1; min-width: 0; }

.voice-status { font-size: 12.5px; color: var(--muted); }
.voice-status .ok { color: var(--green); font-weight: 700; }
.voice-status .bad { color: var(--red); font-weight: 700; }
.voice-status .connecting { color: var(--amber); font-weight: 700; }

/* On-call card: the hero — 3D glass with a live green aura */
#onCallCard {
  border-color: rgba(48, 209, 88, 0.4) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 44px rgba(48, 209, 88, 0.14);
}

.lead-summary {
  display: flex;
  gap: 18px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.lead-summary .big-stat { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.lead-summary .k { color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

.incoming-banner {
  border-radius: var(--radius-s);
  padding: 13px 17px;
  margin-bottom: 14px;
  font-weight: 600;
  background: var(--green-soft);
  border: 1px solid rgba(48, 209, 88, 0.4);
  color: #7bf0a4;
  box-shadow: 0 0 30px rgba(48, 209, 88, 0.15);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 22px rgba(48, 209, 88, 0.12); }
  50% { box-shadow: 0 0 38px rgba(48, 209, 88, 0.28); }
}

/* Disposition buttons */
.disp-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--glass-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 11px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
}
.disp-btn:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.disp-btn.selected {
  background: linear-gradient(180deg, #2f9bff, #0a6fe0);
  border-color: transparent;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 16px rgba(10, 132, 255, 0.45);
}

/* Appointment slot grid */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 9px; margin: 12px 0; }
.slot-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--glass-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.slot-btn:hover { border-color: var(--blue); background: var(--blue-soft); }
.slot-btn.selected {
  background: linear-gradient(180deg, #2f9bff, #0a6fe0);
  border-color: transparent;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 16px rgba(10, 132, 255, 0.4);
}

.radio-row { display: flex; gap: 14px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.radio-row label { display: flex; gap: 7px; align-items: center; font-size: 13px; cursor: pointer; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--blue); width: 15px; height: 15px; }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 6, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 18px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(32, 32, 44, 0.92), rgba(18, 18, 26, 0.94));
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid var(--border-hi);
  border-radius: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 50px 120px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(10, 132, 255, 0.1);
  transform: perspective(1000px) rotateX(1deg);
  animation: modalIn 0.3s cubic-bezier(0.22, 0.9, 0.3, 1.2);
}
@keyframes modalIn {
  from { opacity: 0; transform: perspective(1000px) rotateX(6deg) translateY(24px); }
  to { opacity: 1; transform: perspective(1000px) rotateX(1deg) translateY(0); }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.modal-body { padding: 18px 24px; }
.modal-foot { padding: 0 24px 24px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-x {
  appearance: none;
  border: 0;
  background: var(--glass-2);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.modal-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.14); }

/* ---------------- Toasts ---------------- */
#toasts {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.toast {
  padding: 13px 17px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(20, 20, 30, 0.85);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border-hi);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: toastIn 0.3s cubic-bezier(0.22, 0.9, 0.3, 1.2);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.toast.good { border-color: rgba(48, 209, 88, 0.5); color: #7bf0a4; }
.toast.bad { border-color: rgba(255, 69, 58, 0.5); color: #ff9d97; }

/* ---------------- Misc ---------------- */
.hidden { display: none !important; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.block { display: block; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.idle { color: var(--muted-2); }
.success { color: var(--green); }
.failed { color: var(--red); }

/* Assign dropdown in queue rows */
.assign-select {
  max-width: 150px;
  padding: 6px 9px;
  font-size: 12.5px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px; border-radius: 20px; }
  .tabs { order: 3; flex-basis: 100%; }
  .userbox { margin-left: 0; }
  .card { padding: 17px; border-radius: 17px; }
  .grid.two { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Browser-agent badge variant */
.type-badge.browser {
  background: var(--blue-soft);
  border-color: rgba(10, 132, 255, 0.35);
  color: #6fb3ff;
}
