:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --danger: #dc2626;
  --success: #16a34a;
  --border: #e5e7eb;
  --shadow: 0 14px 35px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, #eef2ff 0%, rgba(238, 242, 255, 0) 60%),
              radial-gradient(900px 500px at 90% 20%, #ecfeff 0%, rgba(236, 254, 255, 0) 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.navbar {
  background: #0b1220;
  color: #fff;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  letter-spacing: 0.2px;
}

.nav-actions {
  display: flex;
  gap: 10px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.card-body { padding: 18px; }

.h1 { font-size: 22px; margin: 0 0 8px; }

.muted { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

@media (max-width: 820px) {
  .col-6 { grid-column: span 12; }
}

.label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--muted); }

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #fff;
}

.input:focus { border-color: rgba(37, 99, 235, 0.55); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }

.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:focus { outline: none; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.20); }

.btn.secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 7px 10px; border-radius: 9px; font-size: 13px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

th { font-size: 13px; color: var(--muted); font-weight: 700; }

tr:hover td { background: rgba(15, 23, 42, 0.015); }

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.badge.active { background: var(--success); }
.badge.expired { background: var(--danger); }

.photo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
}

.alert {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid;
  margin-bottom: 12px;
}

.alert.error { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.alert.ok { background: #ecfdf5; border-color: #bbf7d0; color: #065f46; }

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.footer {
  margin-top: auto;
  border-top: 0;
  background: #0b1220;
  color: #fff;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  align-items: start;
  padding-top: 16px;
  padding-bottom: 16px;
}

.footer-title { font-weight: 800; }
.footer-label { font-size: 12px; color: rgba(255, 255, 255, 0.65); font-weight: 700; margin-bottom: 6px; }
.footer-muted { color: rgba(255, 255, 255, 0.70); font-size: 13px; }
.footer-link { color: var(--primary); text-decoration: none; font-weight: 700; }
.footer-link:hover { text-decoration: underline; }

.footer-block { display: flex; flex-direction: column; gap: 4px; }

/* Stronger rules to ensure footer always matches header */
body .footer { background: #0b1220 !important; color: #fff !important; }
body .footer a { color: #fff; }
body .footer .footer-link { color: #fff; }

/* Align footer content in clean rows */
.footer-left { justify-content: flex-start; }
.footer-mid { justify-content: flex-start; }
.footer-right { justify-content: flex-start; align-items: flex-end; text-align: right; }

@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-block { text-align: left !important; align-items: flex-start !important; }
}
