:root {
  color-scheme: dark;
  --bg: #080c14;
  --surface: #0d1520;
  --surface-2: #111c2a;
  --border: #213044;
  --text: #e7eef7;
  --muted: #8da0b7;
  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --good: #86efac;
  --warn: #fcd34d;
  --bad: #fca5a5;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(94, 234, 212, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, .025) 1px, transparent 1px);
  background-size: 28px 28px;
  line-height: 1.55;
}
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.site-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(8, 12, 20, .88);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-brand, .admin-brand, .auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .09em;
}
.site-brand span, .admin-brand span, .auth-brand span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: .68rem;
}
.site-header nav { display: flex; gap: 28px; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.site-header nav a:hover { color: var(--accent); }
.nav-toggle { display: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); padding: 8px 11px; }

.hero, .services-section, .status-page { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.hero { min-height: 560px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(190px, .55fr); align-items: center; gap: 64px; padding-block: 82px 54px; }
.eyebrow { margin: 0 0 13px; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { margin: 0 0 24px; max-width: 760px; color: #f8fafc; font-size: clamp(2.8rem, 7vw, 5.8rem); letter-spacing: -.055em; line-height: .92; }
.hero h1 span { color: var(--accent); }
.hero-copy > p:not(.eyebrow) { max-width: 720px; margin: 0 0 10px; color: var(--muted); font-size: 1.02rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.tags span { padding: 7px 10px; border: 1px solid #294055; border-radius: 7px; background: #0d1420; color: #b8c6d6; font-size: .67rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.social-links { display: flex; gap: 14px; margin-top: 18px; }
.social-links a { color: var(--accent); font-size: .8rem; font-weight: 700; }
.identity-mark { width: min(220px, 100%); aspect-ratio: 1; justify-self: end; display: grid; place-items: center; border: 1px solid var(--accent-strong); border-radius: 50%; background: #0d1622; box-shadow: 0 0 0 14px rgba(45, 212, 191, .035), 0 0 70px rgba(45, 212, 191, .13); position: relative; }
.identity-mark strong { color: var(--accent); font-size: 3.6rem; letter-spacing: -.1em; }
.identity-mark small { position: absolute; bottom: 24%; color: #7c91a8; font-size: .6rem; letter-spacing: .2em; }

.services-section { padding-block: 50px 96px; }
.section-heading, .page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading h2, .page-heading h1, .status-page h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.035em; }
.overall, .status { display: inline-flex; align-items: center; gap: 7px; font-size: .7rem; font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: .07em; }
.overall::before, .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.overall-operational, .status-online { color: var(--good); }
.overall-incident, .status-offline { color: var(--bad); }
.overall-maintenance, .status-maintenance { color: var(--warn); }
.overall-degraded { color: var(--warn); }
.overall-unknown, .status-unknown, .status-stale, .status-disabled { color: #aab8c8; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.service-card { min-height: 190px; padding: 21px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17, 28, 42, .96), rgba(11, 18, 28, .96)); text-decoration: none; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
a.service-card:hover { transform: translateY(-3px); border-color: #34615f; box-shadow: 0 18px 45px rgba(0, 0, 0, .25); }
.service-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.service-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: #123b39; font-size: .72rem; font-weight: 900; }
.service-icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.service-card h3 { margin: 0 0 5px; font-size: 1.08rem; }
.service-card p { margin: 0 0 12px; color: var(--muted); font-size: .86rem; }
.service-card small { color: #63768d; font-size: .67rem; }
.empty-state, .panel { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(13, 21, 32, .94); color: var(--muted); }
.site-footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto; padding: 26px 0 42px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 20px; color: #687b91; font-size: .72rem; }

.status-page { min-height: 70vh; padding-block: 80px; }
.status-page > .overall { margin: 20px 0 4px; }
.status-lead { max-width: 680px; color: var(--muted); }
.status-list { display: grid; gap: 10px; margin-top: 35px; }
.status-list article { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.status-list h2 { margin: 0; font-size: 1rem; }
.status-list p { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }

.admin-body { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); background: var(--bg); }
.admin-sidebar { min-height: 100vh; padding: 24px 18px; border-right: 1px solid var(--border); background: #0a111b; position: sticky; top: 0; align-self: start; }
.admin-sidebar nav { display: grid; gap: 5px; margin-top: 42px; }
.admin-sidebar nav a { padding: 10px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .83rem; }
.admin-sidebar nav a:hover { background: #102a2b; color: var(--accent); }
.logout-form { margin-top: 32px; }
.logout-form button { border: 0; padding: 10px 12px; color: var(--muted); background: transparent; cursor: pointer; font-size: .75rem; }
.admin-main { width: min(1050px, 100%); padding: 42px clamp(20px, 4vw, 52px); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface-2); text-decoration: none; font-weight: 800; font-size: .78rem; }
.button.primary { border-color: #2c8278; background: #123936; color: #9ff6eb; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats article { padding: 18px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.stats span { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.stats strong { display: block; margin-top: 7px; font-size: 1.9rem; }
.panel-heading, .service-row, .service-admin-card, .row-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.panel-heading h2 { margin: 0; font-size: 1rem; }
.service-row { padding: 13px 0; border-bottom: 1px solid #172333; font-size: .8rem; }
.service-row:last-child { border-bottom: 0; }
.service-admin-card { padding: 15px 0; border-bottom: 1px solid var(--border); }
.service-admin-card:last-child { border-bottom: 0; }
.service-admin-card p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
.row-actions { justify-content: end; }
.row-actions form { margin: 0; }
.row-actions a, .link-danger { border: 0; background: transparent; color: var(--muted); text-decoration: none; font-size: .75rem; }
.link-danger { color: var(--bad); }
.link-button { border: 0; padding: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: .75rem; }
.order-form { margin-bottom: 18px; }
.order-form label { grid-template-columns: 1fr 80px; align-items: center; margin-top: 10px; }
.archived-list { margin-top: 18px; }

.form-grid { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: #b9c6d5; font-size: .78rem; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #2b3b4e; border-radius: 8px; padding: 11px 12px; color: var(--text); background: #08101a; }
textarea { min-height: 120px; resize: vertical; }
label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 9px; }
input[type="checkbox"] { width: auto; accent-color: var(--accent-strong); }
.field-error, .form-error { margin: -8px 0 0; color: var(--bad); font-size: .76rem; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(440px, 100%); }
.auth-brand { margin-bottom: 24px; }
.auth-card { padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-card h1 { margin: 0 0 8px; }
.auth-card > p:not(.eyebrow) { color: var(--muted); }
.auth-card form { display: grid; gap: 17px; margin-top: 24px; }

@media (max-width: 860px) {
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 42px; }
  .identity-mark { width: 160px; justify-self: start; }
  .admin-body { grid-template-columns: 180px minmax(0, 1fr); }
  .admin-sidebar { padding-inline: 12px; }
  .admin-brand { font-size: .7rem; justify-content: flex-start; }
  .admin-sidebar nav a { font-size: .72rem; text-align: left; }
}

@media (max-width: 620px) {
  .site-header { min-height: 64px; padding-inline: 18px; }
  .nav-toggle { display: block; }
  .site-header nav { display: none; position: absolute; top: 64px; left: 0; right: 0; padding: 18px; border-bottom: 1px solid var(--border); background: #0a111b; flex-direction: column; gap: 15px; }
  .site-header nav.open { display: flex; }
  .hero, .services-section, .status-page, .site-footer { width: min(100% - 32px, 1120px); }
  .hero { padding-block: 58px 36px; }
  .service-grid, .stats { grid-template-columns: 1fr; }
  .section-heading, .page-heading, .site-footer { align-items: flex-start; flex-direction: column; }
  .status-list article { align-items: flex-start; flex-direction: column; }
  .admin-body { display: block; }
  .admin-sidebar { min-height: 0; position: static; border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-brand { justify-content: flex-start; font-size: .72rem; }
  .admin-sidebar nav { grid-template-columns: repeat(2, 1fr); margin-top: 16px; }
  .admin-sidebar nav a { font-size: .72rem; text-align: left; }
  .admin-sidebar nav a::first-letter { font-size: inherit; }
  .admin-main { padding: 28px 16px; }
  .service-admin-card { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
