﻿/* =========================================================
   FIXMATE  ENHANCED CSS IMPROVEMENTS v2
   Loaded LAST  adds enhancements only, no breaking changes
   ========================================================= */

/* =========================================================
   UNIFIED DESIGN TOKENS (CANONICAL)
   ========================================================= */

:root {
  /* Typography (offline-safe system stack) */
  --font-family-base: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-size-base: 1rem;
  --line-height-base: 1.6;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Spacing (système unifié 4px base) */
  --sp-xs: 0.25rem;    /* 4px */
  --sp-sm: 0.5rem;     /* 8px */
  --sp-md: 1rem;       /* 16px */
  --sp-lg: 1.5rem;     /* 24px */
  --sp-xl: 2rem;       /* 32px */
  --sp-2xl: 3rem;      /* 48px */
  
  /* Radius (hiérarchie claire) */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  
  /* Colors (palette canonique) */
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-light: rgba(59, 130, 246, 0.1);
  
  --color-success: #10b981;
  --color-success-hover: #059669;
  --color-success-light: rgba(16, 185, 129, 0.1);
  
  --color-warning: #f59e0b;
  --color-warning-hover: #d97706;
  --color-warning-light: rgba(245, 158, 11, 0.1);
  
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-danger-light: rgba(239, 68, 68, 0.1);
  
  --color-info: #3b82f6;
  --color-info-light: rgba(59, 130, 246, 0.1);
  
  /* Backgrounds */
  --color-bg: #0f172a;
  --color-bg-alt: #1e293b;
  --color-bg-card: rgba(255, 255, 255, 0.04);
  --color-card-bg: rgba(255, 255, 255, 0.04);
  --color-surface: rgba(255, 255, 255, 0.06);
  --color-surface-2: rgba(255, 255, 255, 0.08);
  
  /* Borders */
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-hover: rgba(255, 255, 255, 0.2);
  
  /* Text */
  --color-text: rgba(255, 255, 255, 0.92);
  --color-text-secondary: rgba(255, 255, 255, 0.75);
  --color-text-muted: rgba(255, 255, 255, 0.6);
  --color-text-dim: rgba(255, 255, 255, 0.45);
  
  /* Shadows (subtiles, professionnelles) */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.25);
  
  /* Focus ring */
  --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.25);
  
  /* Transitions (standardisées) */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

/* =========================================================
   GLOBAL TYPOGRAPHY (UNIFIED & READABLE)
   ========================================================= */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  font-weight: var(--font-weight-normal);
}

button,
input,
select,
textarea,
label {
  font-family: inherit;
  line-height: inherit;
}

code,
pre,
.monospace {
  font-family: var(--font-family-mono);
}

/* =========================================================
   LOGO STYLES (Transparent PNG)
   ========================================================= */

.logo-header {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease;
}

.logo-header:hover {
  opacity: 0.85;
}

.logo-drawer {
  height: 30px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-drawer-title {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}

/* =========================================================
   LOGIN PAGE LOGO
   ========================================================= */

.login-logo {
  height: 140px;
  width: auto;
  max-width: 420px;
  display: block;
  object-fit: contain;
  margin: 0 auto;
  transition: filter 0.3s ease;
}

.login-logo:hover {
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.2));
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem;
}

.form-container .card {
  max-width: 700px;
  margin: 0 auto 2rem;
}

@media (max-width: 768px) {
  .form-container {
    padding: 0 0.5rem;
  }
  
  .form-container .card {
    max-width: 100%;
  }
}

.mb-2rem {
  margin-bottom: 2rem;
}

.mt-1rem {
  margin-top: 1rem;
}

/* =========================================================
   CARD ENHANCEMENTS
   ========================================================= */

.card {
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.card.card--elevated {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card.card--bordered {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================================================
   TYPOGRAPHY ENHANCEMENTS
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-base);
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--color-text);
}

h1 {
  font-size: 2.25rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.875rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.875rem;
}

h3 {
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
}

h4 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
}

h5, h6 {
  font-size: 1.125rem;
  font-weight: var(--font-weight-medium);
}

/* =========================================================
   INPUT & FORM ENHANCEMENTS
   ========================================================= */

input, textarea, select {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: rgba(0, 0, 0, 0.3);
  color: var(--color-text);
  padding: 0.75rem;
  transition: border-color var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
  font-size: 1rem;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-primary);
  background-color: rgba(0, 0, 0, 0.4);
  box-shadow: var(--focus-ring);
  outline: none;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-family-mono);
}

/* =========================================================
   SECTION & CONTAINER ENHANCEMENTS
   ========================================================= */

.section {
  padding: 2rem;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  color: rgba(255, 255, 255, 0.95);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: 2rem 0;
  border: none;
}

/* =========================================================
   BADGE & LABEL STYLES
   ========================================================= */

.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge.badge-success {
  background-color: var(--color-success-light);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.3);
}

.badge.badge-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  border-color: rgba(245, 158, 11, 0.3);
}

.badge.badge-danger {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

/* =========================================================
   ALERT & NOTICE ENHANCEMENTS
   ========================================================= */

.alert {
  border-left: 4px solid;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  background-color: rgba(0, 0, 0, 0.2);
}

.alert-success {
  border-left-color: var(--color-success);
  background-color: var(--color-success-light);
  color: #a7f3d0;
}

.alert-warning {
  border-left-color: var(--color-warning);
  background-color: var(--color-warning-light);
  color: #fcd34d;
}

.alert-danger {
  border-left-color: var(--color-danger);
  background-color: var(--color-danger-light);
  color: #fca5a5;
}

.alert-info {
  border-left-color: var(--color-info);
  background-color: var(--color-info-light);
  color: #bfdbfe;
}

/* =========================================================
   TABLE ENHANCEMENTS
   ========================================================= */

table {
  width: 100%;
  border-collapse: collapse;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
}

table thead {
  background-color: rgba(0, 0, 0, 0.3);
}

table th {
  padding: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
}

table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.08);
}

/* =========================================================
   DESKTOP TABLE SIZING & PROPORTIONS
   ========================================================= */

/* Ensure table containers don't exceed viewport */
.table-wrap,
.table-wrapper,
.card .table-wrap,
.card .table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fallback: cards containing tables directly (without wrapper) */
.card:has(> table),
.ds-card:has(> table) {
  overflow-x: auto;
}

/* Main content area table overflow protection */
.main-content {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.main-content > .card,
.page-equipements,
.page-cta {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Visual hint for scrollable tables */
.table-wrap::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.table-wrap::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 4px;
}

.table-wrap::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.6);
}

/* Desktop: intelligent table layout */
@media (min-width: 1025px) {
  /* Prevent tables from exceeding container */
  table {
    table-layout: auto;
    max-width: 100%;
  }
  
  /* Large tables with many columns: enable horizontal scroll */
  table.data-table-interventions,
  table[data-no-cards="1"]:not(.compact),
  table[data-columns-count="8"],
  table[data-columns-count="9"],
  table[data-columns-count="10"] {
    min-width: 1200px;
  }
  
  /* Medium tables: comfortable fit */
  table.data-table:not(.compact):not([data-no-cards="1"]),
  table[data-columns-count="6"],
  table[data-columns-count="7"] {
    min-width: 900px;
  }
  
  /* Compact tables: no forced min-width */
  table.compact,
  table[data-columns-count="3"],
  table[data-columns-count="4"],
  table[data-columns-count="5"] {
    min-width: auto;
    max-width: 100%;
  }
  
  /* Prevent ANY table from exceeding its container */
  table {
    max-width: 100% !important;
  }
  
  /* Column width optimization for common patterns */
  table th:first-child,
  table td:first-child {
    width: 80px;
    max-width: 100px;
    white-space: nowrap;
  }
  
  /* ID/Number columns */
  table th[data-col="id"],
  table td[data-col="id"],
  table th:has(.mono),
  table td.mono {
    width: 60px;
    min-width: 60px;
    max-width: 80px;
  }
  
  /* Action columns */
  table th[data-col="action"],
  table td[data-col="action"],
  table th[data-col="actions"],
  table td[data-col="actions"] {
    width: 120px;
    min-width: 100px;
    white-space: nowrap;
    text-align: right;
  }
  
  /* Badge/Status columns */
  table th[data-col="statut"],
  table td[data-col="statut"],
  table th[data-col="priorite"],
  table td[data-col="priorite"],
  table th[data-col="critique"],
  table td[data-col="critique"] {
    width: 130px;
    min-width: 110px;
  }
  
  /* Date columns */
  table th[data-col*="date"],
  table td[data-col*="date"] {
    width: 140px;
    min-width: 120px;
    white-space: nowrap;
  }
  
  /* Description/Text columns - allow expansion */
  table th[data-col="description"],
  table td[data-col="description"],
  table th[data-col="nom"],
  table td[data-col="nom"] {
    min-width: 200px;
    max-width: 400px;
  }
  
  /* Intervention description - special handling */
  table.data-table-interventions td[data-col="description"] {
    max-width: 300px;
  }
  
  table.data-table-interventions td[data-col="description"] .intervention-desc {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
  }
  
  /* Service/Location columns */
  table th[data-col="service"],
  table td[data-col="service"],
  table th[data-col="localisation"],
  table td[data-col="localisation"],
  table th[data-col="lieu"],
  table td[data-col="lieu"] {
    width: 150px;
    min-width: 120px;
    max-width: 200px;
  }
}

/* Wider desktop: more breathing room */
@media (min-width: 1440px) {
  table th,
  table td {
    padding: 1rem 1.25rem;
  }
  
  /* Allow more expansion for text columns */
  table th[data-col="description"],
  table td[data-col="description"] {
    max-width: 500px;
  }
}

/* Ultra-wide screens: maximum comfort */
@media (min-width: 1920px) {
  /* Increase min-widths for better use of space */
  table.data-table-interventions,
  table[data-no-cards="1"]:not(.compact) {
    min-width: 1400px;
  }
  
  table th[data-col="description"],
  table td[data-col="description"] {
    max-width: 600px;
  }
  
  table th[data-col="service"],
  table td[data-col="service"],
  table th[data-col="localisation"],
  table td[data-col="localisation"] {
    max-width: 250px;
  }
}

/* Prevent content overflow in cells */
table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

table td > div,
table td > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Table cell forms and selects */
table td select,
table td .form-control {
  min-width: 100px;
  max-width: 100%;
}

table td select.form-control-sm {
  min-width: 90px;
  font-size: 0.85rem;
}

/* Ensure inline forms in tables don't break layout */
table td form,
table td .inline-form {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

/* Badge spacing in tables */
table td .badge {
  white-space: nowrap;
}

/* Equipment name with serial number stacking */
table td .equipment-name {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

table td .equipment-serial {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Location info stacking */
table td .location-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Brand/model inline display */
table td .brand-model {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

table td .brand-model .brand {
  font-weight: 600;
}

table td .brand-model .model {
  opacity: 0.8;
}

/* =========================================================
   LIST ENHANCEMENTS
   ========================================================= */

ul, ol {
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

ul li, ol li {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
}

ul li strong, ol li strong {
  color: rgba(255, 255, 255, 0.95);
}

/* =========================================================
   LINK ENHANCEMENTS
   ========================================================= */

a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
  border-bottom: 1px solid transparent;
}

a:hover {
  color: #2563eb;
  border-bottom-color: #3b82f6;
}

a.text-muted {
  color: rgba(255, 255, 255, 0.6);
}

a.text-muted:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* =========================================================
   SPACING UTILITIES (expanded)
   ========================================================= */

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* =========================================================
   DISPLAY & VISIBILITY UTILITIES
   ========================================================= */

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

.visibility-hidden { visibility: hidden; }
.invisible { opacity: 0; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-justify { text-align: justify; }

/* =========================================================
   FLEX UTILITIES
   ========================================================= */

.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

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

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* =========================================================
   OPACITY & COLOR UTILITIES
   ========================================================= */

.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

.text-muted { color: rgba(255, 255, 255, 0.6); }
.text-secondary { color: rgba(255, 255, 255, 0.75); }
.text-light { color: rgba(255, 255, 255, 0.95); }
.text-white { color: white; }

.bg-dark { background-color: rgba(0, 0, 0, 0.5); }
.bg-darker { background-color: rgba(0, 0, 0, 0.7); }

/* =========================================================
   BORDER & SHADOW UTILITIES
   ========================================================= */

.rounded { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.border { border: 1px solid rgba(255, 255, 255, 0.1); }
.border-t { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.border-b { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.border-l { border-left: 1px solid rgba(255, 255, 255, 0.1); }
.border-r { border-right: 1px solid rgba(255, 255, 255, 0.1); }

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade { animation: fadeIn 0.3s ease; }
.animate-slide-up { animation: slideInUp 0.4s ease; }
.animate-slide-down { animation: slideInDown 0.4s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* =========================================================
   RESPONSIVE UTILITIES
   ========================================================= */

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
  
  .p-tablet-1 { padding: 0.5rem; }
  .p-tablet-2 { padding: 1rem; }
  
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .hide-sm { display: none !important; }
  .show-sm { display: block !important; }
  
  .p-mobile { padding: 0.5rem; }
  
  .text-sm-center { text-align: center; }
  
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1rem; }
}

/* =========================================================
   PROFESSIONAL FORM LAYOUTS
   ========================================================= */

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.form-inline {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-inline .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 200px;
}

/* =========================================================
   BUTTON GROUPS & ACTIONS
   ========================================================= */

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1.5rem 0;
}

.btn-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.btn-group-right {
  justify-content: flex-end;
}

.btn-group-center {
  justify-content: center;
}

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

@media (max-width: 768px) {
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group > * {
    width: 100%;
  }
  
  .btn-group-vertical {
    width: 100%;
  }
}

/* =========================================================
   IMPROVED BUTTON STYLES (CANONICAL - NO TRANSFORM)
   ========================================================= */

.btn, button, input[type="submit"], input[type="button"], a.btn {
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  border: none !important;
  cursor: pointer !important;
  text-decoration: none !important;
  outline: none !important;
  min-height: 36px !important;
  transition: background-color var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-fast), border-color var(--transition-base) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  white-space: nowrap !important;
  appearance: none !important;
  transform: none !important;
}

.btn:hover {
  box-shadow: var(--shadow-md);
  filter: brightness(1.05);
}

.btn:active {
  opacity: 0.92;
  filter: brightness(0.95);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary, .btn-primary:visited {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.btn-success:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-ghost {
  background-color: transparent;
  color: #3b82f6;
  border: 2px solid #3b82f6;
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  background-color: rgba(59, 130, 246, 0.1);
}

.btn-xs {
  padding: 0.375rem 0.625rem !important;
  font-size: 0.8rem !important;
  min-height: 28px !important;
  border-radius: var(--radius-sm) !important;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 36px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  min-height: 50px;
}

.btn-block, .btn-full {
  width: 100%;
}

.btn-icon {
  padding: 0.75rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

/* =========================================================
   IMPROVED CARD LAYOUTS
   ========================================================= */

.card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-slow);
  position: relative;
}

.card.interactive:hover {
  box-shadow: var(--shadow-xl);
}

.card.compact {
  padding: 1rem;
}

.card.comfortable {
  padding: 2rem;
}

.card-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}

.card-subtitle {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 400;
}

.card-body {
  padding: 1.5rem 0;
}

.card-footer {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .card-grid-2 {
    grid-template-columns: 1fr;
  }
  
  .card.comfortable {
    padding: 1.5rem;
  }
  
  .card-footer {
    flex-direction: column;
    justify-content: stretch;
  }
  
  .card-footer > * {
    width: 100%;
  }
}

/* =========================================================
   UNIFIED SPACING SYSTEM
   ========================================================= */

:root {
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
}

.space-xs { margin: var(--space-xs); }
.space-sm { margin: var(--space-sm); }
.space-md { margin: var(--space-md); }
.space-lg { margin: var(--space-lg); }
.space-xl { margin: var(--space-xl); }

.py-xs { padding: var(--space-xs) 0; }
.py-sm { padding: var(--space-sm) 0; }
.py-md { padding: var(--space-md) 0; }
.py-lg { padding: var(--space-lg) 0; }
.py-xl { padding: var(--space-xl) 0; }

.px-xs { padding: 0 var(--space-xs); }
.px-sm { padding: 0 var(--space-sm); }
.px-md { padding: 0 var(--space-md); }
.px-lg { padding: 0 var(--space-lg); }
.px-xl { padding: 0 var(--space-xl); }

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* =========================================================
   PROFESSIONAL GRID SYSTEM
   ========================================================= */

.container-fluid {
  width: 100%;
  padding: 0 1.5rem;
  margin: 0 auto;
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
}

.container-md {
  max-width: 768px;
  margin: 0 auto;
}

.container-lg {
  max-width: 1024px;
  margin: 0 auto;
}

.container-xl {
  max-width: 1400px;
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container-fluid { padding: 0 1rem; }
  .grid-cols-4 { grid-template-columns: 1fr; }
  .grid-cols-3 { grid-template-columns: 1fr; }
  .grid-cols-2 { grid-template-columns: 1fr; }
}

/* =========================================================
   IMPROVED INPUT STATES
   ========================================================= */

input, textarea, select {
  position: relative;
}

input:focus, textarea:focus, select:focus {
  position: relative;
  z-index: 1;
}

input::placeholder {
  font-weight: 400;
}

textarea:focus {
  resize: vertical;
}

select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.6)" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 20px;
  padding-right: 2.5rem;
}

/* =========================================================
   TEXT UTILITIES
   ========================================================= */

p {
  margin: 0 0 1rem 0;
  color: var(--color-text-secondary);
}

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* =========================================================
   SECTION LAYOUTS
   ========================================================= */

.section {
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.2);
}

.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  color: rgba(255, 255, 255, 0.95);
}

.section-description {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .section {
    padding: 1.5rem 1rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
}

/* =========================================================
   FOCUS STATES & ACCESSIBILITY
   ========================================================= */

*:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 4px;
  border-radius: 4px;
}

/* =========================================================
   UTILITY ALIGNMENT CLASSES
   ========================================================= */

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.align-top { vertical-align: top; }
.align-middle { vertical-align: middle; }
.align-bottom { vertical-align: bottom; }

/* =========================================================
   PROFESSIONAL LOADING STATES
   ========================================================= */

.loading {
  position: relative;
  opacity: 0.6;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   IMPROVED ALERTS
   ========================================================= */

.alert {
  border-left: 4px solid;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  animation: slideInDown 0.3s ease;
}

.alert.dismissible {
  position: relative;
  padding-right: 2.5rem;
}

.alert-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}

.alert-close:hover {
  opacity: 0.7;
}

.alert-success {
  border-left-color: #10b981;
  background-color: rgba(16, 185, 129, 0.1);
  color: #a7f3d0;
}

.alert-warning {
  border-left-color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
}

.alert-danger {
  border-left-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.alert-info {
  border-left-color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.1);
  color: #bfdbfe;
}

/* =========================================================
   PROFESSIONAL TABLE STYLES
   ========================================================= */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table thead {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

table th {
  padding: 1rem;
  font-weight: 600;
  text-align: left;
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
  white-space: nowrap;
}

table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
}

table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.08);
}

table tbody tr:last-child td {
  border-bottom: none;
}

/* =========================================================
   PAGE TRANSITIONS & ANIMATIONS
   ========================================================= */

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Animate page content on load */
body.page-enter {
  animation: none;
}

main, [role="main"], .main-content {
  animation: none;
}

/* =========================================================
   SMOOTH SCROLL BEHAVIOR (no jump to top)
   ========================================================= */

.smooth-scroll {
  scroll-behavior: smooth;
}

html.no-jump {
  scroll-behavior: auto;
}

/* Prevent scroll to top on form submission */
form {
  position: relative;
}

/* =========================================================
   ACTION BUTTON STATES & FEEDBACK
   ========================================================= */

.btn.submitting,
.btn.loading {
  position: relative;
  opacity: 0.8;
  cursor: wait;
}

/* Flash notification without page jump */
.action-feedback {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background-color: rgba(16, 185, 129, 0.95);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: slideInUp 0.3s ease, slideOutDown 0.3s ease 2.7s forwards;
  z-index: 9000;
}

.action-feedback.error {
  background-color: rgba(239, 68, 68, 0.95);
}

.action-feedback.warning {
  background-color: rgba(245, 158, 11, 0.95);
}

.action-feedback.info {
  background-color: rgba(59, 130, 246, 0.95);
}

@media (max-width: 768px) {
  .action-feedback {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.8rem;
  }
}

/* =========================================================
   FORM ACTION IMPROVEMENTS
   ========================================================= */

form {
  transition: none;
}

form.submitting {
  opacity: 1;
}

/* Preserve scroll position on form submit */
form.preserve-scroll {
  scroll-margin-top: 0;
}

/* Modal/Card focus preservation */
.card.active-form {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3), 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   QUICK ANIMATIONS
   ========================================================= */

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-quick {
  animation: slideInUp 0.3s ease;
}

.animate-shake {
  animation: shake 0.4s ease;
}

/* =========================================================
   ROW HIGHLIGHT ON ACTION
   ========================================================= */

tr.row-selected, tr.active-row {
  background-color: rgba(59, 130, 246, 0.15) !important;
  transition: background-color 0.3s ease;
}

tr.row-deleted {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

/* =========================================================
   MODAL/OVERLAY IMPROVEMENTS
   ========================================================= */

.modal {
  animation: none;
}

.modal.closing {
  animation: none;
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

/* =========================================================
   SCROLLBAR STYLING (hidden but functional)
   ========================================================= */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Firefox scrollbar */
* {
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(0, 0, 0, 0.1);
  scrollbar-width: thin;
}

/* =========================================================
   KEYBOARD NAVIGATION INDICATORS
   ========================================================= */

.btn:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Tab navigation visible indicator */
*:focus-visible {
  box-shadow: inset 0 0 0 2px #3b82f6;
}

/* =========================================================
   FINAL RESPONSIVE POLISH
   ========================================================= */

@media (max-width: 1024px) {
  .hide-lg { display: none !important; }
  .show-lg { display: block !important; }
}

@media (max-width: 768px) {
  .hide-md { display: none !important; }
  .show-md { display: block !important; }
  
  body { font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .hide-sm { display: none !important; }
  .show-sm { display: block !important; }
  
  .btn, button, input[type="submit"], input[type="button"] {
    min-height: 40px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }
  
  .btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
  
  .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* =========================================================
   MODERN UX ENHANCEMENTS (SUBTLE)
   ========================================================= */

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Enhanced card hover (modern depth) */
.card:not(.interactive):hover {
  box-shadow: var(--shadow-lg);
}

.card.card--elevated {
  box-shadow: var(--shadow-md);
}

/* Modern table hover */
table tbody tr {
  transition: background-color var(--transition-fast);
}

/* Smooth link transitions */
a {
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

/* Enhanced focus states (accessibility) */
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Modal backdrop - no blur for better UX on plomberie modules */
.modal-backdrop {
  /* backdrop-filter: blur(4px); -- disabled for plomberie compatibility */
  transition: opacity var(--transition-base);
}

/* Professional loading state */
.loading,
[aria-busy="true"] {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

/* Improved button pressed state */
.btn:active:not(:disabled),
button:active:not(:disabled) {
  transform: scale(0.98);
  transition: transform var(--transition-fast);
}

/* Enhanced badge contrast */
.badge {
  font-weight: 650;
  letter-spacing: 0.02em;
}

/* Modern alert styling */
.alert {
  box-shadow: var(--shadow-sm);
}

/* Subtle card border on hover */
.card {
  border: 1px solid transparent;
  transition: border-color var(--transition-base), box-shadow var(--transition-slow);
}

.card:hover {
  border-color: var(--color-border-hover);
}

/* Professional select dropdown */
select {
  cursor: pointer;
}

select:hover {
  border-color: var(--color-border-hover);
}

/* Input hover state */
input:hover:not(:focus),
textarea:hover:not(:focus) {
  border-color: var(--color-border-hover);
}

/* Modern scrollbar (webkit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Reduced motion support (accessibility) */
@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;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn,
  button,
  input,
  select,
  textarea {
    border-width: 2px;
  }
  
  .card {
    border-width: 2px;
  }
  
  a {
    text-decoration: underline;
  }
}

/* Dark mode optimization (already dark, enhance contrast) */
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Professional print styles */
@media print {
  .btn,
  button,
  .nav-drawer,
  .main-header,
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  
  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
}

/* Enhanced visual hierarchy */
h1 {
  font-weight: 900;
  letter-spacing: -0.02em;
}

h2 {
  font-weight: 800;
  letter-spacing: -0.01em;
}

h3 {
  font-weight: 700;
}

/* Professional spacing consistency */
* + h2 {
  margin-top: var(--sp-xl);
}

* + h3 {
  margin-top: var(--sp-lg);
}

/* Improved list readability */
ul,
ol {
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.375rem;
}

/* Modern code blocks */
code,
pre {
  font-family: var(--font-family-mono);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.375rem;
  font-size: 0.9em;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* END MODERN UX ENHANCEMENTS */


/* BAES: unlock 'Etage' column width (override global first-column clamp) */
body[data-active-page="baes"] table.baes-table th:first-child,
body[data-active-page="baes"] table.baes-table td:first-child{
  width:auto !important; min-width:140px !important; max-width:none !important; white-space:normal !important;
}


/* BAES: medium screens — align density with PCF (BAES only)
   Note: "medium" here covers most laptop/desktop widths where BAES felt too roomy. */
@media (min-width: 700px) and (max-width: 1400px) {
  body[data-active-page="baes"] table.baes-table th,
  body[data-active-page="baes"] table.baes-table td {
    padding: 6px 8px !important;
    line-height: 1.2 !important;
    font-size: 0.92rem !important;
  }
  body[data-active-page="baes"] table.baes-table {
    font-size: 0.92rem !important;
  }
  body[data-active-page="baes"] .table-wrap {
    max-width: 100%;
  }
  body[data-active-page="baes"] .table-wrap > .table-wrap {
    overflow-x: auto;
  }
}


  body[data-active-page="baes"] table.baes-table {
    font-size: 0.95rem;
  }
  body[data-active-page="baes"] .table-wrap {
    max-width: 100%;
  }
  body[data-active-page="baes"] .table-wrap > .table-wrap {
    overflow-x: auto;
  }
}



/* Row clickable (BAES/PCF lists) */
body[data-active-page="baes"] tr[data-href],
body[data-active-page="pcf"] tr[data-href]{
  cursor: pointer;
}
body[data-active-page="baes"] tr[data-href]:hover,
body[data-active-page="pcf"] tr[data-href]:hover{
  background: rgba(255,255,255,0.04);
}

/* UI.CSS BUILD: V3.8 BAES=PCF medium density v1 (2025-12-28) */
