/* ============================================================
   VERCETTI PHONE — Vice City Neon
   Heavy pink/blue glow · 80s grid · palm motif · retrofuturistic
   ============================================================ */

:root {
  --bg-0: #050015;
  --bg-1: #0e0330;
  --bg-2: #1a0747;
  --neon-pink: #ff2cb1;
  --neon-pink-soft: #ff5dc8;
  --neon-blue: #2cd2ff;
  --neon-blue-soft: #5dc8ff;
  --neon-purple: #b85bff;
  --neon-yellow: #ffe93d;
  --text: #fbeaff;
  --text-dim: #b69cd8;
  --text-mute: #7e6ba3;
  --panel: rgba(14, 3, 48, 0.62);
  --panel-2: rgba(26, 7, 71, 0.55);
  --panel-edge: rgba(255, 44, 177, 0.22);
  --panel-edge-blue: rgba(44, 210, 255, 0.22);
  --ok: #6fffb1;
  --warn: #ffcb5d;
  --danger: #ff5d6d;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow-pink: 0 0 24px rgba(255, 44, 177, 0.35), 0 0 60px rgba(255, 44, 177, 0.15);
  --shadow-blue: 0 0 24px rgba(44, 210, 255, 0.35), 0 0 60px rgba(44, 210, 255, 0.15);
  --shadow-deep: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100dvh; overflow-x: hidden; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1400px 900px at 80% -20%, rgba(255, 44, 177, 0.30), transparent 60%),
    radial-gradient(1200px 800px at -20% 110%, rgba(44, 210, 255, 0.28), transparent 60%),
    radial-gradient(900px 600px at 50% 50%, rgba(184, 91, 255, 0.18), transparent 70%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 50%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Animated grid floor ---------- */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255, 44, 177, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 210, 255, 0.10) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent 0, transparent 55%, rgba(0,0,0,1) 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 55%, rgba(0,0,0,1) 100%);
  transform: perspective(800px) rotateX(60deg) translateY(40%) scale(2.4);
  transform-origin: 50% 100%;
  pointer-events: none;
  z-index: 0;
  animation: gridMove 20s linear infinite;
}
@keyframes gridMove {
  from { background-position: 0 0; }
  to { background-position: 0 48px; }
}
.bg-sun {
  position: fixed;
  bottom: 28%;
  left: 50%;
  width: 480px; height: 480px;
  margin-left: -240px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--neon-yellow) 0%, var(--neon-pink) 35%, var(--neon-purple) 65%, transparent 80%);
  filter: blur(20px) saturate(1.3);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: sunPulse 6s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.04); }
}
.bg-palms { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.25; }
.palm { position: absolute; bottom: -10px; width: 160px; height: 200px; filter: drop-shadow(0 0 12px rgba(255, 44, 177, 0.6)); }
.palm-l { left: -20px; transform: rotate(-8deg); }
.palm-r { right: -20px; transform: rotate(8deg) scaleX(-1); }

/* ---------- App shell ---------- */
#app {
  position: relative; z-index: 10;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
@media (max-width: 880px) {
  #app { grid-template-columns: 1fr; }
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, rgba(14, 3, 48, 0.85), rgba(5, 0, 21, 0.85));
  border-right: 1px solid var(--panel-edge);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  padding: 24px 16px;
  display: flex; flex-direction: column;
  height: 100dvh;
  position: sticky; top: 0;
}
@media (max-width: 880px) {
  .sidebar {
    position: fixed; bottom: 0; top: auto;
    left: 0; right: 0;
    height: auto;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    flex-direction: row;
    border-right: 0;
    border-top: 1px solid var(--panel-edge);
    z-index: 100;
    justify-content: space-around;
  }
}
.brand {
  font-family: 'Monoton', 'Impact', sans-serif;
  font-size: 28px;
  letter-spacing: 3px;
  line-height: 1;
  background: linear-gradient(135deg, var(--neon-pink) 0%, var(--neon-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 20px rgba(255, 44, 177, 0.4);
  margin-bottom: 4px;
}
.brand-sub {
  font-family: 'Audiowide', sans-serif;
  font-size: 9px;
  letter-spacing: 6px;
  color: var(--neon-blue-soft);
  margin-bottom: 28px;
}
@media (max-width: 880px) { .brand, .brand-sub { display: none; } }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  user-select: none;
  margin-bottom: 4px;
}
.nav-item:hover {
  background: rgba(255, 44, 177, 0.08);
  color: var(--text);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(255, 44, 177, 0.18), rgba(44, 210, 255, 0.18));
  color: var(--text);
  border-color: var(--panel-edge);
  box-shadow: var(--shadow-pink);
}
.nav-item .ico {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.nav-item .pill {
  margin-left: auto;
  background: var(--neon-pink);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 700;
}
@media (max-width: 880px) {
  .nav-item { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 10px; margin: 0; }
  .nav-item span:not(.ico):not(.pill) { font-size: 10px; }
  .nav-item .pill { position: absolute; top: 0; right: 0; }
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
@media (max-width: 880px) { .sidebar-foot { display: none; } }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin-bottom: 8px;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-blue));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  color: var(--bg-0);
}
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Main ---------- */
.main {
  padding: 24px 32px 32px;
  max-width: 1280px;
  width: 100%;
}
@media (max-width: 880px) {
  .main { padding: 16px 14px 90px; }
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title {
  font-family: 'Audiowide', sans-serif;
  font-size: 24px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--text) 0%, var(--neon-pink-soft) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
@media (max-width: 880px) { .page-title { font-size: 18px; } }

/* ---------- Status pill ---------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 500;
}
.status-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-mute);
  box-shadow: 0 0 8px currentColor;
}
.status-pill.ok { color: var(--ok); border-color: rgba(111, 255, 177, 0.25); }
.status-pill.ok .dot { background: var(--ok); color: var(--ok); }
.status-pill.warn { color: var(--warn); border-color: rgba(255, 203, 93, 0.25); }
.status-pill.warn .dot { background: var(--warn); color: var(--warn); animation: pulse 1s infinite; }
.status-pill.fail { color: var(--danger); border-color: rgba(255, 93, 109, 0.25); }
.status-pill.fail .dot { background: var(--danger); color: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- Panel / Card ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-deep);
  position: relative;
  overflow: hidden;
}
.panel.blue { border-color: var(--panel-edge-blue); box-shadow: var(--shadow-deep), 0 0 30px rgba(44, 210, 255, 0.1); }
.panel.glow { box-shadow: var(--shadow-deep), 0 0 40px rgba(255, 44, 177, 0.15); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.panel h2 {
  font-family: 'Audiowide', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neon-pink-soft);
  margin: 0;
}
.panel h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--text); }

/* Grids */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-stat-mobile { grid-template-columns: 1fr 1fr; }
}

/* ---------- Inputs ---------- */
.field-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-mute);
  margin: 14px 0 6px;
  font-weight: 600;
}
.input, select.input {
  width: 100%;
  background: rgba(5, 0, 21, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}
.input:focus {
  border-color: var(--neon-pink);
  box-shadow: 0 0 0 3px rgba(255, 44, 177, 0.18);
}
select.input { cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--neon-pink) 0%, var(--neon-purple) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  border: 0;
  border-radius: 12px;
  padding: 13px 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 44, 177, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.12s ease;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
  opacity: 0; transition: opacity 0.2s;
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn.blue { background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%); box-shadow: 0 8px 24px rgba(44, 210, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn.green { background: linear-gradient(135deg, #6fffb1 0%, #2cd2ff 100%); color: #050015; box-shadow: 0 8px 24px rgba(111, 255, 177, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.danger { background: linear-gradient(135deg, #ff5d6d 0%, #ff8a5d 100%); box-shadow: 0 8px 24px rgba(255, 93, 109, 0.35); }
.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  text-transform: none;
  letter-spacing: 0.3px;
  font-weight: 500;
}
.btn.secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--neon-pink); }
.btn.secondary.active {
  background: linear-gradient(135deg, var(--neon-pink) 0%, var(--neon-purple) 100%);
  color: #fff;
  border-color: var(--neon-pink);
  box-shadow: 0 0 18px rgba(255, 64, 195, 0.55), inset 0 1px 0 rgba(255,255,255,0.15);
  text-shadow: 0 0 8px rgba(255,255,255,0.6);
}
.incall-controls .btn { padding: 10px 16px; font-size: 13px; min-width: 92px; }
.btn.ghost {
  background: transparent;
  color: var(--neon-blue-soft);
  border: 1px solid var(--panel-edge-blue);
  box-shadow: none;
  text-transform: none;
}
.btn.sm { padding: 8px 12px; font-size: 12px; }
.btn.icon-only { padding: 10px; }

/* ---------- Dial Pad ---------- */
.dialpad-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}
@media (max-width: 1100px) {
  .dialpad-wrap { grid-template-columns: 1fr; }
}

.numdisp {
  font-family: 'Audiowide', sans-serif;
  font-size: 36px;
  letter-spacing: 3px;
  text-align: center;
  padding: 24px 18px;
  background: linear-gradient(135deg, rgba(5, 0, 21, 0.7), rgba(14, 3, 48, 0.4));
  border-radius: 14px;
  border: 1px solid rgba(255, 44, 177, 0.18);
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  text-shadow: 0 0 20px rgba(255, 44, 177, 0.5);
  word-break: break-all;
}
.numdisp.empty { color: var(--text-mute); font-size: 16px; letter-spacing: 4px; text-transform: uppercase; }

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.key {
  position: relative;
  padding: 22px 0 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  font-family: 'Audiowide', sans-serif;
}
.key:hover {
  background: linear-gradient(180deg, rgba(255, 44, 177, 0.18), rgba(44, 210, 255, 0.08));
  border-color: var(--neon-pink);
  box-shadow: 0 0 20px rgba(255, 44, 177, 0.25);
  transform: translateY(-1px);
}
.key:active {
  transform: translateY(1px) scale(0.97);
  background: linear-gradient(180deg, rgba(255, 44, 177, 0.3), rgba(44, 210, 255, 0.15));
}
.key .big { font-size: 28px; color: var(--text); }
.key .sub { font-size: 9px; color: var(--text-mute); letter-spacing: 2px; margin-top: 4px; display: block; min-height: 11px; }

.callbar { display: flex; gap: 12px; margin-top: 18px; }
.callbar .btn { flex: 1; padding: 18px; font-size: 16px; }
.btn-call { font-size: 18px !important; }

/* ---------- Stat cards ---------- */
.stat {
  background: linear-gradient(135deg, rgba(255, 44, 177, 0.12), rgba(44, 210, 255, 0.08));
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-deep);
}
.stat .label { font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: var(--text-dim); }
.stat .value { font-family: 'Audiowide', sans-serif; font-size: 30px; margin-top: 6px; background: linear-gradient(135deg, var(--neon-pink-soft), var(--neon-blue-soft)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .sub { font-size: 11px; color: var(--text-mute); margin-top: 4px; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
table.tbl th, table.tbl td { padding: 12px 10px; text-align: left; font-size: 13px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
table.tbl th { color: var(--text-mute); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; }
table.tbl tr:hover td { background: rgba(255, 44, 177, 0.04); }

/* ---------- Chips ---------- */
.chip {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-dim);
  margin-right: 4px;
  font-weight: 500;
}
.chip.pink, .chip.admin { background: rgba(255, 44, 177, 0.15); color: var(--neon-pink-soft); border-color: rgba(255, 44, 177, 0.3); }
.chip.blue { background: rgba(44, 210, 255, 0.15); color: var(--neon-blue-soft); border-color: rgba(44, 210, 255, 0.3); }
.chip.green, .chip.live { background: rgba(111, 255, 177, 0.15); color: var(--ok); border-color: rgba(111, 255, 177, 0.3); animation: livePulse 2s infinite; }
.chip.danger { background: rgba(255, 93, 109, 0.15); color: var(--danger); border-color: rgba(255, 93, 109, 0.3); }
@keyframes livePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(111, 255, 177, 0.4); } 50% { box-shadow: 0 0 0 8px rgba(111, 255, 177, 0); } }

/* ---------- Toasts ---------- */
#toast-stack {
  position: fixed; top: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; max-width: 360px;
}
.toast {
  background: rgba(14, 3, 48, 0.95);
  border: 1px solid var(--panel-edge);
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-deep);
  font-size: 14px;
  backdrop-filter: blur(20px);
  animation: slideInR 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.err { border-color: rgba(255, 93, 109, 0.5); box-shadow: var(--shadow-deep), 0 0 20px rgba(255, 93, 109, 0.2); }
.toast.ok { border-color: rgba(111, 255, 177, 0.5); box-shadow: var(--shadow-deep), 0 0 20px rgba(111, 255, 177, 0.2); }
@keyframes slideInR { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 9000;
  animation: fadeIn 0.2s ease;
}
.modal { max-width: 500px; width: 100%; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Login screen ---------- */
.center-screen {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  max-width: 420px; width: 100%;
  position: relative;
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-brand .logo {
  font-family: 'Monoton', sans-serif;
  font-size: 44px;
  letter-spacing: 5px;
  line-height: 1;
  background: linear-gradient(135deg, var(--neon-pink) 0%, var(--neon-blue) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(255, 44, 177, 0.5);
}
.login-brand .sub {
  font-family: 'Audiowide', sans-serif;
  font-size: 10px;
  letter-spacing: 8px;
  color: var(--neon-blue-soft);
  margin-top: 6px;
}

/* ---------- Live call cards (admin monitor) ---------- */
.livecall {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(255, 44, 177, 0.08), rgba(44, 210, 255, 0.06));
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.livecall::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--neon-pink), var(--neon-blue));
  animation: livePulse2 1.5s infinite;
}
@keyframes livePulse2 { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.livecall .lc-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-blue));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--bg-0);
}
.livecall .lc-info { min-width: 0; }
.livecall .lc-user { font-weight: 600; font-size: 14px; }
.livecall .lc-numbers { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.livecall .lc-dtmf { font-size: 13px; color: var(--neon-pink-soft); margin-top: 4px; letter-spacing: 4px; text-shadow: 0 0 8px rgba(255, 44, 177, 0.4); }
.livecall .lc-actions { display: flex; gap: 8px; }
@media (max-width: 700px) {
  .livecall { grid-template-columns: auto 1fr; padding: 14px; gap: 12px; }
  .livecall .lc-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .livecall .lc-actions .btn { width: 100%; padding: 10px 8px; font-size: 12px; min-width: 0; }
  .livecall .lc-actions .btn:nth-child(3) { grid-column: 1 / -1; } /* Force End full-width below Listen/Barge */
}

/* ---------- Mobile polish (forms, dialer, tables) ---------- */
@media (max-width: 700px) {
  .numdisp { font-size: 26px; letter-spacing: 2px; padding: 18px 10px; min-height: 72px; }
  .numdisp.empty { font-size: 13px; letter-spacing: 3px; }
  .key { padding: 16px 0 10px; }
  .key .big { font-size: 24px; }
  .callbar { gap: 8px; }
  .callbar .btn { padding: 14px 8px; font-size: 14px; }
  .incall-controls { display: flex; flex-wrap: wrap; gap: 8px; }
  .incall-controls .btn { padding: 10px 12px; font-size: 12px; min-width: 0; flex: 1 1 calc(33% - 6px); }
  table.tbl th, table.tbl td { padding: 10px 8px; font-size: 12px; }
  .topbar { gap: 10px; margin-bottom: 16px; }
  .panel { padding: 16px; }
  .panel-head h2 { font-size: 14px; letter-spacing: 1.5px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 24px; }
  .modal { padding: 16px; }
}
@media (max-width: 420px) {
  .grid-stat-mobile { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .value { font-size: 20px; }
  .numdisp { font-size: 22px; }
}

/* ---------- Responsive table→cards toggle ---------- */
.show-mobile { display: none; }
.show-desktop { display: block; }
@media (max-width: 700px) {
  .show-mobile { display: block; }
  .show-desktop { display: none; }
}

/* ---------- Admin Team: user cards (mobile) ---------- */
.user-cards { display: flex; flex-direction: column; gap: 12px; }
.user-card {
  background: linear-gradient(135deg, rgba(255, 44, 177, 0.07), rgba(44, 210, 255, 0.05));
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  padding: 14px;
}
.user-card .uc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.user-card .uc-name { font-size: 15px; }
.user-card .uc-user { font-size: 12px; }
.user-card .uc-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,0.04); font-size: 12px; flex-wrap: wrap; }
.user-card .uc-label { color: var(--text-mute); text-transform: uppercase; font-size: 10px; letter-spacing: 1.5px; font-weight: 600; align-self: center; }
.user-card .uc-val { text-align: right; min-width: 0; flex: 1; word-break: break-word; }
.user-card .uc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.user-card .uc-actions .btn { width: 100%; padding: 10px 8px; font-size: 12px; }

/* ---------- Call History: mobile cards ---------- */
.hist-cards { display: flex; flex-direction: column; gap: 10px; }
.hist-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.hist-card .hc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hist-card .hc-num { font-size: 15px; font-weight: 600; word-break: break-all; }
.hist-card .hc-arrow { font-weight: 700; margin-right: 4px; }
.hist-card .hc-arrow.outbound { color: var(--neon-pink-soft); }
.hist-card .hc-arrow.inbound { color: var(--neon-blue-soft); }
.hist-card .hc-mid { font-size: 12px; }
.hist-card .hc-user { color: var(--neon-blue-soft); font-weight: 600; }
.hist-card .hc-act { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ---------- Safe-area + bottom-nav scrolling ---------- */
@media (max-width: 880px) {
  /* iOS notch / Dynamic Island padding at top */
  .main { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  /* Horizontal scroll for nav so 6+ items stay tappable on narrow phones */
  .sidebar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; justify-content: flex-start; gap: 6px; }
  .sidebar::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; min-width: 60px; }
  /* Hard-stop horizontal overflow from any wide content */
  body, #app, .main { overflow-x: hidden; max-width: 100vw; }
}

/* ---------- Admin Team: DID cards (mobile) ---------- */
.did-cards { display: flex; flex-direction: column; gap: 10px; }
.did-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 12px 14px;
}
.did-card .did-num { font-size: 15px; }
.did-card .did-meta { font-size: 12px; margin-top: 4px; }

/* ---------- Misc ---------- */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.mono { font-family: ui-monospace, 'SF Mono', Monaco, monospace; font-size: 12px; }
.divider { height: 1px; background: rgba(255, 255, 255, 0.06); margin: 18px 0; border: 0; }
hr { border: 0; height: 1px; background: rgba(255, 255, 255, 0.06); margin: 18px 0; }
.spacer { height: 18px; }

#remoteAudio, #monitorAudio { position: absolute; left: -9999px; }

/* Loading shimmer */
.shimmer { background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; height: 14px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
