/* =====================================================================
   Tech Optimum SRMS — Admin Design System
   Concept: "Ledger & Seal" — an academic records office rendered as a
   modern data console. Deep ink surfaces, a hairline-ruled paper
   workspace, and a gold verification seal as the recurring signature
   (echoing the certificate-seal at the heart of the product).
   ===================================================================== */

:root {
  /* Ink (dark surfaces: topbar / sidebar) */
  --ink-900: #10142A;
  --ink-800: #161B37;
  --ink-700: #202650;
  --ink-line: rgba(255,255,255,.09);

  /* Paper (app background / light surfaces) */
  --paper: #F3F4FA;
  --surface: #FFFFFF;
  --line: #E7E9F3;
  --line-soft: #EFF0F8;

  /* Text */
  --text-900: #14172B;
  --text-600: #565C78;
  --text-400: #8B90AC;
  --text-on-ink: #C7CBE8;
  --text-on-ink-dim: #7C82AC;

  /* Signature accent: verification-seal gold */
  --gold: #B9892E;
  --gold-bright: #D9A63F;
  --gold-tint: #FBF3E1;

  /* Status palette */
  --azure: #3A5CE0;
  --azure-tint: #EAEEFD;
  --emerald: #1C8A5C;
  --emerald-tint: #E4F5EC;
  --amber: #C97A1F;
  --amber-tint: #FBEEDD;
  --crimson: #C13B45;
  --crimson-tint: #FBEAEC;
  --violet: #7454C7;
  --violet-tint: #F0EBFC;
  --slate: #5B6178;
  --slate-tint: #EEEFF6;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(16,20,42,.04), 0 8px 24px -12px rgba(16,20,42,.12);
  --shadow-pop: 0 12px 32px -8px rgba(16,20,42,.28);
}

* { box-sizing: border-box; }

body {
  background: var(--paper);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-900);
  font-size: .925rem;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Sora', 'Inter', sans-serif; letter-spacing: -.01em; }

.mono, .stat-value, .enrollment-id, code {
  font-family: 'IBM Plex Mono', 'Consolas', monospace;
}

/* ---------------------------------------------------------------------
   Topbar — ink gradient with a faint guilloché dot-grid, like security
   paper on a certificate.
   --------------------------------------------------------------------- */
.topbar {
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.07) 1px, transparent 0) 0 0/18px 18px,
    linear-gradient(100deg, var(--ink-900) 0%, var(--ink-800) 55%, var(--ink-700) 100%);
  border-bottom: 1px solid var(--ink-line);
  min-height: 60px;
  box-shadow: 0 2px 0 rgba(0,0,0,.04);
}
.topbar .navbar-brand {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.topbar .navbar-brand .brand-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.topbar .navbar-brand span.fw-light { color: var(--text-on-ink-dim); font-weight: 400; }
.topbar .navbar-brand .brand-seal {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold) 70%);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-900);
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(217,166,63,.18), inset 0 1px 2px rgba(255,255,255,.4);
}
.topbar .btn-outline-light {
  border-color: rgba(255,255,255,.25);
  font-size: .82rem;
}
.topbar .btn-outline-light:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
.topbar .dropdown-menu { border: none; box-shadow: var(--shadow-pop); border-radius: var(--radius-sm); overflow: hidden; }
.topbar .container-fluid, .verify-nav .container { flex-wrap: nowrap; }

/* ---------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------- */
.sidebar {
  width: 254px;
  min-height: calc(100vh - 60px);
  background: linear-gradient(185deg, var(--ink-900), var(--ink-800));
  padding: 1.1rem .85rem;
  position: sticky;
  top: 60px;
  align-self: flex-start;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar .nav-link {
  color: var(--text-on-ink);
  padding: .62rem .85rem;
  border-radius: 9px;
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .15rem;
  border-left: none;
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.sidebar .nav-link i { font-size: 1rem; width: 18px; text-align: center; color: var(--text-on-ink-dim); transition: color .15s ease; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link:hover i { color: var(--gold-bright); }
.sidebar .nav-link.active {
  background: rgba(217,166,63,.12);
  color: #fff;
  font-weight: 600;
}
.sidebar .nav-link.active i { color: var(--gold-bright); }
.sidebar .nav-link.active::before {
  content: '';
  position: absolute; left: -.85rem; top: 8%; bottom: 8%; width: 3px;
  background: linear-gradient(var(--gold-bright), var(--gold));
  border-radius: 0 3px 3px 0;
}
.sidebar .nav-link.text-info { color: var(--azure) !important; }
.sidebar .nav-link.text-info i { color: var(--azure); }
.sidebar hr { border-color: var(--ink-line); }
.sidebar-eyebrow {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  color: var(--text-on-ink-dim); padding: .9rem .85rem .35rem;
}
.sidebar > .sidebar-eyebrow:first-child { padding-top: .25rem; }

.main-content { min-width: 0; }

@media (max-width: 991px) {
  .sidebar { position: fixed; z-index: 1040; left: -270px; transition: left .25s ease; top: 60px; height: calc(100vh - 60px); }
  .sidebar.show { left: 0; box-shadow: var(--shadow-pop); }
}

/* ---------------------------------------------------------------------
   Section headers
   --------------------------------------------------------------------- */
.section-title {
  font-weight: 700;
  color: var(--text-900);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.28rem;
}
.section-title i { color: var(--gold); font-size: 1.05rem; }
.section-sub { color: var(--text-400); font-size: .84rem; margin-top: -.7rem; margin-bottom: 1.25rem; }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background: var(--surface);
}

/* ---------------------------------------------------------------------
   Stat cards — restrained: white surface, a colored icon chip, a
   mono numeral, and a tracked caption. No candy gradients.
   --------------------------------------------------------------------- */
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: .9rem;
  height: 100%;
}
.stat-card .stat-icon-chip {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.stat-card .stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-900);
}
.stat-card .stat-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-400);
  font-weight: 600;
  margin-top: .15rem;
}
.chip-azure   { background: var(--azure-tint);   color: var(--azure); }
.chip-emerald { background: var(--emerald-tint); color: var(--emerald); }
.chip-amber   { background: var(--amber-tint);   color: var(--amber); }
.chip-violet  { background: var(--violet-tint);  color: var(--violet); }
.chip-crimson { background: var(--crimson-tint); color: var(--crimson); }
.chip-slate   { background: var(--slate-tint);   color: var(--slate); }
.chip-gold    { background: var(--gold-tint);    color: var(--gold); }

/* legacy gradient hooks kept as aliases so older markup still renders */
.bg-grad-blue, .bg-grad-purple, .bg-grad-orange, .bg-grad-teal, .bg-grad-green, .bg-grad-red {
  color: #fff; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-card);
}
.bg-grad-blue   { background: linear-gradient(135deg,#4A63E8,var(--ink-700)); }
.bg-grad-green  { background: linear-gradient(135deg,#2AA773,var(--emerald)); }
.bg-grad-orange { background: linear-gradient(135deg,#E0932F,var(--amber)); }
.bg-grad-purple { background: linear-gradient(135deg,#9273DD,var(--violet)); }
.bg-grad-teal   { background: linear-gradient(135deg,#2FB6B0,#146C67); }
.bg-grad-red    { background: linear-gradient(135deg,#DE5561,var(--crimson)); }

/* ---------------------------------------------------------------------
   Photos / avatars
   --------------------------------------------------------------------- */
.student-photo, .photo-preview {
  width: 110px; height: 110px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper);
}
.avatar-sm { width: 38px; height: 38px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------------------------------------------------------------------
   Public verification hero
   --------------------------------------------------------------------- */
.verify-hero {
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 0) 0 0/20px 20px,
    linear-gradient(120deg, var(--ink-900), var(--ink-700) 65%, #2A2450);
  color: #fff;
  position: relative;
}
.verify-hero .seal-ring {
  width: 76px; height: 76px; border-radius: 50%;
  border: 2px solid var(--gold-bright);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  background: radial-gradient(circle at 35% 30%, rgba(217,166,63,.25), transparent 70%);
}
.verify-hero .seal-ring i { font-size: 2rem; color: var(--gold-bright); }

/* ---------------------------------------------------------------------
   Status badges — soft-tint pills instead of solid saturated blocks
   --------------------------------------------------------------------- */
.badge { font-weight: 600; font-size: .72rem; letter-spacing: .02em; padding: .4em .65em; border-radius: 999px; }
.badge-status-Issued, .badge-status-Pass, .badge-status-Completed { background: var(--emerald-tint); color: var(--emerald); }
.badge-status-Pending, .badge-status-Running { background: var(--amber-tint); color: var(--amber); }
.badge-status-Dropped, .badge-status-Fail { background: var(--crimson-tint); color: var(--crimson); }
.badge-status-Hold, .badge-status-NotIssued { background: var(--slate-tint); color: var(--slate); }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table { --bs-table-hover-bg: var(--paper); margin-bottom: 0; }
.table thead th {
  text-transform: uppercase; font-size: .7rem; letter-spacing: .06em;
  color: var(--text-400); font-weight: 700; border-bottom: 1px solid var(--line);
  padding-top: .25rem; padding-bottom: .75rem;
}
.table td { border-color: var(--line-soft); vertical-align: middle; }
.table-actions a { margin-right: .35rem; }

/* ---------------------------------------------------------------------
   Forms & buttons
   --------------------------------------------------------------------- */
.form-control, .form-select {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  font-size: .875rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--azure);
  box-shadow: 0 0 0 .2rem var(--azure-tint);
}
.form-label { font-size: .8rem; font-weight: 600; color: var(--text-600); margin-bottom: .35rem; }

.btn { border-radius: var(--radius-sm); font-size: .875rem; font-weight: 600; }
.btn-primary { background: var(--azure); border-color: var(--azure); }
.btn-primary:hover { background: #2E4CC4; border-color: #2E4CC4; }
.btn-outline-primary { color: var(--azure); border-color: var(--azure); }
.btn-outline-primary:hover { background: var(--azure); border-color: var(--azure); }

/* ---------------------------------------------------------------------
   Misc
   --------------------------------------------------------------------- */
.card-header-plain {
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: .95rem;
  color: var(--text-900); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}
.card-header-plain i { color: var(--gold); }

.stat-card, .card { transition: transform .15s ease, box-shadow .15s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(16,20,42,.06), 0 16px 32px -12px rgba(16,20,42,.18); }

/* ---------------------------------------------------------------------
   Dashboard welcome banner
   --------------------------------------------------------------------- */
.welcome-banner {
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 0) 0 0/20px 20px,
    linear-gradient(115deg, var(--ink-900) 0%, var(--ink-700) 65%, #2A2450 100%);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.welcome-banner::after {
  content: '';
  position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(217,166,63,.25);
}
.welcome-banner .eyebrow {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
  color: var(--gold-bright); margin-bottom: .35rem;
}
.welcome-banner h3 { font-weight: 700; margin-bottom: .25rem; }
.welcome-banner p { color: var(--text-on-ink); margin-bottom: 0; font-size: .875rem; }
.welcome-banner .quick-actions { position: relative; z-index: 1; }
.welcome-banner .btn-quick {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: .5rem .9rem;
  display: inline-flex; align-items: center; gap: .45rem;
  transition: background .15s ease, border-color .15s ease;
}
.welcome-banner .btn-quick:hover { background: rgba(217,166,63,.18); border-color: rgba(217,166,63,.4); color: #fff; }
.welcome-banner .btn-quick.primary { background: var(--gold); border-color: var(--gold); color: var(--ink-900); }
.welcome-banner .btn-quick.primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #C7CBDE; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------------
   Print: verification result only
   --------------------------------------------------------------------- */
@media print {
  body.printing-verification * { visibility: hidden; }
  body.printing-verification #verifyResultCard,
  body.printing-verification #verifyResultCard * { visibility: visible; }
  body.printing-verification #verifyResultCard {
    position: absolute; top: 0; left: 0; width: 100%;
    box-shadow: none; border: 1px solid var(--line);
  }
  body.printing-verification .no-print { display: none !important; }
}

/* ---------------------------------------------------------------------
   Public verification navbar (replaces old inline style)
   --------------------------------------------------------------------- */
.verify-nav {
  background: linear-gradient(100deg, var(--ink-900) 0%, var(--ink-700) 100%);
}
.verify-nav .navbar-brand {
  display: flex; align-items: center; min-width: 0; flex-shrink: 1; overflow: hidden;
}
.verify-nav .navbar-brand .brand-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.verify-hero-title { font-size: 2rem; }

/* ---------------------------------------------------------------------
   Mobile sidebar backdrop
   --------------------------------------------------------------------- */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 60px 0 0 0; z-index: 1039;
  background: rgba(16,20,42,.45);
}
.sidebar-backdrop.show { display: block; }

/* =======================================================================
   RESPONSIVE / MOBILE PASS
   ======================================================================= */

/* Tablets and below */
@media (max-width: 991px) {
  .main-content { padding: 1rem !important; }
  .welcome-banner { padding: 1.35rem 1.4rem; }
  .welcome-banner .quick-actions { justify-content: flex-start !important; margin-top: .5rem; }
}

/* Tablet tier: distinct sizing between phone and desktop */
@media (min-width: 576px) and (max-width: 991px) {
  .welcome-banner h3 { font-size: 1.4rem; }
  .welcome-banner p { font-size: .82rem; }
  .section-title { font-size: 1.18rem; }
  .verify-hero-title { font-size: 1.7rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .card.p-4 { padding: 1.25rem !important; }
}

/* Phones */
@media (max-width: 575px) {
  body { font-size: .875rem; }

  .topbar { min-height: 54px; }
  .topbar .navbar-brand { font-size: .95rem; max-width: 60vw; }
  .topbar .navbar-brand .brand-seal { width: 28px; height: 28px; font-size: .85rem; }
  .topbar .btn-outline-light { padding: .3rem .55rem; }

  .sidebar, .sidebar-backdrop { top: 54px; }
  .sidebar { height: calc(100vh - 54px); width: 88vw; max-width: 290px; }

  .main-content { padding: .85rem !important; }

  .section-title { font-size: 1.1rem; }
  .section-sub { font-size: .78rem; }

  .welcome-banner { padding: 1.1rem; border-radius: var(--radius-sm); }
  .welcome-banner h3 { font-size: 1.15rem; }
  .welcome-banner p { font-size: .8rem; }
  .welcome-banner .quick-actions { width: 100%; }
  .welcome-banner .btn-quick { flex: 1 1 calc(50% - .5rem); justify-content: center; font-size: .76rem; padding: .5rem .6rem; }

  .stat-card { padding: .9rem 1rem; gap: .7rem; }
  .stat-card .stat-icon-chip { width: 38px; height: 38px; font-size: 1rem; }
  .stat-card .stat-value { font-size: 1.25rem; }
  .stat-card .stat-label { font-size: .66rem; }

  .card { border-radius: var(--radius-sm); }
  .card.p-4 { padding: 1rem !important; }
  .card-header-plain { font-size: .875rem; }

  .table { font-size: .8rem; }
  .table thead th { font-size: .62rem; }
  .avatar-sm { width: 32px; height: 32px; }

  .student-photo, .photo-preview { width: 90px; height: 90px; }

  .btn { font-size: .8rem; }
  .btn-lg { font-size: .95rem; padding: .6rem 1rem; }

  .verify-hero { padding-left: .5rem; padding-right: .5rem; }
  .verify-hero-title { font-size: 1.35rem; }
  .verify-hero p { font-size: .82rem; }
  .verify-nav .navbar-brand { font-size: .9rem; }

  .modal-dialog { margin: .75rem; }
}

/* ---------------------------------------------------------------------
   Verification result card
   --------------------------------------------------------------------- */
.min-w-0 { min-width: 0; }

.verify-result-photo {
  width: 80px; height: 80px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper); flex-shrink: 0;
}
.verify-details { border-top: 1px solid var(--line); margin-top: .25rem; }
.verify-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--line-soft);
}
.verify-row .label { color: var(--text-400); font-size: .78rem; font-weight: 600; flex-shrink: 0; }
.verify-row .value { font-weight: 600; text-align: right; word-break: break-word; overflow-wrap: anywhere; }
.verify-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.verify-actions .btn { flex: 1 1 0; }

@media (max-width: 575px) {
  .verify-actions { gap: .5rem; }
  .verify-actions .btn { font-size: .78rem; padding: .5rem .5rem; }
}

@media (max-width: 420px) {
  .verify-row { flex-direction: column; align-items: flex-start; gap: .1rem; padding: .5rem 0; }
  .verify-row .value { text-align: left; }
}

/* Very small phones */
@media (max-width: 360px) {
  .stat-card .stat-label { display: none; }
  .welcome-banner .btn-quick { flex: 1 1 100%; }
}
