:root {
  --white: #ffffff;
  --white-95: rgba(255, 255, 255, 0.95);
  --blue-925: #0f2a44;
  --blue-950: #0d1f33;
  --blue-900: #102949;
  --blue-860: #184978;
  --blue-850: #1d3c5a;
  --blue-820: #214969;
  --blue-760: #2a4b67;
  --blue-700: #345572;
  --blue-620: #496178;
  --blue-600: #50667a;
  --blue-540: #5d7893;
  --blue-460: #7c91a8;
  --blue-420: #adc3db;
  --blue-340: #bfcfe0;
  --blue-320: #c9d4e2;
  --blue-300: #d4dde9;
  --blue-280: #d8e3ef;
  --blue-240: #dbe8f6;
  --blue-170: #edf2f7;
  --blue-140: #d9e8ff;
  --blue-120: #f2f5f9;
  --blue-100: #f3f7fb;
  --blue-50: #f8fbff;
  --brand-blue: #005cc8;
  --green-700: #008060;
  --green-100: #e8f9f3;
  --red-700: #b42318;
  --red-100: #fff2f0;
  --amber-700: #8a5a00;
  --amber-100: #fff7e7;
  --violet-700: #6e5a9f;
  --violet-100: #f5f0ff;
  --bg: var(--blue-170);
  --surface: var(--white);
  --ink: #0f2a44;
  --muted: var(--blue-600);
  --line: #dbe4ec;
  --primary: var(--brand-blue);
  --sidebar: var(--blue-950);
  --sidebar-strong: var(--blue-900);
  --sidebar-ink: #dbe8f6;
  --sidebar-ink-muted: rgba(219, 232, 246, 0.72);
  --white-04: rgba(255, 255, 255, 0.04);
  --white-08: rgba(255, 255, 255, 0.08);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-12: rgba(255, 255, 255, 0.12);
  --white-14: rgba(255, 255, 255, 0.14);
  --white-34: rgba(255, 255, 255, 0.34);
  --white-92: rgba(255, 255, 255, 0.92);
  --amber-300: #f7d98c;
  --shadow-card: 0 20px 35px rgba(16, 40, 72, 0.12);
  --shadow-modal: 0 18px 38px rgba(11, 34, 56, 0.22);
}

.toolbar-row,
.filter-panel {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-panel {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.filter-panel label {
  display: grid;
  gap: 4px;
  min-width: 220px;
  color: var(--blue-760);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.filter-panel input,
.filter-panel select,
.drawer-form input,
.drawer-form select,
.drawer-form textarea {
  min-height: 34px;
  border: 1px solid var(--blue-320);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--white);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--blue-320);
  border-radius: 8px;
  background: var(--white-92);
}

.segmented button {
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--blue-700);
  background: transparent;
  cursor: pointer;
}

.segmented button.is-active {
  color: var(--blue-950);
  background: linear-gradient(180deg, #fff7df 0%, #f7d98c 100%);
}

.metric-grid-analytics {
  grid-template-columns: repeat(9, minmax(120px, 1fr));
}

.metric-card small {
  display: block;
  margin-top: 5px;
  color: var(--blue-620);
  font-size: 0.72rem;
}

.metric-card.is-ok strong {
  color: var(--green-700);
}

.metric-card.is-warning strong {
  color: var(--amber-700);
}

.metric-card.is-danger strong {
  color: var(--red-700);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.trend-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(12px, 1fr);
  align-items: end;
  gap: 5px;
  height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--white) 100%);
}

.trend-bar {
  display: flex;
  height: 100%;
  align-items: end;
}

.trend-bar span {
  display: block;
  width: 100%;
  min-height: 6px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--brand-blue) 0%, var(--blue-860) 100%);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.detail-grid div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--blue-50);
}

.detail-grid span {
  display: block;
  color: var(--blue-620);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.detail-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.json-preview {
  max-height: 300px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-950);
  background: #f8fbff;
  font-size: 0.78rem;
  line-height: 1.45;
}

.resource-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
}

.resource-tabs {
  display: grid;
  align-content: start;
  gap: 5px;
}

.resource-tabs button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--blue-320);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--white-92);
  cursor: pointer;
  text-align: left;
}

.resource-tabs button.is-active {
  border-color: #f3cf74;
  background: linear-gradient(180deg, #fff8e6 0%, #f7d98c 100%);
}

.table-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

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

.secondary-button,
.primary-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--brand-blue);
  color: var(--white);
  background: var(--brand-blue);
}

.secondary-button {
  border: 1px solid var(--blue-320);
  color: var(--blue-900);
  background: var(--white);
}

.primary-button.danger,
.icon-button.danger {
  border-color: #f0b8b1;
  color: var(--red-700);
  background: var(--red-100);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(13, 31, 51, 0.32);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(620px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  box-shadow: var(--shadow-modal);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.drawer-form {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 18px;
}

.drawer-form label {
  display: grid;
  gap: 5px;
  color: var(--blue-700);
  font-size: 0.78rem;
}

.drawer-form label > span {
  font-weight: 600;
}

.drawer-form .is-wide,
.drawer-actions,
.form-help {
  grid-column: 1 / -1;
}

.toggle-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.toggle-field input {
  min-height: 0;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

.confirm-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 95;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border-radius: 8px;
  padding: 18px;
  background: var(--white);
  box-shadow: var(--shadow-modal);
}

.confirm-modal h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  max-width: 360px;
  border: 1px solid var(--blue-320);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--blue-950);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.toast.is-error {
  border-color: #f0b8b1;
  color: var(--red-700);
  background: var(--red-100);
}

.toast.is-ok {
  border-color: #aee6d1;
  color: var(--green-700);
  background: var(--green-100);
}

.sidebar.is-customizing .nav-favorite-toggle {
  opacity: 1;
  pointer-events: auto;
}

.nav-item-row.is-favorite .nav-favorite-toggle {
  color: var(--amber-300);
}

body.is-auth-screen .topbar,
body.is-auth-screen .sidebar {
  display: none;
}

body.is-auth-screen .app-shell {
  display: block;
}

body.is-auth-screen .main-shell {
  min-height: 100vh;
}

body.is-auth-screen .content-grid {
  padding: 0;
}

body.is-auth-screen .alert-banner {
  position: fixed;
  top: 90px;
  left: 50%;
  z-index: 20;
  width: min(620px, calc(100vw - 32px));
  transform: translateX(-50%);
}

@media (max-width: 1180px) {
  .metric-grid-analytics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-layout,
  .panel-grid.is-wide,
  .resource-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .drawer-form,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid-analytics {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, var(--blue-140) 0%, var(--bg) 34%, var(--blue-50) 100%);
}

button,
select,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-strong) 100%);
  color: var(--sidebar-ink);
}

.sidebar-header,
.sidebar-footer {
  flex: 0 0 auto;
  padding: 18px 14px 14px;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--white-10);
}

.sidebar-brand-link {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.sidebar-brand-link:focus-visible,
.sidebar-filter-input:focus,
.nav-group-toggle:focus-visible,
.nav-item:focus-visible,
.nav-favorite-toggle:focus-visible,
.sidebar-customize-toggle:focus-visible {
  outline: 2px solid var(--white-34);
  outline-offset: 2px;
}

.sidebar-brand-logo-frame {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.sidebar-brand-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand {
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.12;
  color: #b9e8ff;
}

.sidebar-filter-input {
  width: 100%;
  min-height: 27px;
  border: 1px solid #c7d9f6;
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--blue-950);
  background: linear-gradient(180deg, #eaf3ff 0%, #d7e7ff 100%);
  font-size: 0.78rem;
  line-height: 1.2;
}

.sidebar-filter-input::placeholder {
  color: var(--blue-700);
}

.sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group {
  border: 0;
  background: transparent;
}

.nav-group-toggle {
  width: 100%;
  border: 0;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #d8c4ff;
  background: transparent;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-group.has-active-child .nav-group-toggle {
  color: var(--amber-300);
}

.nav-group-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  flex: 0 0 auto;
  opacity: 0.86;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.nav-group.is-expanded .nav-group-caret {
  transform: rotate(45deg);
}

.nav-group-children {
  display: none;
  margin: 2px 0 6px 7px;
  padding: 2px 0 0 10px;
  border-left: 1px solid var(--white-12);
  gap: 2px;
}

.nav-group.is-expanded .nav-group-children {
  display: grid;
}

.nav-item-row {
  position: relative;
  min-width: 0;
}

.nav-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 32px 7px 10px;
  border-radius: 8px;
  color: var(--white-92);
  background: transparent;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.2;
  transition: background 160ms ease, color 160ms ease;
}

.nav-item:hover {
  color: #ffffff;
  background: var(--white-08);
}

.nav-item.is-active {
  color: var(--blue-950);
  background: linear-gradient(180deg, var(--amber-100) 0%, var(--amber-300) 100%);
  box-shadow: inset 2px 0 0 #345572;
}

.nav-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: currentColor;
  opacity: 0.86;
}

.nav-item-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-favorite-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-ink-muted);
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 160ms ease, color 160ms ease, background 160ms ease;
}

.sidebar.is-customizing .nav-favorite-toggle,
.nav-item-row:hover .nav-favorite-toggle,
.nav-favorite-toggle:focus-visible,
.nav-favorite-toggle.is-active {
  opacity: 1;
}

.nav-favorite-toggle:hover,
.nav-favorite-toggle.is-active {
  color: #93c5fd;
  background: var(--white-08);
}

.nav-item-row.has-active-item .nav-favorite-toggle:hover,
.nav-item-row.has-active-item .nav-favorite-toggle.is-active {
  color: #5b21b6;
  background: rgba(91, 33, 182, 0.1);
}

.sidebar-empty {
  border: 1px dashed var(--white-14);
  border-radius: 8px;
  padding: 10px;
  color: var(--sidebar-ink-muted);
  background: var(--white-04);
  font-size: 0.82rem;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 9px 14px;
  border-top: 1px solid var(--white-12);
  background: linear-gradient(180deg, rgba(10, 24, 43, 0.12) 0%, rgba(7, 20, 36, 0.32) 100%);
}

.sidebar-customize-toggle {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 1px solid var(--white-14);
  border-radius: 8px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white-92);
  background: var(--white-04);
  cursor: pointer;
}

.sidebar-customize-toggle:hover,
.sidebar-customize-toggle.is-active {
  color: #ffffff;
  border-color: #6ea8ff;
  background: rgba(59, 130, 246, 0.18);
}

.sidebar-customize-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-version-value {
  justify-self: end;
  color: var(--white-92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  text-align: right;
  word-break: break-word;
}

.sidebar-body::-webkit-scrollbar {
  width: 10px;
}

.sidebar-body::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-body::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  background-clip: padding-box;
}

.main-shell {
  min-width: 0;
  padding: 0;
}

.topbar {
  min-height: 48px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--white-95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
}

.topbar-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.02rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  font-size: 1rem;
}

.actions,
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.actions-topbar-inline {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}

.topbar-tenant-switcher {
  flex: 0 0 380px;
  min-width: 0;
}

.topbar-tenant-switcher .searchable-select,
.topbar-tenant-switcher .searchable-select-native-host {
  width: 100%;
}

select,
.icon-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(21, 64, 119, 0.07);
}

select {
  min-width: 190px;
  padding: 0 10px;
}

select:disabled,
button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
}

.topbar-icon-btn {
  position: relative;
  box-sizing: border-box;
  border-color: var(--blue-280);
  background: linear-gradient(180deg, var(--surface) 0%, var(--blue-100) 100%);
  color: var(--blue-850);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.topbar-icon-btn:hover {
  border-color: var(--blue-420);
  transform: translateY(-1px);
}

.button-icon {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-select-native {
  display: none !important;
}

.searchable-select-native-host {
  width: 100%;
}

.searchable-select-trigger {
  width: 100%;
  min-height: 27px;
  border: 1px solid var(--blue-340);
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.searchable-select-trigger:disabled {
  cursor: not-allowed;
}

.searchable-select-trigger-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.searchable-select-trigger-copy.has-description .searchable-select-trigger-label {
  font-weight: 600;
}

.searchable-select-trigger:hover {
  border-color: var(--blue-320);
}

.searchable-select-trigger:focus,
.searchable-select-trigger[aria-expanded="true"] {
  outline: 0;
  border-color: var(--blue-460);
  box-shadow: 0 0 0 2px var(--blue-120);
}

.searchable-select-trigger-label,
.searchable-select-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-trigger-description,
.searchable-select-option-description {
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-trigger-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--blue-620);
}

.searchable-select-trigger-icon svg,
.searchable-select-search-icon svg,
.searchable-select-option-check svg {
  width: 100%;
  height: 100%;
  display: block;
}

.searchable-select-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 120;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--blue-240);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(241, 247, 255, 0.98) 100%);
  box-shadow: 0 18px 40px rgba(17, 40, 84, 0.18);
}

.searchable-select-popover.is-portal-open {
  position: fixed;
  left: 0;
  right: auto;
  top: 0;
  z-index: 1400;
}

.searchable-select-search {
  position: relative;
}

.searchable-select-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: var(--blue-540);
  transform: translateY(-50%);
}

.searchable-select-search-input {
  width: 100%;
  min-height: 27px;
  border: 1px solid var(--blue-340);
  border-radius: 6px;
  padding: 4px 8px 4px 32px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
}

.searchable-select-search-input:focus {
  outline: 0;
  border-color: var(--blue-460);
  box-shadow: 0 0 0 2px var(--blue-120);
}

.searchable-select-options {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.searchable-select-option {
  width: 100%;
  min-height: 27px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: transparent;
  color: var(--blue-820);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.searchable-select-option-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.searchable-select-option-copy.has-description .searchable-select-option-label {
  font-weight: 600;
}

.searchable-select-option:hover {
  border-color: rgba(142, 175, 223, 0.34);
  background: rgba(214, 230, 255, 0.42);
}

.searchable-select-option.is-selected {
  border-color: rgba(57, 123, 243, 0.34);
  background: linear-gradient(180deg, rgba(52, 118, 235, 0.12) 0%, rgba(18, 78, 194, 0.18) 100%);
  color: var(--blue-900);
  font-weight: 600;
}

.searchable-select-option-description {
  color: var(--blue-620);
  font-size: 0.76rem;
  line-height: 1.3;
}

.searchable-select-option-check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--blue-760);
}

.searchable-select-empty {
  padding: 10px 12px 4px;
  color: var(--blue-620);
  font-size: 0.82rem;
}

.topbar-tenant-select-trigger {
  width: 100%;
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--blue-280);
  border-radius: 10px;
  padding: 0 10px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--blue-100) 100%);
  color: var(--blue-860);
  box-shadow: 0 4px 12px rgba(21, 64, 119, 0.07);
}

.topbar-tenant-select-trigger:hover {
  border-color: var(--blue-420);
  background: linear-gradient(180deg, var(--surface) 0%, var(--blue-120) 100%);
}

.topbar-tenant-select-trigger .searchable-select-trigger-copy {
  gap: 0;
  align-items: flex-start;
}

.topbar-tenant-select-trigger .searchable-select-trigger-label {
  color: var(--blue-900);
  font-size: 0.82rem;
  font-weight: 700;
}

.topbar-tenant-select-trigger .searchable-select-trigger-description {
  display: none;
}

.topbar-tenant-select-trigger .searchable-select-trigger-icon {
  color: var(--blue-620);
}

.topbar-tenant-select-popover {
  border: 1px solid var(--blue-240);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-modal);
}

.topbar-tenant-select-option.is-selected {
  border-color: rgba(135, 109, 221, 0.24);
  background: linear-gradient(180deg, rgba(150, 120, 230, 0.14) 0%, rgba(123, 97, 214, 0.18) 100%);
}

.topbar-tenant-select-option .searchable-select-option-label {
  font-weight: 500;
}

.topbar-tenant-select-option.is-selected .searchable-select-option-label {
  font-weight: 700;
}

.topbar-tenant-select-popover .searchable-select-search-input {
  text-transform: uppercase;
}

.logout-button {
  color: var(--red-700);
}

.logout-button:hover {
  border-color: #f2b8b5;
  background: var(--red-100);
}

.text-button,
.primary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.alert-banner {
  margin: 14px 22px 0;
  padding: 12px 14px;
  border: 1px solid #f1ddb0;
  border-radius: 8px;
  background: var(--amber-100);
  color: var(--amber-700);
  font-size: 0.9rem;
  font-weight: 700;
}

.content-grid {
  display: grid;
  gap: 16px;
  padding: 22px;
}

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

.metric-card,
.info-panel,
.loading-panel {
  border: 1px solid rgba(183, 201, 221, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
}

.metric-card {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 1.9rem;
  line-height: 1;
}

.metric-card.is-danger strong {
  color: var(--red-700);
}

.metric-card.is-warning strong {
  color: var(--amber-700);
}

.panel-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 16px;
}

.panel-grid.is-wide {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
}

.info-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.text-link {
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.service-list {
  display: grid;
  padding: 12px 16px 16px;
}

.service-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.service-row:last-child {
  border-bottom: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

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

th {
  color: var(--muted);
  background: rgba(242, 247, 253, 0.86);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

tr[data-call-id] {
  cursor: pointer;
}

tr[data-call-id]:hover td {
  background: var(--blue-50);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--blue-50);
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge.is-active {
  color: var(--green-700);
  border-color: #bde8d7;
  background: var(--green-100);
}

.status-badge.is-trial {
  color: var(--amber-700);
  border-color: #f1ddb0;
  background: var(--amber-100);
}

.status-badge.is-suspended {
  color: var(--red-700);
  border-color: #efc5c0;
  background: var(--red-100);
}

.empty-state,
.loading-panel {
  padding: 18px;
  color: var(--muted);
  font-weight: 700;
}

.auth-layout {
  min-height: calc(100vh - 150px);
  display: grid;
  align-items: center;
  justify-items: center;
}

.auth-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(183, 201, 221, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-card);
}

.auth-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.auth-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.auth-panel input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface);
}

.form-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

body.is-auth-screen {
  background: #eef4fb;
}

body.is-auth-screen .app-shell {
  display: block;
  min-height: 100vh;
}

body.is-auth-screen .sidebar,
body.is-auth-screen .topbar,
body.is-auth-screen .alert-banner {
  display: none;
}

body.is-auth-screen .main-shell {
  padding: 0;
}

body.is-auth-screen .content-grid {
  display: block;
  padding: 0;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #eef4fb;
}

.login-site-header {
  position: sticky;
  top: 0;
  z-index: 12;
  border-bottom: 1px solid rgba(18, 52, 91, 0.1);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.login-site-header-inner,
.login-site-footer-inner {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.login-site-header-inner {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.login-site-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.login-site-brand-logo {
  display: block;
  width: 188px;
  height: auto;
  max-height: 58px;
  object-fit: contain;
}

.login-site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.login-site-nav a {
  color: #495c71;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.login-site-cta {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue-950);
  box-shadow: 0 14px 30px rgba(17, 47, 86, 0.16);
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
}

.login-page {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(134, 174, 224, 0.2) 0%, transparent 34%),
    radial-gradient(circle at bottom right, rgba(51, 111, 190, 0.18) 0%, transparent 30%),
    linear-gradient(145deg, #eef4fb 0%, #f5f8fc 42%, #eef3fa 100%);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: grid;
  gap: 20px;
}

.login-shell-wide {
  width: min(1280px, 100%);
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 0.95fr);
  align-items: stretch;
}

.login-card {
  min-height: 520px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 22px;
  padding: 34px 28px;
  border: 1px solid rgba(156, 191, 230, 0.56);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 54px rgba(17, 47, 86, 0.12);
}

.login-card .auth-panel-header {
  min-height: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 0;
  border-bottom: 0;
}

.login-card .auth-panel-header h2 {
  margin: 0 0 10px;
  color: var(--blue-950);
  font-size: 2.2rem;
  line-height: 1.04;
}

.login-card .auth-panel-header p {
  margin: 0;
  color: var(--blue-700);
  font-size: 1rem;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  align-content: start;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--blue-900);
  font-size: 0.92rem;
  font-weight: 500;
}

.auth-form input {
  min-height: 52px;
  width: 100%;
  border: 1px solid #cfe0f4;
  border-radius: 14px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.auth-form input:focus {
  border-color: var(--brand-blue);
  outline: 3px solid rgba(0, 92, 200, 0.14);
}

.login-card .primary-button {
  min-height: 54px;
  margin-top: 12px;
  border-radius: 14px;
  font-size: 1rem;
}

.auth-secondary-row {
  align-self: end;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-blue);
  font-size: 0.86rem;
  font-weight: 800;
}

.login-brand-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 20px;
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(156, 191, 230, 0.34);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(121, 177, 255, 0.24) 0%, transparent 34%),
    linear-gradient(160deg, #102f56 0%, #18406f 45%, #21558d 100%);
  color: #f7fbff;
  box-shadow: 0 28px 58px rgba(17, 47, 86, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.login-brand-hero {
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.login-brand-logo-link {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
}

.login-brand-logo {
  display: block;
  width: 136px;
  height: auto;
}

.login-brand-product-logo {
  width: 146px;
  height: 146px;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(9, 31, 59, 0.24));
}

.login-brand-header {
  display: grid;
  gap: 12px;
}

.login-brand-title {
  margin: 0;
  color: #ffffff;
  font-size: 1.9rem;
  line-height: 1.12;
}

.login-brand-subtitle {
  margin: 0;
  max-width: 36rem;
  color: rgba(239, 247, 255, 0.9);
  font-size: 1rem;
  line-height: 1.55;
}

.login-brand-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.login-brand-steps div {
  min-height: 180px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.login-brand-steps strong {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(185, 232, 255, 0.18);
  color: #d9efff;
}

.login-brand-steps span {
  color: #ffffff;
  font-weight: 900;
}

.login-brand-steps p {
  margin: 0;
  color: rgba(239, 247, 255, 0.84);
  font-size: 0.88rem;
  line-height: 1.45;
}

.login-site-footer {
  border-top: 1px solid rgba(18, 52, 91, 0.1);
  background: rgba(248, 251, 255, 0.9);
}

.login-site-footer-inner {
  min-height: 130px;
  display: grid;
  grid-template-columns: 1fr repeat(3, minmax(150px, 0.48fr));
  gap: 22px;
  align-items: center;
}

.login-site-footer-branding {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.login-site-footer-product-logo {
  display: block;
  width: 116px;
  height: 116px;
  border-radius: 0;
  opacity: 0.76;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(17, 47, 86, 0.12));
}

.login-site-footer-inner div {
  display: grid;
  gap: 7px;
}

.login-site-footer-inner .login-site-footer-branding {
  justify-items: start;
}

.login-site-footer-inner strong {
  color: var(--blue-950);
}

.login-site-footer-inner a {
  color: var(--blue-700);
  font-size: 0.86rem;
  text-decoration: none;
}

.login-site-footer-inner a.login-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-contact-icon {
  width: 14px;
  flex: 0 0 14px;
  color: #6a7c91;
  text-align: center;
}

.login-contact-icon.is-accent {
  color: #6a54d9;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 12px 16px 16px;
  display: grid;
  gap: 10px;
}

.timeline li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-50);
}

.timeline time,
.timeline span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-body {
    max-height: 420px;
  }

  .nav-item {
    min-width: 0;
  }

  .metric-grid,
  .panel-grid,
  .panel-grid.is-wide {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  select,
  .topbar-tenant-switcher {
    flex: 1 1 auto;
    min-width: 0;
  }

  body.is-auth-screen .sidebar {
    display: none;
  }

  .login-site-header-inner {
    min-height: auto;
    padding: 14px 0;
    flex-wrap: wrap;
  }

  .login-site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }

  .login-shell-wide {
    grid-template-columns: 1fr;
  }

  .login-card {
    min-height: auto;
  }

  .login-brand-steps,
  .login-site-footer-inner {
    grid-template-columns: 1fr;
  }

  .login-brand-steps div {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .login-page {
    padding: 14px;
  }

  .login-site-header-inner,
  .login-site-footer-inner {
    width: min(100% - 28px, 1200px);
  }

  .login-site-brand-logo {
    width: 156px;
    max-height: 48px;
  }

  .login-site-cta {
    width: 100%;
  }

  .login-site-footer-product-logo {
    width: 68px;
    height: 68px;
  }

  .login-card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .login-card .auth-panel-header {
    display: grid;
  }

  .login-card .auth-panel-header h2 {
    font-size: 1.8rem;
  }

  .auth-secondary-row {
    display: grid;
  }

  .login-brand-panel {
    padding: 20px;
    border-radius: 20px;
  }

  .login-brand-hero {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
  }

  .login-brand-product-logo {
    width: 92px;
    height: 92px;
  }

  .login-brand-title {
    font-size: 1.55rem;
  }
}
