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

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

* { 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: var(--focus); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--header);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
  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; }
.brand-title { font-size: 18px; font-weight: 700; line-height: 1.2; }

.nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.nav a {
  padding: 8px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  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: 1120px; margin: 0 auto; padding: 28px 16px 56px; }

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; }
.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; }
.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);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--accent);
  color: var(--text);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}
.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-secondary { background: #fff; color: var(--text); border: 1.5px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }

input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=datetime-local],
input[type=file],
select,
textarea {
  width: 100%;
  max-width: 520px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 120px; max-width: 720px; }
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 input, .filters select { max-width: 220px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg);
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  border-top: 5px solid var(--accent);
}
.login-box .brand-kicker { color: var(--focus); }

.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); }
.pill.danger { background: rgba(180, 35, 24, 0.12); color: var(--danger); }

.password-once {
  font-family: ui-monospace, monospace;
  background: #fff8cc;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

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