/* ============================================================================
   GREDO Digital ID System v2 - Design System
   Brand colors taken from the organization's identity: green + gold.
   ============================================================================ */

:root {
  --gredo-green: #00752f;
  --gredo-green-dark: #00541f;
  --gredo-green-light: #e6f3ea;
  --gredo-gold: #f8b715;
  --gredo-gold-dark: #d99e0a;
  --gredo-ink: #1b2430;
  --gredo-muted: #6b7685;
  --gredo-bg: #f4f6f8;
  --gredo-card-radius: 14px;
  --gredo-sidebar-width: 264px;
  --gredo-topbar-height: 68px;
}

* { box-sizing: border-box; }

body {
  background: var(--gredo-bg);
  color: var(--gredo-ink);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--gredo-green); }
a:hover { color: var(--gredo-green-dark); }

/* ---------------------------------------------------------------------------
   Brand mark (used instead of an image logo we don't have locally yet)
   --------------------------------------------------------------------------- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.brand-mark .brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gredo-gold), var(--gredo-green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
.brand-mark .brand-logo-badge {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 6px;
  padding: 3px 6px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.brand-mark .brand-logo-badge img {
  height: 22px;
  width: auto;
  display: block;
}
.brand-mark .brand-text {
  line-height: 1.1;
}
.brand-mark .brand-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}
.brand-mark .brand-text span {
  display: block;
  font-size: 11px;
  opacity: .8;
}

/* ---------------------------------------------------------------------------
   Layout shell
   --------------------------------------------------------------------------- */
.app-shell { min-height: 100vh; }

.app-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--gredo-topbar-height);
  background: linear-gradient(90deg, var(--gredo-green-dark), var(--gredo-green));
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.app-topbar .topbar-search {
  max-width: 320px;
}
.app-topbar .form-control {
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
}
.app-topbar .form-control::placeholder { color: rgba(255,255,255,.75); }
.app-topbar .form-control:focus {
  background: #fff;
  color: var(--gredo-ink);
}

.app-sidebar {
  position: fixed;
  top: var(--gredo-topbar-height);
  bottom: 0;
  left: 0;
  width: var(--gredo-sidebar-width);
  background: #101a13;
  overflow-y: auto;
  z-index: 1020;
  transition: transform .25s ease;
}
.app-sidebar .nav-section-title {
  color: rgba(255,255,255,.4);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 18px 20px 8px;
}
.app-sidebar .nav-link {
  color: rgba(255,255,255,.75);
  padding: 11px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
  font-size: 14.5px;
}
.app-sidebar .nav-link i { width: 18px; text-align: center; }
.app-sidebar .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.app-sidebar .nav-link.active {
  background: rgba(248,183,21,.12);
  border-left-color: var(--gredo-gold);
  color: #fff;
  font-weight: 600;
}
.app-sidebar .nav-link.logout-link { color: #ff8a8a; }

.app-content {
  margin-left: var(--gredo-sidebar-width);
  padding-top: calc(var(--gredo-topbar-height) + 20px);
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 40px;
  min-height: 100vh;
}

.app-footer {
  margin-left: var(--gredo-sidebar-width);
  padding: 16px 24px;
  color: var(--gredo-muted);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid #e4e8ec;
}

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .app-content, .app-footer { margin-left: 0; }
}

/* ---------------------------------------------------------------------------
   Page header
   --------------------------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.page-header .breadcrumb {
  margin: 0;
  font-size: 13px;
}

/* ---------------------------------------------------------------------------
   Cards, stats, tables
   --------------------------------------------------------------------------- */
.card {
  border: none;
  border-radius: var(--gredo-card-radius);
  box-shadow: 0 2px 14px rgba(20, 30, 40, .06);
}
.card-title { font-weight: 700; font-size: 1rem; }

.stat-card {
  border-radius: var(--gredo-card-radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: 13px; opacity: .9; }
.stat-card.bg-total   { background: linear-gradient(135deg, #1c3f2e, var(--gredo-green)); }
.stat-card.bg-approved{ background: linear-gradient(135deg, #0b6b34, #1fae5c); }
.stat-card.bg-rejected{ background: linear-gradient(135deg, #8f1f1f, #d64545); }
.stat-card.bg-pending { background: linear-gradient(135deg, #a5760a, var(--gredo-gold)); }
.stat-card.bg-suspended { background: linear-gradient(135deg, #6c5308, #d4a017); }

.badge-status { font-weight: 600; font-size: 12px; padding: 6px 10px; border-radius: 20px; }

/* Fixed-height wrapper is required for Chart.js (responsive + maintainAspectRatio:false).
   Without an explicit height here, the canvas and its parent fight over sizing and the
   chart grows endlessly ("scrolling" charts). */
.chart-box { position: relative; height: 280px; width: 100%; }
.chart-box canvas { max-width: 100%; }

.table > :not(caption) > * > * { vertical-align: middle; }
.avatar-sm {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #e2e6ea;
}

/* ---------------------------------------------------------------------------
   Approval timeline
   --------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute; left: 8px; top: 4px; bottom: 4px;
  width: 2px; background: #e0e4e8;
}
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute; left: -28px; top: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gredo-green);
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--gredo-green);
}
.timeline-item.rejected::before { background: #d64545; box-shadow: 0 0 0 2px #d64545; }
.timeline-item.pending::before { background: var(--gredo-gold); box-shadow: 0 0 0 2px var(--gredo-gold); }
.timeline-item.corrected::before { background: #6c757d; box-shadow: 0 0 0 2px #6c757d; }

/* ---------------------------------------------------------------------------
   Auth pages (login / forgot / reset password)
   --------------------------------------------------------------------------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #0c4b25, #001a0a 65%);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 920px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
}
.auth-side {
  background: linear-gradient(160deg, var(--gredo-green-dark), var(--gredo-green) 60%, var(--gredo-gold) 150%);
  color: #fff;
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.auth-side .brand-badge { width: 56px; height: 56px; font-size: 18px; }
.brand-logo-badge-lg {
  display: inline-block;
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.brand-logo-badge-lg img { height: 52px; width: auto; max-width: 220px; display: block; }
.auth-form-side { padding: 48px 40px; background: #fff; }

/* ---------------------------------------------------------------------------
   Digital ID / QR card
   --------------------------------------------------------------------------- */
.digital-id-card {
  max-width: 380px;
  margin: 0 auto;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,.12);
}
.digital-id-card .did-header {
  background: linear-gradient(135deg, var(--gredo-green-dark), var(--gredo-green));
  color: #fff;
  padding: 16px 20px;
  text-align: center;
}
.did-logo {
  height: 26px;
  width: auto;
  max-width: 100%;
  background: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.did-org-name {
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  opacity: .9;
  margin-top: 6px;
}
/* Profile row: photo sits beside the holder's name, never overlapping the header. */
.digital-id-card .did-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 10px;
  text-align: left;
}
.digital-id-card .did-photo {
  width: 84px; height: 84px;
  min-width: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gredo-green);
  display: block;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.digital-id-card .did-profile-info { min-width: 0; }
.digital-id-card .did-profile-info h4 { font-size: 1.05rem; overflow-wrap: break-word; }
.digital-id-card .did-qr { padding: 8px 24px 24px; text-align: center; }
.digital-id-card .did-qr img { border: 8px solid #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.digital-id-card .did-meta { border-top: 1px dashed #e2e6ea; padding: 16px 24px; font-size: 13px; }

.verified-tick {
  color: var(--gredo-green);
  font-size: 20px;
  margin-left: 4px;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn-gredo {
  background: var(--gredo-green);
  border-color: var(--gredo-green);
  color: #fff;
}
.btn-gredo:hover { background: var(--gredo-green-dark); border-color: var(--gredo-green-dark); color: #fff; }
.btn-gold { background: var(--gredo-gold); border-color: var(--gredo-gold); color: #1b2430; }
.btn-gold:hover { background: var(--gredo-gold-dark); border-color: var(--gredo-gold-dark); color: #1b2430; }
