:root {
  --bg: #07100f;
  --bg-2: #0b1513;
  --panel: rgba(248, 251, 248, 0.95);
  --panel-soft: rgba(255, 255, 255, 0.74);
  --text: #101817;
  --muted: #62716e;
  --line: rgba(16, 24, 23, 0.13);
  --brand: #008f72;
  --brand-dark: #005f50;
  --accent: #e5aa4c;
  --danger: #bb3f45;
  --ok: #087a50;
  --white: #f8fbf8;
  --glow: rgba(94, 222, 166, 0.35);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  background: radial-gradient(circle at 9% 4%, rgba(0, 143, 114, 0.28), transparent 30%), radial-gradient(circle at 88% 10%, rgba(229, 170, 76, 0.22), transparent 24%), linear-gradient(135deg, #07100f 0%, #101716 56%, #16130e 100%);
  color: var(--text);
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background-image: linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  z-index: 0;
}

.icon-sprite { display: none; }
.ambient-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.ambient-bg::before,
.ambient-bg::after {
  content: "";
  position: absolute;
  width: 44vw;
  height: 44vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
  animation: drift 16s ease-in-out infinite alternate;
}
.ambient-bg::before { left: -12vw; top: 10vh; background: #00a884; }
.ambient-bg::after { right: -18vw; bottom: 4vh; background: #e5aa4c; animation-delay: -5s; }
#pbx-signal-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.35; z-index: 0; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(0.95); } to { transform: translate3d(4vw, -3vh, 0) scale(1.08); } }

body > aside,
body > main { position: relative; z-index: 1; }
a { color: var(--brand-dark); text-decoration: none; font-weight: 700; }
a:hover { color: #003f37; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.sidebar {
  min-height: 100vh;
  color: var(--white);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(7, 16, 15, 0.72);
  border-right: 1px solid rgba(255,255,255,0.13);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--brand), #63d59d);
  color: #04100e;
  font-weight: 900;
  box-shadow: 0 0 36px rgba(94, 222, 166, 0.34);
}
.brand strong { display: block; font-size: 15px; }
.brand span { display: block; color: rgba(248,251,248,0.62); font-size: 12px; margin-top: 3px; }
.primary-nav { display: grid; gap: 8px; margin: 0; }
.primary-nav a {
  color: rgba(248,251,248,0.78);
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: transform 260ms ease, background 260ms ease, border-color 260ms ease, color 260ms ease;
}
.primary-nav a:hover,
.primary-nav a.is-active {
  color: var(--white);
  background: rgba(102, 209, 158, 0.14);
  border-color: rgba(102, 209, 158, 0.28);
  transform: translateX(4px);
}
.pbx-marquee {
  overflow: hidden;
  border-block: 1px solid rgba(255,255,255,0.10);
  padding: 12px 0;
  color: rgba(248,251,248,0.48);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin-top: auto;
}
.pbx-marquee div { display: flex; gap: 18px; width: max-content; animation: marquee 18s linear infinite; }
.pbx-marquee span { white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }
.sidebar-footer { padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.10); }
.user-info { margin-bottom: 10px; font-size: 13px; color: rgba(248,251,248,0.66); }
.logout-form { margin: 0; padding: 0; border: 0; }
.logout-form button { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.20); font-size: 12px; min-height: 38px; justify-content: center; }
.logout-form button:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.38); }

.app-shell { min-width: 0; padding: 26px clamp(18px, 3vw, 38px) 34px; }
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  min-height: 220px;
  padding: clamp(24px, 5vw, 64px);
  margin-bottom: 28px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: linear-gradient(105deg, rgba(7,16,15,0.92) 0%, rgba(10,28,25,0.80) 54%, rgba(67,47,20,0.58) 100%), url("https://picsum.photos/seed/ip-pbx-switchboard/1920/1080") center / cover;
  background-blend-mode: normal, luminosity;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.top-bar::after {
  content: "";
  position: absolute;
  inset: auto 4% -34% auto;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 44px rgba(102,209,158,0.12), 0 0 70px rgba(102,209,158,0.12);
}
.top-bar-left { max-width: min(980px, 100%); position: relative; z-index: 1; }
h1, h2, h3, p { margin-top: 0; }
h1 { color: var(--white); font-size: clamp(2.1rem, 4vw, 4.6rem); line-height: 0.98; letter-spacing: 0; margin: 0 0 14px; font-weight: 800; }
h2 { font-size: 18px; margin-bottom: 0; letter-spacing: 0; }
h3 { letter-spacing: 0; }
p, .empty, label, td, th { font-size: 14px; }
.top-bar-subtitle { max-width: 650px; color: rgba(248,251,248,0.72); font-size: clamp(1rem, 1.4vw, 1.18rem); line-height: 1.55; margin: 0; }
.top-bar-right { position: relative; z-index: 1; display: flex; gap: 12px; align-items: flex-start; }
.content-stage { position: relative; }

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin: 0 0 24px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: var(--white);
  backdrop-filter: blur(14px);
}
.page-header h1 { font-size: clamp(2rem, 3.4vw, 3.8rem); margin-bottom: 8px; }
.page-header p { color: rgba(248,251,248,0.70); }
.page-header p, .empty, .task span, .timeline-item span { color: var(--muted); }

section, .metrics > div, .grid > div {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 14px 44px rgba(0,0,0,0.12);
}
section { overflow: hidden; }
.metrics {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 12px;
  margin-bottom: 18px;
}
.metrics > div {
  grid-column: span 3;
  min-height: 142px;
  margin: 0;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(248,251,248,0.98), rgba(223,239,231,0.94));
  transition: transform 520ms cubic-bezier(.2,.8,.2,1), filter 520ms ease;
}
.metrics > div::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -48px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: rgba(0,143,114,0.13);
}
.metrics > div:hover { transform: translateY(-7px) scale(1.012); filter: contrast(1.04); }
.metrics span { display: block; font-size: clamp(2rem, 3.2vw, 4rem); line-height: 0.95; font-weight: 850; letter-spacing: 0; }
.metrics label { color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: 12px; }

.grid { display: grid; gap: 18px; background: transparent; border: 0; padding: 0; box-shadow: none; }
.grid.two { grid-template-columns: minmax(0, 1.5fr) minmax(320px, .9fr); align-items: start; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.section-title a, .section-title .muted { white-space: nowrap; }
.muted { color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 8px; vertical-align: middle; }
th { color: #5b6966; font-size: 11px; text-transform: uppercase; letter-spacing: 0; font-weight: 850; }
tbody tr { transition: background 220ms ease, transform 220ms ease; }
tbody tr:hover { background: rgba(0,143,114,0.07); }

input, select, textarea, button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  letter-spacing: 0;
}
input, select, textarea { background: rgba(255,255,255,0.94); color: var(--text); outline: none; }
input:focus, select:focus, textarea:focus { border-color: rgba(0,143,114,0.62); box-shadow: 0 0 0 4px rgba(0,143,114,0.12); }
textarea { resize: vertical; }
button, .button-like {
  background: #0b1715;
  color: white;
  border-color: #0b1715;
  cursor: pointer;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease;
}
button:hover { background: #132622; transform: translateY(-1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.accent-button { background: var(--accent); border-color: var(--accent); color: #161006; }
.accent-button:hover { background: #d99b37; }
.secondary-button { background: white; color: var(--text); border-color: var(--line); }
.secondary-button:hover { background: #f4f8f6; color: var(--brand-dark); }

.header-dialer {
  display: grid;
  grid-template-columns: 86px minmax(150px, 1fr) auto;
  gap: 8px;
  min-width: min(420px, 100%);
  background: rgba(248,251,248,0.95);
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
}
.header-dialer select { border: 0; background: transparent; font-weight: 800; }
.header-dialer input { border: 0; background: transparent; min-width: 0; }
.header-dialer button { width: auto; padding: 0 16px; min-height: 36px; border-radius: 8px; white-space: nowrap; }

.filters { background: var(--panel); padding: 18px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.20); margin-bottom: 24px; box-shadow: var(--shadow); }
.filters .search, .search, .inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .stacked { flex: 1; min-width: 150px; }
.filters button { width: auto; min-width: 120px; }
.search input { min-width: 280px; }
.search button, .inline-form button { width: auto; white-space: nowrap; }
.inline-form { margin-bottom: 12px; }
.stacked { display: grid; gap: 12px; }
.stacked label { display: grid; gap: 6px; color: #52615e; font-weight: 750; }

.dashboard-builder { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.dashboard-builder button { width: auto; min-width: 170px; }
.check-option { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.74); color: var(--text); font-weight: 800; }
.check-option input { width: auto; min-height: 0; padding: 0; }

.pill { display: inline-flex; min-height: 25px; align-items: center; padding: 4px 9px; border-radius: 999px; background: rgba(0,143,114,0.10); color: var(--brand-dark); font-size: 12px; font-weight: 850; }
.task { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.task span { display: block; margin-top: 4px; }
.task form { margin: 0; }
.task button { width: auto; min-height: 34px; padding: 6px 10px; }
.timeline-item { border-bottom: 1px solid var(--line); padding: 13px 0; }
.timeline-item p { margin: 8px 0 0; white-space: pre-wrap; }
audio { width: 230px; max-width: 100%; height: 34px; filter: saturate(0.86); }
.operator-statistics { min-width: 0; }
.operator-statistics-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.operator-statistics-scroll:focus-visible { outline: 3px solid rgba(0,143,114,0.24); outline-offset: 2px; }
.operator-statistics-scroll table { min-width: 660px; table-layout: auto; }
.operator-statistics-scroll th, .operator-statistics-scroll td { white-space: nowrap; }
.operator-statistics-scroll th:first-child, .operator-statistics-scroll td:first-child { min-width: 150px; white-space: normal; }
.report-calls { min-width: 0; }
.recent-calls table { table-layout: fixed; }
.recent-calls th:nth-child(1), .recent-calls td:nth-child(1) { width: 72px; }
.recent-calls th:nth-child(2), .recent-calls td:nth-child(2) { width: 96px; }
.recent-calls th:nth-child(3), .recent-calls td:nth-child(3) { width: 72px; }
.recent-calls th:nth-child(5), .recent-calls td:nth-child(5), .recent-calls th:nth-child(6), .recent-calls td:nth-child(6) { width: 88px; }
.recent-calls th:nth-child(7), .recent-calls td:nth-child(7) { width: 180px; }
.recent-calls td { overflow-wrap: anywhere; }
.report-audio { display: block; width: clamp(128px, 100%, 180px); min-width: 0; }
.recent-calls-title { margin-bottom: 10px; }
.recent-calls-title h2 { margin-bottom: 0; }
.recent-calls-scroll {
  max-height: clamp(320px, 52vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  scrollbar-gutter: stable;
}
.recent-calls-scroll:focus-visible { outline: 3px solid rgba(0,143,114,0.24); outline-offset: 2px; }
.recent-calls-scroll table { min-width: 820px; }
.recent-calls-scroll thead { position: sticky; top: 0; z-index: 2; background: #f8fbf8; box-shadow: 0 1px 0 var(--line); }
.recent-calls-scroll tbody tr:last-child td { border-bottom: 0; }
.table-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 12px; }
.pagination-actions { display: flex; gap: 8px; }
.pagination-actions:last-child { justify-content: flex-end; }
.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.pagination-link:hover { border-color: rgba(0,143,114,0.45); color: var(--brand-dark); }
.pagination-link.disabled { opacity: 0.42; cursor: default; }
.pagination-status { color: var(--muted); font-size: 13px; font-weight: 750; white-space: nowrap; }

.flash-list { margin-bottom: 16px; display: grid; gap: 8px; }
.flash { padding: 12px 14px; border-radius: 8px; background: #fff7ed; border: 1px solid #fed7aa; box-shadow: 0 12px 34px rgba(0,0,0,0.10); }
.flash.ok, .flash.success { background: #ecfdf3; border-color: #abefc6; color: var(--ok); }
.flash.error { background: #fef3f2; border-color: #fecdca; color: var(--danger); }
.incoming-call-panel { position: sticky; top: 14px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid rgba(102,209,158,0.38); border-radius: 8px; background: rgba(236,253,243,0.96); color: var(--ok); box-shadow: 0 18px 42px rgba(16, 24, 32, .14); }
.incoming-call-panel[hidden] { display: none; }
.incoming-call-panel span { display: block; margin-top: 3px; color: var(--text); font-size: 14px; }
.incoming-call-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.incoming-call-actions a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: white; font-weight: 800; }
.incoming-call-actions button { width: auto; min-width: 104px; }

.app-footer { display: flex; justify-content: space-between; gap: 12px; color: rgba(248,251,248,0.56); font-size: 13px; padding: 20px 2px 0; border-top: 1px solid rgba(255,255,255,0.12); margin-top: 22px; }
.login-page { display: grid; grid-template-columns: 1fr; place-items: center; padding: 24px; }
.login-shell { width: min(440px, 100%); padding: 0; }
.login-panel { margin: 0; }
.login-brand { color: var(--text); margin-bottom: 20px; }
.login-brand span { color: var(--muted); }

@media (max-width: 1180px) {
  body { grid-template-columns: 248px minmax(0, 1fr); }
  .top-bar { display: grid; }
  .metrics > div { grid-column: span 6; }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: relative; min-height: auto; }
  .primary-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pbx-marquee { display: none; }
  .app-shell { padding: 16px; }
  .top-bar { min-height: auto; padding: 24px; }
  .top-bar-right, .header-dialer { width: 100%; }
  .header-dialer { grid-template-columns: 76px minmax(0, 1fr); }
  .header-dialer button { grid-column: 1 / -1; width: 100%; }
  .metrics { grid-template-columns: 1fr; }
  .metrics > div { grid-column: auto; }
  .page-header, .search, .inline-form, .filters .search { flex-direction: column; align-items: stretch; }
  .search input { min-width: 0; }
  table { display: block; overflow-x: auto; }
  .incoming-call-panel { position: static; align-items: stretch; flex-direction: column; }
  .incoming-call-actions { align-items: stretch; }
  .incoming-call-actions a, .incoming-call-actions button { flex: 1; justify-content: center; }
  .recent-calls table { table-layout: auto; min-width: 820px; }
  .report-audio { width: 170px; }
  .recent-calls-scroll { max-height: min(58vh, 520px); }
  .table-pagination { grid-template-columns: 1fr; }
  .pagination-actions, .pagination-actions:last-child { justify-content: center; }
  .pagination-status { grid-row: 1; text-align: center; }
  .app-footer { display: grid; }
}

.pbx-admin-hero {
  align-items: center;
}

.pbx-guide > div span {
  color: var(--brand-dark);
}

.pbx-board {
  background: rgba(248, 251, 248, 0.96);
}

.pbx-form-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.pbx-form-card ul,
.pbx-form-card .errorlist {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 12px;
}

.pbx-form-card label:has(input[type="checkbox"]) {
  align-items: center;
}

.pbx-form-card label > div,
.pbx-form-card label > ul {
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
}

.pbx-form-card label li {
  list-style: none;
  margin: 6px 0;
}

.pbx-form-card label li label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-transform: none;
}

.pbx-form-card input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.pbx-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.pbx-list h3 {
  margin: 8px 0 4px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
}

.pbx-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.74);
  transition: transform 220ms ease, border-color 220ms ease;
}

.pbx-item:hover {
  transform: translateY(-2px);
  border-color: rgba(0,143,114,0.34);
}

.pbx-item strong,
.pbx-item span,
.pbx-item small {
  display: block;
  overflow-wrap: anywhere;
}

.pbx-item span,
.pbx-item small {
  color: var(--muted);
  margin-top: 4px;
}

.pbx-item form {
  margin: 0;
}

.pbx-item button {
  width: auto;
  min-width: 86px;
}

.pbx-item-tall {
  align-items: start;
}

@media (max-width: 820px) {
  .pbx-item {
    grid-template-columns: 1fr;
  }
  .pbx-item button {
    width: 100%;
  }
}

.pbx-workspace {
  padding: 0;
  background: rgba(248, 251, 248, 0.96);
}

.pbx-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.62);
}

.pbx-tab {
  width: auto;
  min-width: 104px;
  min-height: 38px;
  background: rgba(255,255,255,0.74);
  color: var(--text);
  border-color: var(--line);
  white-space: nowrap;
}

.pbx-tab.is-active {
  background: #0b1715;
  color: white;
  border-color: #0b1715;
}

.pbx-tab-panel {
  display: none;
  padding: 18px;
}

.pbx-tab-panel.is-active {
  display: block;
}

.pbx-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.pbx-panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.pbx-compact-grid {
  margin: 0;
}

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

.pbx-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.66);
  overflow: hidden;
}

.pbx-editor summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 850;
  color: var(--text);
  background: rgba(255,255,255,0.78);
  border-bottom: 1px solid transparent;
}

.pbx-editor[open] summary {
  border-bottom-color: var(--line);
}

.pbx-editor .pbx-form-card {
  border: 0;
  border-radius: 0;
  margin: 0;
  background: transparent;
}

.pbx-workspace .pbx-list {
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

@media (max-width: 820px) {
  .pbx-tab-panel {
    padding: 12px;
  }
  .pbx-tabs {
    padding-bottom: 12px;
  }
  .pbx-tab {
    min-width: 92px;
  }
}

.pbx-inline-action {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}


.pbx-item-editable {
  align-items: stretch;
  display: grid;
  gap: 10px;
}

.pbx-row-editor {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.pbx-row-editor summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent);
  width: fit-content;
}

.pbx-row-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.pbx-row-form label,
.pbx-check-block {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pbx-row-form input,
.pbx-row-form textarea,
.pbx-row-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.88);
  color: var(--text);
}

.pbx-row-form textarea {
  resize: vertical;
}

.pbx-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
}

.pbx-row-actions button {
  min-height: 40px;
}

.pbx-wide-row-form {
  grid-template-columns: 1fr;
}

.pbx-check-block {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.58);
}

.pbx-check-block > span {
  color: var(--text);
}

@media (max-width: 820px) {
  .pbx-row-form {
    grid-template-columns: 1fr;
  }
}


.pbx-inline-form {
  margin: 0;
  display: flex;
  align-items: center;
}


.pbx-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pbx-realtime-metrics {
  margin: 0 0 14px;
}

.pbx-status-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.68);
}

.pbx-status-row small {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.pbx-status-badge {
  width: fit-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.8);
}

.pbx-status-badge.is-up {
  color: #0f7a4d;
  border-color: rgba(34,197,94,0.38);
  background: rgba(34,197,94,0.12);
}

.pbx-status-badge.is-down {
  color: #9a3412;
  border-color: rgba(249,115,22,0.36);
  background: rgba(249,115,22,0.12);
}

.pbx-raw-status {
  margin-top: 12px;
}

.pbx-raw-status pre {
  margin: 0;
  padding: 12px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text);
}


.pbx-trunk-form [data-trunk-field].is-hidden {
  display: none;
}
