html { scroll-behavior: smooth; }

body {
  overflow-x: hidden !important;
}

/* =========================================================
  Brand colors & utilities
========================================================= */
.bg-brand            { background-color: #006d77; }
.text-brand          { color: #006d77; }
.bg-brand-dark       { background-color: #001f3f; }
.text-brand-dark     { color: #001f3f; }
.border-brand-dark   { border-color: #001f3f !important; }

.hover\:bg-brand-dark:hover { background-color: #004f58; }

.focus\:ring-brand:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,109,119,0.45);
}

/* =========================================================
  Global interactions
========================================================= */
[x-cloak] { display: none !important; }

button, a, [role="button"], .btn {
  cursor: pointer !important;
}

/* =========================================================
  Sidebar behaviour
========================================================= */
aside {
  transition: width 0.3s ease-in-out;
}
.transition-margin {
  transition: margin 0.3s ease-in-out;
}

aside nav a {
  transition: background-color 0.25s ease, color 0.25s ease;
}
aside nav a:hover {
  background-color: #00949f;
}
aside nav div a:hover {
  background-color: rgba(0,109,119,0.8);
}

/* =========================================================
  Submenu animation (non x-collapse)
========================================================= */
.submenu-transition {
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

/* =========================================================
  Animations
========================================================= */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-fade-in { animation: fade-in 0.6s ease-out forwards; }

@keyframes fade-slide-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-slide-in {
  animation: fade-slide-in 0.8s ease-out forwards;
}

@keyframes slow-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.animate-slow-pulse {
  animation: slow-pulse 3s infinite;
}

/* Animated gradient text */
@keyframes text-gradient-move {
  0% { background-position:   0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position:  0% 50%; }
}
.animate-text-gradient {
  background: linear-gradient(
    270deg,
    #ffffff,
    #83c5be,
    #2dd4bf,
    #83c5be,
    #ffffff
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  color: transparent;
  animation: text-gradient-move 6s ease infinite;
}

/* =========================================================
  Scrollbar
========================================================= */
.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: #006d77;
  border-radius: 4px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background-color: #1f2937;
}

/* =========================================================
  Login background
========================================================= */
.login-bg {
  position: relative;
  background: url('../img/login-page-bg.webp') center/cover no-repeat;
  background-color: #006d77;
}
.login-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0,109,119,0.6);
}
.login-bg > * {
  position: relative;
  z-index: 1;
}

/* =========================================================
  DataTables Styling
========================================================= */
thead {
  background-color: #001f3f !important;
  color: #ffffff !important;
}
thead th {
  font-weight: 500 !important;
  text-align: center !important;
}
tbody tr:hover {
  background-color: #f1f5f9 !important;
}

div.dataTables_wrapper div.dataTables_paginate .paginate_button {
  color: #001f3f !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 0.25rem !important;
  padding: 0.25rem 0.5rem !important;
  margin: 0 2px !important;
  transition: all 0.2s !important;
}
div.dataTables_wrapper div.dataTables_paginate .paginate_button.current,
div.dataTables_wrapper div.dataTables_paginate .paginate_button:hover:not(.disabled) {
  background-color: #001f3f !important;
  color: #ffffff !important;
  border-color: #001f3f !important;
}

.dt-button,
#dtButtons .dt-button {
  background-color: #001f3f !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0.25rem !important;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.75rem !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}
.dt-button:hover { background-color: #001a35 !important; }

.dataTables_filter input {
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.375rem !important;
  padding: 0.25rem 0.5rem !important;
}

@media (max-width: 768px) {
  .dataTables_wrapper {
    overflow-x: auto !important;
  }
}

/* =========================================================
  Toast System
========================================================= */
#toast-container {
  min-width: 200px;
  max-width: 320px;
  text-align: center;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0.95;
}

.bg-green-500 { background-color: #22c55e !important; }
.bg-red-500   { background-color: #ef4444 !important; }

/* =========================================================
  Profile Card
========================================================= */
.profile-card {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0.75rem !important;
  padding: 1.5rem !important;
  max-width: 500px !important;
  margin: auto !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
  text-align: center !important;
}

.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 9999px;
  border: 2px solid #e5e7eb;
  object-fit: cover;
  margin: 0 auto 1rem;
}

/* =========================================================
  Badge System
========================================================= */
.badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}
.badge-opd   { background: #e0f2fe; color: #0369a1; }
.badge-ipd   { background: #dcfce7; color: #166534; }
.badge-admin { background: #fef3c7; color: #92400e; }
.badge-other { background: #f3f4f6; color: #374151; }

/* =========================================================
  ENTERPRISE FORM SYSTEM (CRITICAL)
========================================================= */
.form-input {
  width: 100%;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #1f2937;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input::placeholder {
  color: #9ca3af;
}
.form-input:focus {
  outline: none;
  border-color: #006d77;
  box-shadow: 0 0 0 2px rgba(0,109,119,0.25);
}
textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* Section headers inside forms */
.form-section-title {
  grid-column: 1 / -1;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.25rem;
  margin-top: 1rem;
}

/* =========================================================
  MODAL SYSTEM (PREMIUM)
========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  max-height: 90vh;
  overflow-y: auto;
}

/* =========================================================
  Logo Upload & Preview
========================================================= */
.logo-preview {
  height: 5rem;
  width: 5rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* =========================================================
  Misc
========================================================= */
.scrollable-table { max-height: 60vh; overflow-y: auto; }

@media print {
  table { font-size: 12px; }
  input { border: none; }
}

.ts-dropdown {
  z-index: 99999 !important;
  min-width: auto !important;
  max-width: 20rem !important;
}

/* ==============================
   HOLIDAY DAY – PROFESSIONAL
================================ */

/* subtle hover (no red!) */
.flatpickr-day.holiday-day:hover {
  background: #dbeafe !important;
}

/* Holiday day styling */
.flatpickr-day.holiday-day {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  font-weight: 600;
  cursor: not-allowed;
  position: relative;
}

/* Small indicator dot */
.flatpickr-day.holiday-day::after {
  content: "";
  width: 6px;
  height: 6px;
  background-color: #dc2626; /* red-600 */
  border-radius: 50%;
  position: absolute;
  bottom: 4px;
  right: 4px;
}

/* ensure disabled days do not look broken */
.flatpickr-day.flatpickr-disabled.holiday-day {
  opacity: 1;
}



