:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --line: #334155;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header-copy .section-title {
  margin-bottom: 4px;
}

.section-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-x: hidden;
}

.admin-brand {
  margin-bottom: 24px;
}

.admin-brand-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.admin-brand-subtitle {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.95rem;
}

.admin-nav {
  display: grid;
  gap: 10px;
}

.admin-nav-link {
  display: block;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
}

.admin-nav-link:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.18);
}

.admin-main {
  min-width: 0;
  overflow-x: hidden;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.admin-menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.admin-topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.admin-content {
  min-width: 0;
  padding: 20px;
  overflow-x: hidden;
}

.page-grid {
  display: grid;
  gap: 18px;
}

.cards-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  min-width: 0;
}

.card {
  min-width: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.card,
.card p,
.card h3,
.list-row,
.list-row-label {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
}

.list-block {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.list-row-label {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid transparent;
}

.badge.ok {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.24);
}

.badge.warn {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.24);
}

.badge.off {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.24);
}

.badge.neutral {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.24);
}

.badge.maintenance {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.24);
}

.badge.suspended {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.24);
}

.flash {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.flash.success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.24);
}

.flash.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.24);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.data-table,
.detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th,
.data-table td,
.detail-table th,
.detail-table td {
  padding: 9px;
  border-bottom: 1px solid #2b2f3a;
  text-align: left;
  vertical-align: top;
  white-space: normal;
}
.data-table th {
  font-size: 0.92rem;
  color: var(--muted);
}

.data-table td {
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 8px 9px;
}

.inline-detail-panel {
  padding: 12px 14px 14px;
}

.json-block {
  white-space: pre-wrap;
  word-break: break-word;
  background: #11151d;
  border: 1px solid #2b2f3a;
  border-radius: 12px;
  padding: 12px;
  overflow-x: auto;
}

.button-link {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #3a4150;
  border-radius: 8px;
  text-decoration: none;
}

details summary {
  user-select: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details[open] summary {
  margin-bottom: 6px;
}

/* ===== Telephony / compact rows ===== */

.telephony-create-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.telephony-inline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.field-label {
  display: block;
  min-width: 0;
}

.field-label .list-row-label {
  margin-bottom: 6px;
}

.field-input,
.field-select {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e5e7eb;
}

.field-input.compact,
.field-select.compact {
  padding: 10px;
  border-radius: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #1f2937;
  color: #e5e7eb;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.btn:hover {
  border-color: #475569;
  background: #243244;
}

.btn-ghost {
  background: #0f172a;
  color: #94a3b8;
}

.btn-ghost:hover {
  color: #e5e7eb;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.28);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-sm {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
}

.row-toggle-col,
.row-toggle-cell {
  width: 48px;
  min-width: 48px;
  text-align: center;
  vertical-align: middle;
}

.row-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
}

.row-toggle-btn:hover {
  color: #e5e7eb;
  border-color: #475569;
}

.actions-col {
  width: 120px;
  min-width: 120px;
  text-align: right;
  white-space: nowrap;
}

.inline-detail-row td {
  padding: 0;
  border-bottom: 1px solid #2b2f3a;
}

.inline-detail-panel {
  padding: 14px 16px 16px;
  background: rgba(11, 18, 32, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  overflow-x: hidden;
}

.inline-detail-title {
  margin: 0 0 12px;
  font-size: 0.98rem;
  font-weight: 600;
}

.inline-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.sda-number {
  font-weight: 700;
}

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

@media (max-width: 1100px) {
  .telephony-create-grid,
  .telephony-inline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    width: 240px;
    z-index: 40;
    transition: left 0.22s ease;
  }

  .admin-sidebar.is-open {
    left: 0;
  }

  .admin-menu-btn {
    display: inline-flex;
  }

  .admin-content {
    padding: 16px;
  }

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

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

@media (max-width: 720px) {
  .telephony-create-grid,
  .telephony-inline-grid {
    grid-template-columns: 1fr;
  }

  .actions-col {
    width: auto;
    min-width: 0;
  }
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}


.table-cell-wrap {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.table-cell-date {
  white-space: nowrap !important;
}

.table-cell-badge {
  white-space: nowrap !important;
}

.table-cell-tight {
  white-space: nowrap !important;
  width: 1%;
}

@media (max-width: 1100px) {
  .data-table th,
  .data-table td {
    white-space: normal;
  }
}

.data-table th,
.data-table td {
  padding: 8px 8px;
  font-size: 0.92rem;
  line-height: 1.2;
}

.data-table th {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.row-toggle-col,
.row-toggle-cell {
  width: 42px;
  min-width: 42px;
}

.row-toggle-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 13px;
}

.badge {
  padding: 3px 9px;
  font-size: 0.78rem;
}

.actions-col {
  width: 54px;
  min-width: 54px;
  text-align: center;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.icon-btn:hover {
  border-color: #475569;
  color: #e5e7eb;
}

.icon-btn-danger {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
}

.icon-btn-danger:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.inline-detail-panel {
  padding: 10px 12px 12px;
}

.inline-detail-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.inline-form-actions {
  margin-top: 10px;
  gap: 8px;
}

.card-subtle {
  padding: 14px;
}

.section-title {
  font-size: 1rem;
}

.list-row-label {
  font-size: 0.92rem;
}

.field-input,
.field-select {
  padding: 10px 12px;
  font-size: 0.95rem;
}

.btn {
  padding: 9px 12px;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 7px 10px;
  font-size: 0.86rem;
}

.actions-col {
  width: 46px;
  min-width: 46px;
  text-align: center;
  white-space: nowrap;
}

/* ===== EOCR table polish ===== */

.eocr-table th,
.eocr-table td {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  padding: 8px 10px;
  font-size: 0.93rem;
  line-height: 1.25;
}

.eocr-table th {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.eocr-table .col-tight {
  width: 1%;
  white-space: nowrap;
}

.eocr-table .col-date {
  white-space: nowrap;
}

.eocr-table .col-template,
.eocr-table .col-caller {
  white-space: nowrap;
}

.eocr-table .col-callid {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 220px;
  max-width: 300px;
}

.eocr-table .col-summary {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 320px;
}

.eocr-table .actions-col {
  width: 46px;
  min-width: 46px;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .eocr-table .col-summary {
    min-width: 240px;
  }

  .eocr-table .col-callid {
    min-width: 180px;
  }
}

/* ===== Trunks table compact stable ===== */

.trunks-table {
  width: 100%;
  table-layout: auto;
}

.trunks-table th,
.trunks-table td {
  padding: 8px 10px;
  font-size: 0.93rem;
  line-height: 1.2;
  vertical-align: top;
  white-space: nowrap;
}

.trunks-table th {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.trunks-table .badge {
  white-space: nowrap;
}

.trunks-host-cell,
.trunks-anomaly-cell {
  white-space: normal;
}

.trunks-host-cell .truncate-inline {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.trunks-anomaly-cell span {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

@media (max-width: 1100px) {
  .trunks-table th,
  .trunks-table td {
    font-size: 0.89rem;
    padding: 7px 8px;
  }

  .trunks-host-cell .truncate-inline {
    max-width: 180px;
  }

  .trunks-anomaly-cell span {
    max-width: 130px;
  }
}

/* ===== Supervision UI ===== */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0 0 4px;
}

.page-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cards-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

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

.stat-card {
  padding: 16px;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-help {
  margin-top: 8px;
  font-size: 0.85rem;
  opacity: 0.7;
}

.status-ok {
  color: #17a34a;
}

.status-warning {
  color: #c98a00;
}

.status-critical {
  color: #d14343;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-ok {
  background: rgba(23, 163, 74, 0.12);
  color: #188c43;
}

.badge-ko {
  background: rgba(209, 67, 67, 0.12);
  color: #c23b3b;
}

.badge-info {
  background: rgba(80, 120, 220, 0.12);
  color: #4f6fd6;
}

.badge-warning {
  background: rgba(201, 138, 0, 0.14);
  color: #b57900;
}

.badge-critical {
  background: rgba(209, 67, 67, 0.12);
  color: #c23b3b;
}

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

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
}

.alert-info {
  background: rgba(80, 120, 220, 0.08);
  border-color: rgba(80, 120, 220, 0.18);
}

.alert-warning {
  background: rgba(201, 138, 0, 0.08);
  border-color: rgba(201, 138, 0, 0.22);
}

.alert-critical {
  background: rgba(209, 67, 67, 0.08);
  border-color: rgba(209, 67, 67, 0.22);
}

.alert-title {
  margin-bottom: 4px;
}

.empty-state {
  padding: 14px;
  border: 1px dashed rgba(127, 127, 127, 0.35);
  border-radius: 12px;
  opacity: 0.8;
}

@media (max-width: 980px) {
  .cards-grid-3 {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 980px) {
  .cards-grid-2,
  .cards-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ===== Maintenance UI ===== */

.maintenance-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.maintenance-action-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(127, 127, 127, 0.18);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.maintenance-action-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.maintenance-action-help {
  font-size: 0.88rem;
  opacity: 0.8;
  min-height: 2.6em;
}

.result-banner {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.result-ok {
  background: rgba(23, 163, 74, 0.10);
  border: 1px solid rgba(23, 163, 74, 0.18);
}

.result-error {
  background: rgba(209, 67, 67, 0.10);
  border: 1px solid rgba(209, 67, 67, 0.18);
}

.result-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.result-block {
  margin-top: 14px;
}

.result-block h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.result-block pre {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(127, 127, 127, 0.18);
  font-size: 0.84rem;
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .maintenance-actions-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  .maintenance-actions-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Logo sidebar ===== */

.admin-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px 12px;
  margin-bottom: 10px;
  text-align: center;
}

.admin-brand-logo {
  display: block;
  width: 50%;
  max-width: 100px;
  height: auto;
  object-fit: contain;
}

.admin-brand-subtitle {
  margin-top: 8px;
  font-size: 0.86rem;
  opacity: 0.8;
}

/* ===== Inbound routing admin ===== */

.inbound-routing-table .code-hints {
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
  line-height: 1.25;
}

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

.inbound-actions form {
  margin: 0;
}

.btn-active {
  border: 1px solid rgba(23, 163, 74, 0.35);
  background: rgba(23, 163, 74, 0.12);
}

.sub-row td {
  padding-top: 0;
}

.inbound-summary {
  font-size: 0.9rem;
  opacity: 0.9;
  padding: 4px 0 8px;
}

.flash-banner {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.flash-success {
  background: rgba(23, 163, 74, 0.10);
  border: 1px solid rgba(23, 163, 74, 0.22);
}

.flash-error {
  background: rgba(209, 67, 67, 0.10);
  border: 1px solid rgba(209, 67, 67, 0.22);
}

.row-highlight {
  outline: 1px solid rgba(80, 120, 220, 0.25);
}

/* ===== Inbound routing admin ===== */

.inbound-routing-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.inbound-routing-table th,
.inbound-routing-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #2b2f3a;
  text-align: left;
  vertical-align: top;
}

.inbound-routing-table th {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.inbound-routing-table td {
  font-size: 0.95rem;
  line-height: 1.3;
}

.inbound-routing-table th:nth-child(1),
.inbound-routing-table td:nth-child(1) {
  width: 170px;
  white-space: nowrap;
}

.inbound-routing-table th:nth-child(2),
.inbound-routing-table td:nth-child(2) {
  width: 180px;
}

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

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

.inbound-routing-table th:nth-child(5),
.inbound-routing-table td:nth-child(5) {
  min-width: 260px;
}

.inbound-routing-table th:nth-child(6),
.inbound-routing-table td:nth-child(6) {
  width: 220px;
}

.inbound-routing-table .code-hints {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  line-height: 1.3;
}

.inbound-routing-table .code-hints div {
  white-space: nowrap;
}

.inbound-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: start;
}

.inbound-actions form {
  margin: 0;
}

.inbound-actions .btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}

.btn-active {
  border: 1px solid rgba(23, 163, 74, 0.35);
  background: rgba(23, 163, 74, 0.12);
}

.sub-row td {
  padding-top: 0;
}

.inbound-summary {
  font-size: 0.92rem;
  opacity: 0.92;
  padding: 6px 0 10px;
}

.flash-banner {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.flash-success {
  background: rgba(23, 163, 74, 0.10);
  border: 1px solid rgba(23, 163, 74, 0.22);
}

.flash-error {
  background: rgba(209, 67, 67, 0.10);
  border: 1px solid rgba(209, 67, 67, 0.22);
}

.row-highlight {
  outline: 1px solid rgba(80, 120, 220, 0.25);
}

@media (max-width: 1100px) {
  .inbound-routing-table .code-hints div {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* ===== SIP flow runtime in inbound routing ===== */

.sip-flow-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(127, 127, 127, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.sip-flow-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.sip-flow-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.8fr) minmax(180px, 1.4fr) minmax(120px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
}

.sip-flow-form .field-label {
  margin: 0;
}

.sip-flow-form .field-input.compact {
  padding: 9px 10px;
}

.sip-flow-actions {
  display: flex;
  align-items: end;
}

.sip-flow-actions .btn {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .sip-flow-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .sip-flow-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .sip-flow-form {
    grid-template-columns: 1fr;
  }

  .sip-flow-actions {
    grid-column: auto;
  }
}

.eocr-table-wrap {
  overflow-x: visible;
}

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

.eocr-table .col-tight {
  width: 64px;
  white-space: nowrap;
}

.eocr-table .col-callid {
  width: 64px;
  white-space: nowrap;
}

.eocr-table .col-template {
  width: 120px;
}

.eocr-table .col-caller {
  width: 150px;
}

.eocr-table .col-summary {
  width: auto;
  max-width: 0;
  line-height: 1.35;
}

.eocr-table .col-date {
  width: 108px;
  white-space: nowrap;
}

.eocr-table .actions-col {
  width: 56px;
  white-space: nowrap;
}

.copy-callid-btn {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline dotted;
}

.copy-callid-btn:hover {
  opacity: 0.8;
}

.eocr-table td,
.eocr-table th {
  overflow: hidden;
  text-overflow: ellipsis;
}

.eocr-table th,
.eocr-table td {
  padding: 7px 8px;
}

.eocr-table .actions-col {
  padding-right: 4px;
  padding-left: 4px;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.list-pagination-meta {
  color: var(--muted, #94a3b8);
  font-size: 0.92rem;
}

.list-pagination-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.cdr-table-wrap {
  overflow-x: visible;
}

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

.cdr-table th,
.cdr-table td {
  padding: 8px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cdr-table .col-tight {
  width: 64px;
  white-space: nowrap;
}

.cdr-table .col-date {
  width: 148px;
  white-space: nowrap;
}

.cdr-table .col-src {
  width: 130px;
}

.cdr-table .col-dst {
  width: 130px;
}

.cdr-table .col-status {
  width: 104px;
  white-space: nowrap;
}

.cdr-table .col-billsec {
  width: 72px;
  white-space: nowrap;
}

.cdr-table .col-uniqueid {
  width: 96px;
}

.cdr-table .col-lastapp {
  width: 110px;
}

.cdr-table .actions-col {
  width: 56px;
  white-space: nowrap;
}

.card-header-inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.header-nav-arrows {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1;
}

.nav-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-arrow-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.instance-inline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.field-span-2 {
  grid-column: span 2;
}

@media (max-width: 980px) {
  .instance-inline-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .field-span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .instance-inline-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: span 1;
  }
}

.admin-auth-page .admin-main {
  width: 100%;
}

.admin-auth-page .admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.admin-auth-page .admin-main {
  width: 100%;
  min-width: 0;
}

.admin-auth-page .admin-content {
  min-height: 100vh;
  width: 100%;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-auth-page .page-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: none;
}

.admin-auth-page .page-grid .card {
  width: 100%;
  max-width: 220px;
}