/* ==========================================================================
   Graduate Profile Display — Premium UI layer on top of AdminLTE 4 + Bootstrap 5
   ========================================================================== */
body { --lte-sidebar-width: 272px; }
:root {
  --gp-primary: #0b2d5b;
  --gp-primary-2: #1d4f91;
  --gp-accent: #c9a227;
  --gp-accent-soft: rgba(201, 162, 39, .14);
  --gp-radius: 14px;
  --gp-shadow: 0 6px 24px rgba(15, 35, 75, .08), 0 1px 3px rgba(15, 35, 75, .06);
  --gp-shadow-lg: 0 14px 40px rgba(15, 35, 75, .16);
  --bs-font-sans-serif: "Inter", "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { font-family: var(--bs-font-sans-serif); background: #f3f5fa !important; }
[data-bs-theme=dark] body { background: #0f1420 !important; }

/* ---------- Premium sidebar ---------- */
.app-sidebar.gp-sidebar {
  background: linear-gradient(180deg, var(--gp-primary) 0%, #071a36 100%) !important;
  border-right: 1px solid rgba(255,255,255,.04);
}
.gp-sidebar .sidebar-brand { border-bottom: 1px solid rgba(255,255,255,.08); height: auto; min-height: 3.5rem; padding: .55rem .9rem; }
.gp-sidebar .brand-link { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.gp-sidebar .brand-image { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; max-height: none; margin: 0; }
.gp-sidebar .brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--gp-accent), #f2d77a); color: #102347; font-size: 1.25rem; }
.gp-sidebar .brand-text { color: #fff; font-weight: 700 !important; letter-spacing: .3px; line-height: 1.1; font-size: .98rem; }
.gp-sidebar .brand-text small { display: block; font-weight: 400; font-size: .68rem; color: rgba(255,255,255,.6); letter-spacing: .4px; }
.gp-user-card { margin: .9rem .75rem .4rem; padding: .7rem .75rem; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.07); display: flex; gap: .6rem; align-items: center; }
.gp-avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #102347; background: linear-gradient(135deg, var(--gp-accent), #f6e3a1); }
.gp-user-card .name { color: #fff; font-size: .85rem; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 165px; }
.gp-user-card .role { font-size: .7rem; }
.gp-sidebar .nav-header { color: rgba(255,255,255,.45) !important; font-size: .68rem; letter-spacing: 1.2px; text-transform: uppercase; padding-top: 1rem; }
.gp-sidebar .sidebar-menu .nav-link { color: rgba(255,255,255,.78) !important; border-radius: 10px; margin: 2px 8px; transition: all .18s ease; }
.gp-sidebar .sidebar-menu .nav-link:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; transform: translateX(2px); }
.gp-sidebar .sidebar-menu .nav-link.active { background: linear-gradient(90deg, var(--gp-accent) 0%, #e3c460 100%) !important; color: #102347 !important; font-weight: 600; box-shadow: 0 6px 18px rgba(201,162,39,.35); }
.gp-sidebar .sidebar-menu .nav-link.active .nav-icon { color: #102347 !important; }
.gp-sidebar .nav-icon { color: rgba(255,255,255,.6); }
.sidebar-collapse .gp-user-card { display: none; }

/* ---------- Header ---------- */
.app-header { box-shadow: 0 2px 14px rgba(15,35,75,.06); border-bottom: 0 !important; }
.gp-header-title { font-weight: 600; color: var(--gp-primary); }
[data-bs-theme=dark] .gp-header-title { color: #dbe6ff; }

/* ---------- Content header / back button ---------- */
.app-content-header { padding-top: 1.1rem; }
.gp-page-title { font-weight: 700; font-size: 1.45rem; color: #13254a; margin: 0; }
[data-bs-theme=dark] .gp-page-title { color: #e6ecff; }
.gp-page-sub { color: #6c7a96; font-size: .88rem; }
.btn-back { border-radius: 999px; padding: .32rem .9rem; font-weight: 500; }

/* ---------- Cards ---------- */
.card { border: 0; border-radius: var(--gp-radius); box-shadow: var(--gp-shadow); }
.card > .card-header .card-tools, .card > .card-header.d-flex .badge { margin-left: auto; }
.card > .card-header { background: transparent; border-bottom: 1px solid rgba(15,35,75,.06); padding: .95rem 1.15rem; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-premium-header { background: linear-gradient(120deg, var(--gp-primary), var(--gp-primary-2)) !important; color: #fff; border-radius: var(--gp-radius) var(--gp-radius) 0 0 !important; }
.card-premium-header .card-title { color: #fff; }

/* ---------- KPI infographic tiles ---------- */
.gp-kpi { position: relative; overflow: hidden; border-radius: 16px; padding: 1.05rem 1.15rem; color: #fff; box-shadow: var(--gp-shadow); min-height: 118px; }
.gp-kpi .kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .9px; opacity: .85; }
.gp-kpi .kpi-value { font-size: 2rem; font-weight: 800; line-height: 1.1; margin-top: .2rem; }
.gp-kpi .kpi-foot { font-size: .78rem; opacity: .9; margin-top: .35rem; }
.gp-kpi .kpi-icon { position: absolute; right: -6px; bottom: -12px; font-size: 5rem; opacity: .18; }
.gp-kpi .progress { height: 6px; background: rgba(255,255,255,.25); margin-top: .5rem; }
.gp-kpi .progress-bar { background: #fff; }
.bg-grad-navy   { background: linear-gradient(135deg, #0b2d5b, #2a64b8); }
.bg-grad-gold   { background: linear-gradient(135deg, #b98a10, #e7c55b); }
.bg-grad-teal   { background: linear-gradient(135deg, #0d7a6f, #2bc4a7); }
.bg-grad-purple { background: linear-gradient(135deg, #5a2ca0, #9a6bea); }
.bg-grad-rose   { background: linear-gradient(135deg, #b4234b, #f0607e); }
.bg-grad-slate  { background: linear-gradient(135deg, #334155, #64748b); }
.bg-grad-sky    { background: linear-gradient(135deg, #0369a1, #38bdf8); }
.bg-grad-green  { background: linear-gradient(135deg, #15803d, #4ade80); }

/* ---------- Tables ---------- */
.table > :not(caption) > * > * { padding: .7rem .75rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .7px; color: #6c7a96; font-weight: 600; border-bottom-width: 1px; background: #f8fafd; }
[data-bs-theme=dark] .table thead th { background: #1a2130; color: #9aa7c2; }
.table-hover tbody tr:hover { background: rgba(11,45,91,.03); }
.avatar-sm { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.avatar-initials { width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--gp-primary), var(--gp-primary-2)); font-size: .85rem; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .86rem; color: #344563; }
[data-bs-theme=dark] .form-label { color: #c8d3ea; }
.form-control, .form-select { border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--gp-primary-2); box-shadow: 0 0 0 .2rem rgba(29,79,145,.15); }
.req { color: #dc3545; font-weight: 700; margin-left: 2px; }
.mandatory-note { font-size: .82rem; background: #fff6f6; border: 1px dashed #f1b0b7; color: #a3263a; border-radius: 10px; padding: .45rem .75rem; }
[data-bs-theme=dark] .mandatory-note { background: #2a1519; }
.btn { border-radius: 10px; font-weight: 500; }
.btn-gold { background: linear-gradient(135deg, #c9a227, #e9cb69); color: #1b2a4a; border: 0; }
.btn-gold:hover { filter: brightness(1.05); color: #1b2a4a; }
.btn-navy { background: linear-gradient(135deg, #0b2d5b, #1d4f91); color: #fff; border: 0; }
.btn-navy:hover { color: #fff; filter: brightness(1.12); }

/* ---------- Photo upload & preview ---------- */
.photo-drop { border: 2px dashed #b9c6de; border-radius: 14px; padding: 1.2rem; text-align: center; background: #f8fafe; cursor: pointer; transition: .2s; }
.photo-drop:hover, .photo-drop.drag { border-color: var(--gp-primary-2); background: #eef4ff; }
[data-bs-theme=dark] .photo-drop { background: #161d2b; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .75rem; }
.photo-tile { position: relative; border-radius: 12px; overflow: hidden; box-shadow: var(--gp-shadow); background: #fff; aspect-ratio: 3/4; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .badge { position: absolute; top: 6px; left: 6px; }
.photo-tile .tile-actions { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 4px; justify-content: center; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }

/* ---------- Profile hero ---------- */
.profile-hero { border-radius: 18px; background: linear-gradient(120deg, var(--gp-primary), var(--gp-primary-2)); color: #fff; padding: 1.4rem; position: relative; overflow: hidden; }
.profile-hero:after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.07); }
.profile-hero .hero-photo { width: 120px; height: 150px; object-fit: cover; border-radius: 14px; border: 4px solid rgba(255,255,255,.85); background: #fff; }
.profile-hero .hero-initials { width: 120px; height: 150px; border-radius: 14px; display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; background: rgba(255,255,255,.14); border: 3px solid rgba(255,255,255,.4); }
.code-box { background: #fff; border-radius: 12px; padding: .75rem; text-align: center; }
.code-box svg { max-width: 100%; height: auto; }

/* ---------- Scanner ---------- */
#reader { border-radius: 14px; overflow: hidden; border: 0 !important; background: #0b1530; min-height: 260px; }
#reader video { border-radius: 14px; }
.scan-result-card { border-left: 5px solid #16a34a; }
.scan-result-card.not-found { border-left-color: #dc3545; }
.scan-pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* ---------- Login ---------- */
.login-page-premium { min-height: 100vh; display: flex; background: #0b1f3f; }
.login-visual { flex: 1.15; position: relative; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 20% 20%, rgba(201,162,39,.35), transparent 40%), linear-gradient(135deg, #0b2d5b 0%, #071a36 70%); background-size: cover; background-position: center; }
.login-visual.has-bg:before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(7,26,54,.88), rgba(11,45,91,.65)); }
.login-visual > * { position: relative; }
.login-visual h1 { font-weight: 800; font-size: 2.3rem; line-height: 1.15; }
.login-visual .feature { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .85rem; }
.login-visual .feature i { color: var(--gp-accent); font-size: 1.3rem; }
.login-panel { flex: 1; background: #fff; display: flex; align-items: center; justify-content: center; padding: 2rem; }
[data-bs-theme=dark] .login-panel { background: #121826; }
.login-box-premium { width: 100%; max-width: 420px; }
.login-logo-img { max-height: 84px; max-width: 220px; object-fit: contain; }
.login-box-premium .form-control { padding: .7rem .9rem; }
.input-group .btn-eye { border-top-right-radius: 10px !important; border-bottom-right-radius: 10px !important; }
.mortar { font-size: 2.6rem; color: var(--gp-accent); }
@media (max-width: 991.98px) { .login-visual { display: none; } }

/* ---------- Misc ---------- */
.badge { font-weight: 600; letter-spacing: .2px; }
.stat-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; background: var(--gp-accent-soft); color: #7a5d06; font-size: .78rem; font-weight: 600; }
.timeline-mini { list-style: none; padding-left: 0; margin: 0; }
.timeline-mini li { position: relative; padding: 0 0 .9rem 1.4rem; border-left: 2px solid #e3e9f4; margin-left: .4rem; }
.timeline-mini li:before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--gp-accent); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--gp-accent); }
.ai-bubble { border-radius: 14px; padding: .7rem .95rem; max-width: 85%; margin-bottom: .6rem; }
.ai-bubble.me { background: var(--gp-primary); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.ai-bubble.bot { background: #eef2fa; color: #1e2b45; border-bottom-left-radius: 4px; }
[data-bs-theme=dark] .ai-bubble.bot { background: #1d2638; color: #e2e8f5; }
.chat-box { height: 380px; overflow-y: auto; padding: .5rem; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border-top: 1px solid #e6ebf3; padding: .75rem 1rem; border-radius: 0 0 var(--gp-radius) var(--gp-radius); }
[data-bs-theme=dark] .sticky-actions { background: rgba(18,24,38,.94); border-color: #263049; }
.app-footer { font-size: .82rem; }
@media print { .no-print { display: none !important; } }
