:root {
  --bg: #f5f8ff;
  --text: #13243d;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.68);
  --ok: #1f8a4c;
  --warning: #b67600;
  --critical: #ba1a1a;
  --shadow: rgba(28, 53, 88, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, #dce9ff 0, transparent 45%),
    linear-gradient(180deg, #eff4ff 0%, #f8fbff 100%);
}

.wrap {
  max-width: 1220px;
  margin: 1.25rem auto 2rem;
  padding: 0 1rem;
}

.page-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--panel-soft);
  border: 1px solid rgba(158, 182, 220, 0.4);
  border-radius: 22px;
  box-shadow: 0 10px 28px var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: #e8f0ff;
  color: #12315e;
  font-size: 0.8rem;
  font-weight: 600;
}

.page-heading {
  min-width: 0;
}

.page-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #567096;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  color: #526680;
  max-width: 60ch;
  line-height: 1.35;
  font-size: 0.92rem;
}

.quick-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.compact-links {
  align-self: start;
}

.compact-button {
  padding: 0.62rem 0.88rem;
  border-radius: 12px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.75rem;
  align-items: center;
  margin: 0.8rem 0 1rem;
}

.status-note {
  font-size: 0.82rem;
  color: #40546f;
}

.status-note.quiet {
  opacity: 0.72;
}

.profile-menu {
  position: relative;
}

.profile-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  background: #ffffff;
  color: var(--text);
  border: 1px solid #d7e3f7;
  box-shadow: 0 4px 14px rgba(20, 48, 86, 0.08);
}

.profile-toggle::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid #567096;
  border-bottom: 2px solid #567096;
  transform: rotate(45deg) translateY(-1px);
  margin-left: auto;
}

.profile-menu.open .profile-toggle::after {
  transform: rotate(-135deg) translateY(-1px);
}

.profile-toggle-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.profile-toggle-copy strong,
.profile-toggle-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.profile-toggle-copy strong {
  font-size: 0.92rem;
}

.profile-toggle-copy span {
  font-size: 0.76rem;
  color: #567096;
}

.avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #124eaf 0%, #5ea0ff 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.avatar-badge.large {
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1rem;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  z-index: 20;
  min-width: 290px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dce6f7;
  border-radius: 18px;
  box-shadow: 0 20px 42px rgba(18, 35, 59, 0.18);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-bottom: 0.7rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid #e4ecf8;
}

.menu-form {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.menu-form label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #567096;
}

.menu-form-row {
  display: flex;
  gap: 0.45rem;
}

.menu-form-row select {
  flex: 1;
  min-width: 0;
}

.menu-link,
.menu-link-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: #183256;
  padding: 0.55rem 0.2rem;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
}

.menu-link:hover,
.menu-link-button:hover {
  background: #f1f6ff;
}

.danger-link {
  color: var(--critical);
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.inline-form select {
  border: 1px solid #c9d8f0;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #fff;
  color: var(--text);
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 0.68rem 0.95rem;
  background: #124eaf;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.button {
  display: inline-block;
  border-radius: 12px;
  padding: 0.68rem 0.95rem;
  text-decoration: none;
  font-weight: 600;
}

.button.secondary {
  background: #dce8ff;
  color: #12315e;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0.75rem 0 1.1rem;
}

.metric-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.card {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 8px 20px var(--shadow);
  padding: 0.85rem 0.95rem;
}

.metric-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
}

.metric-card .label,
.metric-card .value {
  margin: 0;
}

.compact-strip {
  gap: 0.55rem;
}

.card.compact .value {
  font-size: 1.3rem;
}

.label {
  margin: 0;
  font-size: 0.9rem;
  color: #526680;
}

.value {
  margin: 0.25rem 0 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.ok .value {
  color: var(--ok);
}

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

.critical .value {
  color: var(--critical);
}

.table-section {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 8px 20px var(--shadow);
  overflow: auto;
}

.source-tabs-section {
  margin-bottom: 1.5rem;
}

.source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.source-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 150px;
  background: #e8f0ff;
  color: #12315e;
  padding: 0.65rem 0.8rem;
  border: 1px solid #d0def4;
  border-radius: 14px;
}

.source-tab.active {
  background: #124eaf;
  color: #fff;
}

.source-tab-title {
  font-size: 0.94rem;
  font-weight: 700;
}

.source-tab-meta {
  margin-top: 0.2rem;
  font-size: 0.77rem;
  opacity: 0.9;
  white-space: nowrap;
}

.source-panel {
  display: none;
}

.source-panel.active {
  display: block;
}

.source-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.source-table-section {
  margin-bottom: 0;
}

.trmm-subtabs {
  display: grid;
  gap: 0.9rem;
}

.trmm-subtab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.trmm-subtab {
  background: #edf3ff;
  color: #12315e;
  border: 1px solid #c5d7f6;
  border-radius: 10px;
  padding: 0.48rem 0.78rem;
  font-weight: 700;
}

.trmm-subtab.active {
  background: #124eaf;
  color: #fff;
  border-color: #124eaf;
}

.trmm-subtab.good {
  color: var(--ok);
}

.trmm-subtab.bad {
  color: var(--critical);
}

.trmm-subtab.active.good,
.trmm-subtab.active.bad {
  color: #fff;
}

.trmm-subpanel {
  display: none;
}

.trmm-subpanel.active {
  display: block;
}

.custom-field-subtabs {
  display: grid;
  gap: 0.75rem;
}

.custom-field-subtab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.custom-field-subtab {
  background: #f3f7ff;
  color: #12315e;
  border: 1px solid #ccd9f3;
  border-radius: 10px;
  padding: 0.46rem 0.72rem;
  font-weight: 700;
}

.custom-field-subtab.active {
  background: #124eaf;
  color: #fff;
  border-color: #124eaf;
}

.custom-field-subpanel {
  display: none;
}

.custom-field-subpanel.active {
  display: block;
}

.custom-field-meta {
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
  color: #526680;
  font-weight: 600;
}

.custom-field-table-sort {
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.custom-field-table-sort:hover {
  text-decoration: underline;
}

.axcient-subtabs {
  display: grid;
  gap: 0.8rem;
}

.axcient-subtab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.axcient-subtab {
  background: #f0f5ff;
  color: #12315e;
  border: 1px solid #ccd9f3;
  border-radius: 10px;
  padding: 0.48rem 0.72rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 180px;
}

.axcient-subtab-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.axcient-subtab-meta {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  opacity: 0.9;
}

.axcient-subtab.warning {
  color: var(--warning);
}

.axcient-subtab.critical {
  color: var(--critical);
}

.axcient-subtab.ok {
  color: var(--ok);
}

.axcient-subtab.active {
  background: #124eaf;
  color: #fff;
  border-color: #124eaf;
}

.axcient-subpanel {
  display: none;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 8px 20px var(--shadow);
  padding: 0.9rem;
}

.axcient-subpanel.active {
  display: block;
}

.axcient-system-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}

.axcient-system-updated {
  font-size: 0.88rem;
  color: #526680;
  font-weight: 600;
}

.axcient-system-link {
  margin-top: 0.8rem;
  display: inline-block;
  font-weight: 700;
}

.axcient-summary h2 {
  margin-bottom: 0.55rem;
}

.trmm-empty {
  margin: 0;
  font-weight: 600;
  color: #526680;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.62rem 0.7rem;
  border-bottom: 1px solid #e6ecf7;
  vertical-align: top;
  font-size: 0.92rem;
}

.detail-cell {
  min-width: 260px;
  max-width: 420px;
}

.detail-text {
  white-space: pre-line;
  line-height: 1.5;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
}

.pill.ok {
  background: #d7f5e2;
  color: var(--ok);
}

.pill.warning {
  background: #fff2d3;
  color: var(--warning);
}

.pill.critical {
  background: #ffe0e0;
  color: var(--critical);
}

.admin-wrap {
  max-width: 1220px;
}

.notice {
  border-radius: 14px;
  padding: 0.72rem 0.92rem;
  margin: 0.85rem 0;
  font-weight: 600;
}

.notice.success {
  background: #d7f5e2;
  color: var(--ok);
}

.notice.warning {
  background: #fff2d3;
  color: var(--warning);
}

.result-meta {
  margin-top: 0.35rem;
  font-weight: 500;
  font-size: 0.85rem;
}

.config-form {
  display: grid;
  gap: 0.85rem;
}

.admin-form-grid {
  display: contents;
}

.admin-tabs {
  margin-top: 1rem;
}

.admin-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.admin-tab {
  background: #e8f0ff;
  color: #12315e;
  border: 1px solid #c5d7f6;
}

.admin-tab.active {
  background: #124eaf;
  color: #fff;
  border-color: #124eaf;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

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

.form-panel {
  align-self: start;
}

.wide-form-panel {
  grid-column: 1 / -1;
}

.applications-wordpress-panel {
  margin-top: 1rem;
}

.stack-form {
  display: grid;
  gap: 0.75rem;
}

.wide-form-panel .stack-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.wide-form-panel .stack-form > .checkbox-row,
.wide-form-panel .stack-form > .checkbox-grid,
.wide-form-panel .stack-form > .actions-row {
  grid-column: 1 / -1;
}

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

.option-row {
  border: 1px solid #d9e4f6;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #f8fbff;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 8px 20px var(--shadow);
  padding: 0.9rem 0.95rem;
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.panel label {
  display: block;
  font-weight: 600;
  margin-top: 0.62rem;
  margin-bottom: 0.22rem;
  font-size: 0.9rem;
}

.panel input[type="text"],
.panel input[type="url"],
.panel input[type="password"],
.panel input[type="number"],
.panel select {
  width: 100%;
  border: 1px solid #c9d8f0;
  border-radius: 12px;
  padding: 0.55rem 0.66rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.secondary-button {
  background: #dce8ff;
  color: #12315e;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.danger-button {
  border: 0;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  background: #ba1a1a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 768px) {
  .page-top {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .admin-tab-panel.active,
  .wide-form-panel .stack-form {
    grid-template-columns: 1fr;
  }

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

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

  .source-summary {
    grid-template-columns: 1fr;
  }

  .actions-row {
    justify-content: flex-start;
  }

  .quick-actions {
    justify-content: flex-start;
  }

  .profile-dropdown {
    min-width: min(290px, calc(100vw - 2rem));
  }

  .menu-form-row {
    flex-direction: column;
  }
}
