:root {
  --bg: #eef3ea;
  --panel: #f9fbf7;
  --surface: #ffffff;
  --surface-strong: #f4f8ef;
  --text: #17211b;
  --muted: #657164;
  --line: #d8e1d1;
  --accent: #14532d;
  --accent-strong: #0b3b1f;
  --accent-soft: #dff1e4;
  --danger: #b42318;
  --warning: #b54708;
  --shadow: 0 18px 45px rgba(20, 83, 45, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(20, 83, 45, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(84, 130, 53, 0.12), transparent 26%),
    linear-gradient(180deg, #f7faf4 0%, var(--bg) 100%);
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

.auth-shell,
.app-shell {
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 36px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(216, 225, 209, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.logo-wrap {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #edf5ec);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.auth-card h1 {
  margin: 16px 0 10px;
  font-size: 34px;
  line-height: 1.1;
}

.auth-card p {
  color: var(--muted);
  margin-bottom: 24px;
}

.auth-inline-link {
  margin-top: 14px;
}

.auth-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}

.auth-link-button:hover {
  transform: none;
  background: transparent;
  color: var(--accent-strong);
}

.auth-password-panel {
  margin-top: 10px;
  padding-top: 6px;
}

.field-grid,
.stats-grid,
.card-grid,
.two-col {
  display: grid;
  gap: 16px;
}

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

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

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

select[multiple],
.multi-select {
  min-height: 180px;
  padding-right: 8px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(20, 83, 45, 0.18);
  border-color: rgba(20, 83, 45, 0.35);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

button.secondary,
.button.secondary {
  background: #e7efe5;
  color: var(--text);
}

button.secondary:hover,
.button.secondary:hover {
  background: #dce8d8;
}

button.danger {
  background: var(--danger);
}

.mobile-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.mobile-nav-toggle:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.2);
}

.mobile-nav-toggle__bars {
  display: grid;
  gap: 4px;
}

.mobile-nav-toggle__line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(9, 16, 12, 0.54);
  transition: opacity 0.22s ease;
}

.mobile-nav-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

body.mobile-nav-lock {
  overflow: hidden;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  width: 210px;
  height: 100vh;
  padding: 28px 22px;
  background:
    linear-gradient(180deg, rgba(11, 59, 31, 0.98), rgba(20, 83, 45, 0.97)),
    var(--accent-strong);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  -ms-overflow-style: none;
  scrollbar-width: none; 
  overflow-y: auto;
  z-index: 20;
}

.brand {
  margin-bottom: 28px;
}

.brand h2 {
  margin: 12px 0 6px;
  font-size: 26px;
}

.brand p,
.nav-label,
.sidebar small {
  color: rgba(255, 255, 255, 0.72);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-label {
  margin: 18px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: white;
  border: 1px solid transparent;
}

.nav a.active,
.nav a:hover {
  background: rgba(249, 251, 247, 0.98);
  color: var(--text);
  border-color: rgba(216, 225, 209, 0.95);
}

.main {
  margin-left: 210px;
  min-height: 100vh;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-height: 50px;
}

.agent-shell {
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background:
    radial-gradient(circle at top left, rgba(20, 83, 45, 0.14), transparent 20%),
    linear-gradient(180deg, #f7faf4 0%, var(--bg) 100%);
}

.agent-shell::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}


.agent-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  margin-top: 0;
  padding: 10px 12px 0;
  background:
    linear-gradient(180deg, rgba(11, 59, 31, 0.98), rgba(20, 83, 45, 0.97)),
    var(--accent-strong);
  overflow-x: auto;
}

.agent-nav__brand {
  display: grid;
  gap: 4px;
  padding: 0 12px 10px 4px;
  margin-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  flex: 0 0 auto;
}

.agent-nav__brand h2 {
  margin: 0;
  font-size: 22px;
  color: white;
}

.agent-nav__links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
}

.agent-nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 10px 8px;
  flex: 0 0 auto;
}

.agent-nav--simple {
  gap: 14px;
  padding: 12px 16px;
  align-items: center;
  border-radius: 18px;
}

.agent-nav--simple .agent-nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin-right: 12px;
  border-right: 0;
}

.agent-nav__logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.agent-nav__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: white;
  white-space: nowrap;
}

.agent-nav--simple .agent-nav__links {
  gap: 6px;
}

.agent-nav--simple .agent-nav__actions {
  padding: 0;
}

.agent-nav a {
  padding: 10px 16px;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.agent-nav a:hover,
.agent-nav a.active {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-bottom-color: var(--panel);
}

.agent-main {
  padding: 0 20px 10px;
}

.agent-main.stack {
  gap: 0;
}

.agent-main.stack > * + * {
  margin-top: 0px;
}

.agent-main.stack > .agent-pagebar + * {
  margin-top: 0px;
}

.agent-pagebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  position: sticky;
  top: 0;
  z-index: 120;
  margin-bottom: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 20px;
  background:
    linear-gradient(180deg, rgba(9, 51, 27, 0.99), rgba(20, 83, 45, 0.96)),
    var(--accent-strong);
  box-shadow: 0 18px 42px rgba(11, 59, 31, 0.18);
}

.agent-pagebar__brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.agent-pagebar__logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  padding: 4px;
  box-shadow: 0 10px 24px rgba(20, 83, 45, 0.12);
}

.agent-pagebar__title {
  margin: 0;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: white;
}

.agent-pagebar h1 {
  color: white;
}

.agent-pagebar p {
  color: rgba(255, 255, 255, 0.82);
}

.agent-pagebar__right {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.agent-inline-nav {
  display: flex;
  gap: 0;
  align-self: stretch;
  align-items: stretch;
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.agent-inline-nav a {
  display: flex;
  align-items: center;
  height: 100%;
  flex: 0 0 auto;
  padding: 0 18px;
  border-radius: 0;
  text-decoration: none;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  border: 0;
  font-size: 16px;
  line-height: 1.2;
  transition: background 0.18s ease, color 0.18s ease;
}

.agent-inline-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.agent-inline-nav a.active {
  background: linear-gradient(180deg, #f7faf4, var(--bg));
  color: var(--text);
  box-shadow:
    inset 1px 0 0 rgba(216, 225, 209, 0.9),
    inset -1px 0 0 rgba(216, 225, 209, 0.9);
}

.agent-pagebar .secondary {
  flex: 0 0 auto;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.agent-pagebar .secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.summary-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

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

.summary-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.topbar h1 {
  margin-bottom: 6px;
  font-size: 30px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-idle {
  background: #edf2ed;
  color: #46604a;
}

.status-ringing,
.status-dialing {
  background: #fff1d6;
  color: var(--warning);
}

.status-talking {
  background: #ddf7e6;
  color: #137333;
}

.status-hold {
  background: #e7ebff;
  color: #3448b5;
}

.stack{
  display: grid;
  gap: 10px;
}

.card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 225, 209, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 50px;
}

.card h3 {
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
}

.stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 239, 0.95));
}

.stat-value {
  font-size: 34px;
  font-weight: 800;
  margin: 8px 0 6px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-strong);
  font-size: 13px;
  color: var(--muted);
}

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

.link-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf5ef;
  text-decoration: none;
}


.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.helper {
  font-size: 13px;
  color: var(--muted);
}

.secret-input {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.secret-input input {
  flex: 1 1 auto;
}

.secret-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7faf4, #edf4ea);
  border: 1px solid var(--line);
}

.secret-pill__value {
  display: inline-block;
  min-width: 120px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.secret-pill__value.is-masked {
  filter: blur(4px);
  opacity: 0.75;
  user-select: none;
}

.secret-toggle {
  min-width: 68px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.toolbar .compact-field,
.toolbar .compact-file {
  width: auto;
  flex: 0 1 260px;
}

.error {
  color: var(--danger);
}

.hidden {
  display: none;
}

.phone-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.phone-shell {
  display: grid;
  gap: 18px;
}

.phone-workspace {
  display: grid;
  justify-items: center;
  padding: 0 0 0px;
}

.phone-workspace--modal {
  padding: 0;
}

.phone-workspace__toolbar {
  width: min(760px, 100%);
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.phone-workspace__toolbar--modal {
  width: min(780px, 100%);
  margin-bottom: 14px;
}

.phone-modal-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.phone-modal-header__eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 83, 45, 0.08);
  color: #176733;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phone-modal-header__title {
  margin: 10px 0 6px;
  font-size: 28px;
  line-height: 1.12;
  color: #122033;
}

.phone-modal-header__meta {
  max-width: 480px;
  color: #667487;
}

.phone-console {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 340px);
  gap: 16px;
  align-items: stretch;
}

.phone-workspace--modal .phone-console {
  width: min(804px, 100%);
  grid-template-columns: minmax(0, 388px) minmax(0, 1fr);
  gap: 18px;
}

.phone-device {
  width: 100%;
}

.phone-sidepanel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  align-content: stretch;
  min-height: 100%;
}

.phone-workspace--modal .phone-sidepanel {
  gap: 12px;
}

.phone-device__frame {
  padding: 16px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(245, 247, 250, 0.98), rgba(235, 239, 244, 0.98)),
    #eef2f6;
  border: 1px solid rgba(196, 205, 217, 0.9);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.phone-workspace--modal .phone-device__frame {
  padding: 18px;
  border-radius: 24px;
  box-shadow:
    0 18px 34px rgba(15, 23, 42, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.phone-device__statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.phone-device__title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5f6b7a;
}

.phone-device__statusmeta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phone-device__timer {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.phone-screen {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.phone-screen--compact {
  padding: 0;
}

.phone-screen__label {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.phone-screen__connect {
  min-width: 96px;
  min-height: 42px;
  padding-inline: 12px;
}

.phone-screen__select {
  margin-bottom: 8px;
  min-height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
}

.phone-screen__identity {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-strong);
}

.phone-screen__number {
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid #b7c0cc;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  box-shadow: none;
}

.phone-screen__number:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.phone-screen__timer {
  font-size: 13px;
  font-weight: 800;
  color: #3f4c62;
  white-space: nowrap;
}

.phone-screen__number::placeholder {
  color: #8a958c;
  letter-spacing: 0;
}

.phone-screen__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.phone-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 4px;
}

.phone-key {
  min-height: 54px;
  padding: 6px;
  border-radius: 0;
  border: 1px solid #c7ced8;
  background:
    linear-gradient(180deg, rgba(244, 246, 248, 0.98), rgba(231, 236, 241, 0.96)),
    #edf1f4;
  color: #111827;
  display: grid;
  gap: 2px;
  justify-items: center;
  align-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.phone-key:hover {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(236, 241, 246, 0.98)),
    #f5f7fa;
}

.phone-key__digit {
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.phone-key__letters {
  min-height: 12px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.phone-tool-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 4px;
}

.phone-tool,
.phone-side-action {
  border-radius: 18px;
}

.phone-tool {
  min-height: 44px;
  background: linear-gradient(180deg, rgba(244, 246, 248, 0.98), rgba(231, 236, 241, 0.96));
  color: #4b5563;
  border: 1px solid #c7ced8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.phone-tool:hover {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(236, 241, 246, 0.98));
}

.phone-tool:disabled,
.phone-device-action:disabled,
.phone-side-action:disabled,
.phone-call-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.phone-tool svg,
.phone-device-action svg,
.phone-side-action svg,
.phone-call-action svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.phone-tool span {
  font-size: 22px;
  font-weight: 800;
}

.phone-action-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  gap: 6px;
  margin-top: 8px;
}

.phone-action-row--dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.phone-device-action,
.phone-side-action,
.phone-call-action {
  min-height: 52px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 1px 2px rgba(15, 23, 42, 0.08);
}

.phone-device-action {
  gap: 8px;
  padding-inline: 10px;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(244, 246, 248, 0.98), rgba(231, 236, 241, 0.96));
  color: #334155;
  border: 1px solid #c7ced8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.phone-device-action:hover,
.phone-device-action.is-active {
  background: linear-gradient(180deg, rgba(228, 236, 245, 0.98), rgba(215, 225, 236, 0.96));
  color: #0f172a;
}

.phone-side-action {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.phone-side-action:hover,
.phone-side-action.is-active {
  background: rgba(255, 255, 255, 0.2);
}

.phone-side-action--danger {
  background: rgba(180, 35, 24, 0.92);
  color: white;
}

.phone-side-action--danger:hover {
  background: #962617;
}

.phone-call-action {
  gap: 10px;
  padding-inline: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 0;
}

.phone-call-action--call {
  background: #16a34a;
  color: white;
}

.phone-call-action--call:hover {
  background: #15803d;
}

.phone-call-action--end {
  background: #dc2626;
  color: white;
}

.phone-call-action--end:hover {
  background: #b91c1c;
}

.phone-call-action span,
.phone-device-action span,
.phone-tool span,
.phone-side-action span {
  pointer-events: none;
}

.phone-message {
  flex: 1 1 auto;
  min-height: 20px;
  color: var(--muted);
}

.phone-message--device {
  margin-top: 8px;
  text-align: center;
}

.phone-panel-card {
  padding: 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d8dee8;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

.phone-panel-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.phone-panel-card__header h3 {
  margin-bottom: 4px;
}

.phone-panel-card__identity {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-strong);
  margin: 0;
  text-align: right;
}

.phone-panel-card__meta {
  margin-top: 6px;
  line-height: 1.45;
}

.phone-panel-card__meta--subtle {
  margin-top: 10px;
  font-size: 12px;
}

.phone-panel-card--compact {
  padding: 13px 14px;
}

.phone-panel-card--connection {
  background:
    linear-gradient(180deg, rgba(248, 251, 246, 0.98), rgba(255, 255, 255, 0.98)),
    #ffffff;
  border-color: #d7e1d5;
}

.frejun-dialer-host {
  display: grid;
}

.frejun-widget-stage {
  width: 100%;
  display: grid;
}

.frejun-dialer-card {
  display: grid;
  gap: 10px;
  min-height: 100%;
}

.frejun-dialer-card__account {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(196, 205, 217, 0.92);
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.frejun-dialer-card__frame {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(196, 205, 217, 0.92);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.frejun-dialer-card__frame iframe {
  display: block;
  width: 100%;
  min-height: 420px;
  border: 0;
  background: #f8fafc;
}

.phone-panel-card__topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.phone-panel-card__topline .phone-screen__label {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.phone-connect-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 8px;
  align-items: center;
}

.phone-connect-row .phone-screen__select {
  margin-bottom: 0;
}

.phone-sidepanel__actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.phone-panel-card--toggle {
  align-self: start;
}

.phone-panel-card--toggle .phone-sidepanel__actions {
  margin-top: 0;
}

.phone-sidepanel__actions--stacked {
  margin-bottom: 12px;
}

.phone-notes {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.phone-notes__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.phone-notes__header h3 {
  margin-bottom: 4px;
}

.phone-device__hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  text-align: left;
}

.phone-notes textarea {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  resize: none;
}

.phone-panel-card .phone-message {
  color: var(--muted);
}

.phone-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(11, 59, 31, 0.98), rgba(28, 97, 56, 0.92)),
    var(--accent-strong);
  color: white;
  box-shadow: 0 24px 60px rgba(11, 59, 31, 0.2);
}

.phone-hero h1 {
  margin: 14px 0 8px;
  font-size: 34px;
}

.phone-hero p {
  margin: 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
}

.phone-hero .eyebrow {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.phone-hero__actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.phone-panel,
.phone-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 40px rgba(20, 83, 45, 0.08);
}

.phone-panel--accent {
  background:
    linear-gradient(180deg, rgba(223, 241, 228, 0.95), rgba(255, 255, 255, 0.98)),
    var(--surface);
}

.phone-panel__heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.phone-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

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

.microsip-hero-card__heading {
  align-items: flex-start;
  gap: 16px;
}

.microsip-status-card__message {
  margin: 12px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #18352c;
  line-height: 1.5;
}

.microsip-dial-card__row {
  align-items: stretch;
}

.microsip-dial-card__row input {
  flex: 1 1 280px;
  min-width: 0;
}

.microsip-dial-card__row button {
  flex: 0 0 auto;
}

.microsip-did-list {
  margin-top: 14px;
}

.agent-provider-layout {
  display: grid;
  gap: 20px;
}

.agent-provider-layout--split {
  grid-template-columns: minmax(0, 1.58fr) minmax(360px, 0.92fr);
  align-items: start;
}

.agent-provider-layout--microsip-only {
  max-width: 460px;
  margin: 0 auto;
}

.agent-provider-layout__main,
.agent-provider-layout__rail {
  min-width: 0;
}

.agent-provider-layout__rail {
  display: grid;
  gap: 16px;
  align-content: start;
}

.didlogic-setup-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid #d8e3db;
  background:
    linear-gradient(180deg, rgba(238, 247, 241, 0.98), rgba(255, 255, 255, 0.98)),
    #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.didlogic-setup-card h2 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.05;
}

.didlogic-setup-card__downloads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}

.didlogic-setup-card__download {
  text-align: center;
  text-decoration: none;
}

.didlogic-setup-card__meta {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.didlogic-account-card--server {
  display: flex;
  align-items: center;
  gap: 10px;
}

.didlogic-copy-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #d6e4da;
  background: #f8fbf8;
}

.didlogic-copy-pill > strong,
.didlogic-copy-pill > code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.didlogic-copy-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #234635;
}

.didlogic-copy-icon:hover {
  background: rgba(35, 70, 53, 0.08);
}

.didlogic-copy-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.didlogic-meta-chip__label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4f6f60;
  white-space: nowrap;
}

.didlogic-credential-stack {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.didlogic-account-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #dbe7dd;
  background: rgba(255, 255, 255, 0.88);
}

.didlogic-account-card--empty {
  color: #456755;
  font-size: 14px;
  font-weight: 600;
}

.didlogic-account-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
}

.didlogic-account-row__label {
  font-size: 12px;
  font-weight: 700;
  color: #4f6f60;
  white-space: nowrap;
}

.didlogic-account-row__value {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #d6e4da;
  background: #f8fbf8;
  font-size: 13px;
  color: #173127;
  word-break: break-all;
}

.didlogic-account-row__value--code {
  font-family: "Consolas", "Courier New", monospace;
}

.didlogic-account-row strong.didlogic-account-row__value {
  font-family: inherit;
  font-weight: 800;
}

.agent-provider-layout--split .agent-provider-layout__rail {
  align-self: stretch;
}

.agent-provider-layout--split .didlogic-setup-card {
  max-height: 760px;
  height: 100%;
  overflow: auto;
}

.phone-identity {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 800;
}

.phone-checklist {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.phone-checklist div {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.phone-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.phone-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 12, 0.52);
  backdrop-filter: blur(6px);
}

.phone-modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px 26px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.99), rgba(236, 241, 246, 0.99)),
    #eef2f6;
  border: 1px solid rgba(196, 205, 217, 0.95);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.phone-workspace {
  position: relative;
}

.modal-card {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.modal-card__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 12, 0.48);
}

.modal-card__panel {
  position: relative;
  width: min(640px, calc(100vw - 24px));
  margin: 40px auto;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  box-shadow: 0 28px 72px rgba(9, 16, 12, 0.2);
}

.status-row-idle td {
  background: #f6faf4;
}

.status-row-ringing td,
.status-row-dialing td {
  background: #fff6e4;
}

.status-row-talking td {
  background: #e7f8eb;
}

.status-row-hold td {
  background: #eef0ff;
}

.phone-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.monitor-card {
  background: rgba(255, 255, 255, 0.95);
}

.monitor-main {
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  padding-top: 18px;
  padding-bottom: 18px;
}

.monitor-main > * {
  min-width: 0;
}

.monitor-topbar {
  min-height: 0;
  margin-bottom: 0;
}

.monitor-topbar h1 {
  margin: 0;
  font-size: 28px;
}

.monitor-hero,
.monitor-table-card {
  margin-top: 0;
}

.monitor-filter-bar {
  display: grid;
  gap: 6px;
  margin-top: 0;
}

.monitor-hero {
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 240, 0.97)),
    var(--surface);
}

.monitor-hero__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.monitor-hero__header h3 {
  margin: 0;
  font-size: 22px;
}

.monitor-hero__meta {
  white-space: nowrap;
}

.monitor-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.monitor-summary__card {
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(216, 225, 209, 0.92);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(20, 83, 45, 0.05);
}

.monitor-summary__card--total {
  box-shadow: inset 0 4px 0 rgba(20, 83, 45, 0.95), 0 8px 18px rgba(20, 83, 45, 0.05);
}

.monitor-summary__card--idle {
  box-shadow: inset 0 4px 0 #8aa088, 0 8px 18px rgba(20, 83, 45, 0.05);
}

.monitor-summary__card--ringing {
  box-shadow: inset 0 4px 0 #d89d2f, 0 8px 18px rgba(20, 83, 45, 0.05);
}

.monitor-summary__card--dialing {
  box-shadow: inset 0 4px 0 #7c9cc3, 0 8px 18px rgba(20, 83, 45, 0.05);
}

.monitor-summary__card--talking {
  box-shadow: inset 0 4px 0 #2f8a54, 0 8px 18px rgba(20, 83, 45, 0.05);
}

.monitor-summary__card--hold {
  box-shadow: inset 0 4px 0 #6473b8, 0 8px 18px rgba(20, 83, 45, 0.05);
}

.monitor-summary__label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.monitor-summary__value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.monitor-filters {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 1.9fr) minmax(150px, 0.65fr) minmax(230px, 1fr) 106px;
  gap: 10px;
  align-items: center;
}

.monitor-filters input,
.monitor-filters select,
.monitor-filters button {
  width: 100%;
  min-height: 42px;
}

.monitor-listen-message {
  display: block;
  margin-top: 0;
  padding: 6px 2px 0;
  border-radius: 12px;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.monitor-table-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.monitor-table-wrap {
  border-radius: 18px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.monitor-table {
  min-width: 1040px;
}

.monitor-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2f6ef;
}

.monitor-table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.monitor-table tbody tr {
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.monitor-table tbody tr:hover td {
  background-image: linear-gradient(0deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12));
}

.monitor-table .status-row-idle td {
  background: #f7faf6;
}

.monitor-table .status-row-ringing td {
  background: #fff7ea;
}

.monitor-table .status-row-dialing td {
  background: #f1f6ff;
}

.monitor-table .status-row-talking td {
  background: #ebf8ef;
}

.monitor-table .status-row-hold td {
  background: #f0f2ff;
}

.monitor-table .status-row-idle td:first-child {
  box-shadow: inset 4px 0 0 #8aa088;
}

.monitor-table .status-row-ringing td:first-child {
  box-shadow: inset 4px 0 0 #d89d2f;
}

.monitor-table .status-row-dialing td:first-child {
  box-shadow: inset 4px 0 0 #7c9cc3;
}

.monitor-table .status-row-talking td:first-child {
  box-shadow: inset 4px 0 0 #2f8a54;
}

.monitor-table .status-row-hold td:first-child {
  box-shadow: inset 4px 0 0 #6473b8;
}

.monitor-status-badge {
  min-width: 90px;
  justify-content: center;
  letter-spacing: 0.04em;
}

.monitor-did__value {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.monitor-agent-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.monitor-agent-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #d7e2d0;
  background: #edf4ea;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.monitor-traffic-cell {
  min-width: 150px;
}

.monitor-traffic-cell__value {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.monitor-updated {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.monitor-empty {
  font-size: 13px;
  color: var(--muted);
}

.monitor-listen-button {
  min-width: 84px;
  min-height: 40px;
}

.cdr-filters {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1.9fr) minmax(120px, 0.78fr) minmax(130px, 0.82fr) minmax(150px, 1fr) minmax(150px, 0.95fr) 104px;
  gap: 10px;
  align-items: center;
}

.cdr-filters--custom {
  grid-template-columns: minmax(200px, 1.55fr) minmax(110px, 0.72fr) minmax(120px, 0.78fr) minmax(140px, 0.92fr) minmax(140px, 0.92fr) minmax(135px, 0.86fr) minmax(135px, 0.86fr) 104px;
}

.recordings-filters {
  width: 100%;
  grid-template-columns: minmax(360px, 3.15fr) minmax(180px, 1.15fr) minmax(180px, 1.15fr) 104px;
}

.recordings-filters.cdr-filters--custom {
  grid-template-columns: minmax(280px, 2.3fr) minmax(170px, 1.08fr) minmax(170px, 1.08fr) minmax(145px, 0.92fr) minmax(145px, 0.92fr) 104px;
}

.lead-activity-topbar__actions {
  justify-content: flex-end;
  gap: 10px;
}

.lead-activity-topbar {
  max-height: none;
}

.lead-activity-topbar__pill {
  white-space: nowrap;
}

.lead-activity-filter-bar {
  display: grid;
  gap: 6px;
}

.lead-activity-filters {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 2.45fr) minmax(160px, 1fr) minmax(132px, 0.84fr) minmax(150px, 0.94fr) 116px;
  gap: 10px;
  align-items: center;
}

.lead-activity-filters--custom {
  grid-template-columns: minmax(240px, 1.75fr) minmax(150px, 0.92fr) minmax(128px, 0.8fr) minmax(140px, 0.88fr) minmax(140px, 0.88fr) minmax(140px, 0.88fr) 116px;
}

.lead-activity-filters input,
.lead-activity-filters select,
.lead-activity-filters button {
  width: 100%;
  min-height: 42px;
}

.lead-activity-message {
  margin-top: 2px;
}

.cdr-filters input,
.cdr-filters select,
.cdr-filters button {
  width: 100%;
  min-height: 42px;
}

.cdr-message {
  margin-top: 6px;
  font-size: 12px;
}

.cdr-main,
.recordings-main,
.leads-main,
.lead-activity-main {
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  padding-top: 18px;
  padding-bottom: 18px;
}

.leads-main {
  height: auto;
  max-height: none;
  grid-template-rows: auto auto auto;
  overflow-y: visible;
  overflow-x: hidden;
  padding-bottom: 24px;
}

.leads-main > * {
  min-width: 0;
}

.cdr-topbar,
.recordings-topbar,
.leads-topbar {
  min-height: 0;
  margin-bottom: 0;
}

.cdr-topbar h1,
.recordings-topbar h1,
.leads-topbar h1 {
  margin: 0;
  font-size: 28px;
}

.cdr-filter-bar,
.recordings-filter-bar {
  display: grid;
  gap: 6px;
  margin-top: 0;
}

.leads-controls {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.leads-controls__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.leads-controls__header h3 {
  margin: 0;
}

.leads-toolbar {
  width: 100%;
  gap: 10px;
}

.leads-toolbar--header {
  width: auto;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.leads-toolbar--filters {
  display: grid;
  grid-template-columns: minmax(0, 2.75fr) minmax(0, 1.05fr) minmax(0, 1.05fr) minmax(300px, 344px);
  align-items: center;
}

.leads-toolbar--filters .compact-field,
.leads-toolbar--filters button {
  width: 100%;
  min-width: 0;
}

.leads-toolbar .compact-field,
.leads-toolbar .compact-file {
  width: auto;
  flex: 0 1 168px;
}

.leads-search-input {
  flex: 1 1 260px;
  min-width: 0;
}

.leads-upload-input {
  flex: 0 1 210px;
}

.leads-sample-link {
  gap: 8px;
  text-decoration: none;
}

.leads-sample-link__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.leads-toolbar__spacer {
  flex: 1 1 auto;
}

.leads-upload-message {
  min-height: 18px;
}

.leads-batch-actions {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 344px;
  justify-self: end;
  padding: 10px 12px;
  border: 1px solid rgba(20, 83, 45, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(223, 241, 228, 0.72), rgba(247, 250, 244, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.leads-batch-actions__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.leads-batch-actions__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.leads-batch-actions__controls .compact-field,
.leads-batch-actions__controls button {
  width: 100%;
  min-width: 0;
}

.cdr-table-card,
.recordings-table-card {
  margin-top: 0;
  padding: 0px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lead-activity-table-card {
  margin-top: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cdr-table-wrap,
.recordings-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.lead-activity-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.leads-table-card {
  margin-top: 0;
  padding: 0;
  display: block;
  min-height: 640px;
}

.leads-table-wrap {
  min-height: 0;
  height: auto;
  max-height: none;
}

.leads-table {
  width: 100%;
  table-layout: fixed;
}

.leads-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.leads-table td {
  font-size: 14.5px;
  line-height: 1.45;
  vertical-align: middle;
}

.leads-table th:nth-child(1),
.leads-table td:nth-child(1) {
  width: 48px;
  text-align: center;
}

.leads-table th:nth-child(2),
.leads-table td:nth-child(2),
.leads-table th:nth-child(3),
.leads-table td:nth-child(3) {
  width: 148px;
}

.leads-table th:nth-child(4),
.leads-table td:nth-child(4) {
  width: 126px;
  white-space: nowrap;
}

.leads-table th:nth-child(5),
.leads-table td:nth-child(5) {
  width: 92px;
}

.leads-table th:nth-child(6),
.leads-table td:nth-child(6) {
  width: 132px;
}

.leads-table th:nth-child(7),
.leads-table td:nth-child(7) {
  width: 124px;
}

.leads-table__actions,
.dids-table__actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px;
}

.leads-table__action-button,
.dids-table__action-button {
  min-width: 64px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.leads-table__action-button.secondary,
.dids-table__action-button.secondary {
  background: linear-gradient(180deg, #eef4eb, #e3ede0);
  color: #193022;
  border: 1px solid #d2dfcf;
}

.leads-table__action-button.secondary:hover,
.dids-table__action-button.secondary:hover {
  background: linear-gradient(180deg, #f4f8f2, #e8f0e5);
}

.leads-table__action-button.danger,
.dids-table__action-button.danger {
  background: linear-gradient(180deg, #fff2ef, #ffe3dc);
  color: #9f231d;
  border: 1px solid #f5c2b6;
}

.leads-table__action-button.danger:hover,
.dids-table__action-button.danger:hover {
  background: linear-gradient(180deg, #fff6f3, #ffe8e1);
}

.leads-table__action-button {
  min-width: 0;
  padding-inline: 11px;
  font-size: 13px;
}

.dids-table__action-button {
  min-width: 68px;
}

.leads-table-footer {
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 20px 18px;
}

.leads-table-footer__controls {
  gap: 8px;
}

.leads-page-size-label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.leads-page-size-select {
  width: 92px;
  min-height: 40px;
}

.lead-agent-pill,
.lead-readonly-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.lead-agent-pill {
  background: #edf4ea;
  color: #27453a;
  border: 1px solid #d7e2d0;
}

.lead-agent-pill--empty {
  background: #e7f0ff;
  color: #2552b5;
  border-color: #c8dafd;
}

.leads-table th:nth-child(6),
.leads-table td:nth-child(6),
.leads-table th:nth-child(7),
.leads-table td:nth-child(7) {
  padding-left: 10px;
  padding-right: 10px;
}

.lead-readonly-pill {
  justify-content: flex-start;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f7faf6;
  color: var(--text);
}

.agents-main {
  gap: 10px;
}

.agents-topbar {
  min-height: 0;
  margin-bottom: 0;
}

.agents-topbar h1 {
  margin: 0;
  font-size: 28px;
}

.agents-topbar__actions {
  justify-content: flex-end;
}

.agents-filter-card,
.agents-table-card {
  margin-top: 0;
}

.agents-filter-card {
  padding: 18px 20px;
}

.agents-filters {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(0, 1.1fr) minmax(0, 1.15fr) 106px;
  gap: 10px;
  align-items: center;
}

.agents-filters input,
.agents-filters select,
.agents-filters button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
}

.agents-table-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 640px;
}

.agents-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}

.agents-table {
  width: 100%;
  table-layout: fixed;
}

.agents-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.agents-table td {
  font-size: 14.5px;
  line-height: 1.45;
  vertical-align: middle;
}

.agents-table th:nth-child(1),
.agents-table td:nth-child(1) {
  width: 160px;
}

.agents-table th:nth-child(2),
.agents-table td:nth-child(2) {
  width: 200px;
}

.agents-table th:nth-child(3),
.agents-table td:nth-child(3) {
  width: 126px;
  white-space: nowrap;
}

.agents-table th:nth-child(4),
.agents-table td:nth-child(4) {
  width: auto;
}

.agents-table th:nth-child(5),
.agents-table td:nth-child(5) {
  width: 162px;
}

.agent-did-list,
.agent-selected-dids {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-did-pill,
.agent-selected-did-pill,
.agent-empty-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.agent-did-pill,
.agent-selected-did-pill {
  background: #edf4ea;
  color: #27453a;
  border: 1px solid #d7e2d0;
}

.agent-empty-pill {
  background: #e7f0ff;
  color: #2552b5;
  border: 1px solid #c8dafd;
}

.agent-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.agent-actions__button {
  min-width: 64px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.agent-actions__button.secondary {
  background: linear-gradient(180deg, #eef4eb, #e3ede0);
  color: #193022;
  border: 1px solid #d2dfcf;
}

.agent-actions__button.secondary:hover {
  background: linear-gradient(180deg, #f4f8f2, #e8f0e5);
}

.agent-actions__button.danger {
  background: linear-gradient(180deg, #fff2ef, #ffe3dc);
  color: #9f231d;
  border: 1px solid #f5c2b6;
}

.agent-actions__button.danger:hover {
  background: linear-gradient(180deg, #fff6f3, #ffe8e1);
}

.agents-table-footer {
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 20px 18px;
}

.agents-table-footer__controls {
  gap: 8px;
}

.agents-page-size-label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.agents-page-size-select {
  width: 92px;
  min-height: 40px;
}

.agents-modal__panel {
  width: min(640px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  margin: 14px auto;
  overflow-y: auto;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 244, 0.98)),
    #ffffff;
}


.agents-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(216, 225, 209, 0.95);
}

.agents-modal__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.agents-modal__subtitle {
  max-width: 420px;
}

.agents-modal__close {
  min-width: 78px;
  min-height: 38px;
  padding-inline: 12px;
}

.agents-modal__section {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(216, 225, 209, 0.92);
  background: rgba(255, 255, 255, 0.92);
}

.agents-modal__section--soft {
  background: linear-gradient(180deg, rgba(243, 248, 239, 0.95), rgba(255, 255, 255, 0.98));
}

.agents-modal__section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.agents-modal__section-title {
  margin: 0;
  font-size: 15px;
}

.agents-modal__grid {
  gap: 12px;
}

.agents-modal__password-help {
  margin-top: 6px;
  font-size: 12px;
}

.agents-modal__did-help {
  margin-top: 8px;
  font-size: 12px;
}

.agents-did-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.agents-did-pane {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(216, 225, 209, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
}

.agents-did-pane--selected {
  background: linear-gradient(180deg, rgba(241, 247, 238, 0.95), rgba(255, 255, 255, 0.98));
}

.agents-did-pane__title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.agents-did-search {
  min-height: 36px;
  margin-bottom: 6px;
}

.agents-did-list {
  min-height: 96px;
  max-height: 96px;
  overflow-y: auto;
  display: grid;
  gap: 0;
}

.agents-did-list--selected {
  min-height: 96px;
  max-height: 96px;
}

.agents-did-list__empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 10px 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.agents-did-item {
  width: 100%;
  min-height: 32px;
  padding: 5px 2px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid #e1e8dc;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: none;
}

.agents-did-item:hover {
  background: rgba(20, 83, 45, 0.05);
}

.agents-did-item--selected {
  border-bottom-color: #d4e1cf;
}

.agents-did-item:last-child {
  border-bottom: 0;
}

.agents-did-item__main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.agents-did-item__value {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agents-did-item__status {
  flex: 0 0 auto;
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
}

.agents-did-item__action {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 800;
}

.agents-did-item--selected .agents-did-item__action {
  color: #9f231d;
}

.agents-modal__footer {
  margin-top: 12px;
  justify-content: flex-start;
  gap: 10px;
}

.agents-modal__primary,
.agents-modal__secondary {
  min-width: 104px;
  min-height: 40px;
}

.cdr-table,
.recordings-table {
  width: 100%;
  table-layout: fixed;
}

.lead-activity-table,
.lead-activity-history-table {
  width: 100%;
  table-layout: fixed;
}

.cdr-table th,
.recordings-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
}

.lead-activity-table th,
.lead-activity-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
}

.cdr-table td,
.recordings-table td {
  padding-top: 11px;
  padding-bottom: 11px;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lead-activity-table td,
.lead-activity-history-table td {
  padding-top: 11px;
  padding-bottom: 11px;
  font-size: 14.8px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.lead-activity-lead {
  display: grid;
  gap: 4px;
}

.lead-activity-lead__name {
  font-size: 15.2px;
  font-weight: 800;
  color: var(--text);
}

.lead-activity-lead__meta {
  font-size: 13.2px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-activity-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.8px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.lead-activity-status--yes {
  background: rgba(20, 83, 45, 0.12);
  color: var(--accent-strong);
}

.lead-activity-status--no {
  background: rgba(32, 94, 184, 0.12);
  color: #1d4ed8;
}

.lead-activity-history-button {
  min-width: 68px;
}

.lead-activity-footer {
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 20px 18px;
}

.lead-activity-footer__controls {
  gap: 8px;
}

.lead-activity-page-size-label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-activity-page-size-select {
  width: 88px;
  min-height: 38px;
  padding: 8px 10px;
}

.lead-activity-history-modal {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 36px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.lead-activity-history-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lead-activity-history-modal__title {
  margin: 0 0 4px;
  font-size: 24px;
}

.lead-activity-history-modal__table-wrap {
  max-height: min(520px, calc(100vh - 190px));
}

.cdr-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 10px;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.cdr-sort-button:hover,
.cdr-sort-button:focus-visible {
  transform: none;
  background: rgba(47, 111, 95, 0.08);
  color: #1f4d41;
  box-shadow: inset 0 0 0 1px rgba(47, 111, 95, 0.12);
}

.cdr-sort-button:focus-visible {
  outline: none;
}

.cdr-sort-button__indicator {
  font-size: 0;
  color: #2f6f5f;
}

.cdr-sort-button__indicator::before {
  content: "A-Z";
  font-size: 11px;
  letter-spacing: 0.04em;
}

.cdr-sort-button__indicator[data-state="asc"]::before {
  content: "ASC";
}

.cdr-sort-button__indicator[data-state="desc"]::before {
  content: "DESC";
}

.cdr-sort-button--active .cdr-sort-button__indicator {
  color: #1f4d41;
}

.cdr-sort-button--active {
  background: rgba(47, 111, 95, 0.1);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 95, 0.16);
}

.lead-activity-table th:nth-child(1),
.lead-activity-table td:nth-child(1) {
  width: 220px;
}

.lead-activity-table th:nth-child(2),
.lead-activity-table td:nth-child(2) {
  width: 138px;
  white-space: nowrap;
}

.lead-activity-table th:nth-child(3),
.lead-activity-table td:nth-child(3) {
  width: 140px;
}

.lead-activity-table th:nth-child(4),
.lead-activity-table td:nth-child(4) {
  width: 110px;
}

.lead-activity-table th:nth-child(5),
.lead-activity-table td:nth-child(5) {
  width: 174px;
  white-space: nowrap;
}

.lead-activity-table th:nth-child(7),
.lead-activity-table td:nth-child(7) {
  width: 96px;
}

.lead-activity-history-table th:nth-child(1),
.lead-activity-history-table td:nth-child(1) {
  width: 160px;
}

.lead-activity-history-table th:nth-child(2),
.lead-activity-history-table td:nth-child(2) {
  width: 110px;
}

.lead-activity-history-table th:nth-child(3),
.lead-activity-history-table td:nth-child(3) {
  width: 178px;
  white-space: nowrap;
}

.cdr-table th:nth-child(1),
.cdr-table td:nth-child(1) {
  width: 84px;
}

.cdr-table th:nth-child(2),
.cdr-table td:nth-child(2),
.cdr-table th:nth-child(3),
.cdr-table td:nth-child(3) {
  width: 148px;
  white-space: nowrap;
}

.cdr-table th:nth-child(4),
.cdr-table td:nth-child(4) {
  width: 110px;
}

.cdr-table th:nth-child(5),
.cdr-table td:nth-child(5) {
  width: 188px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.cdr-table th:nth-child(6),
.cdr-table td:nth-child(6) {
  width: 84px;
}

.cdr-table th:nth-child(7),
.cdr-table td:nth-child(7) {
  width: 148px;
}

.cdr-table td:nth-child(7) {
  white-space: nowrap;
}

.recordings-table th:nth-child(1),
.recordings-table td:nth-child(1),
.recordings-table th:nth-child(2),
.recordings-table td:nth-child(2) {
  width: 150px;
  white-space: nowrap;
}

.recordings-table th:nth-child(3),
.recordings-table td:nth-child(3) {
  width: 110px;
}

.recordings-table th:nth-child(4),
.recordings-table td:nth-child(4) {
  width: 150px;
  white-space: nowrap;
}

.recordings-table th:nth-child(5),
.recordings-table td:nth-child(5) {
  width: 220px;
}

.recordings-table audio {
  width: 100%;
  max-width: 200px;
}

.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 1080px) {
  .app-shell,
  .two-col,
  .field-grid.two,
  .stats-grid,
  .stats-grid.three,
  .card-grid,
  .phone-console,
  .phone-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: auto;
    height: auto;
    padding-bottom: 14px;
    position: relative;
    left: auto;
    top: auto;
    overflow: visible;
  }

  .app-shell {
    display: block;
  }

  .main {
    margin-left: 0;
    padding: 18px;
  }

  .monitor-main {
    height: auto;
    max-height: none;
    grid-template-rows: none;
    overflow: visible;
  }

  .cdr-main,
  .recordings-main,
  .leads-main,
  .lead-activity-main {
    height: auto;
    max-height: none;
    grid-template-rows: none;
    overflow: visible;
  }

  .phone-hero,
  .phone-panel__heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  .microsip-phone-grid {
    grid-template-columns: 1fr;
  }

  .agent-provider-layout--split {
    grid-template-columns: 1fr;
  }

  .monitor-hero__header,
  .monitor-summary,
  .monitor-filters,
  .cdr-filters,
  .agents-filters,
  .lead-activity-filters {
    grid-template-columns: 1fr;
    display: grid;
  }

  .leads-toolbar .compact-field,
  .leads-toolbar .compact-file,
  .leads-search-input {
    width: 100%;
    flex-basis: 100%;
    min-width: 0;
  }

  .microsip-dial-card__row > * {
    width: 100%;
    flex-basis: 100%;
  }

  .leads-toolbar--filters {
    grid-template-columns: 1fr;
  }

  .leads-batch-actions__controls {
    grid-template-columns: 1fr;
  }

  .leads-toolbar__spacer {
    display: none;
  }

  .agents-topbar__actions,
  .lead-activity-topbar__actions,
  .agents-table-footer,
  .agents-table-footer__controls,
  .lead-activity-footer,
  .lead-activity-footer__controls {
    width: 100%;
  }

  .agents-topbar__actions,
  .lead-activity-topbar__actions,
  .agents-table-footer,
  .lead-activity-footer {
    justify-content: flex-start;
  }

  .agent-actions {
    flex-wrap: wrap;
  }

  .agents-did-picker {
    grid-template-columns: 1fr;
  }

  .phone-screen__linebar,
  .phone-notes__header,
  .phone-panel-card__header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .phone-screen__connect,
  .phone-call-action {
    width: 100%;
  }

  .agent-pagebar,
  .agent-pagebar__right {
    align-items: stretch;
  }

  .agent-pagebar {
    margin-left: -20px;
    margin-right: -20px;
    flex-direction: column;
    min-height: 0;
  }

  .agent-inline-nav {
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
  }

  .agent-inline-nav a,
  .toolbar .compact-field,
  .toolbar .compact-file {
    width: 100%;
    flex-basis: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .agent-nav__brand {
    min-width: max-content;
  }

  .agent-nav__actions {
    padding-right: 4px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-backdrop {
    z-index: 130;
  }

  .topbar.mobile-nav-host {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .topbar.mobile-nav-host > * {
    min-width: 0;
  }

  .topbar.mobile-nav-host .mobile-nav-titleblock {
    min-width: 0;
  }

  .topbar.mobile-nav-host > :not(.mobile-nav-toggle):not(.mobile-nav-titleblock) {
    width: auto;
    justify-self: end;
  }

  .topbar.mobile-nav-host .mobile-nav-toggle {
    color: var(--text);
    background: #e7efe5;
    border-color: var(--line);
  }

  .topbar.mobile-nav-host .mobile-nav-toggle:hover {
    background: #dce8d8;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(292px, calc(100vw - 48px));
    height: 100dvh;
    padding: 18px 14px 16px;
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    z-index: 140;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    visibility: hidden;
    pointer-events: none;
  }

  .sidebar.is-mobile-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar .nav {
    grid-template-columns: 1fr;
  }

  .agent-pagebar {
    margin-left: -20px;
    margin-right: -20px;
    padding: 10px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 0;
  }

  .agent-pagebar__brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .agent-pagebar__title {
    font-size: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .agent-pagebar > .mobile-nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: white;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
  }

  .agent-pagebar__right {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(308px, calc(100vw - 28px));
    padding: 18px 14px 18px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 14px;
    background:
      linear-gradient(180deg, rgba(11, 59, 31, 0.99), rgba(20, 83, 45, 0.98)),
      var(--accent-strong);
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.26);
    transform: translateX(104%);
    transition: transform 0.24s ease;
    z-index: 140;
    visibility: hidden;
    pointer-events: none;
  }

  .agent-pagebar__right.is-mobile-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .agent-inline-nav {
    flex-direction: column;
    gap: 8px;
    width: 100%;
    overflow: visible;
  }

  .agent-inline-nav a {
    width: 100%;
    flex: 0 0 auto;
    min-height: 44px;
    white-space: normal;
    border-radius: 14px;
  }

  .agent-pagebar .secondary {
    width: 100%;
    margin-top: auto;
  }
}

@media (max-width: 768px) {
  .auth-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 24px;
    border-radius: 22px;
  }

  .logo-wrap {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .sidebar {
    padding: 18px 14px 16px;
  }

  .brand {
    margin-bottom: 18px;
  }

  .brand h2 {
    font-size: 22px;
  }

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

  .mobile-nav-toggle {
    color: var(--text);
    background: #e7efe5;
    border-color: var(--line);
  }

  .topbar.mobile-nav-host .mobile-nav-toggle:hover {
    background: #dce8d8;
  }

  .nav a {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .main {
    padding: 14px;
  }

  .topbar,
  .agents-topbar,
  .cdr-topbar,
  .recordings-topbar,
  .leads-topbar,
  .lead-activity-topbar,
  .monitor-topbar,
  .leads-controls__header,
  .leads-toolbar--header,
  .lead-activity-history-modal__header,
  .lead-activity-footer,
  .lead-activity-footer__controls,
  .agents-table-footer,
  .agents-table-footer__controls,
  .leads-table-footer,
  .leads-table-footer__controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .topbar h1,
  .agents-topbar h1,
  .cdr-topbar h1,
  .recordings-topbar h1,
  .leads-topbar h1,
  .lead-activity-topbar h1,
  .monitor-topbar h1 {
    font-size: 24px;
  }

  .stats-grid,
  .stats-grid.three,
  .card-grid,
  .two-col,
  .field-grid.two {
    grid-template-columns: 1fr;
  }

  .monitor-hero {
    padding: 14px;
  }

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

  .monitor-hero__meta,
  .lead-activity-topbar__pill {
    white-space: normal;
  }

  .leads-toolbar--header,
  .leads-toolbar,
  .agents-topbar__actions,
  .lead-activity-topbar__actions {
    width: 100%;
  }

  .leads-toolbar--header {
    align-items: stretch;
  }

  .leads-sample-link {
    justify-content: center;
  }

  .monitor-table,
  .cdr-table,
  .recordings-table,
  .lead-activity-table,
  .lead-activity-history-table,
  .leads-table,
  .agents-table {
    min-width: 720px;
  }

  .monitor-table th,
  .monitor-table td,
  .cdr-table th,
  .cdr-table td,
  .recordings-table th,
  .recordings-table td,
  .lead-activity-table th,
  .lead-activity-table td,
  .lead-activity-history-table th,
  .lead-activity-history-table td,
  .leads-table th,
  .leads-table td,
  .agents-table th,
  .agents-table td {
    padding: 10px 12px;
  }

  .phone-modal__panel,
  .modal-card__panel,
  .lead-activity-history-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    padding: 18px;
    border-radius: 20px;
  }

  .phone-workspace__toolbar--modal,
  .phone-workspace--modal .phone-console {
    width: 100%;
  }

  .phone-device__frame {
    padding: 14px;
    border-radius: 20px;
  }

  .phone-screen__number {
    font-size: 18px;
  }

  .phone-connect-row {
    grid-template-columns: 1fr;
  }

  .phone-action-row {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
  }

  .phone-panel-card__topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .phone-panel-card__identity {
    text-align: left;
  }

  .didlogic-setup-card__status {
    flex-direction: column;
    align-items: flex-start;
  }

  .didlogic-setup-card__downloads {
    grid-template-columns: 1fr;
  }

  .didlogic-setup-card__meta {
    grid-template-columns: 1fr;
  }

  .didlogic-account-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .didlogic-copy-pill {
    width: 100%;
  }

  .didlogic-account-card--server {
    width: 100%;
  }

  .phone-sidepanel {
    grid-template-rows: none;
    min-height: auto;
  }

  .phone-notes textarea {
    min-height: 120px;
    height: auto;
  }

  .agent-pagebar > .mobile-nav-toggle {
    color: white;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
  }
}

@media (max-width: 560px) {
  .nav {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 12px;
  }

  .topbar h1,
  .agents-topbar h1,
  .cdr-topbar h1,
  .recordings-topbar h1,
  .leads-topbar h1,
  .lead-activity-topbar h1,
  .monitor-topbar h1 {
    font-size: 22px;
  }

  .monitor-summary {
    grid-template-columns: 1fr;
  }

  .phone-modal__panel,
  .modal-card__panel,
  .lead-activity-history-modal {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    padding: 16px;
    border-radius: 18px;
  }

  .phone-action-row {
    grid-template-columns: 64px minmax(0, 1fr) 64px;
  }

  .monitor-table,
  .cdr-table,
  .recordings-table,
  .lead-activity-table,
  .lead-activity-history-table,
  .leads-table,
  .agents-table {
    min-width: 680px;
  }
}

@media (max-width: 1080px) {
  .app-shell,
  .main,
  .main.stack,
  .main.stack > *,
  .card,
  .topbar,
  .toolbar,
  .table-wrap,
  .cdr-filter-bar,
  .recordings-filter-bar,
  .lead-activity-filter-bar,
  .leads-controls,
  .leads-controls__header,
  .agents-filter-card,
  .agents-table-card,
  .lead-activity-table-card,
  .cdr-table-card,
  .recordings-table-card,
  .leads-table-card,
  .agent-shell,
  .agent-main,
  .agent-pagebar,
  .agent-pagebar__brand,
  .agent-pagebar__right {
    min-width: 0;
    max-width: 100%;
  }

  .app-shell,
  .main,
  .agent-shell,
  .agent-main {
    overflow-x: hidden;
  }

  .topbar,
  .agents-topbar,
  .cdr-topbar,
  .recordings-topbar,
  .leads-topbar,
  .lead-activity-topbar,
  .monitor-topbar,
  .leads-controls__header,
  .leads-toolbar--header,
  .agents-topbar__actions,
  .lead-activity-topbar__actions,
  .agents-table-footer,
  .agents-table-footer__controls,
  .leads-table-footer,
  .leads-table-footer__controls,
  .lead-activity-footer,
  .lead-activity-footer__controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    max-height: none;
  }

  .topbar > *,
  .toolbar > *,
  .leads-controls__header > * {
    min-width: 0;
  }

  .topbar > button.secondary,
  .agents-topbar__actions > button,
  .lead-activity-topbar__actions > button,
  .agents-table-footer__controls > *,
  .leads-table-footer__controls > *,
  .lead-activity-footer__controls > * {
    width: 100%;
  }

  .leads-toolbar--header {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .leads-toolbar--header .compact-file,
  .leads-toolbar--header button,
  .leads-toolbar--header .button {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }

  .leads-toolbar--filters,
  .cdr-filters,
  .cdr-filters--custom,
  .recordings-filters,
  .recordings-filters.cdr-filters--custom,
  .agents-filters,
  .lead-activity-filters,
  .lead-activity-filters--custom {
    grid-template-columns: 1fr;
  }

  .leads-batch-actions {
    max-width: none;
    justify-self: stretch;
  }

  .leads-batch-actions__controls {
    grid-template-columns: 1fr;
  }

  .leads-sample-link {
    justify-content: center;
  }

  .agents-table-footer__controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agents-page-size-label,
  .agents-page-size-select,
  .pagination {
    width: 100%;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .leads-table-card,
  .agents-table-card,
  .lead-activity-table-card,
  .cdr-table-card,
  .recordings-table-card {
    overflow: hidden;
  }

  .leads-table,
  .agents-table,
  .lead-activity-table {
    min-width: 640px;
    table-layout: auto;
  }

  .leads-table-wrap,
  .agents-table-wrap,
  .lead-activity-table-wrap,
  .cdr-table-wrap,
  .recordings-table-wrap {
    width: 100%;
    min-width: 0;
  }

  .leads-table__actions,
  .agent-actions {
    flex-wrap: wrap;
  }

  .leads-table__action-button,
  .agent-actions__button {
    min-width: 0;
  }

  .mobile-nav-toggle {
    position: relative;
    z-index: 145;
    display: inline-flex;
  }

  .sidebar {
    overflow-x: hidden;
  }

  .sidebar .brand,
  .sidebar .nav,
  .sidebar .nav a {
    min-width: 0;
  }

  .sidebar .nav a {
    white-space: normal;
  }

  body.mobile-nav-lock .agent-shell {
    overflow: hidden;
  }

  .agent-shell {
    overflow-x: hidden;
  }

  .agent-main {
    padding: 62px 16px 18px;
  }

  .agent-main.stack > .agent-pagebar + * {
    margin-top: 8px;
  }

  .agent-pagebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: normal;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 6px 16px;
    min-height: 48px;
    overflow: visible;
    z-index: 150;
  }

  .agent-pagebar__brand {
    display: flex;
    flex: 1 1 auto;
    max-width: calc(100% - 56px);
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .agent-pagebar__title {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .agent-pagebar > .mobile-nav-toggle {
    display: inline-flex;
    margin-left: auto;
    justify-self: end;
  }

  .agent-pagebar__right {
    flex: 0 0 auto;
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    width: min(292px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    margin-left: 0;
    padding: max(16px, env(safe-area-inset-top)) 14px 16px;
    background:
      linear-gradient(180deg, rgba(11, 59, 31, 0.99), rgba(20, 83, 45, 0.98)),
      var(--accent-strong);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    transform: translateX(-104%);
    z-index: 151;
    overflow-y: auto;
  }

  .agent-inline-nav,
  .agent-inline-nav a {
    width: 100%;
  }

  .agent-inline-nav {
    display: grid;
    gap: 8px;
  }

  .agent-inline-nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: white;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
  }

  .agent-inline-nav a:hover,
  .agent-inline-nav a.active {
    background: rgba(249, 251, 247, 0.98);
    color: var(--text);
    border-color: rgba(216, 225, 209, 0.95);
    box-shadow: none;
  }

  .agent-pagebar .secondary {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 768px) {
  .main {
    padding: 12px;
  }

  .card {
    padding: 16px;
    margin-top: 18px;
  }

  .agent-main {
    padding: 60px 12px 16px;
  }

  .agent-pagebar {
    padding: 6px 12px;
  }

  .agent-pagebar__title {
    font-size: 17px;
  }
}
