/* LGU Pikit EBMS — Gradient Blue Theme */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --blue-900: #0d1b4b;
  --blue-700: #1a3a8f;
  --blue-500: #1a56db;
  --blue-400: #3b82f6;
  --blue-300: #60a5fa;
  --cyan:     #06b6d4;
  --grad-main: linear-gradient(135deg, #0d1b4b 0%, #1a56db 55%, #06b6d4 100%);
  --grad-card: linear-gradient(135deg, #1a3a8f 0%, #1a56db 100%);
  --bg-page:  #eef2ff;
  --sidebar-w: 250px;
  --font-heading: 'Poppins', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  background: var(--bg-page);
  font-family: var(--font-body);
  color: #1e293b;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand, .auth-title, .page-header h4,
.btn, .card-header-gradient, .stat-num {
  font-family: var(--font-heading);
}

/* ── Fade / slide-in animation utilities ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
.animate-in { animation: fadeInUp .6s ease both; }
.animate-in-fast { animation: fadeInUp .45s ease both; }
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }
.delay-4 { animation-delay: .32s; }

/* ── Navbar (legacy top nav, kept for reference) ── */
.app-navbar {
  background: var(--grad-main) !important;
  box-shadow: 0 2px 16px rgba(13,27,75,.35);
  padding: .5rem 1rem;
}
.brand-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.18);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.user-avatar-sm {
  width: 30px; height: 30px;
  background: rgba(255,255,255,.22);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}
.navbar-nav .nav-link { color: rgba(255,255,255,.88) !important; font-size: .88rem; border-radius: 6px; padding: .35rem .65rem !important; transition: background .2s; }
.navbar-nav .nav-link:hover { background: rgba(255,255,255,.15); color: #fff !important; }

/* ── App Shell (left sidebar layout) ── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--grad-main);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1030;
  box-shadow: 2px 0 16px rgba(13,27,75,.25);
  transition: transform .25s ease;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .65rem;
  padding: 1.25rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.sidebar-brand .brand-icon { width: 40px; height: 40px; font-size: 1.2rem; border-radius: 11px; overflow:hidden; background:rgba(255,255,255,.95); }
.sidebar-brand .brand-icon img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.sidebar-brand-text { line-height: 1.15; }
.sidebar-brand-text .name { font-weight: 700; font-size: .95rem; }
.sidebar-brand-text .org  { font-size: .68rem; opacity: .8; }

.sidebar-nav { flex: 1; padding: .9rem .7rem; list-style: none; margin: 0; }
.sidebar-nav .nav-item { margin-bottom: .25rem; }
.sidebar-nav .nav-link {
  color: rgba(255,255,255,.85) !important;
  font-size: .89rem;
  border-radius: 9px;
  padding: .6rem .8rem !important;
  display: flex; align-items: center; gap: .65rem;
  transition: background .18s, color .18s, transform .18s;
  position: relative;
}
.sidebar-nav .nav-link i { font-size: 1rem; width: 1.15rem; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.14); color: #fff !important; transform: translateX(2px); }
.sidebar-nav .nav-link.active { background: rgba(255,255,255,.95); color: var(--blue-700) !important; font-weight: 600; box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.sidebar-nav .nav-badge { margin-left: auto; }
.sidebar-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255,255,255,.14); font-size: .68rem; opacity: .75; }

.main-wrap { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: .65rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1020;
  box-shadow: 0 2px 8px rgba(13,27,75,.05);
}
.sidebar-toggle-btn {
  border: none; background: #eef2ff; color: var(--blue-700);
  width: 38px; height: 38px; border-radius: 9px; font-size: 1.1rem;
  display: none; align-items: center; justify-content: center;
}
.topbar-title { font-family: var(--font-heading); font-weight: 700; color: var(--blue-900); font-size: 1.02rem; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(13,27,75,.45); z-index: 1025; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .sidebar-toggle-btn { display: inline-flex; }
  .sidebar-backdrop.show { display: block; }
}

/* ── Page Header ── */
.page-header {
  background: var(--grad-main);
  border-radius: 14px;
  color: #fff;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute; right: -30px; top: -30px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}
.page-header > * { position: relative; z-index: 1; }
.page-header h4 { margin: 0; font-weight: 700; }
.page-header p  { margin: .25rem 0 0; opacity: .8; font-size: .875rem; }

/* ── Stat Cards ── */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  border: none;
  box-shadow: 0 2px 12px rgba(26,86,219,.09);
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(26,86,219,.16); }
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: #64748b; margin-top: .2rem; }
.icon-blue   { background: #dbeafe; color: var(--blue-500); }
.icon-green  { background: #dcfce7; color: #16a34a; }
.icon-yellow { background: #fef9c3; color: #ca8a04; }
.icon-red    { background: #fee2e2; color: #dc2626; }
.icon-cyan   { background: #cffafe; color: #0891b2; }
.icon-purple { background: #ede9fe; color: #7c3aed; }

/* ── Cards / Tables ── */
.card {
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(26,86,219,.07);
}
.card-header-gradient {
  background: var(--grad-card);
  color: #fff;
  border-radius: 14px 14px 0 0 !important;
  padding: .85rem 1.25rem;
  font-weight: 600;
}
.table th { background: #f0f4ff; font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: #4a5568; border-bottom: 2px solid #dbeafe; }
.table td { vertical-align: middle; font-size: .88rem; }
.table-hover tbody tr:hover { background: #f0f7ff; }

/* ── Buttons ── */
.btn-primary   { background: var(--blue-500); border-color: var(--blue-500); }
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn-gradient  { background: var(--grad-main); border: none; color: #fff; }
.btn-gradient:hover { opacity: .88; color: #fff; }

/* ── Forms ── */
.form-control:focus, .form-select:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 .2rem rgba(59,130,246,.2);
}
.form-label { font-weight: 600; font-size: .85rem; color: #374151; }
.form-section-title {
  font-weight: 700; font-size: .9rem;
  color: var(--blue-700);
  border-bottom: 2px solid #dbeafe;
  padding-bottom: .4rem;
  margin-bottom: 1rem;
}

/* ── Auth Pages (login / register) — split panel design ── */
.auth-split {
  min-height: 100vh;
  display: flex;
}
.auth-split-wide .auth-form-panel { flex-basis: 62%; }
.auth-split-wide .auth-brand-panel { flex-basis: 38%; }

.auth-brand-panel {
  flex: 0 0 44%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3rem 2rem;
  background-size: cover;
  background-position: center;
  color: #fff;
  isolation: isolate;
  min-height: 100vh;
}
.auth-brand-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(13,27,75,.94) 0%, rgba(26,86,219,.88) 55%, rgba(6,182,212,.82) 100%);
  z-index: -1;
}
.auth-brand-content { animation: fadeInUp .6s ease both; }
.auth-brand-top { display: flex; align-items: center; gap: .85rem; margin-bottom: 2.5rem; }
.auth-brand-seal { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 12px; padding: 5px; flex-shrink: 0; }
.auth-brand-eyebrow { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.auth-brand-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.05rem; }
.auth-brand-headline { font-family: var(--font-heading); font-weight: 800; font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.15; margin-bottom: 1rem; }
.auth-brand-sub { font-size: .92rem; opacity: .88; max-width: 440px; margin-bottom: 2rem; }
.auth-brand-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .9rem; }
.auth-brand-features li { display: flex; align-items: center; gap: .75rem; font-size: .88rem; }
.auth-brand-features i { font-size: 1.15rem; width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-brand-note { display: flex; gap: .6rem; align-items: flex-start; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: .8rem 1rem; margin-top: 1.75rem; font-size: .8rem; opacity: .95; }
.auth-brand-note i { margin-top: .15rem; }
.auth-brand-foot { font-size: .75rem; opacity: .7; border-top: 1px solid rgba(255,255,255,.2); padding-top: 1rem; }

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--bg-page);
  min-height: 100vh;
}
.auth-form-inner { width: 100%; max-width: 400px; animation: fadeInUp .55s ease both; }
.auth-form-inner-wide { max-width: 560px; }
.auth-form-logo { text-align: center; margin-bottom: 1.25rem; }
.auth-form-logo img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 16px; padding: 8px; box-shadow: 0 6px 20px rgba(26,86,219,.2); }
.auth-form-heading { margin-bottom: 1.5rem; }
.auth-form-heading h2 { font-family: var(--font-heading); font-weight: 800; font-size: 1.5rem; color: var(--blue-900); margin-bottom: .2rem; }
.auth-form-heading p { color: #64748b; font-size: .88rem; margin: 0; }
.auth-input-group .input-group-text { background: #fff; border-right: none; color: var(--blue-500); }
.auth-input-group .form-control, .auth-input-group .form-select { border-left: none; }
.auth-input-group .form-control:focus, .auth-input-group .form-select:focus { box-shadow: none; border-color: #86b0ff; }
.auth-input-group:focus-within .input-group-text { border-color: #86b0ff; }
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.5rem 0 1rem; color: #94a3b8; font-size: .78rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }
.auth-fieldset-title {
  font-family: var(--font-heading);
  font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--blue-700);
  margin: 0 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid #dbeafe;
}

.password-strength-bar { height: 5px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.password-strength-bar span { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .25s ease, background-color .25s ease; }
.password-strength-bar span.strength-weak   { background: #dc2626; }
.password-strength-bar span.strength-fair   { background: #d97706; }
.password-strength-bar span.strength-good   { background: #0ea5e9; }
.password-strength-bar span.strength-strong { background: #16a34a; }

@media (max-width: 991.98px) {
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; }
}

/* ── Landing Page ── */
.landing-hero {
  min-height: 100vh;
  position: relative;
  display: flex; flex-direction: column;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  isolation: isolate;
  color: #fff;
}
.landing-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(13,27,75,.92) 0%, rgba(26,86,219,.82) 55%, rgba(6,182,212,.75) 100%);
  z-index: -1;
}
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 2rem; }
.landing-nav .brand { display: flex; align-items: center; gap: .7rem; }
.landing-nav .brand-badge { width: 42px; height: 42px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 4px; }
.landing-nav .brand-badge img { width: 100%; height: 100%; object-fit: contain; }
.landing-nav .brand-name { font-family: var(--font-heading); font-weight: 700; line-height: 1.1; }
.landing-nav .brand-name small { display: block; font-weight: 400; opacity: .8; font-size: .68rem; }
.landing-main { flex: 1; display: flex; align-items: center; padding: 2rem; }
.landing-headline { font-family: var(--font-heading); font-weight: 800; font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.12; margin-bottom: 1rem; }
.landing-sub { font-size: 1.05rem; opacity: .88; max-width: 560px; margin-bottom: 2rem; }
.landing-cta .btn { padding: .75rem 1.6rem; font-weight: 600; border-radius: 10px; }
.landing-badges { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2.25rem; }
.landing-badge { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 10px; padding: .65rem 1rem; font-size: .8rem; backdrop-filter: blur(4px); display: flex; align-items: center; gap: .5rem; }
.landing-footer { text-align: center; font-size: .78rem; opacity: .75; padding: 1.25rem; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.landing-float { animation: floatY 4s ease-in-out infinite; }

/* ── RFID Scanner ── */
.rfid-scanner-box {
  background: linear-gradient(135deg, #0d1b4b 0%, #1a3a8f 100%);
  border-radius: 18px;
  padding: 2.5rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.rfid-scanner-box::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 30px, rgba(59,130,246,.07) 30px, rgba(59,130,246,.07) 31px);
}
.rfid-pulse {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(59,130,246,.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
  animation: pulse-ring 1.8s ease-in-out infinite;
  position: relative;
}
.rfid-pulse::before, .rfid-pulse::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(59,130,246,.5);
  animation: scan-ring 1.8s ease-out infinite;
}
.rfid-pulse::before { width: 120px; height: 120px; }
.rfid-pulse::after  { width: 150px; height: 150px; animation-delay: .4s; }
@keyframes pulse-ring { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes scan-ring  { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }

.rfid-input-field {
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(59,130,246,.4);
  border-radius: 12px;
  color: #fff;
  font-size: 1.2rem;
  text-align: center;
  padding: .75rem;
  width: 100%;
  transition: border-color .2s, background .2s;
}
.rfid-input-field:focus {
  outline: none;
  border-color: var(--blue-300);
  background: rgba(255,255,255,.14);
  box-shadow: 0 0 0 .2rem rgba(59,130,246,.3);
}
.rfid-input-field::placeholder { color: rgba(255,255,255,.45); font-size: .95rem; }

/* ── Equipment Status Cards ── */
.equipment-card {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(26,86,219,.08);
  transition: transform .2s, box-shadow .2s;
}
.equipment-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(26,86,219,.15); }
.equipment-card .eq-header {
  background: var(--grad-card);
  color: #fff;
  padding: 1.1rem 1.25rem;
  font-size: 1.3rem;
}
.status-available { color: #16a34a; }
.status-borrowed  { color: #d97706; }
.status-maintenance { color: #0891b2; }

/* ── Badges ── */
.badge { font-size: .75rem; font-weight: 600; padding: .38em .65em; }

/* ── Timeline / History ── */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ''; position: absolute; left: .45rem; top: 0; bottom: 0; width: 2px; background: #dbeafe; }
.timeline-item { position: relative; padding-bottom: 1.2rem; }
.timeline-dot {
  position: absolute; left: -1.15rem; top: .25rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--blue-400);
  background: var(--blue-400);
}

/* ── Attached Letter / Documents ── */
.attached-letter-card { border-width: 2px; }
.attached-doc-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .65rem .8rem;
  background: #f8fafc;
}
.attached-doc-item .min-w-0 { min-width: 0; }
.attached-doc-thumb {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  border: 1px solid #dbeafe;
  display: block;
}
.attached-doc-pdf {
  width: 100%;
  height: 360px;
  border-radius: 8px;
  border: 1px solid #dbeafe;
}
.attached-docs-box {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .6rem .7rem;
  background: #f8fafc;
  margin-bottom: .5rem;
}
.attached-doc-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .1rem;
  font-size: .85rem;
  color: #1e293b;
  border-radius: 6px;
}
.attached-doc-link:hover { background: #eef2ff; color: var(--blue-700); }
.attached-doc-link span { max-width: 100%; min-width: 0; }

/* ── Formal Report Letterhead ── */
.report-letterhead {
  display: flex; align-items: center; gap: 1rem;
  border-bottom: 3px solid var(--blue-700);
  padding-bottom: .85rem; margin-bottom: 1rem;
}
.report-letterhead img { width: 68px; height: 68px; object-fit: contain; flex-shrink: 0; }
.report-letterhead .text { text-align: center; flex: 1; }
.report-letterhead .republic { font-size: .78rem; margin: 0; }
.report-letterhead .office   { font-size: .78rem; margin: 0; }
.report-letterhead .title    { font-family: var(--font-heading); font-weight: 800; font-size: 1.15rem; margin: .25rem 0 0; color: var(--blue-900); text-transform: uppercase; letter-spacing: .03em; }
.report-meta-row { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: .9rem; color: #334155; }
.report-formal-table { border: 1px solid #94a3b8 !important; }
.report-formal-table th, .report-formal-table td { border: 1px solid #cbd5e1 !important; }
.report-formal-table thead th { background: #dbeafe !important; color: #1e293b !important; }
.report-signatures { display: flex; justify-content: space-between; margin-top: 3rem; gap: 2rem; }
.report-signatures .sig-block { text-align: center; flex: 1; font-size: .82rem; }
.report-signatures .sig-line { border-top: 1px solid #1e293b; margin-top: 2.75rem; padding-top: .3rem; font-weight: 600; }
.report-signatures .sig-role { color: #64748b; font-size: .75rem; }

/* ── Print Utilities ── */
@media print {
  .app-navbar, .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .main-wrap { margin-left: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  @page { margin: 14mm 12mm; }
  .report-formal-table { font-size: .8rem; }
  .col-lg-7, .col-lg-5 { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
}

/* ── Misc ── */
.section-divider { border: none; border-top: 2px solid #dbeafe; margin: 1.5rem 0; }
.text-gradient { background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.footer-bar { background: var(--blue-900); color: rgba(255,255,255,.55); text-align: center; font-size: .78rem; padding: .75rem; margin-top: 2rem; }
