/* VOIP dashboard UI */

:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-hover: #fafbfc;
  --border: #e4e6ea;
  --text: #16181d;
  --muted: #697077;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-ink: #4f46e5;
  --inbound: #059669;
  --inbound-soft: #d1fae5;
  --outbound: #7c3aed;
  --outbound-soft: #ede9fe;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --chart-bar: #c7d2fe;
  --note-bg: #fffbeb;
  --note-border: #fde68a;
  --pill-bg: #eef0f3;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* Dark mode: OS preference (unless overridden by data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #181b21;
    --surface-hover: #1e222a;
    --border: #2a2e36;
    --text: #e7e9ee;
    --muted: #9aa1ab;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-soft: rgba(99, 102, 241, 0.16);
    --accent-ink: #a5b4fc;
    --inbound: #34d399;
    --inbound-soft: rgba(52, 211, 153, 0.14);
    --outbound: #a78bfa;
    --outbound-soft: rgba(167, 139, 250, 0.14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.14);
    --chart-bar: #4338ca;
    --note-bg: rgba(251, 191, 36, 0.08);
    --note-border: rgba(251, 191, 36, 0.25);
    --pill-bg: #262a32;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

/* Explicit dark override (in-app toggle) */
[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #181b21;
  --surface-hover: #1e222a;
  --border: #2a2e36;
  --text: #e7e9ee;
  --muted: #9aa1ab;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-ink: #a5b4fc;
  --inbound: #34d399;
  --inbound-soft: rgba(52, 211, 153, 0.14);
  --outbound: #a78bfa;
  --outbound-soft: rgba(167, 139, 250, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --chart-bar: #4338ca;
  --note-bg: rgba(251, 191, 36, 0.08);
  --note-border: rgba(251, 191, 36, 0.25);
  --pill-bg: #262a32;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* ---------- Side nav ---------- */

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

.side-nav {
  width: 230px;
  flex-shrink: 0;
  background: #16181d;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.875rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.side-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  padding: 0.25rem 0.625rem 1.25rem;
}

.side-nav__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
}

.side-nav__links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.side-nav__link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: #9aa1ab;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 0.625rem;
  border-radius: 8px;
  white-space: nowrap;
}

.side-nav__icon {
  font-size: 0.95rem;
  width: 1.35rem;
  text-align: center;
  flex-shrink: 0;
}

.side-nav__label--short {
  display: none;
}

.side-nav__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.side-nav__link--active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.side-nav__tools {
  display: flex;
  flex-direction: row;
  gap: 0.375rem;
  padding: 0.5rem 0.625rem 0;
  margin-top: auto;
}

.side-nav__theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #9aa1ab;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.side-nav__theme-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.side-nav__user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.875rem 0.625rem 0;
  margin-top: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-nav__user-name {
  font-size: 0.8rem;
  color: #9aa1ab;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav__signout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #9aa1ab;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.side-nav__signout:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Mobile-only avatar menu (hidden on desktop, where the sidebar shows
   the switcher and sign-out inline) */
.user-menu {
  display: none;
  position: relative;
}

.user-menu__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.user-menu__trigger::-webkit-details-marker {
  display: none;
}

.user-menu[open] .user-menu__trigger {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 230px;
  background: #16181d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.user-menu__name {
  margin: 0;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.user-menu__email {
  margin: 0;
  color: #9aa1ab;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu__switcher {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-menu__passkeys {
  display: block;
  margin-top: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #e7e9ee;
  text-decoration: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.user-menu__passkeys:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-menu__signout {
  width: 100%;
  margin-top: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e7e9ee;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.user-menu__signout:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.account-switcher {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 0.625rem 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 1rem;
}

.account-switcher__label {
  font-size: 0.7rem;
  color: #9aa1ab;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.account-switcher__select {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.account-switcher__select:focus {
  outline: none;
  border-color: var(--accent);
}

.account-switcher__select option {
  color: var(--text);
}

.app-content {
  flex: 1;
  min-width: 0;
}

/* ---------- Login ---------- */

.app-shell--login {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(50rem 30rem at 50% -10%, rgba(79, 70, 229, 0.14), transparent 65%),
    var(--bg);
}

.app-shell--login .app-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem;
}

.app-shell--login .main {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.app-shell--login .flash {
  width: 100%;
  max-width: 24rem;
  margin: 0 0 1rem;
  text-align: center;
}

.login-card {
  width: 100%;
  max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 12px 32px -12px rgba(16, 24, 40, 0.18);
  padding: 2.5rem 2rem 2rem;
}

.login-card__brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.login-card__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, 0.6);
}

.login-card__title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  text-align: center;
}

.login-card__subtitle {
  margin: 0.35rem 0 1.75rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.login-form__row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.login-form__row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.login-form__row input {
  width: 100%;
  padding: 0.7rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-form__row input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.login-form__row input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-form__submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  border-radius: 10px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-card__passkey-status {
  margin: 0.4rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.login-card__alt {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.login-card__alt a {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.login-card__alt a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .app-shell--login .main {
    padding: 0;
  }

  .login-card {
    padding: 2rem 1.5rem 1.5rem;
  }
}

@media (max-width: 760px) {
  .app-shell {
    flex-direction: column;
  }

  /* Slim top bar: brand + account switcher */
  .side-nav {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    padding-top: calc(0.5rem + env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 20;
    overflow-y: visible;
  }

  .side-nav__brand {
    padding: 0;
  }

  /* Links become a fixed bottom tab bar */
  .side-nav__links {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    flex-direction: row;
    flex: none;
    gap: 0;
    background: #16181d;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .side-nav__link {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    min-height: 52px;
    padding: 0.4rem 0.2rem;
    border-radius: 0;
    font-size: 0.65rem;
    text-align: center;
  }

  .side-nav__icon {
    font-size: 1.15rem;
    width: auto;
  }

  .side-nav__label--full {
    display: none;
  }

  .side-nav__label--short {
    display: inline;
  }

  .side-nav__link--active {
    background: none;
    color: #fff;
  }

  /* Collapse the inline switcher and sign-out into the avatar menu */
  .side-nav > .account-switcher,
  .side-nav__user {
    display: none;
  }

  .user-menu {
    display: block;
    margin-left: auto;
  }

  /* Keep content clear of the fixed tab bar */
  .main {
    padding: 1.25rem 1rem calc(4.5rem + env(safe-area-inset-bottom));
  }

  .reply-panel {
    bottom: calc(3.75rem + env(safe-area-inset-bottom));
  }
}

/* ---------- Accounts page ---------- */

.account-form__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.account-form__fields input[type="text"],
.account-form__fields input[type="tel"] {
  flex: 1 1 200px;
}

.account-form__hint {
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
}

.admin-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

.accounts-table__actions {
  white-space: nowrap;
  text-align: right;
}

.accounts-table__actions form {
  display: inline-block;
}

.webhook-url {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
}

/* ---------- Phone number chips ---------- */

.accounts-table__numbers {
  max-width: 22rem;
}

.number-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 0.15rem 0.3rem 0.15rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0.35rem 0.35rem 0;
  white-space: nowrap;
}

.number-chip__remove-form {
  display: inline-flex;
}

.number-chip__remove {
  background: transparent;
  border: none;
  color: var(--accent-ink);
  opacity: 0.6;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: 50%;
}

.number-chip__remove:hover {
  opacity: 1;
  background: rgba(79, 70, 229, 0.15);
}

.number-add-form {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.number-add-form__input {
  width: 9.5rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.8rem;
}

.number-add-form__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

/* ---------- Phone number cards ---------- */

.number-card__number {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.number-card__label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.number-settings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.toggle-row__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.9rem;
}

.toggle-row__hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.toggle-row--disabled {
  opacity: 0.45;
  cursor: default;
}

.number-settings__announcement {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-left: 1.75rem;
}

.number-settings__announcement input {
  max-width: 32rem;
}

.number-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.panel__heading-hint a {
  color: inherit;
}

.calls-table__subline {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.1rem;
}

.calls-table__subline--mono {
  font-family: monospace;
  letter-spacing: 0.02em;
}

.calls-table__activity-link {
  color: var(--muted);
  text-decoration: none;
}

.calls-table__activity-link:hover {
  color: var(--accent);
}

.calls-table__activity-sep {
  margin: 0 0.2rem;
  color: var(--border);
}

/* ---------- Conversations ---------- */

.conversation-list {
  list-style: none;
  padding: 0;
  margin: 0 -1.5rem -1.25rem;
}

.conversation-item {
  border-top: 1px solid var(--border);
}

.conversation-item__link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.5rem;
  text-decoration: none;
  color: inherit;
}

.conversation-item__link:hover {
  background: var(--surface-hover);
}

.conversation-item__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.conversation-item__avatar--lg {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.conversation-item__main {
  flex: 1;
  min-width: 0;
}

.conversation-item__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.conversation-item__contact {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9rem;
}

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

.conversation-item__preview {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item__you {
  font-weight: 600;
}

/* ---------- Message thread ---------- */

.thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.thread--transcript,
.thread--compact {
  margin-top: 0;
}

.thread--compact .bubble {
  max-width: 85%;
  padding: 0.45rem 0.7rem;
}

.thread--compact .bubble__body {
  font-size: 0.85rem;
}

.thread--transcript .bubble {
  max-width: 85%;
  padding: 0.5rem 0.75rem;
}

.thread--transcript .bubble__body {
  font-size: 0.875rem;
}

.thread__day {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.5rem;
}

.bubble-row {
  display: flex;
}

.bubble-row--inbound {
  justify-content: flex-start;
}

.bubble-row--outbound {
  justify-content: flex-end;
}

.bubble {
  max-width: 70%;
  padding: 0.6rem 0.875rem;
  border-radius: 16px;
}

.bubble--inbound {
  background: var(--bg);
  border-bottom-left-radius: 4px;
}

.bubble--outbound {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble__meta {
  display: block;
  font-size: 0.68rem;
  margin-top: 0.25rem;
  opacity: 0.65;
  text-align: right;
}

/* ---------- Layout ---------- */

.main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.flash {
  max-width: 64rem;
  margin: 1rem auto -1rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.flash--notice {
  background: var(--inbound-soft);
  color: var(--inbound);
}

.flash--alert {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Dashboard header ---------- */

.dashboard__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard__header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.dashboard__date {
  color: var(--muted);
  font-size: 0.875rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

/* ---------- Stat cards ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-card__value--inbound {
  color: var(--inbound);
}

.stat-card__value--outbound {
  color: var(--outbound);
}

.stat-card__value--missed {
  color: var(--danger);
}

.stat-card__hint {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}

.panel + .panel,
.panel--calls {
  margin-top: 1.5rem;
}

.panel__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel__heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.panel__heading-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
}

a.panel__heading-hint:hover {
  color: var(--accent-ink);
}

/* ---------- Bar chart ---------- */

.panel--chart {
  margin-bottom: 1.5rem;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.bar-chart__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.bar-chart__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar-chart__bar-track {
  width: 100%;
  max-width: 56px;
  height: 110px;
  display: flex;
  align-items: flex-end;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.bar-chart__bar {
  width: 100%;
  min-height: 3px;
  background: var(--chart-bar);
  border-radius: 6px 6px 0 0;
  transition: height 0.3s ease;
}

.bar-chart__bar--today {
  background: var(--accent);
}

.bar-chart__day {
  font-size: 0.75rem;
  color: var(--muted);
}

.bar-chart--dense {
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 3px;
}

.bar-chart__bar-track--short {
  height: 80px;
  max-width: none;
  border-radius: 3px;
}

.bar-chart--dense .bar-chart__bar {
  border-radius: 3px 3px 0 0;
}

/* ---------- Dashboard split + horizontal bars ---------- */

.dashboard__split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: stretch;
}

.dashboard__split > .panel {
  margin-top: 0;
}

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

.hbar-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.hbar {
  display: grid;
  grid-template-columns: 7.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.75rem;
}

.hbar__label {
  font-size: 0.85rem;
  color: var(--text);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hbar__label--mono {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: none;
}

.hbar__track {
  background: var(--bg);
  border-radius: 5px;
  height: 14px;
  overflow: hidden;
}

.hbar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 5px;
  min-width: 2px;
}

.hbar__fill--alt {
  background: var(--inbound);
}

.hbar__count {
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--muted);
}

/* ---------- Filters ---------- */

.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filters-bar .filters__search {
  flex: none;
  width: 100%;
}

.filters-bar__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.segmented__option {
  position: relative;
  cursor: pointer;
}

.segmented__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented__option span {
  display: inline-block;
  padding: 0.32rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.segmented__option:hover span {
  color: var(--text);
}

.segmented__option:has(input:checked) span {
  background: var(--accent);
  color: #fff;
}

.segmented__option:has(input:focus-visible) span {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

@media (max-width: 760px) {
  .filters-bar__row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .filters-bar__row > * {
    flex-shrink: 0;
  }
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filters__search {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
}

.filters__select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}

/* Only stretch search fields when they sit in a row of filters */
.filters .filters__search,
.account-form__fields .filters__search,
.filters-bar__row .filters__search {
  flex: 1 1 220px;
}

.filters__search:focus,
.filters__select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ---------- Calls table ---------- */

.calls-table-wrap {
  overflow-x: auto;
  margin: 0 -1.5rem -1.25rem;
}

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

.calls-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.calls-table th:first-child,
.calls-table td:first-child {
  padding-left: 1.5rem;
}

.calls-table th:last-child,
.calls-table td:last-child {
  padding-right: 1.5rem;
}

.calls-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.calls-table tbody tr:last-child td {
  border-bottom: none;
}

.calls-table__row {
  cursor: pointer;
}

.calls-table__row:hover {
  background: var(--surface-hover);
}

.calls-table__number {
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

.calls-table__number a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.calls-table__number a:hover {
  color: var(--accent-ink);
}

.calls-table__number-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.calls-table__number-sub {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.calls-table__duration {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

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

.calls-table__badges {
  white-space: nowrap;
}

/* ---------- Badges and pills ---------- */

.dir-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}

.dir-icon--inbound {
  background: var(--inbound-soft);
  color: var(--inbound);
}

.dir-icon--outbound {
  background: var(--outbound-soft);
  color: var(--outbound);
}

.dir-icon--lg {
  width: 44px;
  height: 44px;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.status-pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--pill-bg);
  color: var(--muted);
  text-transform: capitalize;
}

.status-pill--completed {
  background: var(--inbound-soft);
  color: var(--inbound);
}

.status-pill--in-progress,
.status-pill--ringing {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.status-pill--no-answer,
.status-pill--busy {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill--failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-right: 0.25rem;
}

.mini-badge--note {
  background: var(--warning-soft);
  color: var(--warning);
}

/* ---------- Nav badge (unread count) ---------- */

.nav-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  background: #e53e3e;
  color: #fff;
  flex-shrink: 0;
}

/* ---------- Unread indicators ---------- */

.calls-table__row--unread td:first-child {
  border-left: 3px solid var(--accent);
  padding-left: calc(1.5rem - 3px);
}

.calls-table__row--unread .calls-table__number a,
.calls-table__row--unread .calls-table__number span:first-child {
  font-weight: 700;
  color: var(--text);
}

.conversation-item--unread {
  border-left: 3px solid var(--accent);
}

.conversation-item--unread .conversation-item__link {
  padding-left: calc(1.5rem - 3px);
}

/* ---------- Empty state ---------- */

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

.empty-state--compact {
  padding: 1rem 0;
  text-align: left;
}

.empty-state__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.empty-state__icon {
  display: block;
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.empty-state__hint {
  font-size: 0.875rem;
  max-width: 32rem;
  margin: 0.5rem auto 0;
}

.empty-state .btn {
  margin-top: 1rem;
}

.empty-state__hint--technical {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
}

.empty-state--compact a {
  color: var(--accent-ink);
}

.empty-state code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  font-size: 0.8rem;
  word-break: break-all;
}

/* ---------- Call detail ---------- */

.back-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.back-link-row .back-link {
  margin-bottom: 0;
}

.back-link:hover {
  color: var(--accent-ink);
}

.call-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.call-hero__main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.call-hero__heading {
  min-width: 0;
}

.call-hero__name {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-hero__sub {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.call-hero__sub .dir-icon {
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
}

.call-hero__number-sub {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.call-hero__actions {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Icon action bar (call detail) ---------- */

.action-bar {
  display: flex;
  gap: 0.125rem;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.action-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.action-btn--primary {
  color: var(--accent-ink);
}

.action-btn--primary:hover {
  color: var(--accent-hover);
  background: var(--accent-soft);
}

.action-btn__form {
  display: contents;
}

.call-hero__chips {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.call-detail__col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.call-detail__col .panel + .panel {
  margin-top: 0;
}

.detail-list {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.detail-list__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-list__row:last-child {
  border-bottom: none;
}

.detail-list dt {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  flex-shrink: 0;
}

.detail-list dd {
  margin: 0;
  font-size: 0.875rem;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-list__mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.call-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 720px) {
  .call-detail__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .call-hero {
    padding: 1.25rem;
  }

  .action-bar {
    width: 100%;
    justify-content: center;
  }

  .dashboard__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.recording-player {
  width: 100%;
}

/* ---------- Transcription ---------- */

.transcription-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transcription-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
}

.transcription-item p {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.transcription-item__meta {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---------- Notes ---------- */

.notes-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.note-item {
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
}

.note-item p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.note-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.note-item__meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.note-form textarea {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  resize: vertical;
  background: var(--surface);
}

.note-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.3;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--secondary {
  background: var(--surface);
  color: var(--accent-ink);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--accent-soft);
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
}

.btn--ghost:hover {
  color: var(--danger);
}

.btn--danger {
  color: var(--danger) !important;
}

.btn--danger:hover {
  background: var(--danger-soft);
}

.btn--small {
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Contact + compose forms ---------- */

.contact-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.contact-form--stacked .form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.contact-form--stacked label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-form--stacked textarea,
.contact-form--stacked input,
.contact-form--stacked select {
  width: 100%;
  max-width: 28rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-actions .btn--danger {
  margin-left: auto;
}

/* ---------- Contact edit page ---------- */

.contact-edit-page {
}

.contact-edit-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-edit-header .conversation-item__avatar {
  width: 52px;
  height: 52px;
  font-size: 1.2rem;
}

.contact-edit-header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.contact-edit-header .subtitle {
  margin: 0.2rem 0 0;
}

.contact-edit-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-edit-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input,
.field textarea,
.field select {
  padding: 0.55rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.925rem;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.field textarea {
  resize: vertical;
  line-height: 1.5;
}

.panel--danger-zone {
  border-color: var(--danger-soft);
  margin-top: 1.5rem;
}

.panel--danger-zone .panel__heading h2 {
  color: var(--danger);
}

.danger-zone__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.danger-zone__body .muted {
  margin: 0;
  flex: 1;
}

@media (max-width: 540px) {
  .contact-edit-form__grid {
    grid-template-columns: 1fr;
  }
}

.reply-panel {
  margin-top: 1rem;
  position: sticky;
  bottom: 1rem;
}

.reply-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.reply-form__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.reply-form__from {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reply-form__body {
  width: 100%;
  resize: none;
}

/* SMS auto-reply grid */
.sms-reply-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sms-reply-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.sms-reply-row__label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.2rem;
}

.sms-reply-row__fields {
  display: flex;
  flex-direction: column;
}

/* Business hours day checkboxes */
.business-hours__days {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.day-checkbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.day-checkbox input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Reports filter bar label ---------- */

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

/* ---------- Day × hour heatmap ---------- */

.heatmap-grid {
  display: grid;
  grid-template-columns: 2.5rem repeat(24, 1fr);
  gap: 3px;
  align-items: center;
  overflow-x: auto;
}

.heatmap-grid__row-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
  padding-right: 6px;
  white-space: nowrap;
}

.heatmap-grid__col-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.2em;
}

.heatmap-grid__cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) var(--cell-intensity, 0%), var(--surface));
  border: 1px solid var(--border);
  min-width: 14px;
  cursor: default;
}

.heatmap-grid__cell:hover {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Business hours schedule ---------- */

.bh-schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.bh-schedule th {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  padding: 0 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.bh-schedule td {
  padding: 0.45rem 0.75rem;
  vertical-align: middle;
}

.bh-schedule tbody tr + tr td {
  border-top: 1px solid var(--border);
}

.bh-schedule__day {
  font-weight: 600;
  min-width: 2.5rem;
}

.bh-schedule__check {
  text-align: center;
}

.bh-schedule__dash {
  color: var(--muted);
  padding: 0 0.25rem;
  text-align: center;
}

.bh-schedule__hint {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 0.25rem;
}

.bh-time-input {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 7.5rem;
}

.bh-time-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.bh-time-input--secondary {
  opacity: 0.65;
}

.bh-time-input--secondary:focus {
  opacity: 1;
}

.bh-day-toggle {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Pagy pagination ---------- */

nav.pagy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1rem 0 0.5rem;
  flex-wrap: wrap;
}

nav.pagy a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s;
}

nav.pagy a:hover:not([aria-disabled="true"]) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

nav.pagy a.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: default;
}

nav.pagy a[aria-disabled="true"] {
  color: var(--muted);
  cursor: default;
}

nav.pagy a.gap {
  border-color: transparent;
  background: transparent;
  cursor: default;
  color: var(--muted);
}

/* ---------- Contact show / profile ---------- */

.contact-show {
}

.contact-profile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.contact-profile__identity {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
  flex: 1;
}

.contact-profile__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-profile__info {
  min-width: 0;
  padding-top: 0.1rem;
}

.contact-profile__name {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.contact-profile__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.contact-profile__sep {
  margin: 0 0.3rem;
  opacity: 0.4;
}

.contact-profile__email {
  color: var(--accent-ink);
  text-decoration: none;
}

.contact-profile__email:hover {
  text-decoration: underline;
}

.contact-profile__notes {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

.contact-profile__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ---------- Activity feed ---------- */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.activity-feed__date {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 0.75rem 0 0.25rem;
}

.activity-feed__date:first-child {
  padding-top: 0;
}

.activity-event {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.activity-event--call {
  padding: 0.65rem 0.875rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}

.activity-event--call:hover {
  background: var(--accent-soft);
}

.activity-event__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.activity-event__icon--in {
  background: var(--inbound-soft);
  color: var(--inbound);
}

.activity-event__icon--out {
  background: var(--outbound-soft);
  color: var(--outbound);
}

.activity-event__body {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.activity-event__title {
  font-size: 0.875rem;
  font-weight: 500;
}

.activity-event__duration {
  color: var(--muted);
  font-weight: 400;
}

.activity-event__time {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-event__arrow {
  color: var(--muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  opacity: 0.5;
}

.activity-event--message {
  gap: 0;
}

.activity-event--message.activity-event--outbound {
  justify-content: flex-end;
}

.activity-event--message.activity-event--inbound {
  justify-content: flex-start;
}

.activity-event__bubble {
  max-width: 72%;
  padding: 0.5rem 0.75rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.activity-event--inbound .activity-event__bubble {
  background: var(--bg);
  border-bottom-left-radius: 4px;
}

.activity-event--outbound .activity-event__bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.activity-event__bubble-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.activity-event__bubble-meta {
  display: block;
  font-size: 0.68rem;
  margin-top: 0.2rem;
  opacity: 0.6;
  text-align: right;
}

.activity-event--inbound .activity-event__bubble-meta {
  text-align: left;
}

/* ---------- Compose bar (contact show reply box) ---------- */

.compose-bar {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem 1.25rem;
  margin: 1rem -1.5rem -1.25rem;
}

.compose-bar__form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.compose-bar__input {
  flex: 1;
  resize: none;
}

.compose-bar__from {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill--sm {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
}

@media (max-width: 540px) {
  .contact-profile {
    flex-direction: column;
  }

  .contact-profile__actions {
    width: 100%;
  }

  .contact-profile__actions .btn {
    flex: 1;
    text-align: center;
  }
}

/* ---------- Compliance wizard ---------- */

.compliance-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
}

.compliance-steps__step {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  text-decoration: none;
  white-space: nowrap;
}

a.compliance-steps__step:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.compliance-steps__step--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.compliance-steps__step--done {
  border-color: var(--accent);
  color: var(--accent);
}

.compliance-steps__step--locked {
  opacity: 0.45;
}

.compliance-steps__sep {
  color: var(--muted);
  font-size: 0.75rem;
}

.compliance-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.compliance-form .panel {
  margin-bottom: 1rem;
}

.compliance-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
}

.compliance-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.compliance-form__field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compliance-form__field--wide {
  grid-column: 1 / -1;
}

.compliance-form__textarea {
  height: auto;
  resize: vertical;
}

.compliance-form__actions {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0 1.5rem;
}

.profile-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  padding: 1rem 1.5rem 1.5rem;
  font-size: 0.875rem;
}

.profile-dl dt {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: start;
  padding-top: 0.1rem;
}

.profile-dl dd {
  margin: 0;
  word-break: break-word;
}

/* ---------- Compliance sub-steps (phone numbers page) ---------- */

.compliance-substeps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 0.75rem 0 0;
}

.compliance-substep {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  background: var(--bg);
}

.compliance-substep:last-child {
  border-bottom: none;
}

.compliance-substep--done {
  background: transparent;
}

.compliance-substep__label {
  font-weight: 500;
}

.compliance-substep--done .compliance-substep__label::before {
  content: "✓ ";
  color: var(--accent);
  font-weight: 700;
}

.compliance-substep__status {
  font-size: 0.8125rem;
  color: var(--muted);
}

.compliance-substep--done .compliance-substep__status {
  color: var(--accent);
  font-weight: 600;
}

.compliance-substep__action {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.compliance-substep__action:hover {
  text-decoration: underline;
}

.compliance-substep__action--alert {
  color: #c0392b;
}

/* ---------- Trust Hub provisioning step list ---------- */

.provision-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.provision-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.provision-step:last-child {
  border-bottom: none;
}

.provision-step__icon {
  font-size: 0.8rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.provision-step--done .provision-step__icon {
  color: var(--accent);
  font-weight: 700;
}

.provision-step--waiting .provision-step__icon {
  color: var(--muted);
}

.provision-step__label {
  flex: 1;
}

.provision-step--waiting .provision-step__label {
  color: var(--muted);
}

.provision-step__sid {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: monospace;
}

/* ---------- Compliance warning banner ---------- */

.compliance-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--warning-soft);
  border: 1px solid var(--note-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.compliance-banner__icon {
  color: var(--warning);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.compliance-banner__text {
  color: var(--text);
}

.compliance-banner__text a {
  color: var(--warning);
  font-weight: 600;
}

.compliance-banner__text a:hover {
  text-decoration: underline;
}

/* ── Softphone Widget ─────────────────────────────────────────────────────── */

.softphone [hidden] { display: none !important; }
html[data-softphone-minimized="1"] .softphone { display: none; }

.softphone {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow), 0 12px 40px rgba(0,0,0,.25);
  z-index: 1000;
  overflow: hidden;
  font-size: 0.875rem;
  user-select: none;
}

/* Header */
.softphone__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
}

.softphone__title {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.softphone__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.softphone__dot--ready   { background: #22c55e; box-shadow: 0 0 6px #22c55e88; }
.softphone__dot--active  { background: #22c55e; box-shadow: 0 0 6px #22c55e88; animation: softphone-pulse 1.2s ease-in-out infinite; }
.softphone__dot--ringing { background: #f59e0b; box-shadow: 0 0 6px #f59e0b88; animation: softphone-pulse 0.7s ease-in-out infinite; }
.softphone__dot--offline { background: var(--muted); }
.softphone__dot--error   { background: #ef4444; }

@keyframes softphone-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.softphone__status {
  color: var(--muted);
  font-size: 0.75rem;
  flex: 1;
  text-align: right;
  margin-right: 0.25rem;
}

.softphone__header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.softphone__header-btn:hover {
  background: rgba(128,128,128,0.15);
  color: var(--text);
}

/* Diagnostics panel */
.softphone__diagnostics {
  padding: 0.875rem 1rem 1rem;
}

.softphone__diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.softphone__diag-title {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
}

.softphone__diag-list {
  list-style: none;
  margin: 0 0 0.875rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.softphone__diag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
}
.softphone__diag-row:last-child { border-bottom: none; }

.softphone__diag-label {
  color: var(--text);
  font-weight: 500;
}

.softphone__diag-result {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  text-align: right;
}

.softphone__diag-value {
  color: var(--muted);
  font-size: 0.75rem;
  max-width: 140px;
  text-align: right;
  line-height: 1.3;
}

.softphone__diag-icon {
  font-size: 0.75rem;
  font-weight: 700;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

[data-diag-state="pass"]     .softphone__diag-icon { color: #22c55e; }
[data-diag-state="fail"]     .softphone__diag-icon { color: #ef4444; }
[data-diag-state="warn"]     .softphone__diag-icon { color: var(--warning); }
[data-diag-state="checking"] .softphone__diag-icon { color: var(--muted); }
[data-diag-state="fail"]     .softphone__diag-value { color: #ef4444; }
[data-diag-state="warn"]     .softphone__diag-value { color: var(--warning); }

.softphone__diag-run-btn {
  width: 100%;
  padding: 0.5rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.softphone__diag-run-btn:hover { background: var(--pill-bg); }

/* Incoming call */
.softphone__incoming {
  padding: 1rem 0.875rem;
  background: var(--warning-soft);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.softphone__incoming-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--warning);
  font-weight: 700;
  margin: 0 0 0.25rem;
}
.softphone__incoming-from {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.875rem;
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.softphone__incoming-actions {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
}

/* Shared button base */
.softphone__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: none;
  border-radius: 50px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 1.25rem;
  transition: filter 0.15s;
}
.softphone__btn:hover  { filter: brightness(1.1); }
.softphone__btn:active { filter: brightness(0.9); }
.softphone__btn--answer  { background: #22c55e; color: #fff; flex: 1; }
.softphone__btn--decline { background: #ef4444; color: #fff; flex: 1; }

/* Dialpad */
.softphone__dialpad {
  padding: 0.875rem 1rem 1rem;
}

.softphone__display-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

.softphone__display-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  outline: none;
  letter-spacing: 0.03em;
  text-align: center;
}
.softphone__display-input:focus { border-color: var(--accent); }
.softphone__display-input::placeholder { color: var(--muted); font-size: 0.8125rem; font-weight: 400; letter-spacing: 0; }

.softphone__backspace {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.softphone__backspace:hover  { background: var(--surface-hover); color: var(--text); }
.softphone__backspace:active { background: var(--border); }

/* Key grid */
.softphone__keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.softphone__key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0.625rem 0.25rem 0.5rem;
  transition: background 0.1s, transform 0.08s;
  line-height: 1;
  gap: 0.125rem;
}
.softphone__key:hover  { background: var(--pill-bg); }
.softphone__key:active { background: var(--border); transform: scale(0.94); }

.softphone__key-digit {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
}
.softphone__key-sub {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* Caller ID select */
.softphone__select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8125rem;
  padding: 0.4375rem 0.5rem;
  margin-bottom: 0.875rem;
  outline: none;
}

/* Call button */
.softphone__call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #22c55e;
  border: none;
  color: #fff;
  cursor: pointer;
  margin: 0 auto;
  transition: filter 0.15s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(34,197,94,.4);
}
.softphone__call-btn:hover  { filter: brightness(1.1); transform: scale(1.05); }
.softphone__call-btn:active { filter: brightness(0.9); transform: scale(0.97); }

/* Active call */
.softphone__active {
  padding: 1.5rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.softphone__timer {
  font-size: 2rem;
  font-weight: 300;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.softphone__hangup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(239,68,68,.4);
}
.softphone__hangup-btn:hover  { filter: brightness(1.1); transform: scale(1.05); }
.softphone__hangup-btn:active { filter: brightness(0.9); transform: scale(0.97); }

.softphone__incoming-queue {
  font-size: 0.75rem;
  color: var(--muted);
  margin: -0.5rem 0 0.75rem;
  letter-spacing: 0.01em;
}

/* Active call row with timer + transfer button */
.softphone__active-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: center;
  width: 100%;
}
.softphone__transfer-open-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .25rem .625rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.softphone__transfer-open-btn:hover { color: var(--text); border-color: var(--text); }

/* Transfer target picker */
.softphone__transfer {
  display: flex;
  flex-direction: column;
  min-height: 180px;
  max-height: 260px;
  overflow: hidden;
}
.softphone__transfer-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.softphone__transfer-back {
  background: none;
  border: none;
  color: var(--brand);
  font-size: .8125rem;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.softphone__transfer-title {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text);
}
.softphone__transfer-body {
  overflow-y: auto;
  flex: 1;
}
.softphone__transfer-section {
  padding: .25rem 0;
}
.softphone__transfer-section-label {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  padding: .375rem .75rem .25rem;
  margin: 0;
}
.softphone__transfer-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .375rem .75rem;
  justify-content: space-between;
}
.softphone__transfer-name {
  font-size: .8125rem;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Warm transfer / conference active */
.softphone__warm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .875rem;
  padding: 1.5rem 1rem 1.25rem;
  text-align: center;
}
.softphone__warm-label {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.softphone__warm-hint {
  font-size: .8125rem;
  margin: -.5rem 0 0;
}
.softphone__warm-leave-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: .5rem 1.5rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
}
.softphone__warm-leave-btn:hover { filter: brightness(1.1); }

.softphone__agent-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem 0.625rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.softphone__agent-status-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
.softphone__agent-status-select {
  flex: 1;
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-hover);
  color: var(--text);
  cursor: pointer;
}
.softphone__agent-status-select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ── Supervisor dashboard ──────────────────────────────────── */

.supervisor__live-badge {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #22c55e;
  padding: .25rem .625rem;
  border: 1px solid #22c55e40;
  border-radius: 20px;
  background: #22c55e10;
  animation: supervisor-pulse 2s ease-in-out infinite;
}
@keyframes supervisor-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}

.supervisor__loading {
  padding: 2rem;
  color: var(--muted);
  font-size: .875rem;
}

/* Queue cards row */
.supervisor__queues {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .875rem;
  margin-bottom: .25rem;
}
.supervisor__queue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .875rem 1rem;
}
.supervisor__queue-name {
  font-weight: 700;
  font-size: .9375rem;
  margin-bottom: .625rem;
  color: var(--text);
}
.supervisor__queue-metrics {
  display: flex;
  gap: 1rem;
}
.supervisor__metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.supervisor__metric-value {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.supervisor__metric-value--alert { color: #ef4444; font-weight: 600; }
.supervisor__metric-value--good  { color: #22c55e; }
.supervisor__metric-value--warn  { color: var(--warning); }
.supervisor__metric-value--muted { color: var(--muted); }
.supervisor__metric-label {
  font-size: .625rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 600;
  margin-top: .25rem;
}
.supervisor__queue-sla-hint {
  font-size: .6875rem;
  color: var(--muted);
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

/* Agent status pill in the board */
.supervisor__agent-status {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 20px;
}
.supervisor__agent-status--available { background: #22c55e20; color: #16a34a; }
.supervisor__agent-status--busy      { background: #ef444420; color: #dc2626; }
.supervisor__agent-status--break     { background: #f59e0b20; color: #d97706; }
.supervisor__agent-status--wrap-up,
.supervisor__agent-status--wrap_up   { background: #f59e0b20; color: #d97706; }
.supervisor__agent-status--offline   { background: var(--pill-bg); color: var(--muted); }
/* TeleSmarter Marketing — v2 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:        #2563eb;
  --brand-dark:   #1d4ed8;
  --brand-light:  #eff6ff;
  --accent:       #38bdf8;
  --dark:         #0a0f1e;
  --navy:         #111827;
  --ink:          #1e293b;
  --text:         #374151;
  --muted:        #6b7280;
  --subtle:       #9ca3af;
  --border:       #e5e7eb;
  --border-dark:  #1f2937;
  --surface:      #f9fafb;
  --white:        #ffffff;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:       0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:    0 20px 48px rgba(0,0,0,.18), 0 8px 20px rgba(0,0,0,.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv02","cv03","cv04","cv11";
  color: var(--text);
  line-height: 1.6;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Nav ──────────────────────────────────────────── */
.mkt-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.mkt-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mkt-nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.mkt-nav__logo strong { color: var(--brand); font-weight: 800; }
.mkt-nav__logomark { width: 32px; height: 32px; flex-shrink: 0; }
.mkt-nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
}
.mkt-nav__links a:not(.mkt-btn) { transition: color .15s; }
.mkt-nav__links a:not(.mkt-btn):hover { color: var(--ink); }

/* ── Buttons ──────────────────────────────────────── */
.mkt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: .875rem;
  line-height: 1;
  padding: 9px 20px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -.01em;
}
.mkt-btn--primary {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(37,99,235,.25), inset 0 1px 0 rgba(255,255,255,.12);
}
.mkt-btn--primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 4px 14px rgba(37,99,235,.4), inset 0 1px 0 rgba(255,255,255,.12);
  transform: translateY(-1px);
}
.mkt-btn--outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.mkt-btn--outline:hover { background: var(--brand-light); }
.mkt-btn--ghost {
  background: rgba(255,255,255,.1);
  color: var(--white);
  border-color: rgba(255,255,255,.25);
}
.mkt-btn--ghost:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }
.mkt-btn--white {
  background: var(--white);
  color: var(--brand);
  border-color: var(--white);
  box-shadow: var(--shadow);
}
.mkt-btn--white:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.mkt-btn--lg { padding: 14px 28px; font-size: .9375rem; border-radius: 10px; }

/* ── Hero ─────────────────────────────────────────── */
.mkt-hero {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  padding: 96px 32px 80px;
  display: flex;
  justify-content: center;
}
.mkt-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% -10%, rgba(37,99,235,.35) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(56,189,248,.12) 0%, transparent 60%),
    linear-gradient(180deg, #0a0f1e 0%, #0f1a2e 100%);
}
.mkt-hero__inner {
  position: relative;
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 80px;
  align-items: center;
}
.mkt-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37,99,235,.15);
  border: 1px solid rgba(37,99,235,.35);
  color: #93c5fd;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.mkt-hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(.85)} }

.mkt-hero__headline {
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.03em;
  color: var(--white);
  margin-bottom: 20px;
}
.mkt-hero__accent {
  background: linear-gradient(90deg, #60a5fa, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mkt-hero__sub {
  font-size: 1.05rem;
  color: #94a3b8;
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 36px;
}
.mkt-hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.mkt-hero__note { font-size: .8rem; color: #475569; }

/* ── Dashboard widget ─────────────────────────────── */
.mkt-dashboard {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.04) inset;
  backdrop-filter: blur(12px);
}
.mkt-dashboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.mkt-dashboard__title {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
}
.mkt-dashboard__live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  color: #22c55e;
}
.mkt-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-dot 1.8s infinite;
}
.mkt-dashboard__calls { padding: 8px 0; }
.mkt-call-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
}
.mkt-call-row:last-child { border-bottom: none; }
.mkt-call-row:hover { background: rgba(255,255,255,.03); }
.mkt-call-row--queue { background: rgba(56,189,248,.04); }
.mkt-call-row__dir {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.mkt-call-row__dir--in  { background: rgba(34,197,94,.12); color: #4ade80; }
.mkt-call-row__dir--out { background: rgba(99,102,241,.12); color: #a5b4fc; }
.mkt-call-row__dir--wait { background: rgba(251,191,36,.12); color: #fbbf24; }
.mkt-call-row__info { flex: 1; min-width: 0; }
.mkt-call-row__name { display: block; font-size: .82rem; font-weight: 600; color: #e2e8f0; }
.mkt-call-row__num  { display: block; font-size: .75rem; color: #475569; margin-top: 1px; }
.mkt-call-row__timer {
  font-size: .78rem;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.mkt-call-row__badge {
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56,189,248,.1);
  padding: 3px 8px;
  border-radius: 100px;
  animation: pulse-dot 1.5s infinite;
}
.mkt-dashboard__stats {
  display: flex;
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 16px 0;
}
.mkt-stat { flex: 1; text-align: center; }
.mkt-stat + .mkt-stat { border-left: 1px solid rgba(255,255,255,.06); }
.mkt-stat__num { font-size: 1.35rem; font-weight: 800; color: var(--white); letter-spacing: -.02em; }
.mkt-stat__label { font-size: .7rem; color: #475569; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* ── Logos ────────────────────────────────────────── */
.mkt-logos {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 32px;
  background: var(--surface);
}
.mkt-logos__inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.mkt-logos__label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--subtle);
  margin-bottom: 16px;
}
.mkt-logos__row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}
.mkt-logos__row span {
  font-size: .875rem;
  font-weight: 600;
  color: #d1d5db;
  letter-spacing: .01em;
  padding: 0 28px;
  border-right: 1px solid var(--border);
}
.mkt-logos__row span:last-child { border-right: none; }

/* ── Section shared ───────────────────────────────── */
.mkt-section-inner { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.mkt-section-header { text-align: center; max-width: 580px; margin: 0 auto 64px; }
.mkt-section-header h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -.025em;
  line-height: 1.2;
}
.mkt-section-header p { font-size: 1rem; color: var(--muted); line-height: 1.65; }

/* ── Features ─────────────────────────────────────── */
.mkt-features { padding: 104px 32px; background: var(--white); }
.mkt-features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mkt-feat {
  background: var(--white);
  padding: 36px 32px;
  transition: background .2s;
}
.mkt-feat:hover { background: var(--surface); }
.mkt-feat__icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--brand);
}
.mkt-feat__icon-wrap svg { width: 18px; height: 18px; }
.mkt-feat h3 {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -.01em;
}
.mkt-feat p { font-size: .875rem; color: var(--muted); line-height: 1.65; }

/* ── Solutions ────────────────────────────────────── */
.mkt-solutions { padding: 104px 32px; background: var(--surface); }
.mkt-solutions__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.mkt-solution-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  position: relative;
}
.mkt-solution-card--featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow);
}
.mkt-solution-card__tag {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--brand);
  color: var(--white);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
}
.mkt-solution-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  margin-bottom: 16px;
}
.mkt-solution-card--featured .mkt-solution-card__icon { background: var(--brand); color: var(--white); }
.mkt-solution-card__icon svg { width: 16px; height: 16px; }
.mkt-solution-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -.015em;
}
.mkt-solution-card p { font-size: .875rem; color: var(--muted); line-height: 1.65; margin-bottom: 20px; }
.mkt-solution-card ul { display: flex; flex-direction: column; gap: 9px; }
.mkt-solution-card li {
  font-size: .8375rem;
  color: var(--text);
  padding-left: 18px;
  position: relative;
  line-height: 1.4;
}
.mkt-solution-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

/* ── CTA ──────────────────────────────────────────── */
.mkt-cta {
  background: var(--dark);
  padding: 104px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mkt-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(37,99,235,.3) 0%, transparent 70%);
  pointer-events: none;
}
.mkt-cta__inner { position: relative; max-width: 600px; margin: 0 auto; }
.mkt-cta h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 14px;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.mkt-cta p { font-size: 1rem; color: #64748b; margin-bottom: 36px; line-height: 1.65; }
.mkt-cta__buttons { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ── Footer ───────────────────────────────────────── */
.mkt-footer {
  background: var(--navy);
  border-top: 1px solid var(--border-dark);
  padding: 40px 32px;
}
.mkt-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.mkt-footer__left p { font-size: .8rem; color: #374151; margin-top: 4px; }
.mkt-footer__brand {
  font-size: 1.05rem;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: -.01em;
}
.mkt-footer__brand strong { color: var(--brand); font-weight: 800; }
.mkt-footer__copy { font-size: .8rem; color: #374151; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 960px) {
  .mkt-hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .mkt-hero__gfx { max-width: 480px; }
  .mkt-features__grid { grid-template-columns: repeat(2, 1fr); }
  .mkt-solutions__grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .mkt-hero, .mkt-features, .mkt-solutions, .mkt-cta { padding-left: 20px; padding-right: 20px; }
  .mkt-nav__inner { padding: 0 20px; }
  .mkt-nav__links a:not(.mkt-btn) { display: none; }
  .mkt-features__grid { grid-template-columns: 1fr; }
  .mkt-hero__gfx { display: none; }
  .mkt-hero__ctas, .mkt-cta__buttons { flex-direction: column; align-items: stretch; }
  .mkt-btn--lg { justify-content: center; }
  .mkt-footer__inner { flex-direction: column; align-items: flex-start; }
  .mkt-logos__row span { padding: 4px 16px; }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
