:root {
  --bg: #F8FAFC;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #ea580c;
  --warning-light: #ffedd5;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --secondary: #64748b;
  --nav-height: 48px;
}

/* Pull-to-refresh indicator - Safari style */
.pull-to-refresh {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  z-index: 9999;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 0;
}
.pull-to-refresh.visible {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}
.pull-to-refresh-spinner {
  width: 28px;
  height: 28px;
  position: relative;
}
.pull-to-refresh-spinner svg {
  width: 100%;
  height: 100%;
}
.pull-to-refresh-spinner line {
  stroke-linecap: round;
  stroke-width: 3;
  transition: opacity 0.08s ease-out;
}
.pull-to-refresh-spinner.loading {
  animation: spinner-rotate 0.8s linear infinite;
}
@keyframes spinner-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
* , *::before, *::after { box-sizing: border-box; }
html { height: 100%; overflow: hidden; background: #fff; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  margin: 0;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  line-height: 1.5;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
@media (min-width: 769px) { body { padding-top: 64px; } }
.wrap {
  flex: 1 1 0%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  min-height: 0;
}
.wrap.wrap-fixed {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card.card-fixed {
  flex: 1 1 0%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
h1 { font-size: 26px; margin: 0 0 16px; font-weight: 600; line-height: 1.3; }
h2 { font-size: 20px; margin: 20px 0 12px; font-weight: 600; line-height: 1.3; }
label { display: block; font-size: 16px; margin: 12px 0 6px; color: var(--text); font-weight: 500; }
input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  font-size: 17px;
  font-family: inherit;
  line-height: 1.5;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #cfd5e3;
  background: #fff;
  box-sizing: border-box;
}
input[type="date"], input[type="time"], input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 48px;
  height: 48px;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value {
  text-align: left;
  min-width: 0;
  font-size: 16px;
  line-height: 1.4;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(43, 108, 176, 0.2);
  border-color: var(--primary);
}
.btn { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-row { display:flex; gap:10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 140px; }
.btn-row form { flex: 1; margin: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-light { background: #edf2f7; color: var(--text); border-color: var(--border); }
.btn.loading { opacity: 0.7; cursor: wait; }
.btn.loading .icon { animation: spin 1s linear infinite; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.list { display:flex; flex-direction:column; gap:8px; }
.list-item { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; background:#fff; border:1px solid var(--border); padding:10px 12px; border-radius:10px; }
.list-main { flex:1; min-width:0; }
.list-title-row { display:flex; align-items:center; gap:8px; }
.list-title-row .btn { margin-left: auto; }
.list-title { font-size:16px; font-weight:700; color:var(--text); }
.list-meta { font-size:14px; color:var(--muted); margin-top:2px; }
.list-actions { display:flex; gap:8px; align-items:center; flex-wrap: wrap; flex-shrink: 0; }
.list-actions.stack-buttons { flex-direction: column; align-items: stretch; gap: 6px; }
.list-actions.stack-buttons .btn { width: 100%; min-width: 84px; }
.badge { display:inline-flex; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:700; background:#edf2f7; color:var(--text); }
.badge.success { background:#c6f6d5; color:#22543d; }
.badge.warning { background:#fbd38d; color:#7b341e; }
.badge.info { background:#bee3f8; color:#2a4365; }
.toast { padding: 10px; border-radius: 10px; margin-bottom: 8px; font-size: 15px; }
.toast.success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.toast.error { background: #fff5f5; color: #9b2c2c; border: 1px solid #fed7d7; }
.toast.warning { background: #fefcbf; color: #744210; border: 1px solid #faf089; }
.toast.info { background: #ebf8ff; color: #2a4365; border: 1px solid #bee3f8; }
.error { background: #fff5f5; border: 1px solid #fed7d7; color: #9b2c2c; padding: 12px; border-radius: 10px; margin-bottom: 12px; font-size: 15px; }
.hint { font-size: 14px; color: var(--muted); margin-top: 10px; }
.pagination { display:flex; gap:6px; margin-top:14px; flex-wrap: wrap; justify-content: center; align-items: center; flex-shrink: 0; padding: 8px 0; }
.page-link { padding:10px 14px; border-radius:10px; border:1px solid var(--border); text-decoration:none; color:var(--text); background:#fff; font-size:14px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; transition: all 0.15s ease; }
.page-link:active { transform: scale(0.95); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.checkbox-row { display:flex; align-items:center; gap:10px; margin: 10px 0; font-size:16px; }
.checkbox-row input { width: auto; }
.form-search { margin-bottom: 10px; }
.form-actions { margin-top: 12px; }
.form-search .form-actions { margin-top: 8px; }
.page-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom: 10px; flex-wrap: wrap; }
.page-header .btn { margin-left: auto; }
.page-header h1 { margin: 0; }
.page-header .btn { white-space: nowrap; }
.autocomplete { position: relative; }
.autocomplete-list { position:absolute; top:100%; left:0; right:0; background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12); margin-top:6px; z-index: 30; display:none; max-height: 220px; overflow-y: auto; }
.autocomplete-list.show { display:block; }
.autocomplete-item { width:100%; border:0; background:transparent; text-align:left; padding:10px 12px; font-size:14px; color:var(--text); cursor:pointer; display:block; }
.autocomplete-item + .autocomplete-item { border-top:1px solid var(--border); }
.autocomplete-item:hover, .autocomplete-item:focus { background:#edf2f7; outline: none; }
.list-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta.compact { font-size: 13px; }
.list-title.compact { font-size: 15px; }
.list-item.stack-actions { flex-direction: column; }
.list-item.stack-actions .list-actions { width: 100%; justify-content: flex-start; }
.list-item.keep-actions .list-actions { flex-wrap: nowrap; }
.list-item.keep-actions .list-actions .btn { flex: 0 0 auto; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 36px; }
.input-suffix span { position:absolute; right:12px; top:50%; transform:translateY(-50%); color: var(--muted); font-weight: 600; }
.icon { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; }
.icon svg { width:18px; height:18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-sm .icon svg { width: 16px; height: 16px; }
.section { margin-top: 14px; }
.action-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.action-grid .btn { width: 100%; white-space: normal; }
.action-grid form { margin: 0; }
.action-wide { grid-column: 1 / -1; }
.action-icon { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:8px; background: rgba(255,255,255,0.22); font-size: 11px; font-weight: 700; letter-spacing: 0.5px; }
.report-grid { display:grid; gap:10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card { background:#f8fafc; border:1px solid var(--border); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:6px; }
.stat-title { font-size:13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; }
.stat-value { font-size:20px; font-weight: 800; color: var(--text); }
.stat-sub { font-size:13px; color: var(--muted); }
.filter-row { display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.filter-row label { margin: 0; font-size: 14px; color: var(--muted); }
.filter-row select { width: auto; min-width: 140px; }
.export-list { align-items: center; gap: 10px; }
.export-group { display:flex; align-items:center; gap:6px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: #fff; }
.export-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); font-weight: 700; }
.export-group .btn { padding: 6px 8px; font-size: 12px; border-radius: 8px; }
.btn-ghost { background: transparent; border-color: var(--border); }
.reports-section { margin-top: 14px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); padding: 8px 0; border-bottom: 1px solid var(--border); }
.report-table td { padding: 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.report-table tr:last-child td { border-bottom: 0; }
.report-table.activity td { padding: 12px 20px 14px 0; }
.report-table.activity td:last-child { padding-right: 0; }
.report-table.activity .bar-track { margin-top: 8px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .report-table { min-width: 520px; }
.table-scroll .report-table th,
.table-scroll .report-table td { white-space: nowrap; }
.table-scroll.compact .report-table { min-width: 420px; }
.bar-track { width: 100%; max-width: 180px; height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; display: block; }
.bar-fill { height: 100%; display: block; }
.bar-fill.stays { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.bar-fill.nights { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-fill.revenue { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-value { font-size: 12px; color: var(--muted); margin-top: 6px; }
.status-row { display:flex; gap:8px; flex-wrap: wrap; }
.report-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.report-card h3 { margin: 0 0 10px; font-size: 16px; }
.pill { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; background:#edf2f7; color: var(--text); font-size: 12px; font-weight: 600; }
.pill.success { background:#c6f6d5; color:#22543d; }
.pill.warning { background:#fbd38d; color:#7b341e; }
.pill.info { background:#bee3f8; color:#2a4365; }
.monthly-activity { display:flex; flex-direction: column; gap: 8px; }
.month-item { border: 1px solid var(--border); border-radius: 10px; background: #fff; transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.month-item[open] { background: #f8fafc; }
.month-summary { display:flex; align-items:center; gap: 10px; cursor: pointer; list-style: none; padding: 8px 10px; border-radius: 10px; background: #f8fafc; transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.month-item[open] .month-summary { background: #eef2f7; }
.month-summary::-webkit-details-marker { display: none; }
.month-name { font-size: 14px; font-weight: 700; text-transform: capitalize; flex: 0 0 68px; }
.month-metrics { flex: 1; display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
.month-metric { display:flex; flex-direction: column; gap: 4px; min-width: 0; }
.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.metric-value { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-metric .bar-track { height: 6px; margin-top: 4px; }
.month-toggle { display:flex; align-items:center; gap:6px; font-size: 12px; color: var(--muted); font-weight: 600; margin-left: auto; }
.month-toggle-icon { display:inline-flex; transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.month-item[open] .month-toggle-icon { transform: rotate(180deg); }
.month-details { 
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid transparent;
}
.month-item[open] .month-details { 
  grid-template-rows: 1fr;
  border-top-color: var(--border);
  margin-top: 4px;
}
.month-details > div {
  overflow: hidden;
  padding: 0 10px;
}
.month-item[open] .month-details > div {
  padding: 8px 10px 10px;
}
.month-list { list-style: none; margin: 0; padding: 0; display:flex; flex-direction: column; gap: 6px; }
.month-contract { display:flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); background: #fff; border: 1px solid var(--border); padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.month-contract:hover { background: #edf2f7; }
.contract-id { font-weight: 700; color: var(--muted); }
.contract-client { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contract-dates { color: var(--muted); font-size: 12px; white-space: nowrap; }
.contract-nights, .contract-total { font-weight: 600; white-space: nowrap; }
.tax-grid { display:grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tax-item { background:#f8fafc; border:1px solid var(--border); border-radius:10px; padding:10px; display:flex; flex-direction:column; gap:6px; }
.bar-fill.stays { background: linear-gradient(90deg, #3b82f6, #60a5fa) !important; }
.bar-fill.nights { background: linear-gradient(90deg, #10b981, #34d399) !important; }
.bar-fill.revenue { background: linear-gradient(90deg, #f59e0b, #fbbf24) !important; }
.inline-list { display:flex; flex-wrap: wrap; gap:8px; }
.muted { color: var(--muted); }
@media (min-width: 680px) {
  .report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  
  .wrap { 
    padding: 14px 14px 24px; 
    max-width: 900px;
  }
  
  .card { 
    padding: 18px; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    margin-bottom: 16px;
  }
  
  /* Restore desktop typography */
  body { font-size: 18px; }
  h1 { font-size: 24px; margin: 0 0 16px; }
  h2 { font-size: 20px; margin: 20px 0 12px; }
  h3 { font-size: 18px; margin: 16px 0 8px; }
  label { font-size: 16px; margin: 12px 0 6px; }
  
  /* Restore desktop forms */
  input, select, textarea {
    font-size: 16px;
    padding: 14px 16px;
    border-radius: 8px;
  }
  
  /* Restore desktop buttons */
  .btn {
    font-size: 16px;
    padding: 12px 16px;
    border-radius: 8px;
  }
  
  /* Restore desktop reports */
  .reports-section { margin-top: 16px !important; }
  .report-card { padding: 18px !important; border-radius: 12px !important; }
  .monthly-activity { gap: 8px !important; }
  .month-item { border-radius: 8px !important; margin-bottom: 4px !important; }
  .month-summary { 
    padding: 12px 16px !important; 
    font-size: 14px !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
  }
  .month-metrics {
    flex: 1 !important;
    flex-direction: row !important;
    gap: 16px !important;
  }
  .month-metric {
    min-width: 0 !important;
    justify-content: flex-start !important;
  }
  .bar-track { 
    width: 100% !important;
    max-width: none !important; 
    height: 8px !important; 
  }
  .month-toggle {
    margin-left: auto !important;
  }
  .month-details {
    padding: 16px 18px !important;
  }
  .month-list li {
    padding: 12px 0 !important;
    margin-bottom: 8px !important;
  }
  .month-contract {
    font-size: 14px !important;
    padding: 12px 16px !important;
  }
}
@media (max-width: 600px) {
  .wrap { 
    padding: 8px 6px calc(var(--nav-height) + env(safe-area-inset-bottom, 0px)); 
    max-width: 100%;
  }
  
  /* Cards plus compactes */
  .card { 
    padding: 12px 14px; 
    border-radius: 8px; 
    box-shadow: none; 
    margin-bottom: 8px;
  }
  
  /* Mobile reports styles for 481-600px range */
  .month-summary { 
    padding: 6px 4px !important; 
    font-size: 16px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 3px !important;
  }
  
  .month-metrics {
    width: 100% !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
  
  .month-toggle {
    align-self: flex-start !important;
    margin-left: auto !important;
    margin-top: -4px !important;
  }
  
  /* Typographie mobile optimisée */
  body { font-size: 17px; } /* Un peu plus petit mais lisible */
  h1 { font-size: 22px; margin: 0 0 12px; }
  h2 { font-size: 18px; margin: 16px 0 8px; }
  h3 { font-size: 16px; margin: 12px 0 6px; }
  label { font-size: 15px; margin: 8px 0 4px; }
  
  /* Formulaires mobile */
  input, select, textarea {
    font-size: 16px; /* iOS zoom prevention */
    padding: 12px 14px;
    border-radius: 8px;
  }
  
  /* Boutons mobile */
  .btn {
    font-size: 15px;
    padding: 10px 14px;
    min-height: 44px; /* Touch target iOS */
    border-radius: 8px;
  }
  
  .btn-sm {
    font-size: 13px;
    padding: 8px 12px;
    min-height: 36px;
  }
  
  /* Grid optimisée */
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-title { font-size: 12px; }
  .stat-value { font-size: 18px; }
  .stat-sub { font-size: 11px; }
  
  /* Sections compactes */
  .reports-section { margin-top: 6px; }
  .report-card { padding: 8px; border-radius: 8px; }
  
  /* Export optimisé */
  .export-group { padding: 6px 8px; margin-bottom: 6px; }
  .export-group .btn { padding: 8px 10px; font-size: 13px; }
  .export-label { font-size: 12px; }
  .report-table.stack thead { display: none; }
  .report-table.stack, .report-table.stack tbody, .report-table.stack tr {
    display: block;
    width: 100%;
  }
  .report-table.stack tr {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
  .report-table.stack td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    border: 0;
    padding: 4px 0;
    white-space: normal;
  }
  .report-table.stack td:last-child { padding-bottom: 0; }
  .report-table.stack td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 110px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--muted);
  }
  .table-scroll { margin: 0 -6px; padding: 0 6px; }
  .table-scroll.compact .report-table { min-width: 360px; }
  .report-table.activity td { padding: 10px 0 12px; }
  .report-table.activity .bar-track { margin-top: 6px; }
  .month-item { padding: 0; }
  .month-summary { gap: 8px; padding: 8px; }
  .month-name { flex-basis: 58px; font-size: 13px; }
  .month-metrics { gap: 8px; }
  .metric-value { font-size: 12px; }
  .tax-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-contract { flex-wrap: wrap; gap: 6px 10px; }
  .contract-total { margin-left: auto; }
  .list-item { flex-direction: column; }
  .list-actions { width: 100%; justify-content: flex-start; }
  .list-actions .btn { flex: 1 1 auto; }
  .list-actions { margin-top: 8px; }
  .list-item.keep-actions { flex-direction: row !important; align-items: flex-start !important; }
  .list-item.keep-actions .list-actions { width: auto; margin-top: 0; margin-left: auto; }
  .list-item.keep-actions .list-actions .btn { flex: 0 0 auto; }
}
@media (max-width: 480px) {
  .list-item.keep-actions .btn-sm { padding: 6px 8px; font-size: 12px; }
  .list-item.keep-actions .btn-sm .icon { width: 14px; height: 14px; }
  .list-item.keep-actions .btn-sm .icon svg { width: 14px; height: 14px; }
  
  .wrap { padding: 6px 4px calc(var(--nav-height) + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 8px 10px; margin-bottom: 4px; }
  
  /* Rapports mobile optimisé */
  .monthly-activity { gap: 2px; }
  .month-item { border-radius: 6px; margin-bottom: 1px; }
  .month-summary { 
    padding: 8px 6px !important; 
    font-size: 16px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    position: relative !important;
  }
  
  .month-name {
    font-size: 15px !important;
    font-weight: 700 !important;
  }
  
  .month-metrics {
    width: 100% !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
  
  .month-metric {
    width: 100%;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
  }
  
  .bar-track { 
    width: 98% !important;
    max-width: none !important;
    height: 7px !important;
  }
  
  .metric-label {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }
  
  .metric-value {
    font-size: 15px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }
  
  .month-summary .month-toggle {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
  }
  
  /* Tableaux mobiles */
  .report-table.stack td { padding: 4px 0; font-size: 14px; }
  .report-table.stack td:before { 
    font-size: 12px; 
    font-weight: 600;
    margin-bottom: 1px;
  }
  
  /* Optimisation détails réservations */
  .month-details {
    padding: 10px 8px !important;
  }
  .month-list {
    margin: 0;
    padding: 0;
  }
  .month-list li {
    padding: 8px 0;
    margin-bottom: 3px;
    border-bottom: 1px solid #f1f5f9;
  }
  .month-contract {
    font-size: 13px;
    padding: 8px 8px;
  }
  .contract-client {
    font-weight: 600;
    margin-bottom: 3px;
  }
  .contract-dates {
    font-size: 12px;
    color: var(--muted);
  }
}

@media (max-width: 360px) {
  .action-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .month-summary { font-size: 13px; }
  .metric-label { font-size: 12px; }
  .metric-value { font-size: 14px; }
}

/* iPhone 16 Pro and modern iPhones specific */
@media only screen 
  and (device-width: 393px) 
  and (device-height: 852px) 
  and (-webkit-device-pixel-ratio: 3) {
  .month-summary { 
    padding: 6px 4px !important; 
    font-size: 16px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 3px !important;
  }
  
  .month-metrics {
    width: 100% !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
  
  .month-toggle {
    align-self: flex-start !important;
    margin-left: auto !important;
    margin-top: -4px !important;
  }
}

/* ============================================
   BOTTOM NAVIGATION (Mobile/Tablet)
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: -35px;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 0px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0px);
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 16px;
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  transition: color 0.15s ease;
  height: var(--nav-height);
  box-sizing: border-box;
}
.nav-item.active { color: var(--primary); }
.nav-item .nav-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-item .nav-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 4px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  z-index: 999;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fab:hover { transform: scale(1.05); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5); }
.fab:active { transform: scale(0.95); }
.fab svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* FAB Menu */
.fab-menu {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 4px + 56px + 10px);
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.2s ease;
}
.fab-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.fab-menu-item .icon { width: 20px; height: 20px; color: var(--primary); }
.fab-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 997;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.fab-overlay.open { opacity: 1; visibility: visible; }

/* ============================================
   TOP NAVIGATION (Desktop)
   ============================================ */
.top-nav { display: none; }
@media (min-width: 769px) {
  .wrap { padding: 14px 14px 24px; }
  .bottom-nav, .fab, .fab-menu, .fab-overlay { display: none; }
  .top-nav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 0 24px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  .top-nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }
  .top-nav-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
  }
  .top-nav-links { 
    display: flex; 
    gap: 8px; 
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  .top-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.15s ease;
  }
  .top-nav-link:hover { background: #f8fafc; color: var(--text); }
  .top-nav-link.active { background: var(--primary-light); color: var(--primary); }
  .top-nav-link .icon { width: 18px; height: 18px; }
  .top-nav-actions { 
    display: flex; 
    gap: 10px; 
    align-items: center;
    margin-left: auto;
  }
}

/* ============================================
   CONTRACT TIMELINE
   ============================================ */
.contract-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
}
.timeline-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.timeline-step.completed:not(:last-child)::after { background: var(--primary); }
.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 0.2s ease;
}
.timeline-step.completed .timeline-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.timeline-step.current .timeline-dot { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.timeline-dot svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; }
.timeline-label { margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.timeline-step.completed .timeline-label, .timeline-step.current .timeline-label { color: var(--primary); }

/* ============================================
   DASHBOARD HOME
   ============================================ */
.dashboard-greeting { margin-bottom: 24px; }
.dashboard-greeting h1 { font-size: 28px; font-weight: 700; margin: 0 0 4px; }
.dashboard-greeting .subtitle { font-size: 15px; color: var(--muted); }
.dashboard-stat-highlight {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--primary-light);
  border-radius: 12px;
  margin-bottom: 20px;
}
.dashboard-stat-highlight .stat-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.dashboard-stat-highlight .stat-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.dashboard-stat-highlight .stat-content { flex: 1; }
.dashboard-stat-highlight .stat-value { font-size: 24px; font-weight: 700; color: var(--primary); }
.dashboard-stat-highlight .stat-label { font-size: 14px; color: var(--text); }
.dashboard-section { margin-bottom: 24px; }
.dashboard-section h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.dashboard-section h2 .icon { color: var(--muted); }
.upcoming-list { display: flex; flex-direction: column; gap: 8px; }
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s ease;
}
.upcoming-item:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
.upcoming-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  background: var(--primary-light);
  border-radius: 8px;
  min-width: 56px;
}
.upcoming-date .day { font-size: 20px; font-weight: 700; color: var(--primary); line-height: 1; }
.upcoming-date .month { font-size: 11px; font-weight: 600; color: var(--primary); text-transform: uppercase; }
.upcoming-info { flex: 1; min-width: 0; }
.upcoming-client { font-weight: 600; font-size: 15px; }
.upcoming-details { font-size: 13px; color: var(--muted); }

/* Hide "nouveau" buttons on mobile - use FAB instead */
@media (max-width: 768px) {
  .btn-nouveau, .page-header .btn-primary { display: none !important; }
}

/* Page header */
.page-header-with-back {
  margin-bottom: 16px;
  padding-top: 20px;
}
.page-header-with-back h1 { margin: 0; line-height: 1.2; }

/* Add top padding to all h1 titles */
h1 { padding-top: 20px; }
.card > h1:first-child { padding-top: 20px; }

/* Card list item - modern style like upcoming arrivals */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s ease;
}
.card-item:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); border-color: #cbd5e1; }
.card-item:active { transform: scale(0.995); }
.card-item-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 14px;
  background: var(--primary-light);
  border-radius: 10px;
  min-width: 60px;
}
.card-item-date .day { font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1; }
.card-item-date .month { font-size: 11px; font-weight: 600; color: var(--primary); text-transform: uppercase; margin-top: 2px; }
.card-item-date .year { font-size: 10px; font-weight: 500; color: var(--primary); opacity: 0.7; }
.card-item-content { flex: 1; min-width: 0; }
.card-item-title { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.card-item-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.card-item-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.card-item-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-item-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.card-item-badge.draft { background: #f1f5f9; color: #64748b; }
.card-item-badge.sent { background: #fef3c7; color: #d97706; }
.card-item-badge.validated { background: #dcfce7; color: #16a34a; }

/* Client card avatar */
.card-item-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
