:root {
  --bg: #f6f6f2;
  --surface: #ffffff;
  --surface-2: #fbfbf7;
  --ink: #111418;
  --muted: #5f646c;
  --faint: #8b9099;
  --line: #e6e6de;
  --line-soft: #efefe8;
  --accent: #16603d;
  --accent-soft: #e8f2ec;
  --warn: #8a5a00;
  --warn-soft: #fbf1da;
  --danger: #a3231b;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(17, 20, 24, 0.05);
  --shadow-md: 0 1px 2px rgba(17, 20, 24, 0.04), 0 10px 28px rgba(17, 20, 24, 0.06);
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 320px at 50% -8%, #eef3ea 0%, rgba(238, 243, 234, 0) 72%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ---------- верхняя панель ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 246, 242, 0.78);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-in {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 7px;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.count,
.who {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.who {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .count {
    display: none;
  }
}

/* ---------- каркас ---------- */

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.page-head {
  margin-bottom: 30px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.028em;
}

.lede {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- секции ---------- */

.section + .section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding-left: 2px;
}

.section-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.section-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--line-soft);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
}

.list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.project {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s ease;
}

.project:last-child {
  border-bottom: 0;
}

.project:hover {
  background: var(--surface-2);
}

.project-main {
  flex: 1;
  min-width: 0;
}

.project-title h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.project-desc {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.project-note {
  margin: 5px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.project-side {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

/* ---------- статусы ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.status-online .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.status-degraded .status-dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

.status-offline .status-dot {
  background: var(--danger);
}

/* ---------- кнопки ---------- */

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 31px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.15s ease;
}

.btn:hover {
  background: #f2f2ec;
  border-color: #d6d6cb;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #262b32;
  border-color: #262b32;
}

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

.btn-ghost:hover {
  background: #ecece4;
  border-color: transparent;
  color: var(--ink);
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

/* ---------- подвал ---------- */

.foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 24px 34px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--faint);
  border-top: 1px solid var(--line-soft);
}

/* ---------- вход ---------- */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 356px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-md);
}

.login-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-head .brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.login-head .brand-name {
  font-size: 14px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfcfa;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:focus {
  border-color: #a9a999;
  background: #fff;
}

.login-submit {
  width: 100%;
  height: 40px;
  margin-top: 8px;
  border-radius: 10px;
}

.form-error {
  margin: 0 0 12px;
  min-height: 18px;
  font-size: 13px;
  color: var(--danger);
}

.login-hint {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}

/* ---------- адаптив ---------- */

@media (max-width: 640px) {
  .topbar-in {
    padding: 0 16px;
  }

  .wrap {
    padding: 26px 16px 44px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .project {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 15px 16px;
  }

  .project-side {
    justify-content: space-between;
    gap: 12px;
  }

  .actions {
    flex: 1;
    justify-content: flex-end;
  }

  .foot {
    flex-direction: column;
    gap: 4px;
    padding: 16px 16px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
