:root {
  --bg: #f4f6fb;
  --sidebar: #1e2733;
  --accent: #4a7dff;
  --danger: #e74c3c;
  --ok: #27ae60;
  --text: #22303f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 220px; background: var(--sidebar); color: #cbd5e1;
  display: flex; flex-direction: column;
}
.sidebar .brand {
  padding: 18px 16px; font-size: 17px; font-weight: 700; color: #fff;
  border-bottom: 1px solid #334155;
}
.sidebar nav { flex: 1; padding-top: 8px; }
.sidebar nav a {
  display: block; padding: 11px 16px; color: #cbd5e1; text-decoration: none;
}
.sidebar nav a:hover { background: #2b3a4d; color: #fff; }
.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid #334155; font-size: 14px;
}
.sidebar-footer a { color: #f2994a; text-decoration: none; }
.content { margin-left: 220px; padding: 24px 28px; max-width: 1400px; }
.content-centered { margin-left: 0; }
h1 { margin-top: 0; font-size: 24px; }
h1 small { color: #8899aa; font-weight: 400; }
h2 { font-size: 18px; margin: 28px 0 10px; }
.muted { color: #8899aa; }

table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  font-size: 14px;
}
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #eef1f6; }
th { background: #f8fafc; font-weight: 600; white-space: nowrap; }
th a { color: var(--text); text-decoration: none; }
tr:hover td { background: #fafbfe; }
td small { color: #8899aa; }
td.actions { white-space: nowrap; }
.actions form.inline { display: inline-block; }

.cards { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 16px 20px; min-width: 150px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.stat-card b { font-size: 28px; display: block; }
.stat-card span { color: #8899aa; font-size: 13px; }
.stat-card.warn b { color: var(--danger); }

.card {
  background: #fff; border-radius: 10px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.login-card { max-width: 360px; margin: 10vh auto; }
.login-card label { display: block; margin: 12px 0 4px; font-weight: 600; }
.login-card input { width: 100%; }
.login-card .btn { width: 100%; margin-top: 16px; }

label { font-size: 14px; }
input[type=text], input[type=password], select {
  padding: 8px 10px; border: 1px solid #d4dbe6; border-radius: 6px;
  font-size: 14px; background: #fff;
}
input.wide { width: 100%; min-width: 260px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters label { display: flex; align-items: center; gap: 5px; }

.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 9px 14px; font-size: 14px; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.btn:hover { opacity: .9; }
.btn-ghost { background: #e4e9f2; color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-small { padding: 5px 9px; font-size: 12px; }

.flag { border: 1px solid #d4dbe6; border-radius: 6px; background: #f4f6fb; cursor: pointer; padding: 3px 6px; }
.flag.on { background: #fdecea; border-color: var(--danger); }
.tag { margin-right: 3px; }

.flashes { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 14px; }
.flash-ok { background: #e7f6ec; color: #1d6b38; }
.flash-error { background: #fdecea; color: #9c2b1e; }

.pagination { margin-top: 14px; display: flex; gap: 12px; align-items: center; }
.pagination a { color: var(--accent); }
