.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px #45d7c533);
}

.filter-form select {
  width: 220px;
}

.form-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* Shared Gemini liquid-glass palette used by the Stella user shell. */
:root {
  color-scheme: light;
  color: #1f1f1f;
  background: #f8fafd;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-2: rgba(255, 255, 255, 0.86);
  --line: rgba(95, 99, 104, 0.18);
  --muted: #5f6368;
  --cyan: #0b57d0;
  --blue: #0b57d0;
  --danger: #b3261e;
  --warning: #8a4f00;
  --admin-bg: #f8fafd;
  --admin-sidebar: rgba(240, 244, 249, 0.88);
  --admin-sidebar-deep: rgba(233, 238, 246, 0.82);
  --admin-surface: rgba(255, 255, 255, 0.72);
  --admin-surface-strong: rgba(255, 255, 255, 0.9);
  --admin-text: #1f1f1f;
  --admin-hover: rgba(211, 227, 253, 0.58);
  --admin-active: rgba(211, 227, 253, 0.88);
  --admin-shadow: rgba(60, 64, 67, 0.12);
}

.dark {
  color-scheme: dark;
  color: #e3e3e3;
  background: #131314;
  --panel: rgba(40, 42, 44, 0.72);
  --panel-2: rgba(40, 42, 44, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --muted: #9a9b9c;
  --cyan: #a8c7fa;
  --blue: #a8c7fa;
  --danger: #ffb4ab;
  --warning: #ffb95c;
  --admin-bg: #131314;
  --admin-sidebar: rgba(40, 42, 44, 0.9);
  --admin-sidebar-deep: rgba(30, 31, 32, 0.88);
  --admin-surface: rgba(30, 31, 32, 0.72);
  --admin-surface-strong: rgba(40, 42, 44, 0.9);
  --admin-text: #e3e3e3;
  --admin-hover: rgba(255, 255, 255, 0.08);
  --admin-active: rgba(168, 199, 250, 0.14);
  --admin-shadow: rgba(0, 0, 0, 0.3);
}

body {
  color: var(--admin-text);
  background:
    radial-gradient(circle at 84% -8%, rgba(211, 227, 253, 0.48), transparent 36%),
    var(--admin-bg);
}

.dark body {
  background:
    radial-gradient(circle at 84% -8%, rgba(61, 83, 130, 0.2), transparent 36%),
    var(--admin-bg);
}

.sidebar {
  border-right-color: rgba(255, 255, 255, 0.62);
  background:
    radial-gradient(circle at 10% 0, rgba(255, 255, 255, 0.7), transparent 36%),
    linear-gradient(155deg, var(--admin-sidebar), var(--admin-sidebar-deep));
  box-shadow: 18px 0 48px var(--admin-shadow), inset -1px 0 rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(28px) saturate(160%);
}

.dark .sidebar {
  border-right-color: var(--line);
  background:
    radial-gradient(circle at 10% 0, rgba(68, 71, 74, 0.3), transparent 36%),
    linear-gradient(155deg, var(--admin-sidebar), var(--admin-sidebar-deep));
  box-shadow: 18px 0 48px var(--admin-shadow), inset -1px 0 rgba(255, 255, 255, 0.04);
}

.brand-mark {
  color: #fff;
  background: linear-gradient(135deg, #0b57d0, #4c8bf5);
  box-shadow: 0 10px 28px rgba(11, 87, 208, 0.24);
}

.brand-logo {
  filter: drop-shadow(0 8px 18px rgba(11, 87, 208, 0.2));
}

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

.nav-item:hover,
.nav-item.active {
  color: var(--admin-text);
  background: var(--admin-hover);
}

.nav-item.active {
  background: linear-gradient(145deg, var(--admin-active), var(--admin-hover));
  box-shadow: 0 8px 24px var(--admin-shadow), inset 0 1px rgba(255, 255, 255, 0.48);
}

.dark .nav-item.active {
  box-shadow: 0 8px 24px var(--admin-shadow), inset 0 1px rgba(255, 255, 255, 0.08);
}

.back-link:hover,
.eyebrow {
  color: var(--cyan);
}

.metric,
.card {
  border-color: var(--line);
  background: linear-gradient(145deg, var(--admin-surface-strong), var(--admin-surface));
  box-shadow: 0 16px 44px var(--admin-shadow), inset 0 1px rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(22px) saturate(145%);
}

.dark .metric,
.dark .card {
  box-shadow: 0 16px 44px var(--admin-shadow), inset 0 1px rgba(255, 255, 255, 0.06);
}

.model-tier-card {
  margin-bottom: 18px;
}

.maintenance-summary-card {
  margin-bottom: 18px;
}

.maintenance-summary-card .card-head {
  margin-bottom: 8px;
}

.announcement-preview {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--admin-surface);
}

.announcement-preview > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 18px;
}

.announcement-preview p,
.announcement-preview h3,
.announcement-preview h4,
.announcement-preview ul,
.announcement-preview pre {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.announcement-preview pre {
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: var(--admin-hover);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.model-tier-card > .card-head small {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.5;
  text-align: right;
}

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

.model-tier-item {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--admin-surface);
}

.model-tier-heading,
.model-tier-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.model-tier-heading > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.model-tier-key,
.model-tier-multiplier {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
}

.model-tier-multiplier {
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--admin-active);
}

.model-tier-alias {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-tier-actions .button {
  flex: 1;
}

.model-tier-item > small:last-child {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1320px) {
  .model-tier-grid {
    grid-template-columns: 1fr;
  }
}

label {
  color: var(--admin-text);
}

input,
textarea,
select,
.button.secondary {
  color: var(--admin-text);
  border-color: var(--line);
  background: var(--admin-surface);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.12);
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, #0b57d0, #4c8bf5);
  box-shadow: 0 8px 20px rgba(11, 87, 208, 0.18);
}

.button.secondary:hover {
  background: var(--admin-hover);
}

.table-wrap {
  border-color: var(--line);
  background: var(--admin-surface);
}

th {
  color: var(--muted);
  background: var(--admin-surface-strong);
}

th,
td,
.timeline-item,
.form-card hr {
  border-color: var(--line);
}

tbody tr:hover {
  background: var(--admin-hover);
}

.status.ok,
.pill.active {
  color: #137333;
  border-color: rgba(19, 115, 51, 0.2);
  background: rgba(230, 244, 234, 0.8);
}

.dark .status.ok,
.dark .pill.active {
  color: #81c995;
  background: rgba(19, 115, 51, 0.18);
}

.notice,
.rollout-impact {
  color: var(--admin-text);
  border-color: rgba(11, 87, 208, 0.2);
  background: rgba(211, 227, 253, 0.48);
}

.dark .notice,
.dark .rollout-impact {
  background: rgba(168, 199, 250, 0.1);
}

.readiness-warning {
  color: var(--warning);
}

.service-status strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.readiness-card .card-head {
  margin-bottom: 10px;
}

#readiness-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
}

.service-status-light {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #137333;
  box-shadow: 0 0 0 4px rgba(19, 115, 51, 0.13);
}

.service-status {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--admin-surface);
}

.service-status strong {
  font-size: 12px;
}

.service-status small,
.service-status time {
  color: var(--muted);
  font-size: 11px;
}

.service-status time {
  flex: 0 0 auto;
}

.service-status.warning .service-status-light {
  background: #f9ab00;
  box-shadow: 0 0 0 4px rgba(249, 171, 0, 0.16);
}

.service-status.error .service-status-light {
  background: #d93025;
  box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.14);
}

.organization-member-table {
  max-height: min(52dvh, 540px);
  overflow: auto;
}

/* Lightweight list-first admin layout. Editing stays in native dialogs. */
.panel-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--admin-surface);
  box-shadow: 0 10px 28px var(--admin-shadow);
  backdrop-filter: blur(18px) saturate(140%);
}

.panel-search {
  width: min(420px, 100%);
}

.panel-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.two-column.list-only,
.two-column.narrow-form.list-only {
  display: block;
}

.two-column.list-only > .stack {
  width: 100%;
}

.action-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(86vh, 920px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  color: var(--admin-text);
  background: transparent;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.28);
  overflow: visible;
}

.action-dialog::backdrop {
  background: rgba(31, 31, 31, 0.36);
  backdrop-filter: blur(8px);
}

.dialog-card {
  position: relative;
  max-height: min(86vh, 920px);
  overflow: auto;
  background: var(--admin-surface-strong);
}

.dialog-close {
  position: sticky;
  z-index: 2;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  margin: -8px -8px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--admin-text);
  background: var(--admin-surface-strong);
  font: 24px/1 system-ui, sans-serif;
  cursor: pointer;
}

.dialog-action-title {
  margin: 2px 46px 22px 0;
  font-size: 20px;
}

.action-dialog.single-action .dialog-card > form:not(.action-form-active),
.action-dialog.single-action .dialog-card > hr,
.action-dialog.single-action .dialog-card > .card-head,
.action-dialog.single-action .dialog-card > .form-help,
.action-dialog.single-action .dialog-card > .eyebrow,
.action-dialog.single-action .action-form-active > .card-head {
  display: none;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.user-avatar-wrap {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.user-avatar,
.user-avatar-fallback {
  grid-area: 1 / 1;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cyan);
  background: var(--admin-active);
  object-fit: cover;
  font-weight: 800;
}

.user-avatar {
  position: relative;
  z-index: 1;
  background: var(--admin-surface-strong);
}

@media (max-width: 1180px) {
  .panel-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .panel-search {
    width: 100%;
  }
}

/* Keep the operator console usable on tablets and phones without changing its desktop layout. */
body {
  min-width: 0;
}

@media (max-width: 820px) {
  #readiness-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .sidebar {
    position: relative;
    z-index: 10;
    width: 100%;
    height: auto;
    padding: 12px;
    overflow-x: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding: 0 4px 10px;
  }

  .sidebar nav {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .nav-item.active {
    box-shadow: inset 0 -3px var(--cyan);
  }

  .back-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 4px 0;
  }

  main {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 18px 12px calc(32px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .topbar,
  .top-actions,
  .card-head,
  .filter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .filter-form {
    width: 100%;
  }

  .top-actions .button,
  .filter-form input,
  .filter-form select {
    width: 100%;
  }

  .metric-grid,
  .split-fields,
  .two-column,
  .two-column.narrow-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .card,
  .metric {
    padding: 16px;
  }

  .table-wrap {
    max-width: calc(100vw - 24px);
    overflow-x: auto;
  }

  .timeline-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .timeline-item > *,
  .timeline strong,
  .timeline small {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .action-dialog {
    width: calc(100vw - 16px);
    max-height: 92dvh;
  }

  .dialog-card {
    max-height: 92dvh;
  }
}

@media (max-width: 520px) {
  #readiness-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Touch layouts extend the original operator UI; all data and actions stay shared. */
.shell, main, .panel, .stack, .card-head > *, .filter-form > * { min-width: 0; }
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.card-head { gap: 16px; }
.card-head small, .notice, .service-status, .dialog-card { overflow-wrap: anywhere; }
@media (min-width: 821px) and (max-width: 1100px) {
  .shell { grid-template-columns: 188px minmax(0, 1fr); }
  .sidebar { padding: 22px 12px; }
  main { padding: 24px 20px 40px; }
  .topbar { align-items: flex-start; gap: 16px; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .card-head, .filter-form { flex-wrap: wrap; }
  .filter-form input, .filter-form select { width: min(220px, 100%); }
}
@media (max-width: 820px) {
  .sidebar nav { scroll-padding-inline: 4px; }
  .topbar, .top-actions, .card-head, .filter-form { gap: 12px; }
  .top-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .top-actions .status { text-align: center; }
  input, select, textarea { font-size: 16px; }
  .button, .nav-item, .dialog-close { min-height: 44px; }
  .dialog-close { min-width: 44px; }
  .panel-actions { width: 100%; }
  .panel-actions .button { flex: 1 1 130px; }
  .card-head > .row-actions { width: 100%; }
  .card-head > .row-actions > label { flex: 1 1 160px; }
  .card-head > .row-actions > .button { flex: 1 1 100%; }
  .model-tier-card > .card-head small { text-align: left; }
  .form-help { overflow-wrap: anywhere; }
  .table-wrap { max-width: 100%; }
  .table-wrap table { min-width: 620px; }
  [data-panel-id="users"] .table-wrap table { min-width: 860px; }
  .row-actions .button { min-width: 72px; }
  .action-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); }
}
@media (max-width: 520px) {
  h1 { font-size: 25px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand strong { font-size: 15px; }
  .top-actions { gap: 8px; }
  .metric-grid, .customer-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 14px 12px; }
  .metric strong { font-size: 26px; }
}
