:root {
  --rulio-red: #b0272c;
  --rulio-red-hover: #8e1f23;
  --rulio-dark: #1a252f;
  --sidebar-width: 280px;
  --navbar-height: 70px;
  --border-radius: 8px;
  --premium-border-radius: 12px;
  --gray-50: #f9fafb;
  --gray-100: #f2f4f7;
  --gray-200: #eaecf0;
  --gray-300: #d0d5dd;
  --gray-400: #98a2b3;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-900: #101828;
}

/* CUSTOM SCROLLBARS */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-400) var(--gray-50);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 10px;
  border: 2px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-600);
}

body {
  background-color: #fcfcfd;
  font-family:
    "Inter",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--gray-900);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* TOP NAVBAR */
.navbar {
  height: var(--navbar-height);
  z-index: 1050;
  background-color: #fff;
  border-bottom: 2px solid var(--gray-100);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}

.navbar-brand img {
  max-height: 38px;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  background: var(--rulio-dark);
  color: #fff;
  z-index: 1040;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
}

.sidebar .section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  padding: 24px 20px 8px;
  letter-spacing: 0.05em;
}

.sidebar .nav-link {
  color: #d0d5dd;
  padding: 10px 16px;
  margin: 2px 14px;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar .nav-link.active {
  background: var(--rulio-red);
  color: #fff;
}

.hover-underline:hover {
  text-decoration: underline !important;
}

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 20px;
  padding-top: calc(var(--navbar-height) + 20px);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    top: 0;
    height: 100vh;
    z-index: 1060;
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
  }
  .sidebar-overlay.show {
    display: block;
  }
}

/* CARDS & CONTAINERS */
.card {
  border-radius: var(--premium-border-radius);
  border: 1px solid var(--gray-200);
  box-shadow:
    0 1px 3px rgba(16, 24, 40, 0.1),
    0 1px 2px rgba(16, 24, 40, 0.06);
  background-color: #fff;
  /* Allow dropdowns to pop out */
  overflow: visible;
  position: relative;
}

/* Ensure children don't bleed out of rounded corners on non-table cards */
.card > *:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.card > *:last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

.table-responsive {
  /* Allow dropdowns to pop out vertically in tables */
  overflow: visible !important;
}

@media (max-width: 768px) {
  .table-responsive {
    /* Restore scroll on very small screens if needed, 
       but note this will clip dropdowns again if scrolling is active */
    overflow-x: auto !important;
  }
}

.card-header-premium {
  padding: 1.25rem 1.5rem;
  background-color: #fff;
  border-bottom: 1px solid var(--gray-200);
}

/* BUTTONS */
.btn-rulio {
  background-color: var(--rulio-red);
  border-color: var(--rulio-red);
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
}

.btn-rulio:hover {
  background-color: var(--rulio-red-hover);
  border-color: var(--rulio-red-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary-rulio {
  background-color: #fff;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--border-radius);
}

.btn-secondary-rulio:hover {
  background-color: var(--gray-50);
  color: var(--gray-900);
  border-color: var(--gray-300);
}

/* TABLES */
.table thead th {
  background-color: var(--gray-50);
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
}

.table tbody td {
  padding: 16px;
  vertical-align: middle;
}

/* FORMS */
.form-control-material {
  border: none;
  border-bottom: 2px solid var(--gray-200);
  border-radius: 0;
  padding: 0.5rem 0;
  background-color: transparent;
  transition: all 0.2s;
}

.form-control-material:focus {
  outline: none;
  border-bottom-color: var(--rulio-red);
  box-shadow: none;
}

.search-pill {
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 100px;
  padding: 0.25rem 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

/* NOTIFICATIONS */
.notif-item {
  border-bottom: 1px solid var(--gray-100) !important;
  padding: 1.25rem 1.5rem !important;
}

.notif-item.unread {
  background-color: rgba(176, 39, 44, 0.02) !important;
  border-left: 4px solid var(--rulio-red) !important;
}

.notif-icon {
  width: 45px;
  height: 45px;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}

.breadcrumb-item a {
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-item.active {
  color: var(--gray-900);
  font-weight: 600;
}

/* FULLCALENDAR RULIO THEME */
:root {
  --fc-button-bg-color: var(--rulio-dark);
  --fc-button-border-color: var(--rulio-dark);
  --fc-button-hover-bg-color: var(--rulio-red);
  --fc-button-hover-border-color: var(--rulio-red);
  --fc-button-active-bg-color: var(--rulio-red);
  --fc-button-active-border-color: var(--rulio-red);
  --fc-today-bg-color: rgba(176, 39, 44, 0.05);
  --fc-border-color: var(--gray-200);
}

.fc .fc-toolbar-title {
  font-size: 1.25rem !important;
  font-weight: 700;
  color: var(--rulio-dark);
}

.fc .fc-button-primary {
  font-weight: 600 !important;
  text-transform: capitalize !important;
  padding: 0.4rem 1rem !important;
  box-shadow: none !important;
}

.fc-event {
  cursor: pointer;
  padding: 3px 6px !important;
  font-size: 0.85rem !important;
  border-radius: 6px !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(16, 24, 40, 0.08) !important;
  margin: 1px 2px !important;
}

#calendar {
  background: #fff;
  min-height: 700px;
}

/* JOB VIEW SIDE TABS / SUB-NAVIGATION */
.job-view-tabs .nav-link {
  color: var(--gray-600);
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 1rem 1.5rem;
  transition: all 0.2s ease;
  position: relative;
  border-radius: 0;
}

.job-view-tabs .nav-link:hover {
  color: var(--rulio-red);
  background: rgba(176, 39, 44, 0.05);
}

.job-view-tabs .nav-link.active {
  color: var(--rulio-red);
  background: transparent;
  border: none;
}

.job-view-tabs .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--rulio-red);
}

/* =========================================
   LOGIN PAGE
   ========================================= */

.login-body {
  background:
    linear-gradient(rgba(26, 37, 47, 0.7), rgba(26, 37, 47, 0.9)),
    url("../images/login-bg.jpg") center/cover no-repeat fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}

.login-card-container {
  width: 100%;
  max-width: 450px;
  animation: loginSlideUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes loginSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-glass-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  box-shadow: 0 45px 90px -25px rgba(0, 0, 0, 0.4);
  padding: 3rem 2.5rem;
}

.login-input-group {
  margin-bottom: 1.5rem;
}

.login-input-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: block;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrapper i {
  position: absolute;
  left: 1.25rem;
  color: var(--gray-400);
  font-size: 1.1rem;
}

.login-input-wrapper .form-control {
  padding: 0.85rem 1rem 0.85rem 3.5rem;
  background-color: var(--gray-50);
  border: 2px solid transparent;
  border-radius: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.login-input-wrapper .form-control:focus {
  background-color: #fff;
  border-color: var(--rulio-red);
  box-shadow: 0 0 0 4px rgba(176, 39, 44, 0.1);
  color: var(--gray-900);
}

.login-input-wrapper .form-control:focus + i {
  color: var(--rulio-red);
}

.btn-login {
  background-color: var(--rulio-red);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
  margin-top: 1rem;
  transition: all 0.3s;
  box-shadow: 0 12px 24px -6px rgba(176, 39, 44, 0.4);
}

.btn-login:hover {
  background-color: var(--rulio-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(176, 39, 44, 0.5);
  color: #fff;
}

.version-pill {
  display: inline-block;
  padding: 5px 15px;
  background: var(--gray-100);
  border-radius: 50px;
  color: var(--gray-600);
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 2rem;
}

.login-copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-top: 2rem;
  text-align: center;
}

/* ==========================================================================
   FULLCALENDAR CUSTOMIZATION (BOOTSTRAP 5 THEME)
   ========================================================================== */
/* Capture all varieties of buttons FullCalendar might use in BS5 mode */
.fc .btn,
.fc .fc-button,
.fc .fc-button-primary,
.fc .btn-primary {
  background-color: var(--rulio-red) !important;
  border-color: var(--rulio-red) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  text-transform: capitalize !important;
  padding: 8px 16px !important;
  font-size: 0.875rem !important;
}

.fc .btn:hover,
.fc .fc-button:hover,
.fc .fc-button-primary:hover,
.fc .btn-primary:hover {
  background-color: var(--rulio-red-hover) !important;
  border-color: var(--rulio-red-hover) !important;
}

/* Today Button - Professional Gray */
.fc .fc-today-button,
.fc .btn-secondary {
  background-color: var(--gray-600) !important;
  border-color: var(--gray-600) !important;
  color: #fff !important;
  opacity: 1 !important;
}

.fc .fc-today-button:hover,
.fc .btn-secondary:hover {
  background-color: var(--gray-700) !important;
  border-color: var(--gray-700) !important;
}

/* Active View Buttons (Month/Week/Day selected) */
.fc .fc-button-active,
.fc .fc-button-primary.fc-button-active,
.fc .btn-primary.active,
.fc .btn-primary:active {
  background-color: var(--gray-900) !important;
  border-color: var(--gray-900) !important;
  color: #fff !important;
}

/* Icon Styles */
.fc .fc-icon {
  font-size: 1.2em !important;
  vertical-align: middle !important;
}

/* Force Bootstrap Icons if plugin doesn't map them */
.fc .fc-button .fc-icon {
  font-family: "bootstrap-icons" !important;
}

.fc-prev-button .fc-icon::before {
  content: "\F285" !important;
}
.fc-next-button .fc-icon::before {
  content: "\F286" !important;
}

.fc .fc-toolbar-title {
  font-weight: 700 !important;
  color: var(--gray-900);
  font-family: "Inter", sans-serif !important;
}

/* ==========================================================================
   MEDICAL ASSESSMENT FORM STYLES
   ========================================================================== */
.form-control-material,
.form-select-material {
  border: none;
  border-bottom: 1px solid #ced4da;
  border-radius: 0;
  padding: 0.375rem 0;
  background-color: transparent;
  width: 100%;
  display: block;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}

.form-control-material:focus,
.form-select-material:focus {
  outline: none;
  border-bottom: 2px solid var(--rulio-red);
}

.border-dotted {
  border-bottom-style: dotted !important;
}

.section-number {
  background-color: var(--rulio-red) !important;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.form-field {
  margin-bottom: 1.5rem;
}

.form-label-small {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 0.2rem;
  display: block;
  font-weight: 600;
}

#medFormTabs .nav-link {
  color: #6c757d;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 1rem 1.25rem;
}

#medFormTabs .nav-link.active {
  color: var(--rulio-red);
  border-bottom: 3px solid var(--rulio-red);
  background: transparent;
}

.tab-pane-content {
  padding: 1.5rem 2rem;
}

.section-header {
  color: var(--rulio-dark);
}

/* Job Highlight Colour Helper */
.job-colour-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}
/* Document Library Helpers */
.no-caret::after {
  display: none !important;
}

.dropdown-item:active {
  background-color: var(--rulio-red) !important;
}

.hover-underline:hover {
  text-decoration: underline !important;
  cursor: pointer;
}
