:root {
  --bg: #f4f7fb;
  --text: #142033;
  --muted: #5c6b82;
  --line: rgba(125, 150, 182, 0.18);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --shadow: 0 28px 60px rgba(26, 49, 86, 0.12);
  --primary: #0a84ff;
  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff453a;
  --info: #4d7cff;
  --muted-pill: #7f8da4;
  --field-bg: rgba(247, 251, 255, 0.95);
  --field-border: rgba(77, 124, 255, 0.22);
  --field-border-hover: rgba(77, 124, 255, 0.34);
  --field-border-focus: rgba(10, 132, 255, 0.52);
  --field-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58), 0 10px 24px rgba(56, 86, 130, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.portal-body {
  min-height: 100vh;
}

.portal-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(185, 214, 255, 0.55), transparent 32%),
    radial-gradient(circle at bottom right, rgba(220, 235, 255, 0.8), transparent 38%),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}

.portal-blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.6;
}

.portal-blob-a {
  top: -8rem;
  right: -6rem;
  width: 26rem;
  height: 26rem;
  background: rgba(185, 214, 255, 0.62);
}

.portal-blob-b {
  bottom: 8rem;
  left: -10rem;
  width: 30rem;
  height: 30rem;
  background: rgba(207, 231, 255, 0.66);
}

.portal-blob-c {
  top: 45%;
  left: 45%;
  width: 18rem;
  height: 18rem;
  background: rgba(232, 241, 255, 0.8);
}

.glass-card {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.portal-shell {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 100vh;
  padding: 1.25rem;
}

.portal-sidebar {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  width: min(252px, calc(100vw - 2.5rem));
  min-height: calc(100vh - 2.5rem);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateX(calc(-100% - 2rem));
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
  z-index: 24;
}

.portal-shell.is-sidebar-open .portal-sidebar {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.portal-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  border: 0;
  background: rgba(17, 25, 40, 0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-brand,
.auth-brand {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.brand-badge,
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.92), rgba(77, 124, 255, 0.78));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 18px 32px rgba(10, 132, 255, 0.24);
}

.eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(20, 32, 51, 0.5);
}

.sidebar-title,
.page-header h1,
.auth-panel h1,
.auth-side-panel h2 {
  margin: 0;
}

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.8rem 1rem;
  border-radius: 18px;
  color: var(--muted);
  transition: 160ms ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.sidebar-link.is-active {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.16), rgba(255, 255, 255, 0.74));
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
}

.sidebar-footer-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.sidebar-footer-value {
  margin: 0.3rem 0 0;
  font-weight: 600;
}

.portal-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-topbar {
  position: sticky;
  top: 1.25rem;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
}

.topbar-primary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 auto;
}

.topbar-leading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 0 0 auto;
}

.topbar-brand-logo {
  display: block;
  width: auto;
  height: 1.9rem;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(20, 32, 51, 0.12));
}

.topbar-copy {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
  align-content: center;
}

.topbar-copy .eyebrow {
  margin-bottom: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  opacity: 0.9;
}

.topbar-copy strong {
  font-size: 1.08rem;
  font-weight: 700;
  display: block;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.about-shell {
  position: relative;
}

.about-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.8);
  box-shadow:
    0 10px 20px rgba(32, 58, 95, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.54);
}

.about-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.16), rgba(255, 255, 255, 0.88));
  color: var(--primary);
}

.about-panel {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  width: min(280px, calc(100vw - 2rem));
  padding: 1rem 1.1rem;
  display: none;
  gap: 0.35rem;
  z-index: 12;
}

.about-shell.is-about-open .about-panel {
  display: grid;
}

.about-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.topbar-actions .status-pill {
  min-height: 2.2rem;
  padding-inline: 0.85rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.topbar-actions .admin-button,
.topbar-actions .danger-button {
  min-height: 2.55rem;
  padding: 0.72rem 0.95rem;
  border: 1px solid rgba(125, 150, 182, 0.16);
  box-shadow:
    0 10px 20px rgba(32, 58, 95, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.topbar-actions .admin-button:hover,
.topbar-actions .danger-button:hover,
.about-toggle:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 24px rgba(32, 58, 95, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.sidebar-toggle {
  display: inline-flex;
  box-shadow:
    0 12px 24px rgba(32, 58, 95, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.58);
  transform: translateY(-1px);
  transition: box-shadow 160ms ease, transform 160ms ease, background 160ms ease, color 160ms ease;
}

.sidebar-toggle:hover {
  box-shadow:
    0 16px 30px rgba(32, 58, 95, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

.sidebar-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.16), rgba(255, 255, 255, 0.88));
  color: var(--primary);
}

.portal-content {
  display: grid;
  gap: 1.25rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.4rem 0.15rem;
}

.page-header h1 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.05;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.page-subtitle,
.auth-copy,
.helper-text,
.cell-meta,
.metric-meta,
.highlight-meta,
.activity-meta,
.activity-timestamp,
.settings-meta {
  margin: 0;
  color: var(--muted);
}

.page-subtitle {
  max-width: 74ch;
  line-height: 1.55;
  color: rgba(92, 107, 130, 0.92);
}

.cell-meta {
  margin-top: 0.18rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(92, 107, 130, 0.9);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
}

.metric-card {
  padding: 1rem 1.05rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow:
    0 18px 30px rgba(26, 49, 86, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.metric-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(92, 107, 130, 0.84);
}

.metric-value {
  margin: 0.28rem 0 0.14rem;
  font-size: clamp(1.65rem, 1.8vw, 2.1rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.metric-meta {
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(92, 107, 130, 0.9);
}

.metric-card-primary .metric-value {
  color: var(--primary);
}

.metric-card-success .metric-value {
  color: var(--success);
}

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

.metric-card-danger .metric-value {
  color: var(--danger);
}

.portal-grid {
  display: grid;
  gap: 1rem;
}

.portal-grid-hero {
  grid-template-columns: 1.35fr 1fr;
}

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

.portal-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.map-panel {
  display: grid;
  gap: 0.9rem;
  padding: 1.05rem 1.05rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow:
    0 26px 44px rgba(26, 49, 86, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.map-panel-subtitle,
.map-stat-label {
  margin: 0;
  color: var(--muted);
}

.map-panel-heading {
  align-items: center;
  margin-bottom: 0.15rem;
}

.map-panel-subtitle {
  max-width: 72ch;
}

.map-legend {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.35rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.map-legend-swatch {
  inline-size: 0.82rem;
  block-size: 0.82rem;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(20, 32, 51, 0.12);
}

.map-legend-swatch-anchor {
  background: var(--warning);
}

.map-legend-swatch-sensor {
  background: var(--primary);
}

.map-legend-swatch-site {
  background: var(--info);
}

.map-legend-swatch-gateway {
  background: var(--success);
}

.map-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.map-stat-card {
  padding: 0.78rem 0.9rem 0.72rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.map-stat-value {
  margin: 0.18rem 0 0;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.05;
}

.leaflet-map-shell {
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 18px 34px rgba(26, 49, 86, 0.09),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.leaflet-map-canvas {
  min-height: 36.5rem;
}

.leaflet-container {
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.95), rgba(232, 239, 248, 0.95));
}

.map-popup p,
.map-popup-link {
  margin: 0.35rem 0 0;
}

.map-popup-link a {
  color: var(--primary);
  font-weight: 600;
}

.spotlight-card,
.glass-card {
  padding: 1.2rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.highlight-grid,
.quick-links {
  display: grid;
  gap: 0.85rem;
}

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

.highlight-item,
.quick-link-card {
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.highlight-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.highlight-value {
  margin: 0.35rem 0 0.15rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.quick-link-card {
  display: grid;
  gap: 0.25rem;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.quick-link-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(26, 49, 86, 0.12);
}

.quick-link-label {
  font-weight: 600;
}

.quick-link-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.activity-list {
  display: grid;
  gap: 0.8rem;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}

.activity-item:first-child {
  border-top: 0;
  padding-top: 0.1rem;
}

.activity-title {
  margin: 0 0 0.18rem;
  font-weight: 600;
}

.activity-side {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.table-shell {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 12px 26px rgba(26, 49, 86, 0.06);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 0.8rem 0.95rem;
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(92, 107, 130, 0.86);
  letter-spacing: 0.02em;
  padding-top: 0.78rem;
  padding-bottom: 0.72rem;
}

.data-table tbody tr {
  border-top: 1px solid var(--line);
  transition: background 140ms ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.34);
}

.cell-text {
  font-weight: 600;
  line-height: 1.3;
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.inline-action-form {
  display: inline-flex;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.72rem;
  padding: 0.1rem 0.66rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(20, 32, 51, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.status-pill-success {
  color: #157a31;
  background: rgba(48, 209, 88, 0.16);
}

.status-pill-warning {
  color: #9b5d00;
  background: rgba(255, 159, 10, 0.2);
}

.status-pill-danger {
  color: #a7231a;
  background: rgba(255, 69, 58, 0.16);
}

.status-pill-info {
  color: #1451c8;
  background: rgba(10, 132, 255, 0.14);
}

.status-pill-muted {
  color: #5f6c80;
  background: rgba(95, 108, 128, 0.12);
}

.primary-button,
.action-button,
.secondary-button,
.nav-button,
.admin-button,
.danger-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.85rem 1.05rem;
  border-radius: 18px;
  border: 0;
  cursor: pointer;
  transition: 160ms ease;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.primary-button,
.action-button,
.admin-button {
  background: linear-gradient(135deg, #0a84ff, #4d7cff);
  color: #fff;
  box-shadow: 0 18px 30px rgba(10, 132, 255, 0.26);
}

.primary-button:hover,
.action-button:hover,
.admin-button:hover,
.nav-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.secondary-button,
.nav-button {
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.92), rgba(230, 134, 14, 0.92));
  color: #fff;
  box-shadow: 0 18px 30px rgba(230, 134, 14, 0.24);
}

.danger-button {
  background: linear-gradient(135deg, #d94841, #b32922);
  color: #fff;
  box-shadow: 0 18px 30px rgba(179, 41, 34, 0.24);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.compact-button {
  min-height: 2.45rem;
  padding: 0.64rem 0.9rem;
  border-radius: 16px;
  font-size: 0.92rem;
}

.is-disabled {
  opacity: 0.58;
  cursor: default;
  pointer-events: none;
}

.icon-button {
  width: 2.75rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.7);
}

.primary-button:focus-visible,
.action-button:focus-visible,
.secondary-button:focus-visible,
.nav-button:focus-visible,
.admin-button:focus-visible,
.danger-button:focus-visible,
.ghost-button:focus-visible,
.icon-button:focus-visible,
.glass-input:focus-visible,
.portal-checkbox:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.24);
  outline-offset: 2px;
}

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

.status-message {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(20, 32, 51, 0.08);
}

.status-message-error {
  background: rgba(255, 69, 58, 0.12);
  color: #9a241c;
}

.status-message-success {
  background: rgba(48, 209, 88, 0.14);
  color: #156a2d;
}

.status-message-warning {
  background: rgba(255, 159, 10, 0.16);
  color: #925700;
}

.status-message-info {
  background: rgba(10, 132, 255, 0.12);
  color: #1451c8;
}

.empty-state {
  padding: 2.2rem 1.1rem;
  text-align: center;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(244, 248, 253, 0.72));
  border: 1px dashed rgba(125, 150, 182, 0.24);
}

.empty-state h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.empty-state p {
  margin: 0 auto;
  max-width: 46ch;
  color: var(--muted);
  line-height: 1.55;
}

.portal-pagination {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.pagination-summary {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1.2rem;
  padding: 1.3rem;
  align-items: stretch;
}

.auth-panel,
.auth-side-panel {
  padding: 2rem;
}

.auth-panel {
  display: grid;
  gap: 1.3rem;
}

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

.field-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

/* Editable field polish for portal forms. Keep this block isolated for easy rollback. */
.glass-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  box-shadow: var(--field-shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

select.glass-input {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(92, 107, 130, 0.78) 50%),
    linear-gradient(135deg, rgba(92, 107, 130, 0.78) 50%, transparent 50%);
  background-position:
    calc(100% - 1.2rem) calc(50% - 0.12rem),
    calc(100% - 0.9rem) calc(50% - 0.12rem);
  background-size: 0.38rem 0.38rem, 0.38rem 0.38rem;
  background-repeat: no-repeat;
  padding-right: 2.7rem;
}

.glass-input:hover {
  border-color: var(--field-border-hover);
  background: rgba(255, 255, 255, 0.98);
}

.glass-input:focus,
.glass-input:focus-visible {
  border-color: var(--field-border-focus);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.82),
    0 0 0 4px rgba(10, 132, 255, 0.14),
    0 18px 36px rgba(56, 86, 130, 0.12);
}

.glass-input[readonly],
.glass-input:disabled {
  color: rgba(20, 32, 51, 0.62);
  background: rgba(244, 247, 251, 0.86);
  border-color: rgba(125, 150, 182, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  cursor: not-allowed;
}

.auth-status {
  min-height: 1.4rem;
  color: var(--muted);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.ghost-link {
  color: var(--primary);
  font-weight: 600;
}

.feature-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.75rem;
  color: var(--muted);
}

.settings-list {
  display: grid;
  gap: 0.8rem;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.settings-item:first-child {
  border-top: 0;
  padding-top: 0.1rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.15rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--primary);
  font-weight: 600;
}

.breadcrumbs-current {
  color: var(--text);
  font-weight: 600;
}

.breadcrumbs-separator {
  color: rgba(92, 107, 130, 0.5);
}

.list-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.filter-panel,
.activation-status-card {
  padding: 1.1rem 1.2rem;
}

.filter-panel {
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow:
    0 18px 32px rgba(26, 49, 86, 0.07),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.filter-panel-heading {
  margin-bottom: 0.85rem;
}

.filter-panel-heading h2 {
  font-size: 1.04rem;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 0.8rem;
  align-items: end;
}

.filter-field {
  display: grid;
  gap: 0.32rem;
  color: rgba(92, 107, 130, 0.9);
  font-size: 0.84rem;
  font-weight: 600;
}

.compact-input {
  min-height: 2.6rem;
  padding: 0.68rem 0.84rem;
  border-radius: 16px;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.1rem;
}

.portal-grid-detail {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
}

.portal-grid-detail > .glass-card,
.portal-grid-single > .glass-card {
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow:
    0 22px 38px rgba(26, 49, 86, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.portal-form-layout {
  display: grid;
  gap: 1.25rem;
}

.form-section {
  display: grid;
  gap: 1rem;
}

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

.form-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.form-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.form-field {
  display: grid;
  gap: 0.45rem;
}

.portal-form-layout .form-field .glass-input,
.portal-form-layout .checkbox-field,
.filter-panel .glass-input {
  position: relative;
}

.textarea-input {
  min-height: 7rem;
  resize: vertical;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.checkbox-control input {
  inline-size: 1.1rem;
  block-size: 1.1rem;
  margin-top: 0.15rem;
}

.checkbox-copy {
  display: grid;
  gap: 0.2rem;
}

.form-toolbar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.page-header-actions .action-button,
.page-header-actions .nav-button,
.page-header-actions .danger-button,
.page-header-actions .admin-button,
.table-actions .action-button,
.table-actions .nav-button,
.table-actions .danger-button,
.pagination-actions .nav-button,
.filter-actions .action-button,
.filter-actions .nav-button,
.form-toolbar .action-button,
.form-toolbar .nav-button,
.topbar-actions .admin-button,
.topbar-actions .danger-button {
  min-height: 2.4rem;
  padding: 0.62rem 0.88rem;
  border-radius: 16px;
  font-size: 0.92rem;
}

.page-header-actions .action-button,
.page-header-actions .nav-button,
.page-header-actions .danger-button,
.page-header-actions .admin-button {
  padding-inline: 0.92rem;
}

.table-actions .action-button,
.table-actions .nav-button,
.table-actions .danger-button {
  min-height: 2.25rem;
  padding: 0.52rem 0.76rem;
  font-size: 0.86rem;
}

.action-affordance::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 1rem;
  block-size: 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
  flex: 0 0 auto;
}

.action-affordance-view::before {
  content: "↗";
}

.action-affordance-edit::before {
  content: "✎";
}

.action-affordance-delete::before {
  content: "−";
}

.pagination-actions .nav-button {
  min-width: 5.5rem;
  justify-content: center;
}

.field-errors,
.form-error-banner {
  color: #a7231a;
}

.field-errors {
  font-size: 0.88rem;
}

.form-error-banner {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255, 69, 58, 0.12);
}

.portal-stack {
  display: grid;
  gap: 1.25rem;
}

.portal-stack > div {
  padding: 1rem 1rem 1.05rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(247, 250, 255, 0.52));
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.portal-stack h3 {
  margin: 0 0 0.7rem;
  font-size: 1.02rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.key-value-list {
  margin: 0;
  display: grid;
  gap: 0.78rem;
}

.key-value-item {
  display: grid;
  gap: 0.18rem;
  padding: 0.82rem 0;
  border-top: 1px solid var(--line);
}

.key-value-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.key-label {
  color: rgba(92, 107, 130, 0.88);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.key-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.stack-list {
  display: grid;
  gap: 0.8rem;
}

.stack-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.stack-card strong {
  display: block;
  margin-bottom: 0.3rem;
}

.stack-meta {
  margin: 0.16rem 0 0;
  color: var(--muted);
}

.detail-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.confirm-card {
  display: grid;
  gap: 1.25rem;
}

.warning-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.55rem;
  color: var(--text);
}

.cell-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 0.14em;
}

.cell-link:hover {
  text-decoration: underline;
}

.activation-shell {
  display: grid;
  gap: 1rem;
}

.activation-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.activation-step {
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.activation-step.is-active {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.16), rgba(255, 255, 255, 0.74));
  color: var(--text);
}

.auth-status-success {
  color: #137d39;
}

.auth-status-danger {
  color: #ba2d24;
}

.auth-status-info {
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

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

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

  .map-stat-grid {
    grid-template-columns: 1fr;
  }

  .map-panel-heading {
    align-items: flex-start;
  }

  .map-legend {
    justify-content: flex-start;
  }

  .filter-form,
  .portal-grid-hero,
  .portal-grid-detail,
  .portal-grid-columns,
  .form-grid,
  .form-stack,
  .form-checkbox-grid,
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-header {
    flex-direction: column;
  }
}

@media (max-width: 920px) {
  .portal-sidebar {
    width: min(20rem, calc(100vw - 2rem));
    left: 1rem;
    top: 1rem;
    min-height: calc(100vh - 2rem);
  }

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

  .filter-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .portal-shell,
  .auth-shell {
    padding: 0.8rem;
  }

  .kpi-grid,
  .list-summary-grid,
  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar-primary {
    width: 100%;
    gap: 0.8rem;
  }

  .topbar-leading {
    gap: 0.6rem;
  }

  .topbar-brand-logo {
    height: 1.55rem;
  }
}
