:root {
  --hospital-primary: #0b5ed7;
  --hospital-teal: #0d9488;
  --hospital-dark: #0f2942;
  --hospital-bg: #f4f7fb;
  --card-shadow: 0 4px 16px rgba(15, 41, 66, 0.06);
}

body {
  font-family: "Sarabun", "Noto Sans Thai", system-ui, -apple-system, sans-serif;
  background-color: var(--hospital-bg);
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar-hospital {
  background: linear-gradient(135deg, #0f2942 0%, #0d5c75 60%, #0d9488 100%);
  box-shadow: 0 2px 12px rgba(15, 41, 66, 0.15);
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.25;
}

.brand-subtitle {
  font-size: 0.78rem;
  opacity: 0.85;
  font-weight: 400;
}

.hero-header {
  background: linear-gradient(120deg, #ffffff 0%, #eef6ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
}

.stat-card {
  border: none;
  border-radius: 0.9rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 41, 66, 0.1);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.search-box-card {
  border: 2px solid #bfdbfe;
  border-radius: 1rem;
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.08);
  background: #ffffff;
}

.search-input-lg {
  font-size: 1.1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

/* Prominent Department & Sequence Badges */
.badge-dept-lg {
  background-color: #0f2942;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.45em 0.85em;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-seq-lg {
  background-color: #fef3c7;
  color: #92400e;
  border: 1.5px solid #f59e0b;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.4em 0.75em;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-dept-table {
  background-color: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35em 0.65em;
  border-radius: 0.45rem;
}

.badge-seq-table {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.3em 0.6em;
  border-radius: 0.45rem;
}

.highlight-result-card {
  border: 1.5px solid #93c5fd;
  border-left: 6px solid #0d9488;
  border-radius: 0.85rem;
  background: #ffffff;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.15s ease;
}

.highlight-result-card:hover {
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.14);
}

.device-code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 0.95rem;
  background-color: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 0.2rem 0.55rem;
  border-radius: 0.4rem;
  display: inline-block;
}

.dept-progress-card {
  border: none;
  border-radius: 0.9rem;
  box-shadow: var(--card-shadow);
}

.dept-bar-item {
  cursor: pointer;
  padding: 0.85rem;
  border-radius: 0.85rem;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.dept-bar-item:hover {
  transform: translateY(-2px);
  border-color: #60a5fa;
  box-shadow: 0 6px 16px rgba(15, 41, 66, 0.08);
}

.dept-bar-item.active {
  background-color: #f0f9ff;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.18);
}

.dept-metric-pill {
  border-radius: 0.5rem;
  padding: 0.3rem 0.45rem;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.2;
}

.dept-metric-pill .val {
  font-size: 0.98rem;
  font-weight: 700;
  display: block;
}

.table-equipment th {
  background-color: #f8fafc;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid #cbd5e1;
}

.table-equipment td {
  vertical-align: middle;
}

.remarks-text {
  font-size: 0.85rem;
  color: #b45309;
  white-space: pre-line;
}

.status-badge {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.38em 0.7em;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pending { background-color: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.status-sent { background-color: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.status-returned { background-color: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.status-broken { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.status-excluded { background-color: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.login-wrapper {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  border: none;
  border-radius: 1.15rem;
  box-shadow: 0 12px 32px rgba(15, 41, 66, 0.12);
  overflow: hidden;
}

.login-card-header {
  background: linear-gradient(135deg, #0f2942 0%, #0d9488 100%);
  color: #ffffff;
}

footer {
  margin-top: auto;
}

.mobile-equip-card {
  border: 1px solid #e2e8f0;
  border-left: 5px solid #94a3b8;
  border-radius: 0.9rem;
  background: #ffffff;
  box-shadow: var(--card-shadow);
}

.mobile-equip-card.card-status-pending { border-left-color: #64748b; }
.mobile-equip-card.card-status-sent { border-left-color: #2563eb; }
.mobile-equip-card.card-status-returned { border-left-color: #16a34a; }
.mobile-equip-card.card-status-broken { border-left-color: #dc2626; }
.mobile-equip-card.card-status-excluded { border-left-color: #d97706; }

.mobile-fab-search {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 1040;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(11, 94, 215, 0.35);
}

@media (max-width: 767.98px) {
  input.form-control,
  select.form-select,
  textarea.form-control {
    font-size: 16px !important;
  }
  .navbar-hospital .brand-title {
    font-size: 0.95rem !important;
  }
  .hero-header h1 {
    font-size: 1.15rem !important;
  }
  .stat-card .stat-num {
    font-size: 1.4rem !important;
  }
  .stat-card .stat-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    border-radius: 9px;
  }
  .badge-dept-lg,
  .badge-seq-lg {
    font-size: 0.85rem;
  }
  .search-input-lg {
    min-height: 48px;
  }
  .mobile-action-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
  }
}
