/* Base styles */
body { 
    margin: 0; 
    padding: 0; 
    overflow-x: hidden; 
    font-family: Arial, sans-serif; 
}
.navbar { 
    min-height: 56px; 
    background-color: #003A6D !important; 
}

/* Consolidated Portal Styling
   Created: 2025
   Description: Core styling for all portal pages
*/

/* Add Roboto font from Google Fonts */
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&display=swap');

/* Portal CSS Refactored: Base, Typography, Navbar */
:root {
  --font-main: 'Roboto', Arial, Helvetica, sans-serif;
  --color-primary: #003A6D;
  --color-primary-dark: #07264E;
  --color-accent: #005b9e;
  --color-bg: #f0f2f5;
  --color-text: #222;
  --navbar-height: 56px;
}

html, body {
  margin: 0;
  padding: 0;
  border: none;
  box-sizing: border-box;
  font-family: var(--font-main);
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
  /* Sticky footer layout */
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
  font-family: var(--font-main);
  font-weight: 500;
  margin: 0;
}
h1, .h1 { font-size: 1.5rem; font-weight: 700; }
h2, .h2 { font-size: 1.25rem; }
h3, .h3 { font-size: 1.1rem; }
h4, .h4 { font-size: 1rem; }
h5, .h5 { font-size: 0.95rem; }
h6, .h6 { font-size: 0.9rem; }

.card, .list-group-item, .btn, .form-control, .navbar, .table {
  font-family: var(--font-main);
}

input, select, textarea, button {
  font-size: 0.9rem;
  font-family: var(--font-main);
}

body.no-navbar {
  padding-top: 0;
}

/* Add padding to main content containers that need navbar spacing */
.container {
  padding-top: 20px;
}

/* Hero Sections */
.hero-section {
  position: relative;
  width: 100%;
  padding: 1.5rem 0;
  margin: 65px auto 0;
  overflow: hidden;
}

.hero-section > .container {
  position: relative;
  padding: 2rem;
  border-radius: 12px;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  right: 0;
  bottom: 0;
  width: 100vw;
  transform: translateX(-50%);
  background: url('../images/hero background.png') no-repeat center bottom;
  background-size: cover;
  opacity: 0.7;
  z-index: -1;
}

.hero-section > .container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: inherit;
  z-index: -1;
  border-radius: 12px;
}

.hero-section .container {
  padding-top: 0;
}

.hero-section h1 {
  color: #2c3e50; /* Dark blue-gray for better contrast */
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0;
  position: relative;
  opacity: 1;
}

.hero-section .lead {
  color: #495057; /* Slightly darker gray for better contrast */
  font-size: 0.9rem;
  margin: 0;
  position: relative;
  opacity: 1;
}

/* Remove padding for navbar container */
.navbar .container {
  padding-top: 0;
}

/* Remove padding for modal containers */
.modal .container {
  padding-top: 0;
}

/* Remove padding for dropdown containers */
.notification-dropdown .container,
.dropdown-menu .container {
  padding-top: 0;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  margin: 0;
  z-index: 1030;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 6px 1rem;
  width: 100%;
  height: var(--navbar-height);
  min-height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar-brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  padding: 0.3rem 0;
  margin: 0 1rem;
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.navbar-nav.flex-row { flex-direction: row; }

.navbar-nav .nav-item { margin: 0 0.2rem; }

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255,255,255,0.85);
  padding: 0.25rem 0.8rem;
  font-size: 0.85rem;
  margin: 0 0.2rem;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #fff;
  background-color: rgba(255,255,255,0.1);
}

.navbar .nav-link.active,
.navbar .nav-link[aria-current='page'] {
  background-color: #d0e7ff;
  color: var(--color-accent);
  border-radius: 4px;
}

.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
  color: rgba(255,255,255,0.85);
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

.navbar-collapse { flex-grow: 0; }

.navbar.bg-primary {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.container-fluid, .container {
  margin-top: 0;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Override Bootstrap spacing classes */
.mt-0, .mt-1, .mt-2, .mt-3, .mt-4, .mt-5 {
  margin-top: 0;
}
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mb-9p1 { margin-bottom: 9.1px !important; }
.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 1rem; }
.pt-4 { padding-top: 1.5rem; }
.pt-5 { padding-top: 3rem; }
body > .container:first-of-type,
body > .container-fluid:first-of-type,
body > header:first-of-type,
body > .hero:first-of-type,
body > .page-header:first-of-type {
  margin-top: 0;
}
main, .main-content, .content-wrapper {
  margin-top: 0;
}
.row, .row:first-child {
  margin-top: 0;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
.navbar > * {
  margin-top: 0;
}

/* Flex and alignment utilities */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.ms-auto { margin-left: auto; }
.ms-3 { margin-left: 1rem; }
.flex-row { flex-direction: row; }

/* Notification dropdown */
.notification-dropdown {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s cubic-bezier(.4,0,.2,1);
  transform: translateY(-10px);
  position: fixed;
  left: 0; /* set by JS */
  top: 0;  /* set by JS */
  min-width: 320px;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 9999;
  display: block;
}

/* Notification bell styles */
.notification-bell {
  position: relative;
  cursor: pointer;
  font-size: 1.3rem;
  color: #fff;
  margin-right: 1rem;
  display: inline-flex;
  align-items: center;
  z-index: 10000;
  padding: 4px 8px;
  overflow: visible;
}
#notification-bell-placeholder {
  position: relative;
  z-index: 10000;
  display: flex;
  align-items: center;
}
.notification-bell .badge {
  position: absolute;
  right: -4px;
  top: 2px;
  background: #dc3545;
  color: #fff;
  font-size: 0.8rem;
  padding: 0 6px;
  border-radius: 999px;
  z-index: 10;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.notification-bell i.bi-bell {
  z-index: 1;
  font-size: 1.3rem;
  display: inline-block;
}
.notification-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.notification-dropdown .dropdown-header {
  font-weight: 600;
  padding: 0.75rem 1rem 0.5rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  background: #f8f9fa;
}
.notification-dropdown .notification-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}
.notification-dropdown .notification-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
}
.notification-dropdown .notification-item:last-child {
  border-bottom: none;
}
.notification-dropdown .notification-item:hover {
  background: #f5f5f5;
}
.notification-dropdown .notification-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.notification-dropdown .notification-message {
  font-size: 0.88rem;
  color: #333;
}
.notification-dropdown .notification-time {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}
.notification-dropdown .dropdown-footer {
  padding: 0.5rem 1rem;
  text-align: right;
  background: #f8f9fa;
  border-top: 1px solid #f0f0f0;
}
.notification-dropdown .dropdown-footer button {
  font-size: 0.85rem;
  color: var(--color-accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Cards, tables, and forms */
.card, .practice-card, .table-card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  margin-bottom: 1.5rem;
  transition: none;
  background: #fff;
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
}

.card-header, .card-header.bg-primary {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.125);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-main);
}
.card-title {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* Tables */
.table, .table-responsive {
  width: 100%;
  margin-bottom: 0;
  background: #fff;
  font-family: var(--font-main);
  font-size: 13px;
}
.table thead, .table-gradient thead tr {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
}
.table th, .table-gradient thead th, .custom-thead th {
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  vertical-align: middle;
  padding: 0.75em 0.75em;
  border-bottom: 2px solid #e0e0e0;
}
.table td {
  font-size: 13px;
  vertical-align: middle;
  padding: 0.6em 0.75em;
  border-color: #e0e0e0;
}
.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0,0,0,0.02);
}

/* Status badges */
.status-badge {
  padding: 4px 10px;
  border-radius: 3px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  min-width: 70px;
  display: inline-block;
  text-transform: capitalize;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
/* Status badge color system - Modernized */
.status-accepted { background-color: #10B981; } /* Green */
.status-approved-batching { background-color: #06B6D4; } /* Cyan */
.status-awaiting-payment { background-color: #3B82F6; } /* Blue */
.status-billed { background-color: #6366F1; } /* Indigo */
.status-busamed-claim { background-color: #10B981; } /* Green */
.status-claim-dispute { background-color: #EF4444; } /* Red */
.status-claim-queried { background-color: #F59E0B; color: #1F2937; } /* Amber */
.status-clinically-assessed { background-color: #8B5CF6; } /* Violet */
.status-courtesy-call { background-color: #06B6D4; } /* Cyan */
.status-credit-note { background-color: #F97316; } /* Orange */
.status-extracted { background-color: #A855F7; } /* Purple */
.status-handed-over-practice { background-color: #6366F1; } /* Indigo */
.status-indigent-non-bill { background-color: #6c757d; }
.status-on-hold { background-color: #6c757d; }
.status-on-hold-claim-query { background-color: #ffc107; color: #212529; }
.status-overdue { background-color: #dc3545; }
.status-overpaid { background-color: #fd7e14; }
.status-paid { background-color: #28a745; }
.status-paid-onscene { background-color: #28a745; }
.status-partial-payment { background-color: #fd7e14; }
.status-patient-liable { background-color: #ffc107; color: #212529; }
.status-pending { background-color: #ffc107; color: #212529; }
.status-raf { background-color: #6f42c1; }
.status-rejected { background-color: #dc3545; }
.status-rejected-practice { background-color: #dc3545; }
.status-rejected-stale { background-color: #dc3545; }
.status-resubmit { background-color: #e83e8c; }
.status-submitted { background-color: #007bff; }
.status-unpaid { background-color: #dc3545; }
.status-wca { background-color: #e83e8c; }

/* Legacy status mappings for backward compatibility */
.status-approved { background-color: #28a745; }
.status-processing { background-color: var(--color-accent); }

/* Forms */
.form-label {
  font-weight: 600;
  color: var(--color-accent);
  font-size: 0.9rem;
}
.form-control, .form-select {
  font-size: 12px;
  border-radius: 0;
  border: 1px solid #ced4da;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-main);
}
.form-control:focus, .form-select:focus {
  outline: none;
  box-shadow: none;
  border-color: var(--color-accent);
}
.form-label[for="dos"]:after,
.form-label[for="amount"]:after,
.form-label[for="name_surname"]:after {
  content: " *";
  color: #dc3545;
}

/* Buttons */
.btn, .btn-sm {
  font-size: 13px;
  font-family: var(--font-main);
  font-weight: 500;
  line-height: 1.4;
  padding: 0.25rem 0.5rem;
}
.btn-primary {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border: none;
}
.btn-success { background: #00a651; border: none; }
.btn-danger { background: #ed1c24; border: none; }
.btn-warning { background: #f7941d; border: none; color: #fff; }
.btn-info { background: #00aeef; border: none; color: #fff; }

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  color: #fff;
  cursor: pointer;
}
.action-view { background-color: #0dcaf0; }
.action-edit { background-color: #ffc107; }
.action-delete { background-color: #dc3545; }

/* Modals */
.modal-content {
  border: none;
  border-radius: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.modal-header, .modal-header.bg-primary {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  border-radius: 0;
  padding: 1rem 1.5rem;
}
.modal-footer {
  border-top: 1px solid #edf2f9;
  background: #e6e6e6;
  border-radius: 0;
}

/* Alerts */
.alert {
  border-radius: 0.5rem;
  margin: 1rem 0;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

/* Tabs */
.nav-tabs {
  border-bottom: none;
  margin-bottom: 0;
}
.nav-tabs .nav-item { margin-bottom: 0; }
.nav-tabs .nav-link {
  border: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding: 0.75rem 1rem;
  color: rgba(255,255,255,0.7);
  background-color: var(--color-accent);
  margin-right: 2px;
  transition: none;
}
.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus {
  border-color: transparent;
  background-color: #004a8b;
  color: #fff;
  transition: none;
}
.nav-tabs .nav-link.active {
  color: #333;
  background-color: #fff;
  border-color: transparent;
  border-bottom-color: #fff;
  position: relative;
  z-index: 1;
}
.nav-tabs .nav-link.active::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #fff;
  z-index: 2;
}
.nav-tabs .nav-link .badge {
  margin-left: 5px;
  background-color: #6c757d;
  color: #fff;
}
.tab-content {
  background-color: #fff;
  padding: 1.5rem;
  border: 1px solid #dee2e6;
  border-top: none;
  display: flex;
  flex-direction: column;
}
.tab-pane {
  display: flex;
  flex-direction: column;
  flex-basis: 0;
  flex-grow: 1;
  height: 100%;
}
.tab-pane .table-responsive,
.tab-pane .text-center.p-4 {
  flex-grow: 1;
}
.tab-pane h2:first-child { margin-top: 0; }
.tab-pane form.row { margin-top: 1rem; margin-bottom: 1rem; }
.tab-pane .table-responsive { margin-top: 1rem; }
.tab-pane .mt-3 { margin-top: 1rem; }
.tab-pane .text-center.p-4 { padding: 2rem; }

/* Status Cards */
.status-card {
  padding: 1rem;
  border-radius: 0.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  color: inherit;
}
.status-card .display-4 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.status-card h5, .status-card .mb-0 {
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  margin-bottom: 0;
}
.status-card .bi {
  font-size: 2rem;
  opacity: 0.8;
}
.status-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.status-card hr {
  border-top: 1px solid rgba(255,255,255,0.5);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.status-card .paid-this-month-count,
.status-card .paid-last-month-count {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.5rem;
}

/* Responsive practice cards */
@media (max-width: 768px) {
  .practice-card { margin-bottom: 0.5rem; }
  .col { flex: 0 0 100%; max-width: 100%; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .col { flex: 0 0 50%; max-width: 50%; }
}
@media (min-width: 1025px) {
  .col { flex: 0 0 33.333333%; max-width: 33.333333%; }
}

/* Particles.js background */
#particles-js {
  margin: 0;
  padding: 0;
  border: none;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  display: block;
}

/* Navbar stacking context */
.navbar { z-index: 1030; position: fixed; }

.navbar .container.d-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
  flex-grow: 0;
}

/* Modal and backdrop z-index */
.modal-backdrop {
  z-index: 1050 !important;
}
.modal {
  z-index: 1060 !important;
}
.modal-dialog,
.modal-content {
  z-index: 1061 !important;
}

.navbar-dark, .bg-dark, .bg-primary {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.navbar .bi { font-size: 0.9rem; }

/* Practice icon styling */
.practice-icon {
  font-size: 2rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

/* Table card specific styling */
.table-card {
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  border-radius: 0;
  overflow: hidden;
  max-width: 100%;
}
.table-card .card-body {
  padding: 0;
}

/* Badge system */
.badge {
  font-size: 0.8rem;
  padding: 0.35em 0.65em;
}
.badge.bg-primary { background-color: var(--color-accent); }
.badge.bg-info { background-color: #00aeef; }
.badge.bg-success { background-color: #00a651; }
.badge.bg-warning { background-color: #f7941d; color: #fff; }
.badge.bg-danger { background-color: #ed1c24; }
.badge.bg-secondary { background-color: #6c757d; }

/* Badge variants */
.badge-paid { background-color: #00a651; color: #fff; }
.badge-rejected { background-color: #ed1c24; color: #fff; }
.badge-pending { background-color: #f7941d; color: #fff; }
.badge-submitted { background-color: #0dcaf0; color: #fff; }
.badge-processing { background-color: var(--color-accent); color: #fff; }
.badge-awaiting-payment { background-color: #17a2b8; color: #fff; }
.badge-aod { background-color: #8B5CF6; color: #fff; } /* Violet for AOD */
.badge-statement { background-color: #3B82F6; color: #fff; } /* Blue for Statement */

/* Status card backgrounds */
.bg-submitted { background-color: #0dcaf0; color: #000; }
.bg-awaiting { background-color: #17a2b8; color: #fff; }
.bg-paid-value { background-color: #00a651; color: #fff; }
.bg-paid-month { background-color: #198754; color: #fff; }
.bg-paid-last-month { background-color: #0dcaf0; color: #000; }
.bg-liable { background-color: #cddc39; color: #000; }

/* Card header buttons */
.card-header .btn, .card-header .btn-link, .card-header .dropdown-toggle {
  font-size: 1rem;
  font-family: var(--font-main);
  font-weight: 500;
  line-height: 1.4;
}
.card-header .btn-link {
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.card-header .btn-claim-reminders, .card-header .btn-assigned-claims {
  font-size: 1rem;
  font-family: var(--font-main);
  font-weight: 500;
  line-height: 1.4;
  color: inherit;
  background: transparent;
  border: none;
  box-shadow: none;
  text-decoration: none;
  padding: 0;
}

/* Practice info styling */
.practice-info-header, .card-header.practice-info-header {
  background: #e9ecef;
  color: #222;
}
.practice-info-value {
  color: #6c757d;
  font-weight: 500;
}
.practice-info-value a {
  color: #6c757d;
  text-decoration: none;
}

/* Table styling refinements */
.table td, .table th {
  font-family: inherit;
  font-size: 1rem;
  vertical-align: middle;
}
.recent-claim-row:hover {
  background-color: #f8f9fa;
}

/* Toast positioning */
.toast-container {
  z-index: 1100;
}
.toast-container.position-fixed.top-0.end-0 {
  margin-top: 80px;
  z-index: 1100;
}
.toast-container.position-fixed.bottom-0.end-0 {
  margin-bottom: 20px;
}
.toast-container + .toast-container {
  margin-bottom: 65px;
}
.toast-container + .toast-container + .toast-container {
  margin-bottom: 125px;
}

/* Modern toast styling - FORCE NAVBAR BLUE FOR ALL TOASTS */
.toast,
.toast.bg-success,
.toast.bg-danger,
.toast.bg-warning,
.toast.bg-info,
.toast.bg-primary,
.toast.bg-blue {
  border-left: 4px solid var(--color-accent) !important;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  font-family: var(--font-main);
  font-size: 0.9rem;
  max-width: 400px;
  margin-bottom: 1rem;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

.toast-header {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%) !important;
  color: #fff !important;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toast-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transition: all 0.2s ease;
  background-size: 1.1rem;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  margin: 0;
  border-radius: 50%;
}

.toast-header .btn-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.toast-body {
  padding: 1.25rem;
  color: var(--color-text);
  line-height: 1.6;
  background: var(--color-bg) !important;
  font-size: 0.9rem;
  position: relative;
}

/* Remove all type-specific overrides */
.toast.bg-success .toast-header,
.toast.bg-danger .toast-header,
.toast.bg-warning .toast-header,
.toast.bg-info .toast-header {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%) !important;
  color: #fff !important;
}
.toast.bg-success,
.toast.bg-danger,
.toast.bg-warning,
.toast.bg-info {
  border-left: 4px solid var(--color-accent) !important;
}

/* Toast animations - Modern Portal Theme */
.toast.show {
  animation: toastSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Toast hover effects */
.toast:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toast close button enhancement */
.toast-header .btn-close {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  margin: 0;
  background-size: 1.1rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.toast-header .btn-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

/* Toast entrance animation */
.toast {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive toast positioning */
@media (max-width: 768px) {
  .toast-container.position-fixed.top-0.end-0 {
    margin-top: 70px;
    right: 0.5rem;
    left: 0.5rem;
  }
  
  .toast {
    max-width: 100%;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    backdrop-filter: blur(8px);
  }
  
  .toast-header {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
  
  .toast-body {
    padding: 1rem;
    font-size: 0.85rem;
  }
  
  .toast-header .btn-close {
    width: 1.3rem;
    height: 1.3rem;
    background-size: 1rem;
  }
}

/* Position utilities */
.position-fixed { position: fixed; }
.position-absolute { position: absolute; }
.position-relative { position: relative; }

/* Component positioning */
.claims-container, .claims-card, .notes-container, .table-responsive, .card {
  position: relative;
  z-index: 1;
}
.notes-container {
  max-height: 400px;
  overflow-y: auto;
}

/* Modal positioning */
.modal { z-index: 1050; }
.modal-dialog { z-index: 1055; }
.modal-content { z-index: 1056; }

/* Form validation */
.form-control.is-invalid, .form-select.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}
.form-control.is-valid, .form-select.is-valid {
  border-color: #198754;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Pagination */
.pagination .page-link {
  color: var(--color-accent);
  border-color: #dee2e6;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.pagination .page-item.active .page-link {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* List group and dropdown */
.list-group-item {
  font-size: 13px;
  font-family: var(--font-main);
}
.dropdown-menu {
  border-radius: 0;
  border: 1px solid #e3e3e3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.tooltip {
  font-family: var(--font-main);
  font-size: 12px;
}

/* Responsive design */
@media (max-width: 768px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .container, .container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: 0;
    margin-right: 0;
  }
  .hero-section {
    padding: calc(var(--navbar-height) + 10px) 1rem 10px 1rem;
    overflow: hidden;
  }
  .hero-section h1 {
    font-size: 1.1rem;
  }
  .navbar .container {
    justify-content: space-between;
    max-width: 100%;
    overflow: hidden;
  }
  .navbar-dark .navbar-nav .nav-link {
    padding: 0.25rem 0.5rem;
    margin: 0 0.1rem;
  }
  .navbar-brand {
    margin: 0 0.5rem;
  }
  .navbar-collapse {
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 0.25rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    overflow: hidden;
  }
  .navbar-nav .nav-item {
    margin: 0.25rem 0;
  }
  .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
  }
  .navbar-toggler {
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.25rem 0.5rem;
  }
  .notification-bell {
    margin-right: 0.5rem;
  }
  .row-cols-1, .row-cols-md-2, .row-cols-lg-3 {
    margin: 0;
    padding: 0;
  }
  .col {
    padding: 0.5rem;
    margin: 0;
  }
}

/* Notification bell hover effect */
.notification-bell:hover, .notification-bell:focus {
  background-color: rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 6px;
  transition: background-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

body.modal-open {
  padding-right: 0 !important;
}
body.modal-open .navbar[style] {
  padding-right: 0 !important;
}

/* Persistent Toasts - visually distinct */
.toast-persistent {
  border-left: 6px solid var(--color-accent);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.98);
}
.toast-persistent .toast-header i {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

/* Enhanced glass morphism login card */
.card.login-card-bg {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: 
    0 12px 40px rgba(0,0,0,0.35), 
    0 4px 16px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 16px !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Add subtle inner glow effect */
.card.login-card-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
  border-radius: 16px;
  z-index: -1;
}

.centered-alert {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  width: 100%;
}

.align-with-sidebar {
  justify-content: flex-start !important;
  margin-left: 0 !important;
}

/* Prevent body shift during modal transitions */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

/* Ensure modals don't cause body padding changes */
.modal {
    padding-right: 0 !important;
}

/* Prevent navbar shift during modal transitions - FIXED */
.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding-right: 0 !important;
    margin-right: 0 !important;
}

/* Ensure navbar stays in place during modal operations */
body.modal-open .navbar {
    padding-right: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
}

/* Ensure smooth modal transitions */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

/* Prevent any layout shift during modal operations */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1040;
}

/* Ensure proper z-index stacking for nested modals */
.modal:nth-of-type(2) {
    z-index: 1060;
}

.modal:nth-of-type(2) .modal-dialog {
    z-index: 1065;
}

.modal:nth-of-type(2) .modal-content {
    z-index: 1066;
}

/* Force body to maintain its position during modal operations */
body {
    position: relative !important;
}

/* Prevent scrollbar width compensation */
body.modal-open {
    padding-right: 0 !important;
    margin-right: 0 !important;
}

/* Ensure containers don't shift */
.container, .container-fluid {
    padding-right: 0 !important;
}

/* --- Invoice System Styles --- */
.invoice-table { margin-top: 2rem; }
.invoice-table th, .invoice-table td { vertical-align: middle; }
.invoice-actions .btn { margin-right: 0.25rem; }
.invoice-details-table { width: 100%; max-width: 600px; margin-bottom: 2rem; }
.invoice-details-table th { width: 180px; background: #f0f2f5; }
@media (max-width: 600px) {
  .invoice-details-table, .invoice-details-table th, .invoice-details-table td { font-size: 0.95rem; }
}

.btn-whatsapp {
    background-color: #25D366;
    color: #fff;
    border: none;
    font-weight: 500;
    display: inline-block;
    text-align: center;
    align-items: center;
    gap: 0.4em;
    padding: 0.375rem 0.75rem;
    border-radius: 0.3rem;
    transition: background 0.2s;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.08);
}
.btn-whatsapp:hover, .btn-whatsapp:focus {
    background-color: #128C7E;
    color: #fff;
    text-decoration: none;
}
.btn-whatsapp .bi-whatsapp {
    font-size: 1.1em;
    vertical-align: -0.1em;
}