@import url("https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700&display=swap");

:root {
  --bg: #f3f8fc;
  --surface: #ffffff;
  --header: #83c5f7;
  --header-deep: #70b8f0;
  --text: #0b1b2b;
  --muted: rgba(11, 27, 43, 0.58);
  --border: rgba(11, 27, 43, 0.1);
  --accent: #f8d840;
  --accent-secondary: #83c5f7;
  --danger: #b42318;
  --success: #0f5a05;
  --radius: 16px;
  --radius-sm: 12px;
  --font: "X5 Sans", "Onest", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 400 15px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: #1a6fb8; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: linear-gradient(180deg, var(--header) 0%, var(--header-deep) 100%);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
}

.brand-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}

.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
}

.nav a.active {
  background: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.nav-actions {
  margin-left: auto;
}

.nav-actions form { margin: 0; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

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

h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 12px;
  letter-spacing: -0.01em;
}

.muted { color: var(--muted); font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.card.stat {
  border-top: 4px solid var(--accent);
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  font-weight: 500;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(131, 197, 247, 0.12);
}

tr:last-child td { border-bottom: 0; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--text);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.btn:hover {
  filter: brightness(0.97);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
}

input[type=text],
input[type=password],
input[type=url],
select,
textarea {
  width: 100%;
  max-width: 480px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--header-deep);
  box-shadow: 0 0 0 3px rgba(131, 197, 247, 0.35);
}

textarea { min-height: 100px; max-width: 640px; }

label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
}

.error { color: var(--danger); margin: 12px 0; font-weight: 500; }
.ok { color: var(--success); margin: 12px 0; font-weight: 500; }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
}

.filters .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filters input,
.filters select { max-width: 220px; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(248, 216, 64, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 60% at 100% 100%, rgba(131, 197, 247, 0.55), transparent 50%),
    var(--bg);
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px 24px;
  border-top: 5px solid var(--accent);
}

.login-box .brand-kicker {
  color: #1a6fb8;
  margin-bottom: 4px;
}

.login-box h1 { margin-top: 4px; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(131, 197, 247, 0.22);
  font-size: 12px;
  font-weight: 600;
}

.pill.done {
  background: rgba(15, 90, 5, 0.12);
  color: var(--success);
}

.pill.progress {
  background: rgba(248, 216, 64, 0.35);
  color: var(--text);
}

.bar {
  height: 10px;
  background: rgba(131, 197, 247, 0.25);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.stack { display: flex; flex-direction: column; gap: 8px; }

:focus-visible {
  outline: 2px solid #1a6fb8;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .nav-actions { width: 100%; margin-left: 0; }
  .topbar-inner { padding-bottom: 16px; }
}
