/* ========================================
   Variables CSS - Design System Tokens
   Based on DESIGN_GUIDELINES.md (Bintelx Layouts)
   ======================================== */
:root {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* ===== GRAYS (cool blue tint) ===== */
  --gray-100: hsl(210, 20%, 98%);
  --gray-200: hsl(210, 20%, 94%);
  --gray-300: hsl(210, 18%, 88%);
  --gray-400: hsl(210, 15%, 80%);
  --gray-500: hsl(210, 12%, 65%);
  --gray-700: hsl(210, 12%, 45%);
  --gray-800: hsl(210, 15%, 25%);
  --gray-900: hsl(210, 18%, 15%);

  /* ===== PRIMARY COLOR (Brand) ===== */
  --primary-100: hsl(205, 90%, 96%);
  --primary-500: hsl(205, 78%, 55%);
  --primary-600: hsl(205, 70%, 48%);
  --primary-700: hsl(205, 65%, 40%);

  /* ===== ACCENT COLORS (Semantic) ===== */
  --red-500: hsl(0, 80%, 60%);
  --yellow-500: hsl(45, 90%, 55%);
  --green-500: hsl(140, 60%, 45%);

  /* ===== SPACING SCALE ===== */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2.5rem;    /* 40px */
  --space-2xl: 4rem;     /* 64px */

  /* ===== TYPOGRAPHY SCALE ===== */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 2rem;      /* 32px */
  --font-size-4xl: 2.5rem;    /* 40px */

  /* ===== FONT WEIGHTS ===== */
  --font-normal: 400;
  --font-medium: 500;
  --font-bold: 700;

  /* Slate colors */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Indigo colors */
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-300: #a5b4fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --indigo-900: #312e81;

  /* Green colors */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  /* Red colors */
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-300: #fca5a5;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-900: #7f1d1d;

  /* Amber/Yellow colors */
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;
  --amber-900: #78350f;

  /* Blue colors */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  /* Surface and text aliases */
  --surface-bg: #ffffff;
  --surface-muted: #f8fafc;
  --surface-border: #e2e8f0;
  --text-base: #0f172a;
  --text-muted: #64748b;
  --text-muted-strong: #334155;

  /* Theme colors */
  --color-primary: #6366f1;
  --color-primary-dark: #4338ca;
  --color-primary-darker: #3730a3;
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;

  /* Shadow */
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* ========================================
   Base styles
   ======================================== */

/* Universal box-sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: inherit;
  background: var(--slate-50);
  color: var(--slate-700);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

/* ========================================
   KPI Cards
   ======================================== */
.kpi-card {
  border-radius: 1.5rem;
  border: 1px solid var(--slate-200);
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.kpi-card .label {
  font-size: 0.85rem;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi-card .value {
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-top: 0.35rem;
}

/* ========================================
   Surface Cards
   ======================================== */
.surface-card {
  border-radius: 1.4rem;
  border: 1px solid var(--surface-border);
  background: var(--surface-bg);
  box-shadow: var(--shadow-soft);
  padding: clamp(1rem, 2vw, 1.5rem);
}

.surface-card-lean {
  border-radius: 1.1rem;
  border: 1px solid var(--surface-border);
  background: var(--surface-bg);
}

.card-header {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ========================================
   Forms
   ======================================== */
.form-label-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-600);
  display: block;
}

.form-input {
  width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: 0.9rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  color: var(--slate-900);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.75rem;
}

.form-input-compact {
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
}

input[type="date"].form-input,
input[type="number"].form-input {
  max-width: 200px;
}

input[type="email"].form-input,
input[type="tel"].form-input,
input[type="text"].form-input[name*="rut"],
input[type="text"].form-input[name*="phone"],
input[type="text"].form-input[name*="telefono"] {
  max-width: 280px;
}

select.form-input {
  max-width: 250px;
}

textarea.form-input {
  max-width: 100%;
  min-height: 100px;
  resize: vertical;
}

.form-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.15s ease;
}

.form-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.form-chip span {
  pointer-events: none;
}

.form-chip:has(input:checked) {
  border-color: var(--indigo-500);
  background: rgba(99, 102, 241, 0.12);
  color: var(--indigo-600);
}

/* ========================================
   Tables
   ======================================== */
.table-head {
  background: #0f172a;
  color: #ffffff;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.table-row {
  color: var(--text-base);
  transition: background 0.2s ease;
}

.table-row:hover {
  background: var(--surface-muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
  border-bottom: 1px solid var(--slate-200);
  padding-bottom: 0.6rem;
}

.data-table td {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--slate-100);
}

/* ========================================
   Buttons
   ======================================== */
.btn,
.btn-primary,
.btn-muted,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-success,
.btn-outline-primary,
.btn-outline-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  background: var(--surface-bg);
  color: var(--text-base);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px rgba(67, 56, 202, 0.25);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-muted,
.btn-outline-light {
  background: var(--surface-muted);
  color: var(--text-base);
  border-color: var(--surface-border);
}

.btn-outline-secondary {
  border-color: var(--surface-border);
  color: var(--text-muted-strong);
  background: transparent;
}

.btn-outline-danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--color-danger);
  background: transparent;
}

.btn-outline-success {
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--color-success);
  background: transparent;
}

.btn-outline-primary {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--color-primary);
  background: transparent;
}

.btn-group {
  display: inline-flex;
  gap: 0.35rem;
}

.btn-group .btn {
  border-radius: 0.85rem;
}

.btn-group-sm .btn {
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
}

/* ========================================
   Layout
   ======================================== */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(0.75rem, 1.4vw, 1.5rem);
}

.section-card {
  border-radius: 1.8rem;
  border: 1px solid var(--slate-200);
  background: rgba(248, 250, 252, 0.92);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.section-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
}

/* ========================================
   Cards
   ======================================== */
.card,
.item-card {
  border-radius: 1.5rem;
  border: 1px solid var(--slate-200);
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ========================================
   Utility classes
   ======================================== */
.d-flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-start {
  align-items: flex-start;
}

.align-items-center {
  align-items: center;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.text-end {
  text-align: right;
}

.text-center {
  text-align: center;
}

.fw-semibold {
  font-weight: 600;
}

.ms-1 {
  margin-left: 0.25rem;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.d-block {
  display: block !important;
}

.d-none {
  display: none !important;
}

.small {
  font-size: 0.82rem;
}

/* ========================================
   Colors
   ======================================== */
.bg-primary {
  background: rgba(99, 102, 241, 0.15);
  color: var(--indigo-600);
}

.bg-light {
  background: var(--slate-100);
  color: var(--slate-600);
}

.bg-success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green-500);
}

.bg-danger {
  background: rgba(239, 68, 68, 0.18);
  color: var(--red-500);
}

.bg-warning {
  background: rgba(245, 158, 11, 0.18);
  color: var(--amber-500);
}

.text-dark {
  color: var(--slate-700);
}

.text-muted {
  color: var(--slate-500) !important;
}

.text-success {
  color: var(--green-500) !important;
}

.text-danger {
  color: var(--red-500) !important;
}

.text-warning {
  color: var(--amber-500) !important;
}

/* ========================================
   Badges
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.75rem;
}

.badge-section {
  text-transform: capitalize;
}

.badge-paid {
  font-size: 0.75rem;
}

/* ========================================
   Status Pills
   ======================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  text-transform: capitalize;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pendiente {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-500);
}

.status-pagado {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green-500);
}

.status-pagado_parcial {
  background: rgba(96, 165, 250, 0.2);
  color: #2563eb;
}

.status-default {
  background: var(--slate-100);
  color: var(--slate-600);
}

/* ========================================
   Score Grid
   ======================================== */
.score-grid {
  display: grid;
  grid-template-columns: repeat(5, 16px);
  gap: 4px;
}

.score-cell {
  width: 16px;
  height: 12px;
  border-radius: 3px;
  background: var(--slate-200);
}

.score-cell.on {
  background: var(--indigo-600);
}

/* ========================================
   Lists
   ======================================== */
.list-group {
  border: 1px solid var(--slate-200);
  border-radius: 1rem;
  background: #fff;
  overflow: hidden;
}

.list-group-item {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--slate-100);
}

.list-group-item:last-child {
  border-bottom: none;
}

/* ========================================
   Alerts
   ======================================== */
.alert {
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.alert-info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #2563eb;
}

.alert-light {
  background: var(--slate-100);
  border-color: var(--slate-200);
  color: var(--slate-600);
}

/* ========================================
   Order Cards
   ======================================== */
.quotes-shell {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.order-card {
  border: 1px solid var(--slate-200);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  margin-bottom: 1rem;
}

.order-card__heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--slate-100);
}

.order-card__grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 1rem;
}

.order-card__grid dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-500);
  margin-bottom: 0.25rem;
}

.order-card__grid dd {
  margin: 0;
  font-weight: 600;
  color: var(--slate-800);
}

.order-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--slate-100);
  padding-top: 0.75rem;
}

.order-card__refunds {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--slate-200);
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ========================================
   Control Personal Cards
   ======================================== */
.cp-category-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.cp-category-card {
  border: 1px solid var(--slate-200);
  border-radius: 1.25rem;
  padding: 1.25rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cp-category-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cp-category-card__section {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-500);
}

.cp-category-card__progress {
  height: 8px;
  border-radius: 999px;
  background: var(--slate-100);
  overflow: hidden;
}

.cp-category-card__progress-bar {
  height: 100%;
  border-radius: 999px;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  width: 260px;
  min-width: 260px;
  transition: width 0.3s ease, transform 0.3s ease;
  z-index: 20;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 15;
}

#app-shell.sidebar-open .sidebar-backdrop {
  opacity: 1;
  visibility: visible;
}

#app-shell.sidebar-open .sidebar {
  transform: translateX(0);
}

#app-shell.sidebar-collapsed .sidebar {
  width: 80px;
  min-width: 80px;
}

.sidebar-transition .nav-link-text,
.sidebar-transition .sidebar-header > div > div,
.sidebar-transition .sidebar-footer small {
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Ocultar textos cuando está colapsado */
#app-shell.sidebar-collapsed .nav-link-text,
#app-shell.sidebar-collapsed .sidebar-header > div > div,
#app-shell.sidebar-collapsed .sidebar-footer small {
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
}

/* Centrar íconos cuando está colapsado */
#app-shell.sidebar-collapsed .nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

#app-shell.sidebar-collapsed .sidebar-header {
  justify-content: center;
}

#app-shell.sidebar-collapsed .sidebar-footer {
  text-align: center;
  justify-content: center;
}

.icon-svg {
  width: 20px;
  height: 20px;
}

.navbar-toggler-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-block;
  vertical-align: middle;
  background-color: transparent;
  position: relative;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after,
.navbar-toggler-icon span {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 1px;
}

.navbar-toggler-icon::before {
  top: 0;
}

.navbar-toggler-icon span {
  top: 50%;
  transform: translateY(-50%);
}

.navbar-toggler-icon::after {
  bottom: 0;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
  }

  .kpi-card {
    padding: 1rem;
  }

  .section-card {
    border-radius: 1.4rem;
  }

  .quotes-shell {
    margin-left: -1rem;
    margin-right: -1rem;
  }
}

@media (min-width: 769px) {
  .quotes-shell {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }
}

@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    inset: 0 auto auto 0;
    transform: translateX(-100%);
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    overflow-y: auto;
    z-index: 1050;
  }

  #app-shell.sidebar-open {
    overflow: hidden;
  }

  #app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  #app-shell.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
  }
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
  width: 40px;
  height: 40px;
  padding: 0;
}

/* ========================================
   RESPONSIVE FIX: Prevent horizontal overflow
   ======================================== */

/* Global overflow prevention */
#app-shell {
  max-width: 100vw !important;
  overflow-x: clip !important;
}

#app-shell > .flex-fill {
  max-width: 100% !important;
  overflow-x: clip !important;
}

/* Force all main content to respect width */
main {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: clip !important;
  overflow-y: auto !important;
  position: relative;
}

main .container-fluid {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: clip !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  margin: 0 !important;
}

/* Neutralize Bootstrap row negative margins */
main .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 100% !important;
}

/* Force ALL descendants to respect container width */
main .container-fluid *,
main .container-fluid > * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Specific overrides for common overflow culprits */
main .container-fluid div,
main .container-fluid section,
main .container-fluid article {
  max-width: 100% !important;
}

/* Tables must be responsive */
main table {
  max-width: 100% !important;
  table-layout: auto !important;
}

main .table-responsive {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100% !important;
}

/* Cards and panels */
main .card,
main .section-card {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Prevent all flex containers from overflowing */
main .d-flex,
main .d-sm-flex,
main .d-md-flex,
main .d-lg-flex,
main [class*="d-flex"] {
  max-width: 100% !important;
  box-sizing: border-box !important;
  flex-wrap: wrap;
}

/* Force all Bootstrap columns to respect width */
main [class*="col-"],
main [class*="col "],
main .col {
  max-width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
}

/* Remove gutter padding on mobile if needed */
@media (max-width: 575px) {
  main .row > [class*="col-"] {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }
}

/* Forms and inputs */
main .form-control,
main .input-group {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Header container also needs limits */
header {
  max-width: 100%;
  overflow-x: hidden !important;
}

header .container-fluid {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden;
}

header .d-flex {
  max-width: 100% !important;
  flex-wrap: wrap;
  gap: 0.25rem !important;
}

/* Ensure header text doesn't overflow */
header h1,
header p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Reduce padding on mobile */
@media (max-width: 575px) {
  main .container-fluid,
  header .container-fluid {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }
}
