/**
 * Modern Base CSS - Minimalist UI & Flat 2.0 Design System
 * Features: Soft UI, Bento Grid utilities, Rounded Corners (12-24px),
 * Full Mobile-First Responsiveness, Zero Bootstrap Dependency.
 */

:root {
  /* Flat 2.0 Medical Palette */
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-active: #115e59;
  --primary-light: #f0fdfa;
  --primary-surface: #ccfbf1;
  --primary-glow: rgba(15, 118, 110, 0.15);
  
  --secondary: #475569;
  --secondary-hover: #334155;
  --secondary-light: #f8fafc;
  
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-light: #f0f9ff;
  
  --success: #059669;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --info: #0284c7;
  --info-light: #f0f9ff;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverted: #ffffff;
  
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-surface-hover: #f8fafc;
  
  --border-subtle: rgba(226, 232, 240, 0.85);
  --border-soft: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #0f766e;
  
  /* Soft UI Rounded Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;
  
  /* Soft Ambient Flat 2.0 Elevation */
  --shadow-soft-xs: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-soft-sm: 0 4px 12px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.02);
  --shadow-soft-md: 0 10px 24px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  --shadow-soft-lg: 0 20px 36px -8px rgba(15, 23, 42, 0.07), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  
  --shadow-xs: var(--shadow-soft-xs);
  --shadow-sm: var(--shadow-soft-sm);
  --shadow-md: var(--shadow-soft-md);
  --shadow-lg: var(--shadow-soft-lg);
  
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: 'Poppins', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text-main);
  background-color: var(--bg-page);
  font-family: inherit;
  font-size: 1rem;
  max-width: 100%;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.45rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  cursor: pointer;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-style: none;
}

.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Utilities */
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-justify { text-align: justify; }
.text-uppercase { text-transform: uppercase; }
.text-muted  { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-align-right { text-align: right; }
.text-align-center { text-align: center; }

.pull-left  { float: left !important; }
.pull-right { float: right !important; }
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* Container & Fluid Grid System */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.container-fluid {
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
  margin-left: auto;
  margin-right: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -12px;
  margin-right: -12px;
  box-sizing: border-box;
}

/* Grid Columns */
[class*="col-"] {
  position: relative;
  width: 100%;
  padding-left: 12px;
  padding-right: 12px;
  min-width: 0;
  box-sizing: border-box;
}

/* Mobile first: col-xs default (all screen sizes) */
.col-xs-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-xs-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-xs-3  { flex: 0 0 25%; max-width: 25%; }
.col-xs-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-xs-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-xs-6  { flex: 0 0 50%; max-width: 50%; }
.col-xs-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-xs-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-xs-9  { flex: 0 0 75%; max-width: 75%; }
.col-xs-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-xs-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-xs-12 { flex: 0 0 100%; max-width: 100%; }

/* Tablet (>= 768px) */
@media (min-width: 768px) {
  .col-sm-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-sm-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-sm-3  { flex: 0 0 25%; max-width: 25%; }
  .col-sm-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-sm-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-sm-6  { flex: 0 0 50%; max-width: 50%; }
  .col-sm-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-sm-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-sm-9  { flex: 0 0 75%; max-width: 75%; }
  .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
  .col-sm-offset-1 { margin-left: 8.333333%; }
  .col-sm-offset-2 { margin-left: 16.666667%; }
  .col-sm-offset-3 { margin-left: 25%; }
}

/* Desktop (>= 992px) */
@media (min-width: 992px) {
  .col-md-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-md-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3  { flex: 0 0 25%; max-width: 25%; }
  .col-md-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-6  { flex: 0 0 50%; max-width: 50%; }
  .col-md-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-9  { flex: 0 0 75%; max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  .col-md-offset-1 { margin-left: 8.333333%; }
  .col-md-offset-2 { margin-left: 16.666667%; }
  .col-md-offset-3 { margin-left: 25%; }
}

/* Large Desktop (>= 1200px) */
@media (min-width: 1200px) {
  .col-lg-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-lg-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-lg-3  { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-6  { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-9  { flex: 0 0 75%; max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Responsive visibility helpers */
@media (max-width: 767px) {
  .hidden-xs { display: none !important; }
}
@media (min-width: 768px) and (max-width: 991px) {
  .hidden-sm { display: none !important; }
}
@media (min-width: 992px) {
  .hidden-md { display: none !important; }
}

/* Bento Grid System Utilities */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.bento-col-12 { grid-column: span 12; }
.bento-col-8  { grid-column: span 8; }
.bento-col-7  { grid-column: span 7; }
.bento-col-6  { grid-column: span 6; }
.bento-col-5  { grid-column: span 5; }
.bento-col-4  { grid-column: span 4; }
.bento-col-3  { grid-column: span 3; }

.bento-card {
  position: relative;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-soft-sm);
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal), transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.bento-card:hover {
  box-shadow: var(--shadow-soft-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.bento-card.bento-tint {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

.bento-card.bento-primary {
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
  border-color: #ccfbf1;
}

.bento-card.bento-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  border: 1px solid #ccfbf1;
  padding: 1.75rem 2rem;
}

.bento-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.bento-card-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Bento Step Guide Component */
.bento-step-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bento-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.bento-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  border: 1px solid var(--primary-surface);
}

.bento-step-text h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 0.2rem 0;
}

.bento-step-text p {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin: 0;
  line-height: 1.45;
}

/* Bento Quick Action Card Links */
.bento-action-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bento-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  min-height: 48px;
}

.bento-action-card:hover {
  background-color: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(3px);
  box-shadow: var(--shadow-soft-xs);
  text-decoration: none;
}

.bento-action-card i.action-icon {
  font-size: 1.15rem;
  color: var(--primary);
  margin-right: 0.75rem;
}

.bento-action-card i.chevron-icon {
  font-size: 0.875rem;
  color: var(--text-subtle);
}

/* Bento Responsive Breakpoints */
@media (max-width: 1279px) and (min-width: 768px) {
  .bento-col-3 {
    grid-column: span 6;
  }
  .bento-col-4 {
    grid-column: span 6;
  }
}

@media (max-width: 991px) {
  .bento-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
  .bento-col-12, .bento-col-8, .bento-col-7,
  .bento-col-6, .bento-col-5, .bento-col-4,
  .bento-col-3 {
    grid-column: span 1 !important;
    min-width: 0;
    max-width: 100%;
  }
  .bento-card {
    padding: 1.35rem;
  }
}

@media (max-width: 767px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  .row {
    margin-left: -8px;
    margin-right: -8px;
  }
  [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
    flex: 0 0 100%;
    max-width: 100%;
  }
  .bento-card {
    padding: 1.15rem 0.95rem;
    border-radius: var(--radius-md);
  }
  .bento-card.bento-hero {
    padding: 1.15rem 0.95rem;
  }
}

/* Modern Form Controls - Soft UI & Flat 2.0 */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-main);
  cursor: default;
}

label[for] {
  cursor: pointer;
}

.form-control {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-surface);
  background-clip: padding-box;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  appearance: none;
}

.form-control:focus {
  color: var(--text-main);
  background-color: var(--bg-surface);
  border-color: var(--border-focus);
  outline: 0;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-control::placeholder {
  color: var(--text-subtle);
  opacity: 0.65;
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--bg-surface-subtle);
  opacity: 0.85;
  cursor: not-allowed;
}

select.form-control {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px 10px;
  cursor: pointer;
}

textarea.form-control {
  min-height: 96px;
  resize: vertical;
}

.form-line {
  position: relative;
  width: 100%;
}

/* Form Validation States - Soft UI & Accessible Feedback */
.form-control.is-invalid,
select.form-control.is-invalid,
textarea.form-control.is-invalid {
  border-color: var(--danger) !important;
  background-color: #fff8f8 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.form-control.is-invalid:focus,
select.form-control.is-invalid:focus,
textarea.form-control.is-invalid:focus {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25) !important;
}

.field-feedback {
  display: none;
  font-size: 0.8125rem;
  line-height: 1.4;
  margin-top: 0.35rem;
  color: var(--danger);
  font-weight: 500;
  transition: opacity var(--transition-fast);
}

.field-feedback.active {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.field-feedback i {
  font-size: 0.875rem;
  flex-shrink: 0;
}

.validation-summary-card {
  display: none;
  background-color: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  animation: slideDown 0.2s ease-out;
}

.validation-summary-card.active {
  display: block;
}

.validation-summary-card h4 {
  color: #991b1b;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.validation-summary-card ul {
  margin: 0;
  padding-left: 1.25rem;
  color: #b91c1c;
  font-size: 0.85rem;
  line-height: 1.6;
}

.validation-summary-card ul li a {
  color: #b91c1c;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.validation-summary-card ul li a:hover {
  color: #7f1d1d;
}

/* Modern Responsive Captcha Component - Flat 2.0 & Mobile Optimized */
.captcha-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  width: 100%;
  max-width: 100%;
  margin-top: 0.25rem;
  margin-bottom: 0.35rem;
  box-sizing: border-box;
}

.captcha-image-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  max-width: 100%;
  background-color: var(--bg-surface-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-soft);
  box-shadow: var(--shadow-soft-xs);
  box-sizing: border-box;
}

.captcha-img {
  display: block;
  width: 220px;
  max-width: 100%;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  background-color: #0f766e;
  transition: opacity var(--transition-fast);
}

.captcha-img:hover {
  opacity: 0.92;
}

.btn-refresh-captcha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 56px;
  border: 1.5px solid var(--border-soft);
  background-color: #ffffff;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  font-size: 1.1rem;
}

.btn-refresh-captcha:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.captcha-input-wrapper {
  flex-grow: 1;
  min-width: 0;
}

.captcha-input-wrapper .form-control {
  min-height: 64px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--primary);
  border-radius: var(--radius-md);
}

.captcha-input-wrapper .form-control::placeholder {
  font-size: 0.875rem;
  letter-spacing: normal;
  font-weight: 400;
  color: var(--text-subtle);
}

/* Mobile Adaptive Layout for Captcha */
@media (max-width: 767px) {
  .captcha-box {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .captcha-image-wrapper {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 6px;
    border-radius: var(--radius-md);
  }

  .captcha-img {
    flex-grow: 1;
    width: calc(100% - 56px);
    height: 64px; /* Large, bold, ultra-readable on phones */
    max-width: none;
    object-fit: fill;
  }

  .btn-refresh-captcha {
    width: 50px;
    height: 64px;
    flex-shrink: 0;
    font-size: 1.25rem;
  }

  .captcha-input-wrapper {
    width: 100%;
  }

  .captcha-input-wrapper .form-control {
    min-height: 52px;
    font-size: 1.35rem;
    letter-spacing: 0.22em;
    text-align: center;
    border-radius: var(--radius-md);
  }
}

/* Modern Flat 2.0 Buttons (Touch friendly >= 44px) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.65rem 1.35rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft-xs);
  transition: all var(--transition-fast);
}

.btn:hover {
  text-decoration: none;
  box-shadow: var(--shadow-soft-sm);
  transform: translateY(-1.5px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-soft-xs);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.65;
  pointer-events: none;
  cursor: not-allowed;
}

/* Button Variants */
.btn-primary {
  color: #ffffff;
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  color: #ffffff;
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-success {
  color: #ffffff;
  background-color: var(--success);
  border-color: var(--success);
}
.btn-success:hover {
  color: #ffffff;
  background-color: #047857;
  border-color: #047857;
}

.btn-danger {
  color: #ffffff;
  background-color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover {
  color: #ffffff;
  background-color: #b91c1c;
  border-color: #b91c1c;
}

.btn-warning {
  color: #ffffff;
  background-color: var(--warning);
  border-color: var(--warning);
}
.btn-warning:hover {
  color: #ffffff;
  background-color: #b45309;
  border-color: #b45309;
}

.btn-info {
  color: #ffffff;
  background-color: var(--info);
  border-color: var(--info);
}
.btn-info:hover {
  color: #ffffff;
  background-color: #0284c7;
  border-color: #0284c7;
}

.btn-default,
.btn-secondary {
  color: var(--text-main);
  background-color: var(--bg-surface);
  border-color: var(--border-soft);
}
.btn-default:hover,
.btn-secondary:hover {
  color: var(--primary);
  background-color: var(--bg-surface-subtle);
  border-color: var(--border-strong);
}

.btn-sm {
  min-height: 38px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  min-height: 50px;
  padding: 0.8rem 1.65rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Modern Soft Tables */
.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-soft-xs);
}

.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-main);
  vertical-align: top;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.95rem 1.15rem;
  vertical-align: middle;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9375rem;
}

.table thead th,
.table > tr.head th,
.table th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--border-subtle);
  border-top: none;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  background-color: var(--bg-surface-subtle);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(248, 250, 252, 0.7);
}

.table-hover tbody tr:hover {
  background-color: rgba(15, 118, 110, 0.03);
}

.table-bordered {
  border: 1px solid var(--border-subtle);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border-subtle);
}

/* Modern Cards - Soft UI & Rounded Corners */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: var(--bg-surface);
  background-clip: border-box;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft-sm);
  margin-bottom: 1.75rem;
  overflow: hidden;
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-soft-md);
  border-color: var(--border-strong);
}

.card .header {
  padding: 1.35rem 1.65rem;
  margin-bottom: 0;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card .header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.card .header h2 small {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.25rem;
}

.card .body {
  padding: 1.65rem;
}

.block-header {
  margin-bottom: 1.35rem;
}

.block-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin: 0;
}

/* Modern Segmented / Pill Tabs */
.nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.nav-tabs {
  background-color: var(--bg-surface-subtle);
  padding: 5px;
  border-radius: var(--radius-md);
  border: none;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  display: inline-flex;
}

.nav-tabs > li {
  margin-bottom: 0;
}

.nav-tabs > li > a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  background-color: transparent;
}

.nav-tabs > li > a:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.6);
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  color: var(--primary);
  background-color: #ffffff;
  box-shadow: var(--shadow-soft-xs);
  font-weight: 600;
}

.tab-content > .tab-pane {
  display: none;
}

.tab-content > .tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modern Soft Badges & Labels */
.label, .badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--radius-full);
}

.label-count {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  background-color: var(--danger);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* Pagination */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  gap: 6px;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.pagination > li > a,
.pagination > li > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  color: var(--text-main);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.pagination > li > a:hover {
  background-color: var(--bg-surface-subtle);
  border-color: var(--border-strong);
  color: var(--primary);
  transform: translateY(-1px);
}

.pagination > .active > a,
.pagination > .active > span {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-soft-xs);
}

.pagination > .disabled > a,
.pagination > .disabled > span {
  color: var(--text-subtle);
  pointer-events: none;
  background-color: var(--bg-surface-subtle);
  border-color: var(--border-subtle);
  opacity: 0.6;
}

/* DataTables Styling Overrides */
.dataTables_wrapper {
  padding: 0.5rem 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background-color: #ffffff;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.dataTables_wrapper .dataTables_info {
  padding-top: 0.85em;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Modern Soft Panels & Accordions */
.panel-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-soft-xs);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.panel-heading {
  padding: 0;
  background-color: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  margin: 0;
  font-size: 0.9375rem;
}

.panel-title > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.45rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  min-height: 48px;
  cursor: pointer;
  background-color: var(--bg-surface);
}

.panel-title > a:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--primary);
  text-decoration: none;
}

.panel-title > a::after {
  content: "\e5cf"; /* keyboard_arrow_down */
  font-family: 'Material Icons';
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.panel-title > a:not(.collapsed)::after {
  transform: rotate(180deg);
}

.collapse {
  display: none;
}

.collapse.in {
  display: block;
}

.panel-body {
  padding: 1.45rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
  background-color: var(--bg-surface);
}

/* Modern Soft Alerts */
.alert {
  padding: 1rem 1.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
  font-size: 0.9375rem;
  line-height: 1.5;
  box-shadow: var(--shadow-soft-xs);
}

.alert-info {
  background-color: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

.alert-warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.alert-success {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* Background Utility Classes */
.bg-danger { background-color: var(--danger) !important; color: #ffffff !important; }
.bg-success { background-color: var(--success) !important; color: #ffffff !important; }
.bg-warning { background-color: var(--warning) !important; color: #ffffff !important; }
.bg-info { background-color: var(--info) !important; color: #ffffff !important; }
.bg-primary { background-color: var(--primary) !important; color: #ffffff !important; }
.bg-light { background-color: var(--bg-surface-subtle) !important; }
.bg-white { background-color: #ffffff !important; }

/* Modern Soft Datepicker Dropdown */
.datepicker-dropdown {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft-lg);
  padding: 1.25rem;
  z-index: 1050;
}

.datepicker table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 4px;
}

.datepicker table tr th {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-main);
  text-align: center;
  padding: 0.5rem;
  border-radius: var(--radius-xs);
}

.datepicker table tr td {
  width: 38px;
  height: 38px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.datepicker table tr td.day:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: var(--shadow-soft-xs);
}

.datepicker table tr td.today {
  background-color: var(--bg-surface-subtle);
  font-weight: 600;
  border: 1px solid var(--primary);
}

/* Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
