:root {
  --bg: #0f1419;
  --panel: #171d24;
  --border: #2a3441;
  --text: #e7edf4;
  --muted: #8b98a8;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --danger: #ef4444;
  --success: #22c55e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.brand { font-weight: 700; font-size: 1.1rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.sidebar a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
}
.sidebar a.active, .sidebar a:hover { background: var(--accent-soft); color: var(--text); }
.sidebar-footer { font-size: 0.85rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.35rem; }

.content { padding: 1.5rem 2rem; }
h1, h2, h3 { margin-top: 0; }
.muted { color: var(--muted); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.grid.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.35rem; border-bottom: 1px solid var(--border); }

label { display: block; margin-bottom: 0.75rem; }
input, select, textarea, button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #11161c;
  color: var(--text);
  padding: 0.5rem 0.65rem;
}
button {
  background: var(--accent);
  border-color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}
.toolbar, .inline-form { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.messages { margin-bottom: 1rem; }
.message { padding: 0.65rem 0.85rem; border-radius: 8px; margin-bottom: 0.5rem; }
.message.error, .message.error { background: rgba(239, 68, 68, 0.15); color: #fecaca; }
.message.success { background: rgba(34, 197, 94, 0.15); color: #bbf7d0; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-card { width: min(420px, 100%); }
.pager { display: flex; gap: 1rem; margin-top: 1rem; }
.pager a { color: var(--accent); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
}
