:root {
  --navy: #16223f;
  --navy-2: #1d2c4f;
  --accent: #4D8BFF;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e3e7ee;
  --bg: #f4f6fa;
  --danger: #c0392b;
  --ok: #2e7d32;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Inter', Segoe UI, system-ui, sans-serif; color: var(--ink); background: var(--bg); }
h1 { font-size: 22px; margin: 0 0 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Sidebar */
.sidebar { width: 230px; background: var(--navy); color: #cdd6e6; display: flex; flex-direction: column; padding: 16px 0; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 18px 18px; font-size: 18px; font-weight: 700; color: #fff; }
.sidebar .brand .logo { width: 26px; height: 26px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.sidebar nav a { color: #cdd6e6; padding: 10px 12px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; }
.sidebar nav a:hover { background: var(--navy-2); text-decoration: none; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar nav a .badge { background: #e5484d; color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 700; min-width: 20px; text-align: center; }
.sidebar .logout { margin-top: auto; padding: 12px 16px; }
.sidebar .logout button { width: 100%; background: transparent; color: #9fb0cc; border: 1px solid #33405f; border-radius: 8px; padding: 8px; cursor: pointer; }
.sidebar .logout button:hover { color: #fff; border-color: var(--accent); }

/* Content */
.content { flex: 1; padding: 24px 28px; max-width: 1100px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: #f0f3f8; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.inactive td { color: var(--muted); font-style: italic; }

/* Forms / buttons */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 2px; }
input, select { padding: 8px 10px; border: 1px solid #cbd2d9; border-radius: 8px; font-size: 14px; width: 100%; max-width: 320px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.row > div { flex: 1; min-width: 140px; }
button, .btn { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { background: #3b78ec; text-decoration: none; color: #fff; }
button.ghost { background: #eef2f8; color: var(--ink); }
button.danger { background: #fdecea; color: var(--danger); }
.error { color: var(--danger); background: #fdecea; padding: 8px 12px; border-radius: 8px; }

/* Login */
.login-card { max-width: 360px; margin: 12vh auto; background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 12px 40px rgba(22,34,63,.18); }
.login-card h1 { text-align: center; }
.login-card p { text-align: center; color: var(--muted); margin-top: 0; }
.login-card input { max-width: none; }
.login-card button { width: 100%; margin-top: 16px; }
