:root {
  --bg: #eaf3ef;
  --panel: #ffffff;
  --panel-alt: #f4f8f6;
  --line: #d8e0e5;
  --line-strong: #b9c8cf;
  --text: #16202c;
  --muted: #64748b;
  --accent: #078783;
  --accent-strong: #0b6f67;
  --sidebar: #20252c;
  --sidebar-panel: rgba(255, 255, 255, 0.08);
  --danger: #b14131;
  --warn: #b7791f;
  --ok: #1f8a5b;
  --unknown: #7b8794;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 26%, rgba(15, 102, 92, 0.09), transparent 38%),
    linear-gradient(180deg, #f3f8f6, #e6eeec);
  color: var(--text);
}

.shell {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 24px 24px 24px;
}

.hidden {
  display: none !important;
}

.auth-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.boot-card {
  width: min(100%, 520px);
  padding: 42px;
  margin: 0 auto;
  text-align: center;
}

.boot-card h1 {
  margin-bottom: 12px;
}

.auth-stage {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(100%, 1180px);
  min-height: 680px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 26px 68px rgba(15, 23, 42, 0.14);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.auth-panel {
  border-right: none;
  padding: 56px;
  background:
    radial-gradient(circle at 76% 18%, rgba(147, 219, 198, 0.32), transparent 34%),
    linear-gradient(155deg, #55c9a8 0%, #2d9d83 46%, #12624f 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
}

.auth-brand-mark {
  margin-bottom: auto;
}

.auth-brand-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-brand-badge {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
}

.auth-brand-placeholder strong,
.auth-brand-placeholder span,
.auth-brand-placeholder small {
  display: block;
}

.auth-brand-placeholder strong {
  font-size: 1.35rem;
}

.auth-brand-placeholder span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-brand-placeholder small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
}

.auth-panel h1 {
  margin: 0;
  font-size: 2.45rem;
  line-height: 1.06;
}

.auth-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  max-width: 36ch;
  font-size: 1.02rem;
  line-height: 1.5;
}

.auth-panel .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.auth-card {
  padding: 72px;
  display: grid;
  align-content: center;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.auth-card h2 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.05;
}

.auth-subtitle {
  margin: 14px 0 28px;
  color: #5f6773;
  font-size: 1.05rem;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form .field span {
  font-size: 0.92rem;
  font-weight: 700;
  color: #475569;
}

.auth-form input {
  border: 1px solid #cfd8e3;
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 1.05rem;
  outline: none;
  background: #f8fafc;
}

.auth-form input:focus {
  border-color: #0b8f85;
  box-shadow: 0 0 0 4px rgba(8, 135, 131, 0.14);
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

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

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.create-email-row {
  align-items: end;
}

.create-email-field {
  width: 100%;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

input,
select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  color: inherit;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(86, 95, 107, 0.2);
  outline-offset: 1px;
}

.button {
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.auth-form[data-mode="switch-account"] .button {
  justify-self: start;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #078783;
  font-weight: 800;
  text-align: left;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.panel-ghost {
  background: #edf0f3;
  border: 1px solid var(--line);
  color: var(--text);
}

.button.danger {
  background: var(--danger);
}

.message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(86, 95, 107, 0.16);
  background: rgba(86, 95, 107, 0.08);
}

.message span {
  min-width: 0;
}

.message-close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.message.error {
  border-color: rgba(177, 65, 49, 0.18);
  background: rgba(177, 65, 49, 0.08);
  color: var(--danger);
}

.app-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 48px);
  align-items: stretch;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 18px 10px 18px 0;
  background: linear-gradient(180deg, #eceef2 0%, #e1e4ea 14%, #d0d4db 100%);
  border-right: 1px solid rgba(17, 24, 39, 0.12);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.36);
}

.sidebar-copy,
.identity-label {
  color: #596271;
}

.sidebar-brand {
  padding: 2px 8px 0 24px;
}

.sidebar-brand h2 {
  margin-bottom: 6px;
  font-size: 1.05rem;
  color: #3e4755;
}

.sidebar-eyebrow {
  margin-bottom: 8px;
  color: #6b7280;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  padding-left: 24px;
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: #4b5563;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.45);
}

.nav-item.active {
  background: linear-gradient(135deg, #555e69, #3d454f);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: 44px;
  padding: 0 8px 0 24px;
  border-top: 1px solid rgba(17, 24, 39, 0.12);
  padding-top: 14px;
  flex: 0 0 auto;
}

.identity-chip {
  height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.identity-chip strong {
  display: block;
  margin-top: 2px;
  word-break: break-word;
  color: #3f4754;
  font-size: 0.92rem;
}

.sidebar-logout {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: #eef1f4 !important;
  color: #3e4755 !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 500;
}

.workspace {
  display: grid;
  gap: 18px;
  padding: 0 20px 0 20px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 6px 4px 0;
}

.workspace-header h1 {
  margin-bottom: 8px;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-note {
  font-size: 0.88rem;
  color: var(--muted);
}

.view-stack {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 22px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 22px;
  background:
    linear-gradient(135deg, rgba(86, 95, 107, 0.12), rgba(60, 67, 77, 0.03)),
    #fff;
}

.hero-panel h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.traffic-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.traffic-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.traffic-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.traffic-dot.green {
  background: var(--ok);
}

.traffic-dot.amber {
  background: var(--warn);
}

.traffic-dot.red {
  background: var(--danger);
}

.traffic-dot.gray {
  background: var(--unknown);
}

.hero-metrics,
.domain-grid,
.service-grid,
.insight-grid,
.system-status-list {
  display: grid;
  gap: 14px;
}

.hero-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.metric-card,
.domain-card,
.service-card,
.alert-item,
.log-file-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-alt);
}

.metric-card {
  padding: 16px;
}

.metric-card strong {
  display: block;
  font-size: 1.7rem;
  margin-bottom: 4px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

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

.domain-card,
.service-card {
  padding: 18px;
}

.host-status-panel {
  background:
    linear-gradient(135deg, rgba(86, 95, 107, 0.08), rgba(60, 67, 77, 0.02)),
    #fff;
}

.host-status-header {
  align-items: center;
}

.host-status-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.host-status-controls {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.host-status-button-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.host-toggle-button {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.host-refresh-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: right;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #edf0f3;
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.system-status-list {
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.system-status-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.system-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-alt);
}

.system-status-key {
  color: var(--muted);
}

.system-status-value {
  text-align: right;
}

.system-status-graph-slot {
  display: grid;
  gap: 12px;
}

.sparkline-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-alt);
  padding: 12px;
}

.sparkline-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.sparkline {
  width: 100%;
  height: 72px;
}

.sparkline-empty {
  min-height: 72px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.domain-card-top,
.service-card-top,
.panel-header,
.toolbar,
.log-viewer-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.toolbar-manage-users {
  flex-wrap: nowrap;
  align-items: center;
}

.toolbar-tenant-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.toolbar-tenant-field span {
  font-size: 0.875rem;
  white-space: nowrap;
}

.toolbar-tenant-field select {
  width: auto;
  min-width: 180px;
}

.toolbar-manage-users #filter-email {
  flex: 1 1 0;
  min-width: 0;
  width: 50%;
}

.subheading,
.service-card h3,
.domain-card h3 {
  margin-bottom: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-badge.healthy {
  background: rgba(31, 138, 91, 0.12);
  color: var(--ok);
  border-color: rgba(31, 138, 91, 0.16);
}

.status-badge.degraded {
  background: rgba(183, 121, 31, 0.12);
  color: var(--warn);
  border-color: rgba(183, 121, 31, 0.16);
}

.status-badge.critical {
  background: rgba(177, 65, 49, 0.12);
  color: var(--danger);
  border-color: rgba(177, 65, 49, 0.16);
}

.status-badge.unknown {
  background: rgba(123, 135, 148, 0.12);
  color: var(--unknown);
  border-color: rgba(123, 135, 148, 0.16);
}

.domain-stats,
.service-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.service-card p:last-child {
  margin-bottom: 0;
}

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

.alert-item {
  padding: 14px;
}

.alert-item.high {
  border-color: rgba(177, 65, 49, 0.22);
  background: rgba(177, 65, 49, 0.05);
}

.alert-item.medium {
  border-color: rgba(183, 121, 31, 0.22);
  background: rgba(183, 121, 31, 0.05);
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 20px;
}

.tab-button {
  border: 1px solid #d5d8e0;
  border-radius: 999px;
  background: #f3f4f7;
  color: #2f343c;
  font-size: 0.88rem;
  padding: 8px 14px;
  cursor: pointer;
}

.tab-button.active {
  background: linear-gradient(135deg, #59616c, #3c434d);
  border-color: transparent;
  color: #f7f8fa;
}

.tabbed-pane-row {
  gap: 0;
  flex-wrap: nowrap;
  border-bottom: 1px solid #d5d8e0;
  align-items: flex-end;
}

.tabbed-pane-button {
  border-radius: 10px 10px 0 0;
  border: 1px solid #d5d8e0;
  border-bottom: 0;
  background: #e9edf1;
  margin-right: 6px;
  padding: 9px 16px;
  position: relative;
  top: 1px;
}

.tabbed-pane-button.active {
  background: linear-gradient(135deg, #59616c, #3c434d);
  color: #f7f8fa;
  border-color: #3c434d;
  z-index: 2;
}

.panel-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.section-copy {
  margin-bottom: 12px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.role-chip {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #f8fafb;
}

.role-chip-copy {
  display: inline-grid;
  gap: 2px;
}

.role-chip-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.role-chip input {
  width: auto;
}

.input-action-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.input-action-row input {
  flex: 1 1 0;
  min-width: 0;
}

.lookup-btn {
  flex: 0 0 auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

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

.data-table th:nth-child(1),
.data-table td:nth-child(1) { width: 22%; }

.data-table th:nth-child(2),
.data-table td:nth-child(2) { width: 12%; }

.data-table th:nth-child(3),
.data-table td:nth-child(3) { width: 30%; }

.data-table th:nth-child(4),
.data-table td:nth-child(4) { width: 28%; }

.tenant-table th:nth-child(1),
.tenant-table td:nth-child(1) { width: 22%; }

.tenant-table th:nth-child(2),
.tenant-table td:nth-child(2) { width: 10%; }

.tenant-table th:nth-child(3),
.tenant-table td:nth-child(3) { width: 10%; }

.tenant-table th:nth-child(4),
.tenant-table td:nth-child(4) { width: 28%; }

.tenant-table th:nth-child(5),
.tenant-table td:nth-child(5) {
  width: 18%;
  white-space: nowrap;
}

.tenant-table th:nth-child(6),
.tenant-table td:nth-child(6) {
  width: 12%;
  white-space: nowrap;
}

.tenant-table td:nth-child(4) {
  overflow-wrap: anywhere;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.data-table .action-row input[type="password"],
.data-table .action-row .button {
  padding: 7px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  background: #eef2f3;
  border-radius: 999px;
  margin-right: 6px;
  margin-bottom: 6px;
}

.log-panel {
  padding: 0;
  overflow: hidden;
}

.log-layout {
  display: block;
  min-height: 720px;
}

.compact {
  margin-bottom: 16px;
}

@media (max-width: 1024px) {
}

.log-viewer {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  padding: 20px;
}

.log-viewer-header {
  display: block;
}

.log-viewer-heading {
  text-align: left;
  margin-top: 12px;
}

.log-viewer-heading h2 {
  margin-bottom: 4px;
  font-size: 1rem;
  font-weight: 600;
}

.log-viewer-heading p {
  margin-bottom: 0;
}

.log-service-field {
  min-width: min(100%, 420px);
  align-items: start;
  justify-self: start;
}

.log-service-field select {
  width: 30%;
  min-width: 0;
}

.log-level-controls {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.log-level-field {
  min-width: min(100%, 240px);
  align-items: start;
  width: 20%;
}

.log-level-field select {
  width: 100%;
}

.log-level-detail {
  margin: 0;
}

.log-service-label {
  color: var(--text);
  font-size: 1.65rem;
  font-weight: 700;
  text-align: left;
  line-height: 1.15;
}

.log-service-selected {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: left;
}

.log-content {
  display: block;
  margin: 0;
  padding: 18px;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  height: calc(50 * 1.55em + 36px) !important;
  max-height: calc(50 * 1.55em + 36px) !important;
  border-radius: 18px;
  border: 1px solid #1f2937;
  background: #111827;
  color: #e5edf8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre;
}

/* ── Pagination ── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 2px;
  flex-wrap: wrap;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  flex: 0 0 auto;
}

.pagination-size label {
  white-space: nowrap;
}

.pagination-size select {
  width: auto !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  font-size: 0.88rem;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
}

.pagination-btn {
  padding: 7px 14px;
  font-size: 0.85rem;
  border-radius: 10px;
  white-space: nowrap;
}

.pagination-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ── Compact role grid (inside table cells) ── */
.role-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 8px;
}

.role-chip-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.role-chip-compact input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.role-chip-compact:has(input:checked) {
  background: rgba(7, 135, 131, 0.08);
  border-color: rgba(7, 135, 131, 0.3);
  color: var(--accent-strong);
  font-weight: 600;
}

/* ── Status cell coloring ── */
.status-cell {
  min-width: 130px;
}

.status-cell select {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.status-cell[data-status="active"] select {
  border-color: rgba(31, 138, 91, 0.4);
  background: rgba(31, 138, 91, 0.08);
  color: var(--ok);
}

.status-cell[data-status="invited"] select {
  border-color: rgba(183, 121, 31, 0.4);
  background: rgba(183, 121, 31, 0.08);
  color: var(--warn);
}

.status-cell[data-status="change_password"] select {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
}

.status-cell[data-status="disabled"] select {
  border-color: rgba(177, 65, 49, 0.4);
  background: rgba(177, 65, 49, 0.08);
  color: var(--danger);
}

/* ── Confirm modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  padding: 36px 32px 28px;
  width: min(100%, 420px);
  text-align: center;
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon-row {
  margin-bottom: 16px;
}

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.4rem;
}

.modal-icon-danger {
  background: rgba(177, 65, 49, 0.1);
  color: var(--danger);
}

.modal-icon-warn {
  background: rgba(183, 121, 31, 0.1);
  color: var(--warn);
}

.modal-icon-progress {
  background: rgba(7, 135, 131, 0.12);
  color: var(--accent);
}

.modal-icon-success {
  background: rgba(34, 139, 34, 0.1);
  color: #228b22;
}

.modal-icon-failure {
  background: rgba(177, 65, 49, 0.1);
  color: var(--danger);
}

.modal-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.modal-message {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-submessage {
  margin: -14px 0 28px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions .button {
  min-width: 100px;
  padding: 12px 20px;
  font-size: 0.92rem;
}

.modal-actions .button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.provision-modal {
  width: min(100%, 460px);
}

.provision-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(7, 135, 131, 0.18);
  border-top-color: var(--accent);
  animation: provisionSpin 0.85s linear infinite;
}

@keyframes provisionSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Toast popup notifications ── */
.toast-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: min(90vw, 560px);
}

.toast {
  pointer-events: all;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.18);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  max-width: 520px;
  animation: toastIn 0.2s ease;
}

.toast-success {
  border-left: 4px solid var(--ok);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-success .toast-icon::before {
  content: "✓";
  color: var(--ok);
  font-weight: 700;
  font-size: 1rem;
}

.toast-error .toast-icon::before {
  content: "✕";
  color: var(--danger);
  font-weight: 700;
  font-size: 1rem;
}

.toast-body {
  flex: 1;
  min-width: 0;
  font-size: 0.94rem;
  line-height: 1.45;
}

.toast-error .toast-body {
  color: var(--danger);
}

.toast-close {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--muted);
  padding: 0;
  line-height: 1;
  margin-top: 1px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .app-layout,
  .hero-panel,
  .log-viewer-header {
    grid-template-columns: 1fr;
  }

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

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

  .domain-grid,
  .service-grid,
  .system-status-list,
  .system-status-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 14px;
  }

  .split,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .create-email-row {
    grid-template-columns: 1fr;
  }

  .create-email-field {
    width: 100%;
  }

  .auth-panel,
  .auth-card {
    padding: 26px;
  }

  .workspace-header,
  .panel-header,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tabbed-pane-row {
    flex-wrap: wrap;
    border-bottom: none;
  }

  .tabbed-pane-button {
    border-bottom: 1px solid #d5d8e0;
    border-radius: 10px;
    top: 0;
    margin-bottom: 6px;
  }
}
