:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --text: #1c2333;
  --muted: #6b7386;
  --line: #e3e7ef;
  --accent: #2557d6;
  --accent-soft: #e8f0ff;
  --danger: #b42318;
  --ok: #1d7a44;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; font-size: 17px; letter-spacing: 0.01em; }

.brand span, .brand .brand-sub { color: var(--muted); font-weight: 500; }

.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }

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

h1 { font-size: 26px; margin: 0 0 6px; }

.lead { color: var(--muted); margin: 0 0 28px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

.tile {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 20px;
  color: inherit;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  position: relative;
}

.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20, 40, 90, 0.08); border-color: #c9d4ee; }

.tile-soon { opacity: 0.55; cursor: default; }

.tile-soon:hover { transform: none; box-shadow: none; border-color: var(--line); }

.tile-locked { opacity: 0.55; }

.tile-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px;
}

.tile h2 { margin: 0 0 6px; font-size: 18px; }

.tile p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

.tile-tag { position: absolute; top: 18px; right: 18px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--bg); padding: 3px 8px; border-radius: 999px; }

.status-line { margin: 26px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9cfdb; margin-right: 6px; vertical-align: middle; }

.dot-ok { background: var(--ok); }

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

/* --- users admin --- */

.section { margin-top: 44px; }

.section h2 { font-size: 18px; margin: 0 0 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }

th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--accent-soft); color: var(--accent); margin-right: 4px; }

.chip-admin { background: #fff3d6; color: #7a5200; }

.button {
  display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 8px 14px; border-radius: 9px; font-size: 14px; cursor: pointer; font-family: inherit;
}

.button-secondary { background: var(--panel); color: var(--text); border-color: var(--line); }

.button-danger { background: var(--panel); color: var(--danger); border-color: #f0c2bf; }

.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

input[type="text"], input[type="password"] {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; background: var(--panel); color: var(--text);
}

.checks { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--text); padding-bottom: 6px; }

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

.error { color: var(--danger); font-size: 14px; margin-top: 8px; }

.muted { color: var(--muted); }

/* --- login / setup --- */

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }

.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px 30px 26px; }

.auth-card h1 { font-size: 22px; margin: 0 0 4px; }

.auth-card .lead { margin-bottom: 20px; font-size: 14px; }

.auth-card .field { margin-bottom: 14px; }

.auth-card input { width: 100%; }

.auth-card .button { width: 100%; padding: 11px; font-size: 15px; margin-top: 6px; }

.topnav { color: var(--muted); font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.topnav:hover { background: var(--bg); }
.topnav-active { color: var(--accent); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.small { font-size: 13px; }
