/* ============================================================
   WISUDA HYBRID 2026 — Application Stylesheet
   Academic graduation theme: Navy + Gold
   ============================================================ */

:root {
  --navy:        #1B3A6B;
  --navy-dark:   #122850;
  --navy-light:  #2A4F8F;
  --gold:        #B8860B;
  --gold-light:  #D4A017;
  --accent:      #4A90D9;
  --bg:          #F0F2F8;
  --white:       #FFFFFF;
  --text:        #2D3748;
  --muted:       #718096;
  --border:      #E2E8F0;
  --success:     #38A169;
  --danger:      #E53E3E;
  --warning:     #D69E2E;
  --sidebar-w:   260px;
  --topbar-h:    56px;
}

/* ── Base ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--text); }
.fw-mono, code { font-family: 'Courier New', monospace; }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--navy), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: white;
  margin: 0 auto;
  box-shadow: 0 8px 20px rgba(27,58,107,.3);
}
.btn-login { background: var(--navy); border-color: var(--navy); padding: .75rem; font-weight: 600; }
.btn-login:hover { background: var(--navy-dark); border-color: var(--navy-dark); }

/* ── Admin layout ────────────────────────────────────────── */
.admin-layout { min-height: 100vh; background: var(--bg); }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 100;
  transition: transform .25s ease;
  overflow-y: auto;
}
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main-content { margin-left: 0; }

.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: white;
  font-size: 1.25rem;
}
.brand-name { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.brand-sub  { font-size: .7rem; opacity: .65; }

.sidebar-nav { list-style: none; padding: .5rem 0; margin: 0; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem 1rem;
  color: rgba(255,255,255,.75);
  text-decoration: none; font-size: .875rem;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover  { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-nav li a.active { color: #fff; background: rgba(255,255,255,.12); border-left-color: var(--gold); }
.sidebar-nav .bi { font-size: 1rem; width: 20px; }
.nav-label {
  padding: .9rem 1rem .25rem;
  font-size: .65rem; font-weight: 700;
  color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .08em;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.user-info { display: flex; align-items: center; gap: .6rem; color: white; font-size: .85rem; margin-bottom: .5rem; }

.main-content { margin-left: var(--sidebar-w); transition: margin-left .25s; min-height: 100vh; }

.main-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: var(--topbar-h);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sidebar-toggle { color: var(--navy); }
.content-wrapper { padding: 1.5rem; }

/* ── Stat cards ──────────────────────────────────────────── */
.stat-card {
  border-radius: 12px;
  padding: 1.25rem 1rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.stat-card::before {
  content: '';
  position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
}
.stat-primary    { background: linear-gradient(135deg,#1B3A6B,#2A4F8F); }
.stat-success    { background: linear-gradient(135deg,#276749,#38A169); }
.stat-warning    { background: linear-gradient(135deg,#975A16,#D69E2E); color: #2D3748; }
.stat-warning .stat-value, .stat-warning .stat-label { color: #2D3748; }
.stat-info       { background: linear-gradient(135deg,#2B6CB0,#4A90D9); }
.stat-danger     { background: linear-gradient(135deg,#9B2C2C,#E53E3E); }
.stat-secondary  { background: linear-gradient(135deg,#4A5568,#718096); }
.stat-dark       { background: linear-gradient(135deg,#1A202C,#2D3748); }
.stat-warning-soft { background: linear-gradient(135deg,#B7791F,#ECC94B); }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .75rem; opacity: .85; margin-top: .25rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-icon  { font-size: 2rem; opacity: .3; position: absolute; right: 1rem; bottom: .75rem; }

/* ── Operator layout (manual page) ──────────────────────── */
.operator-layout { background: #0F1B2E; min-height: 100vh; overflow: hidden; }
.op-topbar { background: #1B3A6B; border-bottom: 1px solid rgba(255,255,255,.1); min-height: 48px; position: relative; z-index: 10; }
.op-content { padding: 0; height: calc(100vh - 48px); position: relative; overflow: hidden; }
.op-content.has-padding { height: auto; overflow-y: auto; }

/* ── Scanner fullscreen layout ───────────────────────────── */
.scanner-fullscreen { background: #1B3A6B; }

/* ── Fullscreen QR Validation Screen ─────────────────────── */
.qv-screen {
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  position: fixed; inset: 0;
  transition: background .25s ease;
}

/* Floating manual button (FAB) */
.qv-fab {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 52px; height: 52px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.7);
  font-size: 1.25rem;
  text-decoration: none;
  z-index: 100;
  transition: background .2s, color .2s, opacity .2s;
  opacity: .45;
}
.qv-fab:hover { background: rgba(255,255,255,.3); color: #fff; opacity: 1; }

/* Logo on result screen */
.qv-result-logo {
  position: absolute; top: 1.5rem; left: 50%; transform: translateX(-50%);
  max-height: 48px; max-width: 160px; object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
  z-index: 1;
}

/* IDLE */
.qv-idle-content {
  color: white;
  padding: 2rem;
  user-select: none;
}
.qv-logo-img {
  max-height: 100px; max-width: 240px; object-fit: contain;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
}
.qv-idle-icon  {
  font-size: 8rem; line-height: 1;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
}
.qv-idle-app   { font-size: 2.5rem; font-weight: 900; letter-spacing: .04em; line-height: 1.1; }
.qv-idle-event { font-size: 1.2rem; opacity: .65; margin: .5rem 0 3rem; }
.qv-idle-scan  {
  font-size: 3.5rem; font-weight: 900; letter-spacing: .2em;
  text-transform: uppercase;
  border: 4px solid rgba(255,255,255,.3);
  padding: .75rem 2.5rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  display: inline-block;
}
.qv-idle-wait  {
  font-size: 1.1rem; opacity: .5; letter-spacing: .05em;
  animation: qv-pulse 2.5s ease-in-out infinite;
}

/* RESULT WRAPPER */
.qv-result-wrap {
  color: white;
  padding: 2rem 3rem;
  max-width: 960px;
  width: 100%;
  user-select: none;
}

/* Symbol */
.qv-symbol {
  font-size: 8rem; line-height: 1;
  font-weight: 900;
  margin-bottom: .5rem;
  text-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.qv-check { color: #ACFFCC; }
.qv-warn  { color: #FFE082; }
.qv-cross { color: #FFAAAA; }

/* Status labels */
.qv-label-valid   { font-size: 3.5rem; font-weight: 900; letter-spacing: .12em; margin-bottom: .75rem; color: #ACFFCC; }
.qv-label-dup     { font-size: 3.5rem; font-weight: 900; letter-spacing: .08em; margin-bottom: .75rem; color: #FFE082; }
.qv-label-invalid { font-size: 3.5rem; font-weight: 900; letter-spacing: .08em; margin-bottom: .75rem; color: #FFAAAA; }

/* Type badge */
.qv-type-badge {
  display: inline-block;
  font-size: 1.6rem; font-weight: 800; letter-spacing: .12em;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.3);
  padding: .3rem 2rem; border-radius: 50px;
  margin-bottom: 1.5rem;
}

/* Name — must be readable from 3m */
.qv-name    { font-size: 5rem; font-weight: 900; line-height: 1.05; margin-bottom: .5rem; text-shadow: 0 3px 12px rgba(0,0,0,.5); }
.qv-nim     { font-size: 2.2rem; font-weight: 700; opacity: .85; margin-bottom: .25rem; font-family: monospace; }
.qv-program { font-size: 1.4rem; opacity: .7; margin-bottom: 2rem; }

/* Success / duplicate sub-labels */
.qv-success  { font-size: 2rem; font-weight: 700; letter-spacing: .1em; opacity: .85; }
.qv-dup-time { font-size: 1.75rem; font-weight: 600; opacity: .8; margin-top: .75rem; }

@keyframes qv-pulse {
  0%, 100% { opacity: .5; }
  50%       { opacity: .85; }
}

/* Manual check-in page (still uses operator layout) */
.op-content.has-padding { height: auto; overflow-y: auto; }

/* ── Public portal ───────────────────────────────────────── */
.public-layout { background: #F7F9FC; }
.public-navbar { background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%); }

.portal-hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
  min-height: 50vh;
  display: flex; align-items: center;
  position: relative;
  overflow: hidden;
}
.portal-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: 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='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='28'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.portal-hero .container { position: relative; }
.hero-badge { font-size: 4rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)); }
.hero-title { color: var(--gold-light); font-size: 1.75rem; font-weight: 800; margin-bottom: .25rem; }
.hero-subtitle { color: white; font-size: 1.1rem; opacity: .9; }
.hero-info { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.info-pill {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  border-radius: 50px;
  padding: .4rem 1rem;
  font-size: .875rem;
}

.search-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  border: 1px solid var(--border);
}
.search-form .input-group .form-control { border-radius: 0; }
.search-form .input-group .input-group-text { border-radius: 12px 0 0 12px; }
.search-form .input-group .btn { border-radius: 0 12px 12px 0; }

.feature-card {
  background: white;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.feature-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--navy), var(--accent));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; color: white;
  margin: 0 auto;
}

.public-footer { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); margin-top: auto; }

/* Invitation card */
.invitation-card {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(27,58,107,.3);
  color: white;
}
.inv-header {
  padding: 2rem;
  text-align: center;
  background: rgba(0,0,0,.1);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.inv-badge { font-size: 3rem; margin-bottom: .5rem; }
.inv-name  { font-size: 1.4rem; font-weight: 800; margin-bottom: .25rem; color: var(--gold-light); }
.inv-nim   { font-size: .95rem; opacity: .7; font-family: monospace; }
.inv-body  { padding: 1.5rem; }
.inv-detail-label { font-size: .75rem; opacity: .6; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.inv-detail-val   { font-size: .95rem; font-weight: 600; }

/* QR cards */
.qr-card {
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  border: 2px solid;
}
.qr-card-active   { background: #F0FFF4; border-color: var(--success); }
.qr-card-inactive { background: #F7FAFC; border-color: var(--border); }
.qr-card-title { font-weight: 700; font-size: .9rem; margin-bottom: .75rem; }
.qr-card-code  { font-family: monospace; font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: .75rem; }
.qr-display    { width: 200px; height: 200px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-xs { padding: .2rem .5rem; font-size: .75rem; }

/* ── Tables ──────────────────────────────────────────────── */
.table th { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #F8FAFF; }
.table td { vertical-align: middle; }

/* ── Cards ───────────────────────────────────────────────── */
.card { border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.05); border-radius: 12px; }
.card-header { background: #FAFBFF; border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0 !important; padding: .85rem 1.25rem; }

/* ── Responsive ──────────────────────────────────────────── */
/* ── Mobile sidebar backdrop ─────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

@media (max-width: 768px) {
  /* Sidebar hidden by default; main content takes full width */
  .sidebar       { transform: translateX(-100%); }
  .main-content  { margin-left: 0 !important; }

  /* Open sidebar on mobile */
  body.sidebar-mobile-open .sidebar          { transform: translateX(0); z-index: 100; }
  body.sidebar-mobile-open .sidebar-backdrop { display: block; }

  /* Desktop collapse class has no effect on mobile */
  body.sidebar-collapsed .sidebar       { transform: translateX(-100%); }
  body.sidebar-collapsed .main-content  { margin-left: 0 !important; }

  /* Content adjustments */
  .content-wrapper     { padding: 1rem !important; }
  .main-header         { padding: 0 .75rem; }
  .stat-value          { font-size: 1.4rem; }
  .hero-title          { font-size: 1.3rem; }
  .qv-name             { font-size: 3rem; }
  .qv-status-label,
  .qv-label-valid,
  .qv-label-dup,
  .qv-label-invalid    { font-size: 2.5rem; }
  .qv-idle-scan        { font-size: 2.2rem; }
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
