/* ============================================================
   ABMS Safety System - Custom Styles
   Font: Sarabun (Google Fonts - THSarabun compatible)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary:        #1565c0;
  --primary-dark:   #0d47a1;
  --primary-light:  #e3f2fd;
  --success:        #2e7d32;
  --warning:        #e65100;
  --danger:         #c62828;
  --info:           #0277bd;
  --bg-page:        #f0f4f8;
  --shadow-card:    0 2px 20px rgba(21,101,192,.1);
  --shadow-hover:   0 8px 30px rgba(21,101,192,.18);
  --radius-card:    14px;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Sarabun', sans-serif;
  background-color: var(--bg-page);
  color: #2d3748;
  font-size: 15px;
  line-height: 1.6;
}
h1,h2,h3,h4,h5,h6 { font-weight: 600; }
a { text-decoration: none; }
code { font-family: 'Sarabun', monospace; font-size: .9em; }

/* ---- Navbar Logo Circle ---- */
.nav-logo-circle {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

/* ---- Hero Banner ---- */
.hero-banner {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 50%, #0288d1 100%);
  color: #fff;
  border-bottom: 4px solid #ffc107;
}

/* ---- Stat Cards ---- */
.stat-card {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  border-top: 4px solid currentColor;
  transition: all .25s ease;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; right: -15px; top: -15px;
  width: 80px; height: 80px; border-radius: 50%;
  background: currentColor; opacity: .06;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.stat-total    { color: var(--primary); }
.stat-received { color: var(--info); }
.stat-processing { color: var(--warning); }
.stat-completed  { color: var(--success); }

.stat-icon {
  font-size: 2rem; margin-bottom: .4rem;
  opacity: .85;
}
.stat-number {
  font-size: 2.2rem; font-weight: 700; line-height: 1;
  margin-bottom: .25rem;
}
.stat-label {
  font-size: .85rem; color: #6b7280; font-weight: 500;
}

/* ---- Dashboard Cards ---- */
.card-dash {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: none;
  overflow: hidden;
}
.card-header-dash {
  background: linear-gradient(135deg, #1a237e 0%, #1565c0 100%);
  color: #fff;
  padding: .85rem 1.25rem;
  font-size: .95rem; font-weight: 600;
}

/* ---- Category Badge ---- */
.badge-category {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  padding: .2rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- Status Badges ---- */
.badge { font-family: 'Sarabun', sans-serif; font-size: .82rem; padding: .35em .75em; border-radius: 20px; }

/* ---- Report Table ---- */
#reportsTable tbody tr { cursor: default; }
#reportsTable tbody tr:hover { background-color: var(--primary-light); }

/* ---- Info Labels in Modal ---- */
.info-label {
  font-size: .75rem; font-weight: 600; color: #6b7280;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem;
}
.info-value { font-size: .95rem; color: #2d3748; }

.desc-box {
  background: #f8fafc; border-radius: 8px;
  padding: .75rem 1rem; border: 1px solid #e2e8f0;
  white-space: pre-wrap; word-break: break-word;
}

/* ---- Timeline ---- */
.timeline-container { position: relative; padding-left: 2.25rem; }

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}
.timeline-item:not(.timeline-last)::before {
  content: '';
  position: absolute;
  left: -1.6rem; top: 1.4rem;
  width: 2px; height: calc(100% - .4rem);
  background: linear-gradient(to bottom, #cbd5e0, transparent);
}
.timeline-dot {
  position: absolute;
  left: -2.25rem; top: .15rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .7rem;
}
.timeline-content {
  background: #f8fafc; border-radius: 10px;
  padding: .75rem 1rem; border: 1px solid #e2e8f0;
}

/* ---- Image Thumbnails ---- */
.img-thumb {
  width: 100%; height: 70px;
  object-fit: cover;
  border-radius: 6px;
  transition: transform .2s;
}
.img-thumb:hover { transform: scale(1.05); }

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed #90caf9;
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  background: #f0f7ff;
  transition: all .2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: #e3f2fd;
}

/* ---- Section Title in Forms ---- */
.section-title {
  color: var(--primary-dark);
  font-size: 1rem;
  font-weight: 700;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--primary-light);
  margin-bottom: 1rem;
}

/* ---- FullCalendar Overrides ---- */
.fc { font-family: 'Sarabun', sans-serif !important; font-size: 13px; }
.fc-toolbar-title { font-size: 1.1rem !important; font-weight: 700 !important; }
.fc-button { font-family: 'Sarabun', sans-serif !important; font-size: .85rem !important; }
.fc-event { border-radius: 6px !important; font-size: .78rem !important; cursor: pointer; }

/* ---- Report Table (export) ---- */
.report-table th, .report-table td { font-size: .82rem; }

/* ---- Pagination ---- */
.page-link { font-family: 'Sarabun', sans-serif; }

/* ---- SweetAlert2 Thai Font Override ---- */
.swal2-container * { font-family: 'Sarabun', sans-serif !important; }
.swal2-title   { font-size: 1.4rem !important; font-weight: 700 !important; }
.swal2-html-container { font-size: 1rem !important; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---- Responsive ---- */
@media (max-width: 575.98px) {
  .stat-number { font-size: 1.6rem; }
  .stat-icon   { font-size: 1.5rem; }
  .hero-banner { padding: 1rem; }
  .hero-banner h2 { font-size: 1.3rem; }
}

/* ---- Print styles ---- */
@media print {
  body { background: #fff !important; font-size: 13px; }
  .card-dash { box-shadow: none !important; border: 1px solid #ddd !important; }
  .navbar, .hero-banner, footer { display: none !important; }
  .no-print { display: none !important; }
}
