:root {
  --hub-primary: #1e3a8a;
  --hub-primary-2: #2563eb;
  --hub-accent: #f59e0b;
  --hub-bg: #f4f6fb;
}
body {
  font-family: 'Sarabun', system-ui, sans-serif;
  background: var(--hub-bg);
  font-size: 1rem;
}
h1, h2, h3, h4, h5, .navbar-brand, .btn, .nav-link, .card-title {
  font-family: 'Prompt', 'Sarabun', sans-serif;
}
.bg-hub { background: linear-gradient(90deg, var(--hub-primary), var(--hub-primary-2)); }
.brand-logo {
  width: 40px; height: 40px; display: inline-block;
  object-fit: contain; flex-shrink: 0; vertical-align: middle;
}
.brand-logo-lg { width: 56px; height: 56px; }
.brand-sub { font-size: .72rem; opacity: .8; line-height: 1; }

.hero {
  background: linear-gradient(135deg, var(--hub-primary) 0%, var(--hub-primary-2) 60%, #38bdf8 100%);
  color: #fff; padding: 3.5rem 0 4.5rem; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.hero .slogan { color: #fde68a; font-weight: 500; }
.hero-search { max-width: 640px; }
.hero-search .form-control { border: 0; }

.type-card {
  border: 0; border-radius: 16px; transition: transform .15s, box-shadow .15s; height: 100%;
}
.type-card:hover { transform: translateY(-4px); box-shadow: 0 .75rem 1.5rem rgba(30,58,138,.15) !important; }
.type-icon {
  width: 56px; height: 56px; border-radius: 14px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 1.6rem;
}
.overlap { margin-top: -3rem; position: relative; z-index: 2; }

.card { border-radius: 14px; }
.card.shadow-sm { border: 0; }
.doc-item .file-ic { font-size: 2rem; line-height: 1; }
.doc-item:hover { background: #f8faff; }
.table > :not(caption) > * > * { vertical-align: middle; }

.footer-hub { background: #0f1f4b; color: #cbd5e1; }

/* Admin */
.admin-sidebar {
  width: 250px; min-height: 100vh; background: #0f1f4b; flex-shrink: 0;
}
.admin-sidebar .nav-link { color: #cbd5e1; border-radius: 8px; padding: .55rem .85rem; }
.admin-sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-sidebar .nav-link.active { background: var(--hub-primary-2); color: #fff; }
.admin-sidebar .nav-section { font-size: .72rem; text-transform: uppercase; color: #64748b; padding: 1rem .85rem .25rem; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
@media (max-width: 991.98px) {
  .admin-sidebar { width: 100%; min-height: auto; }
}
.book-no-display { font-size: 2rem; font-family: 'Prompt', sans-serif; letter-spacing: 1px; }

/* รายงานการไปราชการ: รูปแบบสำหรับพิมพ์ */
.trip-meta th { color: #475569; font-weight: 500; }
@media print {
  @page { size: A4; margin: 1.5cm; }
  body { background: #fff; font-size: 15pt; }
  .navbar, .footer-hub, .d-print-none, .modal { display: none !important; }
  main > .container { max-width: 100% !important; padding: 0 !important; }
  .trip-report { box-shadow: none !important; border: 0; }
  .trip-report .card-body { padding: 0 !important; }
  .trip-report a { color: inherit; text-decoration: none; }
  .trip-gallery-title { break-before: auto; }
  .trip-gallery figure { break-inside: avoid; width: 50%; }
  .trip-sign { break-inside: avoid; }
}

/* ภาพโปรไฟล์ */
.avatar-initial { display: inline-flex; align-items: center; justify-content: center; background: #dbeafe; color: #1e3a8a; font-family: 'Prompt', sans-serif; font-weight: 500; }
.navbar .avatar-initial { background: #fde68a; color: #1f2937; }

/* คู่มือการใช้งาน */
.manual section { scroll-margin-top: 80px; }
@media print {
  .manual .card { box-shadow: none !important; border: 0; break-inside: auto; }
  .manual .accordion-collapse { display: block !important; }
  .manual .accordion-button::after { display: none; }
  .manual { width: 100% !important; }
}

/* คลังรูปภาพ */
.album-banner {
  display: inline-block; background: #fcd34d; color: #1d4ed8; border: 1px solid #f59e0b;
  border-radius: 18px; padding: .9rem 2rem; font-family: 'Prompt', sans-serif; font-weight: 500; font-size: 1.15rem;
  box-shadow: 0 .25rem .75rem rgba(0,0,0,.08);
}
.album-search .form-control:focus { box-shadow: none; border-color: #0dcaf0; }
.album-table { border-collapse: separate; border-spacing: 0; }
.album-table thead th { background: #e5e7eb; font-family: 'Prompt', sans-serif; font-weight: 500; border: 0; }
.album-table tbody tr:nth-child(odd) td { background: #fdecb0; }
.album-table tbody tr:nth-child(even) td { background: #b5ecf5; }
.album-table tbody td { border-bottom: 1px solid #f9a8d4; vertical-align: top; }
.album-table a { color: #1f2937; }
/* ตัวอย่างเอกสาร Word (docx-preview) */
.docx-view { max-height: 80vh; overflow: auto; }
.docx-view:fullscreen { max-height: none; background: #f1f5f9; }
.docx-view-max { position: fixed; inset: 0; z-index: 1080; max-height: none; border-radius: 0 !important; }
.docx-view .docx-wrapper { background: #e5e7eb; padding: 16px; }
.docx-view .docx-wrapper > section.docx { box-shadow: 0 2px 8px rgba(0,0,0,.15); margin-bottom: 16px; }
@media (max-width: 768px) { .docx-view .docx-wrapper { padding: 6px; zoom: .5; } }
