/* ── Variables ─────────────────────────────────────── */
:root {
  --navy:   #0d1b4b;
  --navy2:  #1a2f6e;
  --gold:   #c9a84c;
  --gold2:  #e8c96a;
  --light:  #f0f2f8;
  --white:  #ffffff;
  --text:   #1a1a2e;
  --muted:  #6b7280;
  --danger: #dc2626;
  --success:#16a34a;
  --border: #d1d5db;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(13,27,75,.10);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); background: var(--light); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }

/* ── Typography ────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.2; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.3rem; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }

/* ── Navbar ────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  color: var(--white);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
}
.nav-brand .gem-icon { font-size: 1.5rem; }
.nav-brand span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s;
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(255,255,255,.8);
  font-size: .9rem;
}
.nav-user strong { color: var(--gold); }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s;
  white-space: nowrap;
}
.btn-primary   { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201,168,76,.4); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-secondary:hover { background: var(--navy2); }
.btn-outline   { background: transparent; border: 2px solid var(--gold); color: var(--navy); }
.btn-outline:hover { background: var(--gold); }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost     { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--light); }
.btn-sm { padding: .35rem .85rem; font-size: .82rem; }
.btn-lg { padding: .75rem 1.8rem; font-size: 1rem; }

/* ── Hero ──────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a8a 60%, #2d5bb0 100%);
  color: var(--white);
  padding: 6rem 2rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  background: rgba(201,168,76,.2);
  border: 1px solid rgba(201,168,76,.5);
  color: var(--gold2);
  padding: .3rem 1rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .05em;
  margin-bottom: 1.5rem;
}
.hero h1 { font-size: 3rem; margin-bottom: 1.2rem; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 1.15rem; opacity: .85; margin-bottom: 2.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 3rem;
  justify-content: center;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.15);
}
.hero-stat h3 { font-size: 2rem; color: var(--gold); }
.hero-stat p  { font-size: .85rem; opacity: .7; }

/* ── Section ───────────────────────────────────────── */
.section { padding: 5rem 2rem; }
.section-alt { background: var(--white); }
.container { max-width: 1100px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 { color: var(--navy); margin-bottom: .5rem; }
.section-title p  { color: var(--muted); font-size: 1.05rem; }
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  margin: .8rem auto;
  border-radius: 2px;
}

/* ── Service Cards ─────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}
.service-card {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(13,27,75,.15); }
.service-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
}
.service-card h3 { color: var(--navy); margin-bottom: .5rem; }
.service-card p  { color: var(--muted); font-size: .9rem; }

/* ── Verify Section ────────────────────────────────── */
.verify-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  color: var(--white);
  padding: 5rem 2rem;
  text-align: center;
}
.verify-section h2 { color: var(--white); margin-bottom: .5rem; }
.verify-section p  { opacity: .8; margin-bottom: 2rem; }
.verify-form {
  display: flex;
  gap: .75rem;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.verify-form input {
  flex: 1;
  min-width: 220px;
  padding: .7rem 1.2rem;
  border-radius: var(--radius);
  border: 2px solid rgba(201,168,76,.4);
  background: rgba(255,255,255,.08);
  color: var(--white);
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
.verify-form input::placeholder { color: rgba(255,255,255,.4); }
.verify-form input:focus { border-color: var(--gold); }

/* ── Dashboard layout ──────────────────────────────── */
.dashboard-layout { max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow);
}
.stat-card .stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--navy); }

/* ── Card ──────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.card-header h3 { color: var(--navy); font-size: 1.1rem; }
.card-body { padding: 1.5rem; }

/* ── Search ─────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap input {
  padding: .55rem 1rem .55rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 280px;
  outline: none;
  transition: border-color .2s;
  font-size: .9rem;
}
.search-wrap input:focus { border-color: var(--gold); }
.search-wrap .search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .9rem;
}

/* ── Table ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  padding: .9rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:hover { background: #f8f9fc; }
tbody tr:last-child td { border-bottom: none; }

/* ── Badge ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-active  { background: #dcfce7; color: #15803d; }
.badge-revoked { background: #fee2e2; color: #b91c1c; }
.badge-pending { background: #fef9c3; color: #a16207; }

/* ── Form ──────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--navy); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  font-size: .92rem;
  transition: border-color .2s, box-shadow .2s;
  background: var(--white);
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.15);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group .hint { font-size: .78rem; color: var(--muted); }

.form-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.6rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.form-section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
  margin-bottom: 1.2rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--light);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── Page header ────────────────────────────────────── */
.page-header {
  background: var(--navy);
  color: var(--white);
  padding: 1.8rem 2rem;
}
.page-header h2 { font-size: 1.5rem; margin-bottom: .2rem; }
.page-header p  { opacity: .7; font-size: .9rem; }

/* ── Login page ─────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a8a 100%);
  padding: 2rem;
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.8rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo { font-size: 3rem; margin-bottom: .5rem; }
.login-header h2 { color: var(--navy); font-size: 1.5rem; margin-bottom: .2rem; }
.login-header p  { color: var(--muted); font-size: .9rem; }

/* ── Toast ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.toast {
  padding: .85rem 1.2rem;
  border-radius: var(--radius);
  color: var(--white);
  font-size: .88rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: slideIn .3s ease;
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 240px;
  max-width: 360px;
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger);  }
.toast-info    { background: var(--navy2);   }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(110%); } }

/* ── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: 14px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transform: scale(.95);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal h3 { color: var(--navy); margin-bottom: .5rem; }
.modal p  { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* ── Pagination ─────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
  padding: 1.2rem 0 .5rem;
}
.pagination button {
  padding: .4rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-size: .85rem;
  color: var(--text);
  transition: all .15s;
}
.pagination button:hover:not(:disabled) { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pagination button.active { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 700; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Empty state ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h3 { color: var(--navy); margin-bottom: .4rem; }

/* ── Spinner ────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

/* ── Footer ─────────────────────────────────────────── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,.7);
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: .88rem;
}
footer .footer-brand { color: var(--gold); font-weight: 700; font-size: 1.1rem; margin-bottom: .3rem; }
footer a { color: rgba(255,255,255,.6); }
footer a:hover { color: var(--gold); }

/* ── Utility ────────────────────────────────────────── */
.gap-1 { gap: .5rem; }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-2  { margin-bottom: 1rem; }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-stats { gap: 1.5rem; flex-wrap: wrap; }
  .nav-links { display: none; }
  .search-wrap input { width: 200px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
