* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, Arial, sans-serif;
  background: #fafafa;
  color: #111;
}
a { color: inherit; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 380px;
  max-width: 100%;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 36px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}
.brand-logo {
  width: 38px; height: 38px;
  background: #111; color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 10px; letter-spacing: 1px; color: #999; text-transform: uppercase; }
.eyebrow { font-size: 11px; letter-spacing: 1.5px; color: #999; text-transform: uppercase; margin-bottom: 4px; font-weight: 700; }
h1.title { font-size: 21px; font-weight: 700; margin: 0 0 6px; }
p.subtitle { font-size: 13px; color: #777; margin: 0 0 20px; }

.field { margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: #444; display: block; margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 9px 12px; font-size: 13.5px;
  border: 1px solid #ddd; border-radius: 7px; outline: none; background: #fff;
}
.btn-primary {
  width: 100%; background: #111; color: #fff; border: none; border-radius: 7px;
  padding: 10px 0; font-size: 13.5px; font-weight: 600; cursor: pointer; margin-top: 6px;
}
.btn-primary:hover { background: #000; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 12.5px; color: #888; }
.auth-footer a { font-weight: 600; text-decoration: underline; cursor: pointer; }
.demo-hint { margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f0f0; font-size: 11px; color: #bbb; text-align: center; }
.alert { font-size: 12.5px; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ---------- App layout ---------- */
.app { display: flex; min-height: 100vh; background: #fff; }
.sidebar {
  width: 220px; border-right: 1px solid #eee; display: flex; flex-direction: column;
  background: #fff; flex-shrink: 0;
}
.sidebar-head { padding: 20px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #f2f2f2; }
.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 7px;
  cursor: pointer; font-size: 13px; margin-bottom: 2px; font-weight: 500; color: #333;
  text-decoration: none;
}
.nav-item.active { background: #111; color: #fff; font-weight: 600; }
.nav-item .badge-count {
  margin-left: auto; background: #111; color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 1px 6px;
}
.nav-item.active .badge-count { background: #fff; color: #111; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid #f2f2f2; }
.user-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #f1f1f1;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #555;
}
.user-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 10.5px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-badge {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px; color: #fff; background: #888;
  display: inline-block; padding: 2px 7px; border-radius: 4px; margin-bottom: 10px;
}
.role-badge.admin { background: #111; }
.logout-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: none; border: 1px solid #eee; border-radius: 7px; padding: 8px 10px;
  font-size: 12.5px; cursor: pointer; color: #444; text-decoration: none;
}

.content { flex: 1; padding: 28px 32px; overflow-y: auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 700; margin: 0; }
.page-desc { font-size: 12.5px; color: #888; margin: 4px 0 0; }

.btn-add {
  display: inline-flex; align-items: center; gap: 6px; background: #111; color: #fff;
  border: none; border-radius: 7px; padding: 9px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn-add:hover { background: #000; }

.search-input { max-width: 320px; margin-bottom: 16px; }

.empty-state {
  background: #fafafa; border: 1px solid #eee; border-radius: 10px; padding: 60px 20px; text-align: center;
}
.empty-title { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: #999; text-transform: uppercase; }
.empty-hint { font-size: 12.5px; color: #aaa; margin-top: 6px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap { border: 1px solid #eee; border-radius: 10px; overflow: hidden; }
table.data-table th {
  text-align: left; padding: 10px 14px; font-size: 11px; letter-spacing: 0.5px; color: #888;
  text-transform: uppercase; font-weight: 700; background: #fafafa; border-bottom: 1px solid #eee;
}
table.data-table td { padding: 10px 14px; border-bottom: 1px solid #f3f3f3; }
table.data-table tr:last-child td { border-bottom: none; }

.badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; display: inline-block; }
.badge-gray { background: #f1f1f1; color: #555; }
.badge-green { background: #f0fdf4; color: #15803d; }
.badge-red { background: #fef2f2; color: #b91c1c; }
.badge-orange { background: #fff7ed; color: #c2410c; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }

.del-link { color: #bbb; text-decoration: none; }
.del-link:hover { color: #b91c1c; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { border: 1px solid #eee; border-radius: 10px; padding: 16px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.stat-label { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; color: #999; text-transform: uppercase; }
.stat-value { font-size: 26px; font-weight: 700; }

.form-box {
  border: 1px solid #eee; border-radius: 10px; padding: 20px; margin-bottom: 20px; background: #fcfcfc;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { margin-top: 10px; display: flex; gap: 8px; }
.btn-secondary {
  background: #fff; border: 1px solid #ddd; border-radius: 7px; padding: 9px 14px;
  font-size: 12.5px; cursor: pointer; text-decoration: none; color: #333;
}
.pending-box { border: 1px solid #fed7aa; background: #fff7ed; border-radius: 10px; overflow: hidden; margin-bottom: 22px; }
.pending-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #fed7aa; }
.pending-row:last-child { border-bottom: none; }
.pending-actions { display: flex; gap: 8px; }
.btn-approve { background: #111; color: #fff; border: none; border-radius: 6px; padding: 6px 10px; font-size: 12px; cursor: pointer; text-decoration: none; }
.btn-reject { background: #fff; color: #b91c1c; border: 1px solid #fecaca; border-radius: 6px; padding: 6px 10px; font-size: 12px; cursor: pointer; text-decoration: none; }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; }
  .content { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
}
