/* ── Reset / base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: #f5f6f7;
  color: #1a1a2e;
  min-height: 100vh;
}

a { color: #2a6496; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  height: 48px;
  background: #1a3a52;
  color: #fff;
}

.site-title { font-size: 1rem; font-weight: 700; letter-spacing: 0.02em; }
nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.nav-user { color: #c9d6e0; font-size: 0.85rem; }
.nav-link { color: #c9d6e0; font-size: 0.85rem; padding: 4px 10px; border-radius: 4px; }
.nav-link:hover { background: rgba(255,255,255,0.15); color: #fff; text-decoration: none; }

/* ── Login page ────────────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #eef1f5;
}

.login-card {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  width: min(380px, 95vw);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a3a52;
  margin-bottom: 0.25rem;
}

.login-sub { color: #777; font-size: 0.85rem; margin-bottom: 1.5rem; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.75rem;
}

.form-input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #c8d0d9;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #fff;
}
.form-input:focus { outline: none; border-color: #2a6496; box-shadow: 0 0 0 2px rgba(42,100,150,0.15); }

select.form-input { cursor: pointer; }

.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-label input { width: auto; margin: 0; }

.btn-full { width: 100%; margin-top: 0.5rem; }

/* ── Alerts ────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Admin page ────────────────────────────────────────────────────────── */
.admin-page {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.page-header h2 { font-size: 1.1rem; }

/* ── User table ────────────────────────────────────────────────────────── */
.user-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.user-table th, .user-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.85rem;
}

.user-table thead tr { background: #f0f3f6; border-bottom: 2px solid #dde3e9; }
.user-table tbody tr { border-bottom: 1px solid #eaecef; }
.user-table tbody tr:last-child { border-bottom: none; }
.user-table tbody tr:hover { background: #f8f9fa; }
.row-inactive td { opacity: 0.5; }

.actions { display: flex; gap: 6px; }
.empty-msg { color: #aaa; text-align: center; padding: 2rem; }

/* ── Status dot ────────────────────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.active   { background: #28a745; }
.status-dot.inactive { background: #dc3545; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-admin { background: #fff3cd; color: #856404; }
.badge-user  { background: #e8edf2; color: #444; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: #1a3a52; color: #fff; border-color: #1a3a52; }
.btn-primary:hover   { background: #15304a; }
.btn-secondary { background: #f0f3f6; color: #333; border-color: #c8d0d9; }
.btn-secondary:hover { background: #dde5ee; }
.btn-danger    { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-danger:hover    { background: #c82333; }
.btn-sm { padding: 3px 9px; font-size: 0.78rem; }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 900;
}
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  z-index: 1000;
  width: min(420px, 95vw);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal.hidden, .modal-backdrop.hidden { display: none; }
.modal h3 { margin-bottom: 1rem; font-size: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1rem; }
