:root {
  --bg: #08111d;
  --bg-soft: #0e1a2c;
  --bg-panel: rgba(9, 18, 33, 0.92);
  --panel: rgba(13, 25, 44, 0.88);
  --panel-strong: rgba(17, 30, 50, 0.98);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #edf3ff;
  --muted: rgba(237, 243, 255, 0.68);
  --muted-strong: rgba(237, 243, 255, 0.84);
  --blue: #4f8fff;
  --blue-2: #2e6ae5;
  --green: #2ecc71;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  --radius: 22px;
  --sidebar-width: 286px;
  font-synthesis-weight: none;
  font-synthesis-style: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(78, 132, 255, 0.18), transparent 25%),
    radial-gradient(circle at 90% 10%, rgba(246, 189, 92, 0.14), transparent 22%),
    linear-gradient(180deg, #091321, #040814 100%);
}

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

img {
  display: block;
  max-width: 100%;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 14px 16px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(16, 27, 46, 0.98), rgba(10, 18, 32, 0.98)),
    url('/img/map-bg.jpg') center/cover no-repeat;
  background-blend-mode: multiply;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 24%),
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.04) 100%);
  pointer-events: none;
}

.sidebar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0 10px;
  margin-bottom: 10px;
}

.sidebar-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.sidebar-brand {
  display: grid;
  place-items: center;
  padding: 8px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.sidebar-brand img {
  width: 128px;
}

.sidebar-section {
  margin: 18px 0 10px;
  color: rgba(255, 255, 255, 0.46);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  position: relative;
  z-index: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.90);
  font-weight: 600;
  font-size: 0.96rem;
  position: relative;
  z-index: 1;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: rgba(79, 143, 255, 0.16);
}

.sidebar-footer {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  color: rgba(255, 255, 255, 0.50);
  font-size: 0.82rem;
  z-index: 1;
}

.main {
  min-width: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(79, 143, 255, 0.12), transparent 30%),
    radial-gradient(circle at 70% 15%, rgba(255, 255, 255, 0.06), transparent 18%),
    linear-gradient(180deg, rgba(13, 23, 39, 0.94), rgba(7, 12, 22, 0.98));
}

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 17, 30, 0.90);
  backdrop-filter: blur(18px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar-brand img {
  width: 28px;
  height: 28px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-action {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.03);
}

.topbar-action-admin {
  color: #d8e6ff;
  background: rgba(79, 143, 255, 0.16);
  border-color: rgba(79, 143, 255, 0.34);
}

.topbar-action-admin:hover {
  background: rgba(79, 143, 255, 0.28);
}

.content {
  padding: 24px;
}

.hero-panel,
.surface-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  min-height: 0;
  padding: 0;
  display: block;
  margin-bottom: 32px;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.overview-heading {
  margin: 0 0 12px 2px;
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-copy {
  padding: 4px 2px 18px;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  margin-bottom: 10px;
}

.hero-copy h1,
.panel-head h2 {
  margin: 0 0 10px;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-copy h1 {
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.02;
  max-width: 16ch;
}

.hero-copy p {
  max-width: 60ch;
  margin: 0;
  color: var(--muted-strong);
  font-size: 1.02rem;
  line-height: 1.6;
}

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

.metric {
  min-height: 116px;
  padding: 25px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.metric-link { color: inherit; text-decoration: none; transition: border-color 140ms ease, transform 140ms ease, background 140ms ease; }
.metric-link:hover { border-color: rgba(79,143,255,.45); background: linear-gradient(180deg, rgba(79,143,255,.13), rgba(255,255,255,.03)); transform: translateY(-2px); }

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.metric strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 6px;
}

.metric.healthy strong { color: var(--green); }
.metric.warning strong { color: var(--amber); }
.metric.down strong { color: var(--red); }
.metric.has-alert { border-color: rgba(239,68,68,.55); box-shadow: 0 0 0 1px rgba(239,68,68,.14), 0 0 22px rgba(239,68,68,.14); animation: alert-pulse 1.8s ease-in-out infinite; }
.metric-label { display: flex !important; align-items: center; gap: 9px; }
.alarm-icon { display: inline-grid !important; place-items: center; width: 22px; height: 22px; margin: 0; border-radius: 50%; background: var(--red); color: #fff; font-size: .82rem; font-weight: 800; line-height: 1; vertical-align: middle; animation: icon-pulse 1.1s ease-in-out infinite; }
.alarm-icon-small { width: 15px; height: 15px; margin: 0 5px 0 0; background: transparent; border: 1px solid currentColor; color: inherit; font-size: .62rem; }
@keyframes alert-pulse { 0%, 100% { box-shadow: 0 0 0 1px rgba(239,68,68,.14), 0 0 18px rgba(239,68,68,.10); } 50% { box-shadow: 0 0 0 1px rgba(239,68,68,.34), 0 0 30px rgba(239,68,68,.28); } }
@keyframes icon-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .72; } }
.metric.inactive strong { color: #a7b3c7; }

.filter-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
}

.filter-pill strong {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.86rem;
}

.filter-pill.is-active {
  color: white;
  background: rgba(79, 143, 255, 0.20);
  border-color: rgba(79, 143, 255, 0.38);
}

.surface-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.surface-panel {
  padding: 18px;
  min-width: 0;
}

.services-panel {
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 1.5rem;
}

.panel-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.service-list,
.log-list {
  display: grid;
  gap: 12px;
}

.service-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.service-card.tone-up {
  box-shadow: inset 0 0 0 1px rgba(46, 204, 113, 0.12);
}

.service-card.tone-warning {
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.12);
}

.service-card.tone-down {
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.service-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.service-card-actions { display: grid; justify-items: end; gap: 10px; }
.service-open-button { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 6px 9px; border: 1px solid rgba(79,143,255,.32); border-radius: 7px; color: #c8dcff; background: rgba(79,143,255,.12); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.service-open-button:hover { background: rgba(79,143,255,.24); }

.service-card h3 {
  margin: 0;
  font-size: 1.03rem;
}

.service-card p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.status-badge.tone-up {
  background: rgba(46, 204, 113, 0.12);
  color: #9cf1b9;
}

.status-badge.tone-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #ffd48a;
}

.status-badge.tone-down {
  background: rgba(239, 68, 68, 0.12);
  color: #ffb6b6;
}
.status-badge.tone-inactive { background: rgba(148,163,184,.13); color: #c4cedc; }

.service-status-stack {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.check-mode-label {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

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

.service-meta dt {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

.service-meta dd {
  margin: 0;
  color: var(--muted-strong);
}

.log-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.log-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 160px;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.log-time,
.log-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.log-main strong {
  display: block;
}

.log-main span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.empty-state {
  padding: 18px 0 6px;
  color: var(--muted);
}

.all-good-state {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  color: var(--muted);
}

.all-good-state strong,
.all-good-state span {
  display: block;
}

.all-good-state > div {
  display: grid;
  gap: 4px;
}

.all-good-state strong {
  color: #b8f5ca;
  font-size: 1.08rem;
}

.all-good-state span {
  margin-top: 0;
}

.all-good-icon {
  display: inline-grid !important;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 !important;
  border-radius: 50%;
  color: #071a10 !important;
  background: var(--green);
  font-size: 1.2rem;
  font-weight: 800;
}

.admin-content {
  max-width: 1180px;
}

.services-page { max-width: 1320px; }
.services-heading { align-items: center; }
.service-heading-actions { display: flex; align-items: center; gap: 20px; }
.service-modal { width: min(900px, calc(100% - 32px)); max-height: calc(100% - 64px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: #0d192c; color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.service-modal::backdrop { background: rgba(2,7,16,.78); backdrop-filter: blur(4px); }
.service-modal-card { padding: 24px; }
.service-modal-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.service-modal-head h2 { margin: 4px 0 0; }
.modal-close { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.06); color: var(--muted-strong); font: inherit; font-size: 1.4rem; cursor: pointer; }
.modal-close:hover { background: rgba(255,255,255,.12); color: var(--text); }
.inline-service-form { display: grid; gap: 14px; width: min(820px, calc(100vw - 80px)); color: var(--text); }
.inline-service-form label:not(.checkbox-label) span { display: block; margin-bottom: 6px; color: var(--muted); }
.inline-service-form input:not([type='checkbox']), .inline-service-form select { width: 100%; min-height: 42px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(4,10,21,.72); color: var(--text); padding: 0 11px; font: inherit; color-scheme: dark; }
.inline-service-form input:focus, .inline-service-form select:focus { border-color: rgba(79,143,255,.76); box-shadow: 0 0 0 3px rgba(79,143,255,.16); outline: none; }
.inline-service-form .form-grid { gap: 14px; }
.directory-edit { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.directory-edit > summary { width: fit-content; list-style: none; }
.directory-edit > summary::-webkit-details-marker { display: none; }
.directory-edit[open] > summary { margin-bottom: 16px; }
.directory-edit .inline-service-form { width: 100%; }
.service-count { display: grid; justify-items: end; color: var(--muted); }
.service-count strong { color: var(--text); font-size: 2rem; line-height: 1; }
.service-count span { margin-top: 6px; font-size: .82rem; }
.service-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.service-search { position: relative; display: flex; flex: 1; max-width: 640px; gap: 8px; }
.service-search input { flex: 1; min-width: 0; height: 42px; padding: 0 14px 0 36px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4,10,21,.72); color: var(--text); font: inherit; }
.service-search input:focus { border-color: rgba(79,143,255,.76); box-shadow: 0 0 0 3px rgba(79,143,255,.16); outline: none; }
.search-icon { position: absolute; margin: 9px 0 0 13px; color: var(--muted); font-size: 1.2rem; pointer-events: none; }
.service-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.service-filters .filter-pill { padding: 8px 12px; }
.service-directory { display: grid; row-gap: 18px; transition: opacity 140ms ease; }
.service-directory.is-loading { opacity: .55; pointer-events: none; }
.directory-card { display: grid; grid-template-columns: 120px minmax(220px, 1.4fr) minmax(260px, 1fr) 120px; align-items: center; gap: 20px; padding: 20px 22px; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 16px; background: rgba(13,25,44,.78); box-shadow: 0 14px 36px rgba(0,0,0,.14); }
.directory-card.tone-up { border-left-color: var(--green); }.directory-card.tone-warning { border-left-color: var(--amber); }.directory-card.tone-down { border-left-color: var(--red); }.directory-card.tone-inactive { border-left-color: #94a3b8; opacity: .58; }
.directory-status { display: flex; align-items: center; gap: 8px; color: var(--muted-strong); font-size: .83rem; font-weight: 700; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }.tone-up .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(46,204,113,.12); }.tone-warning .status-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(245,158,11,.12); }.tone-down .status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(239,68,68,.12); }.tone-inactive .status-dot { background: #94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,.12); }
.directory-main h2 { margin: 0; font-size: 1.05rem; }.directory-main p { margin: 5px 0 7px; color: var(--muted); font-size: .88rem; }.directory-key { color: var(--muted); font: .78rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.directory-details { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }.directory-details span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.03); }
.directory-result { display: grid; justify-items: end; gap: 4px; color: var(--muted); font-size: .84rem; }.directory-result strong { color: var(--muted-strong); }.empty-directory { display: grid; gap: 6px; text-align: center; padding: 54px 20px; }.empty-directory span { color: var(--muted); }

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-heading h1 {
  margin: 4px 0 8px;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

.button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.button-icon { font-size: 1.3rem; line-height: 0; margin-right: 5px; }

.button-primary { background: linear-gradient(180deg, #5a8fff, #3f78e4); }
.button-quiet { background: rgba(255, 255, 255, 0.08); color: var(--muted-strong); }

.user-table-panel,
.user-form-panel { padding: 20px 24px; }

.user-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) 1fr 1fr minmax(140px, 0.7fr);
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 0 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-table-row:last-child { border-bottom: 0; }
.user-table-head { min-height: 44px; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; }
.user-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-identity strong { overflow: hidden; text-overflow: ellipsis; }
.user-avatar { display: inline-grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; color: #d8e6ff; background: rgba(79,143,255,.22); border: 1px solid rgba(130,174,255,.35); font-weight: 800; }
.table-muted { color: var(--muted); }
.table-subtext { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; }
.service-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(79,143,255,.12); }
.service-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-badge { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 7px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.role-admin { color: #bcd4ff; background: rgba(79,143,255,.16); border: 1px solid rgba(79,143,255,.28); }
.role-user { color: #cbd2df; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.role-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.table-actions { display: flex; align-items: center; justify-content: end; gap: 8px; }
.table-actions form { margin: 0; }
.table-button { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; height: 34px; padding: 0 12px; border-radius: 8px; font: inherit; font-size: .84rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: filter 140ms ease, transform 140ms ease; }
.table-button:hover { filter: brightness(1.18); transform: translateY(-1px); }
.table-button-edit { color: #d8e6ff; background: rgba(79,143,255,.18); border: 1px solid rgba(79,143,255,.36); }
.table-button-delete { color: #ffd0d0; background: rgba(239,68,68,.13); border: 1px solid rgba(239,68,68,.3); }
.current-user-label { color: var(--muted); font-size: .78rem; padding: 0 6px; }

.admin-form { display: grid; gap: 18px; max-width: 620px; }
.service-form { max-width: 820px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-form [hidden] { display: none; }
.form-info { min-height: 44px; padding: 0 2px; }
.form-info > span, .form-info > strong, .form-info > small { display: block; }
.form-info > span { margin-bottom: 7px; color: var(--muted); }
.form-info > strong { color: var(--text); font-weight: 600; }
.form-info > small { margin-top: 5px; color: var(--muted); }
.admin-form label:not(.checkbox-label) span { display: block; margin-bottom: 7px; color: var(--muted); }
.admin-form label small { display: block; margin-top: 5px; color: var(--muted); }
.admin-form input:not([type='checkbox']):not([type='radio']), .admin-form select, .admin-form textarea { width: 100%; min-height: 44px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(4,10,21,.72); color: var(--text); padding: 0 12px; font: inherit; color-scheme: dark; }
.admin-form textarea { min-height: 100px; padding-top: 11px; resize: vertical; }
.admin-form input::placeholder, .admin-form textarea::placeholder { color: rgba(237,243,255,.42); }
.admin-form input:not([type='checkbox']):not([type='radio']):focus, .admin-form select:focus, .admin-form textarea:focus { border-color: rgba(79,143,255,.76); box-shadow: 0 0 0 3px rgba(79,143,255,.16); outline: none; }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; color: var(--muted-strong); }
.checkbox-label strong, .checkbox-label small { display: block; }
.checkbox-label small { margin-top: 4px; color: var(--muted); }
.checkbox-label input { accent-color: #4f8fff; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.flash { margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; }
.flash-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.25); color: #b8f5ca; }
.flash-error { background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.28); color: #ffc9c9; }
.flash ul { margin: 0; padding-left: 18px; }

.login-shell {
  min-height: 100vh;
  overflow: hidden;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 10% 30%, rgba(255, 255, 255, 0.65), transparent 18%),
    radial-gradient(circle at 78% 20%, rgba(255, 233, 210, 0.52), transparent 20%),
    radial-gradient(circle at 15% 82%, rgba(70, 148, 210, 0.68), transparent 30%),
    linear-gradient(180deg, rgba(183, 204, 224, 0.92), rgba(51, 111, 159, 0.95) 60%, rgba(32, 76, 121, 1));
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background:
    url('/img/login-bg.jpg') center/cover no-repeat,
    linear-gradient(180deg, rgba(184, 200, 219, 0.36), rgba(34, 79, 130, 0.64));
  filter: blur(10px) saturate(0.9);
  transform: scale(1.05);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  margin: 24px;
  padding: 36px 38px 32px;
  border-radius: 22px;
  background: rgba(10, 18, 33, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
  text-align: center;
}

.login-logo {
  width: 140px;
  margin: 0 auto 18px;
}

.login-card h1 {
  margin: 0 0 20px;
  font-size: 1.5rem;
}

.login-form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.login-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form input {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(4, 10, 21, 0.72);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.login-form input:focus {
  border-color: rgba(79, 143, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(79, 143, 255, 0.18);
}

.login-form button {
  margin-top: 6px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #5a8fff, #3f78e4);
  color: white;
  font-size: 1rem;
  font-weight: 700;
}

.alert-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #ffc9c9;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .hero-panel,
  .surface-grid,
  .log-grid {
    grid-template-columns: 1fr;
  }

  .service-meta,
  .log-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .topbar {
    padding: 0 16px;
    height: auto;
    min-height: 72px;
    align-items: start;
    flex-direction: column;
    justify-content: center;
  }

  .content {
    padding: 16px;
  }

  .hero-panel {
  padding: 16px 18px;
  }

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

  .service-meta,
  .log-row {
    grid-template-columns: 1fr;
  }

  .page-heading { align-items: start; flex-direction: column; }
  .service-toolbar { align-items: stretch; flex-direction: column; }
  .service-search { max-width: none; }
  .service-filters { justify-content: start; }
  .directory-card { grid-template-columns: 1fr; gap: 12px; }
  .service-heading-actions { align-items: stretch; flex-direction: column; gap: 12px; }
  .service-count { justify-items: start; }
  .inline-service-form { width: min(100%, 520px); }
  .inline-service-form .form-grid { grid-template-columns: 1fr; }
  .directory-result { justify-items: start; }
  .user-table-head { display: none; }
  .user-table-row { grid-template-columns: 1fr; gap: 10px; padding: 16px 0; }
  .table-actions { justify-content: start; margin-top: 6px; }
}

.services-panel { min-height: 0; }
