:root {
  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --border:         rgba(11,11,11,0.10);

  --slot-blue:    #2a78d6;
  --slot-aqua:    #1baf7a;
  --slot-yellow:  #eda100;
  --slot-green:   #008300;
  --slot-violet:  #4a3aa7;
  --slot-red:     #e34948;

  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-serious:  #ec835a;
  --status-critical: #d03b3b;

  --accent: #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface-1:      #1a1a19;
    --page-plane:     #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --border:         rgba(255,255,255,0.10);

    --slot-blue:    #3987e5;
    --slot-aqua:    #199e70;
    --slot-yellow:  #c98500;
    --slot-green:   #008300;
    --slot-violet:  #9085e9;
    --slot-red:     #e66767;

    --status-good:     #0ca30c;
    --status-warning:  #fab219;
    --status-serious:  #ec835a;
    --status-critical: #d03b3b;

    --accent: #3987e5;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* top navigation bar */
.topbar {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
}
.brand {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}
.brand .accent { color: var(--accent); }
.brand .app-version {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  vertical-align: 2px;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.nav-links a:hover {
  background: var(--page-plane);
  color: var(--text-primary);
}
.nav-links a.active {
  background: var(--accent);
  color: #fff;
}
.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.topbar-user .user-name {
  color: var(--text-secondary);
  font-weight: 500;
}
.topbar-user .logout-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.topbar-user .logout-link:hover {
  color: var(--text-primary);
  background: var(--page-plane);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
header.page-header { margin-bottom: 28px; }
header.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
}
header.page-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}
section h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px;
}
section .subtitle {
  color: var(--text-secondary);
  font-size: 12.5px;
  margin: 0 0 16px;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.section-head .subtitle { margin-bottom: 16px; }
.section-head form { flex: none; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--gridline);
}
tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--gridline);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
td.mono, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 4px;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn.secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

/* формы */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  max-width: 560px;
  background: var(--page-plane);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
.field input[type="text"]:focus,
.field input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}
.form-actions { margin-top: 4px; }

/* форма входа — узкая центрированная карточка */
.auth {
  max-width: 400px;
  margin: 40px auto 0;
}
.auth .field input[type="text"],
.auth .field input[type="password"] { max-width: none; }
.auth .btn { width: 100%; justify-content: center; padding: 10px; }

/* служебные сообщения */
.notice {
  background: rgba(12,163,12,0.10);
  border: 1px solid var(--status-good);
  color: var(--status-good);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}
.notice.error {
  background: rgba(208,59,59,0.10);
  border-color: var(--status-critical);
  color: var(--status-critical);
}

footer {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 24px 0;
}

/* ── Головная: hero с графиней ───────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: center;
  gap: 24px;
  padding: 56px 48px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(42,120,214,0.06), transparent 60%),
    linear-gradient(135deg, var(--surface-1), var(--page-plane));
}
.hero-eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  margin: 0 0 16px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.hero-lead {
  margin: 0 0 28px;
  max-width: 480px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.hero-lead strong { color: var(--text-primary); font-weight: 600; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn { padding: 10px 22px; font-size: 14px; }
.hero-note {
  margin: 28px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.hero-note .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--status-warning);
  box-shadow: 0 0 0 3px rgba(250,178,25,0.18);
}

/* Бледная графиня — декоративная фигура справа */
.hero-figure {
  justify-self: center;
  color: var(--accent);
  opacity: 0.45;
  pointer-events: none;
}
.hero-figure svg {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 36px 24px; }
  .hero-figure { display: none; }
  .hero-title { font-size: 27px; }
}
