/* AfriTrain ICT Academy — deep purple + orange design system */

:root {
  --brand-900: #170a2e;
  --brand-800: #1e0f3c;
  --brand-700: #2a1553;
  --brand-600: #3a1e73;
  --brand-500: #5b2fb0;
  --brand-400: #7a4fd6;
  --accent-500: #ff7a1a;
  --accent-400: #ff9445;
  --accent-soft: rgba(255, 122, 26, 0.14);

  --surface: #1a0f33;
  --surface-2: #22143f;
  --surface-3: #2b1a4f;
  --page-bg: #120726;
  --text: #f3eefc;
  --text-muted: #b0a3cd;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 18px;
  --shadow: 0 18px 45px rgba(8, 2, 22, 0.45);

  --ok: #2ecc8f;
  --warn: #ffb648;
  --bad: #ff5c7a;

  --sidebar-w: 264px;
}

[data-bs-theme='light'] {
  --surface: #ffffff;
  --surface-2: #f7f4fd;
  --surface-3: #efe9fb;
  --page-bg: #f4f1fa;
  --text: #1d1130;
  --text-muted: #6d6285;
  --border: rgba(29, 17, 48, 0.1);
  --shadow: 0 14px 36px rgba(58, 30, 115, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
.text-muted-soft { color: var(--text-muted) !important; }
.text-accent { color: var(--accent-500) !important; }
.link-accent { color: var(--accent-400); font-weight: 600; }
.link-accent:hover { color: var(--accent-500); }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 0.85rem; }

/* ---------- Buttons ---------- */
.btn-brand {
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  padding: 0.65rem 1.15rem;
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-brand:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.06); }
.btn-brand:disabled { opacity: 0.65; transform: none; }

.btn-outline-brand {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  border-radius: 12px;
  padding: 0.65rem 1.05rem;
}
.btn-outline-brand:hover { border-color: var(--accent-500); color: var(--accent-500); }

.btn-icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.1rem;
}
.btn-icon:hover { color: var(--accent-500); border-color: var(--accent-500); }
.btn-icon .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-500);
}

/* ---------- Brand mark ---------- */
.brand-mark {
  width: 46px; height: 46px;
  display: inline-grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--brand-500), var(--accent-500));
  color: #fff; font-size: 1.35rem;
}

/* ---------- Auth ---------- */
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(122, 79, 214, 0.35), transparent 60%),
    radial-gradient(700px 480px at 88% 92%, rgba(255, 122, 26, 0.22), transparent 62%),
    var(--brand-900);
}
.auth-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-brand { align-items: center; padding: 4rem 4.5rem; }
.auth-points li { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.85rem; color: var(--text-muted); }
.auth-points i { color: var(--accent-500); font-size: 1.1rem; }
.auth-panel { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2.4rem;
  box-shadow: var(--shadow);
}
.role-hint {
  display: flex; gap: 0.6rem; align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 122, 26, 0.25);
  color: var(--text-muted);
  border-radius: 12px; padding: 0.75rem 0.9rem; font-size: 0.85rem;
}
.role-hint i { color: var(--accent-500); }

@media (max-width: 991.98px) { .auth-shell { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.form-control, .form-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}
.form-control:focus, .form-select:focus {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent-500);
  box-shadow: 0 0 0 0.2rem rgba(255, 122, 26, 0.18);
}
.form-floating > label { color: var(--text-muted); }
.form-check-input:checked { background-color: var(--accent-500); border-color: var(--accent-500); }

.password-field { position: relative; }
.password-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--text-muted); font-size: 1.05rem;
  padding: 0.35rem 0.5rem; z-index: 5;
}
.password-toggle:hover { color: var(--accent-500); }

.form-message { font-size: 0.9rem; min-height: 1.2rem; }
.form-message.is-error { color: var(--bad); }
.form-message.is-success { color: var(--ok); }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.layout-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand-800), var(--brand-900));
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.9rem;
  display: flex; flex-direction: column; gap: 0.35rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
[data-bs-theme='light'] .sidebar { background: linear-gradient(180deg, #2a1553, #1e0f3c); }

.sidebar-brand { display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0.6rem 1.35rem; color: #fff; }
.sidebar-brand strong { display: block; font-size: 1.05rem; line-height: 1.1; }
.sidebar-brand small { color: rgba(255, 255, 255, 0.6); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }

.sidebar-link {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.68rem 0.85rem; border-radius: 12px;
  color: rgba(243, 238, 252, 0.72); font-size: 0.93rem; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-link.is-active {
  background: linear-gradient(135deg, rgba(122, 79, 214, 0.55), rgba(255, 122, 26, 0.35));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent-500);
}
.sidebar-logout { color: #ffa6b6; margin-top: 0.5rem; }

.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(8, 2, 22, 0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 1030;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

@media (max-width: 991.98px) {
  .sidebar { position: fixed; z-index: 1040; transform: translateX(-100%); transition: transform 0.22s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1.5rem;
  background: color-mix(in srgb, var(--page-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-search { position: relative; flex: 1; max-width: 480px; }
.topbar-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.topbar-search .form-control { padding-left: 2.6rem; border-radius: 999px; }
.topbar-actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

.user-chip {
  display: flex; align-items: center; gap: 0.65rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.3rem 0.85rem 0.3rem 0.35rem; color: var(--text);
}
.user-chip strong { display: block; font-size: 0.85rem; line-height: 1.1; }
.user-chip small { color: var(--text-muted); font-size: 0.72rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
}
.dropdown-menu {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); color: var(--text);
}
.dropdown-item { color: var(--text); border-radius: 8px; }
.dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.notif-menu { width: 320px; }
.notif-item { display: block; padding: 0.5rem 1rem; }
.notif-item small { color: var(--text-muted); display: block; }

/* ---------- Page ---------- */
.page { padding: 1.6rem 1.5rem 2.5rem; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; }
.page-title { font-size: 1.65rem; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--text-muted); margin: 0.25rem 0 0; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; gap: 0.75rem; }
.panel-title { font-size: 1rem; font-weight: 700; margin: 0; }

.badge-soft {
  background: var(--surface-3); color: var(--text-muted);
  border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.75rem; font-weight: 600;
}
.badge-soft.tone-red { background: rgba(255, 92, 122, 0.15); color: var(--bad); }
.badge-soft.tone-orange { background: var(--accent-soft); color: var(--accent-400); }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat-card {
  display: flex; align-items: center; gap: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: transform 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card::after {
  content: ''; position: absolute; inset: auto -30px -40px auto;
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--tone, var(--brand-500)); opacity: 0.14;
}
.stat-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 14px;
  font-size: 1.25rem; color: #fff;
  background: var(--tone, var(--brand-500));
}
.stat-label { margin: 0; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { margin: 0.15rem 0 0; font-size: 1.4rem; font-weight: 700; }

.tone-violet { --tone: #7a4fd6; }
.tone-teal   { --tone: #22b8a6; }
.tone-blue   { --tone: #4a7ddc; }
.tone-indigo { --tone: #5b2fb0; }
.tone-plum   { --tone: #b04fd6; }
.tone-orange { --tone: #ff7a1a; }
.tone-red    { --tone: #ff5c7a; }
.tone-green  { --tone: #2ecc8f; }

/* ---------- Tables & lists ---------- */
.table-clean { color: var(--text); --bs-table-bg: transparent; }
.table-clean thead th {
  color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.05em; font-weight: 700; border-bottom: 1px solid var(--border);
}
.table-clean td { border-color: var(--border); padding-top: 0.85rem; padding-bottom: 0.85rem; }

.list-plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.list-plain li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.amount-negative { color: var(--bad); font-weight: 700; }

.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.timeline li { display: flex; gap: 0.75rem; }
.dot-mark {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
  background: var(--accent-500); box-shadow: 0 0 0 4px var(--accent-soft);
}

.tips li { display: flex; gap: 0.7rem; align-items: flex-start; margin-bottom: 0.85rem; color: var(--text-muted); }
.tips i { color: var(--accent-500); }

.alert { border-radius: 14px; border: 1px solid var(--border); }

/* ---- Print sheets (certificates, ID cards) ------------------------------ */
.print-body { background: #12101c; color: #1b1730; padding: 1.5rem; }
.print-toolbar { display: flex; gap: 0.6rem; justify-content: center; margin-bottom: 1.25rem; }

.certificate-sheet {
  width: 297mm; max-width: 100%; min-height: 210mm; margin: 0 auto; background: #fffdf8;
  padding: 12mm; box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}
.certificate-frame {
  border: 3px solid var(--brand-600, #4b2a86); outline: 1px solid var(--accent-500, #f57c1f);
  outline-offset: 6px; height: 100%; padding: 14mm 16mm; text-align: center; position: relative;
}
.certificate-head h1 { font-size: 1.9rem; font-weight: 800; color: #4b2a86; margin: 0.6rem 0 0.2rem; }
.certificate-head p { color: #6b6580; font-size: 0.85rem; margin-bottom: 1rem; }
.certificate-kicker {
  text-transform: uppercase; letter-spacing: 0.35em; font-weight: 700; color: #f57c1f; margin-bottom: 1.2rem;
}
.certificate-lead { color: #4a4560; margin-bottom: 0.4rem; }
.certificate-name {
  font-size: 2.6rem; font-weight: 800; color: #1b1730; margin: 0.3rem 0 0.8rem; border-bottom: 2px dashed #d9d2ea;
  display: inline-block; padding: 0 2rem 0.4rem;
}
.certificate-course { font-size: 1.5rem; font-weight: 700; color: #4b2a86; margin: 0.6rem 0 0.8rem; }
.certificate-foot {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-top: 2.5rem;
}
.certificate-foot small { display: block; color: #6b6580; font-size: 0.72rem; }
.certificate-sign { display: block; font-weight: 700; color: #1b1730; border-top: 1px solid #b9b2cd; padding-top: 0.35rem; }
.certificate-verify { margin-top: 1.4rem; font-size: 0.72rem; color: #6b6580; word-break: break-all; }
.certificate-revoked {
  position: absolute; inset: 45% 0 auto; font-size: 4rem; font-weight: 900; color: rgba(200, 30, 40, 0.28);
  transform: rotate(-18deg); letter-spacing: 0.3em;
}

@media print {
  .no-print { display: none !important; }
  .print-body { background: #fff; padding: 0; }
  .certificate-sheet { box-shadow: none; width: auto; margin: 0; }
  @page { size: A4 landscape; margin: 8mm; }
}

/* ---- Public pages (certificate verification) ---------------------------- */
.public-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
}
.public-main { padding: 2.5rem 1.5rem 4rem; }
.verify-wrap { max-width: 780px; margin: 0 auto; }
.verify-result { text-align: center; border-width: 1px; border-style: solid; }
.verify-result.is-valid-result { border-color: var(--good, #2fa36b); }
.verify-result.is-valid-result i { color: var(--good, #2fa36b); }
.verify-result.is-invalid-result { border-color: var(--bad, #d9484f); }
.verify-result.is-invalid-result i { color: var(--bad, #d9484f); }

/* Amendment: exact ID card and A5 receipt physical print formats. */
.receipt-a5 { background:#fff !important; color:#161616 !important; width:148mm !important; min-height:210mm !important; margin:0 auto; padding:12mm !important; }
.receipt-a5 .sheet-title,.receipt-a5 .sheet-code,.receipt-a5 .sheet-table,.receipt-a5 .sheet-sub { color:#161616 !important; }
@media print { .receipt-a5 { width:148mm !important; min-height:210mm !important; box-shadow:none !important; } @page { size:A5 portrait; margin:0; } }
.verify-pending{border-color:#d89e00!important}.verify-pending i{color:#d89e00!important}
