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

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Niramit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #1e3a5f;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.brand {
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sidebar nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar-foot { margin-top: auto; }

.btn-logout {
  display: block;
  text-align: center;
  background: #b91c1c;
  color: #fff;
  padding: 0.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-logout:hover { filter: brightness(1.08); }

.main {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-x: auto;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

input, select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
  font-family: inherit;
}

button, .btn-primary {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
}

.login-box h1 { margin-bottom: 1rem; }

.login-box input { margin-bottom: 1rem; }

.err {
  background: #450a0a;
  color: #fecaca;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.meta { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { width: 100%; }
}
