/* ============================================================
   JWL MARKETING — INTRANET GLOBAL CSS
   Design: Premium / Beige / Noir / Or
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --beige:        #F2EDE4;
  --beige-dark:   #E8E0D4;
  --beige-mid:    #D9CFC2;
  --or:           #A8874A;
  --or-light:     #C4A35A;
  --or-dark:      #8A6B35;
  --noir:         #1A1A1A;
  --noir-soft:    #2C2C2C;
  --blanc:        #FFFFFF;
  --gris-light:   #F8F5F0;
  --gris-border:  #E0D8CE;
  --text-primary: #1A1A1A;
  --text-muted:   #7A6E62;
  --text-light:   #A09488;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.12);
  --shadow-or:    0 4px 20px rgba(168,135,74,0.25);

  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;

  --sidebar-w:    240px;
  --header-h:     64px;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --transition:   0.2s ease;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden; /* empêche le scroll horizontal global */
}
body {
  font-family: var(--font-body);
  background: var(--beige);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden; /* empêche le scroll horizontal sur mobile */
  max-width: 100vw;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-body {
  display: flex;
  flex: 1;
  margin-top: var(--header-h);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 36px 40px;
  min-height: calc(100vh - var(--header-h));
  background: var(--beige);
}

/* ── HEADER ─────────────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--noir);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.header-logo .logo-main {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--or);
  letter-spacing: 0.15em;
}
.header-logo .logo-sub {
  font-family: var(--font-body);
  font-size: 0.55rem;
  font-weight: 400;
  color: var(--or-light);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-top: 1px;
}
.header-logo .logo-line {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.header-logo .logo-dash {
  height: 1px;
  width: 20px;
  background: var(--or);
  opacity: 0.6;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  position: relative;
}
.header-user-info {
  text-align: right;
}
.header-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blanc);
}
.header-user-role {
  font-size: 0.72rem;
  color: var(--or-light);
  font-weight: 300;
}
.header-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--or);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--noir);
  overflow: hidden;
  border: 2px solid var(--or-dark);
  flex-shrink: 0;
}
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }

.header-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--blanc);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  overflow: hidden;
  display: none;
  z-index: 200;
}
.header-dropdown.open { display: block; }
.header-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: background var(--transition);
}
.header-dropdown a:hover { background: var(--gris-light); }
.header-dropdown a.logout { color: #c0392b; border-top: 1px solid var(--gris-border); }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: var(--blanc);
  border-right: 1px solid var(--gris-border);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 50;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: all var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}
.sidebar-nav li a:hover {
  color: var(--text-primary);
  background: var(--gris-light);
  border-left-color: var(--beige-mid);
}
.sidebar-nav li a.active {
  color: var(--text-primary);
  background: var(--noir);
  border-left-color: var(--or);
  font-weight: 500;
}
.sidebar-nav li a.active .nav-icon { color: var(--or); }
.nav-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--or);
  color: var(--noir);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── PAGE HEADER ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.page-title { font-size: 1.65rem; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 3px; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--or);
  color: var(--blanc);
  border-color: var(--or);
  box-shadow: var(--shadow-or);
}
.btn-primary:hover {
  background: var(--or-dark);
  border-color: var(--or-dark);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--blanc);
  color: var(--text-primary);
  border-color: var(--gris-border);
}
.btn-secondary:hover { background: var(--gris-light); }
.btn-dark {
  background: var(--noir);
  color: var(--blanc);
}
.btn-dark:hover { background: var(--noir-soft); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gris-border);
  background: var(--blanc);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--gris-light); color: var(--text-primary); }

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--blanc);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gris-border);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-icon { color: var(--or); font-size: 1.1rem; }

/* ── DASHBOARD GRID ──────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.dashboard-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.dash-card {
  background: var(--blanc);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.dash-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--beige-mid);
}
.dash-card-icon {
  font-size: 2rem;
  color: var(--or);
  margin-bottom: 12px;
  display: block;
}
.dash-card-icon.dark { color: var(--noir); }
.dash-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.dash-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── TABLE ───────────────────────────────────────────────────── */
.table-wrapper {
  background: var(--blanc);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  padding: 13px 18px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--gris-light);
  border-bottom: 1px solid var(--gris-border);
}
.data-table td {
  padding: 14px 18px;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--gris-border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gris-light); }

/* Client avatar circle */
.client-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--or);
  color: var(--blanc);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  margin-right: 10px;
  flex-shrink: 0;
  vertical-align: middle;
}
.client-avatar.teal   { background: #5B8FA8; }
.client-avatar.purple { background: #7B6EA6; }
.client-avatar.green  { background: #6A9E6E; }

/* ── STATUS BADGES ───────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.status-active  { background: #E8F5E9; color: #2E7D32; }
.status-active::before  { background: #4CAF50; }
.status-pending { background: #FFF3E0; color: #E65100; }
.status-pending::before { background: #FF9800; }
.status-done    { background: #FAFAFA; color: #616161; }
.status-done::before    { background: #9E9E9E; }

/* ── FORM ELEMENTS ───────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-sm);
  background: var(--blanc);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(168,135,74,0.12);
}
.form-control::placeholder { color: var(--text-light); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237A6E62' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Checkbox custom */
.checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
}
.checkbox-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--or);
  cursor: pointer;
}

/* ── SEARCH BAR ──────────────────────────────────────────────── */
.search-bar {
  position: relative;
  flex: 1;
}
.search-bar input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-sm);
  background: var(--blanc);
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}
.search-bar input:focus { border-color: var(--or); }
.search-bar::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  pointer-events: none;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

/* ── PAGINATION ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--gris-border);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--gris-border);
  border-radius: 4px;
  background: var(--blanc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}
.pagination-btn:hover { background: var(--gris-light); }
.pagination-btn.active {
  background: var(--or);
  color: var(--blanc);
  border-color: var(--or);
}

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  display: none;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--blanc);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gris-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  border: none;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--gris-border); }

/* ── ALERTS / NOTIFICATIONS ──────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.alert-error   { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.alert-info    { background: #E3F2FD; color: #1565C0; border: 1px solid #BBDEFB; }

/* ── TWO-COLUMN FORM LAYOUT ──────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.section-block {
  background: var(--gris-light);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}
.section-block-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-block-title .icon { color: var(--or); }

/* ── BREADCRUMB ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--or); }
.breadcrumb-sep { color: var(--text-light); }

/* ── INFO ROW ────────────────────────────────────────────────── */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gris-border);
  font-size: 0.875rem;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); min-width: 140px; flex-shrink: 0; }
.info-value { color: var(--text-primary); font-weight: 500; }
.info-value.highlight { color: var(--or-dark); }

/* ── FILE ITEM ───────────────────────────────────────────────── */
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--gris-light);
  border: 1px solid var(--gris-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.file-icon { font-size: 1.4rem; flex-shrink: 0; }
.file-info { flex: 1; }
.file-name { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.file-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── MESSAGERIE ──────────────────────────────────────────────── */
.msg-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}
.msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
}
.msg-bubble.sent {
  align-self: flex-end;
  background: var(--noir);
  color: var(--blanc);
  border-radius: 12px 12px 2px 12px;
}
.msg-bubble.received {
  align-self: flex-start;
  background: var(--blanc);
  color: var(--text-primary);
  border: 1px solid var(--gris-border);
  border-radius: 12px 12px 12px 2px;
}
.msg-time { font-size: 0.7rem; opacity: 0.6; margin-top: 4px; text-align: right; }

/* ── UTILITY ─────────────────────────────────────────────────── */
.text-or    { color: var(--or); }
.text-muted { color: var(--text-muted); }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }
.mt-4       { margin-top: 4px; }
.mt-8       { margin-top: 8px; }
.mt-16      { margin-top: 16px; }
.mt-24      { margin-top: 24px; }
.gap-12     { gap: 12px; }
.flex       { display: flex; }
.flex-ac    { display: flex; align-items: center; }
.flex-sb    { display: flex; align-items: center; justify-content: space-between; }
.w-100      { width: 100%; }

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--beige-mid); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--or-light); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — JWL INTRANET
   Breakpoints : 900px (tablette), 600px (mobile)
   ══════════════════════════════════════════════════════════════ */

/* ── BURGER BUTTON (caché sur desktop) ────────────────────────── */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 201;
  flex-shrink: 0;
}
.burger-btn span {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--or-light);
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.28s ease, width 0.28s ease;
}
.burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; width: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 149;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ── TABLETTE (≤ 900px) ────────────────────────────────────────── */
@media (max-width: 900px) {

  /* Layout */
  .main-content {
    margin-left: 0;
    padding: 24px 20px;
  }

  /* Sidebar en drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 150;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Header : afficher burger */
  .burger-btn { display: flex; }

  /* Grilles */
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .clients-grid { grid-template-columns: 1fr; }

  /* Tableaux : scroll horizontal */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }
  table { min-width: 600px; }

  /* Cards */
  .card { padding: 20px; }
  .stat-card { padding: 18px 16px; }

  /* Page header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-header-actions .btn { flex: 1; min-width: 120px; justify-content: center; }

  /* Messagerie */
  .msg-list { max-height: 320px; }
  .msg-bubble { max-width: 85%; }
  .chat-interlocutors { flex-direction: column; gap: 8px; }
  .chat-interlocutor-card { width: 100%; }
}

/* ── MOBILE (≤ 600px) ─────────────────────────────────────────── */
@media (max-width: 600px) {

  /* Header compact */
  .app-header {
    padding: 0 16px;
    gap: 8px;
  }
  .header-logo .logo-main { font-size: 1.35rem; }
  .header-logo .logo-sub { font-size: 0.48rem; letter-spacing: .3em; }
  .header-user-info { display: none; } /* Masquer texte nom/rôle, garder avatar */
  .header-actions-desktop { gap: 10px; }

  /* Main content */
  .main-content {
    padding: 16px 14px;
    padding-bottom: 90px; /* espace pour bottom nav */
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
  }
  .app-body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .app-wrapper {
    overflow-x: hidden;
  }

  /* Sidebar pleine largeur sur mobile */
  .sidebar {
    width: 100%;
    max-width: 300px;
  }

  /* Grilles 1 colonne */
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .clients-grid { grid-template-columns: 1fr; }

  /* Stat cards compactes */
  .stat-card { padding: 14px 12px; }
  .stat-card .stat-value { font-size: 1.6rem; }
  .stat-card .stat-icon { width: 36px; height: 36px; }
  .stat-card .stat-icon svg { width: 18px; height: 18px; }

  /* Titres de page */
  .page-title { font-size: 1.4rem; }
  .page-subtitle { font-size: 0.8rem; }

  /* Tableaux */
  table { min-width: 520px; font-size: 0.82rem; }
  th, td { padding: 10px 12px; }

  /* Formulaires */
  .form-section { padding: 20px 16px; }
  .form-section-title { font-size: 0.8rem; }
  .form-group label { font-size: 0.8rem; }
  input, select, textarea {
    font-size: 16px; /* évite le zoom iOS au focus */
    padding: 10px 12px;
  }

  /* Boutons */
  .btn { padding: 10px 16px; font-size: 0.82rem; }
  .btn-lg { padding: 12px 20px; font-size: 0.9rem; }

  /* Cards et modals */
  .card { padding: 16px 14px; border-radius: var(--radius-md); }
  .modal-box { padding: 20px 16px; margin: 0 12px; border-radius: var(--radius-lg); }

  /* Client profile header */
  .client-profile-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Messagerie mobile */
  .msg-list { max-height: 280px; }
  .msg-input-area { gap: 8px; }
  .msg-input-area input { font-size: 16px; }
  .msg-bubble { max-width: 90%; font-size: 0.82rem; }

  /* Espace personnel / dashboard */
  .welcome-banner { padding: 20px 16px; }
  .welcome-banner h2 { font-size: 1.3rem; }
  .welcome-banner p { font-size: 0.85rem; }

  /* Factures / Documents : liste compacte */
  .doc-item, .invoice-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .doc-item-actions, .invoice-item-actions {
    width: 100%;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }

  /* Badge notification dans nav */
  .nav-badge { font-size: .58rem; padding: 1px 5px; }

  /* ── BOTTOM NAV MOBILE ──────────────────────────────────────── */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--noir);
    border-top: 1px solid rgba(168,135,74,0.25);
    z-index: 120;
    align-items: stretch;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  }
  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: color var(--transition);
    position: relative;
    padding: 6px 4px;
  }
  .bottom-nav a svg { width: 20px; height: 20px; stroke: currentColor; }
  .bottom-nav a.active,
  .bottom-nav a:hover { color: var(--or); }
  .bottom-nav a .bnav-badge {
    position: absolute;
    top: 8px;
    right: calc(50% - 18px);
    background: var(--or);
    color: var(--noir);
    font-size: .55rem;
    font-weight: 700;
    width: 14px; height: 14px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
  }
}

/* ── TRÈS PETIT MOBILE (≤ 380px) ──────────────────────────────── */
@media (max-width: 380px) {
  .app-header { padding: 0 12px; }
  .main-content { padding: 12px 10px; padding-bottom: 90px; }
  .stats-grid { grid-template-columns: 1fr; }
  .btn { padding: 9px 12px; font-size: 0.78rem; }
  table { font-size: 0.78rem; }
  th, td { padding: 8px 10px; }
}

/* ── BOTTOM SHEET (menu "Plus" mobile) ────────────────────────── */
.bottom-sheet {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--blanc);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 90px;
  z-index: 300;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
}
.bottom-sheet.open {
  display: block;
  transform: translateY(0);
}
.bottom-sheet-handle {
  width: 36px; height: 4px;
  background: var(--beige-mid);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.bottom-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.bottom-sheet-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--gris-light);
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  text-align: center;
  transition: background var(--transition), transform var(--transition);
  border: 1px solid var(--gris-border);
}
.bottom-sheet-grid a span { font-size: 1.3rem; }
.bottom-sheet-grid a:hover { background: var(--beige-dark); transform: scale(0.97); }
.bottom-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 290;
}
.bottom-sheet-overlay.open { display: block; }

/* ── SIDEBAR DOWNLOAD WIDGET ─────────────────────────────────── */
.sidebar-download-widget {
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--blanc);
  border-top: 1px solid var(--gris-border);
  padding: 14px 16px;
  margin-top: auto;
  box-sizing: border-box;
  z-index: 10;
}
/* Pour que la sidebar soit flex column et le widget colle en bas */
.sidebar {
  display: flex !important;
  flex-direction: column;
  overflow-y: auto;
}
/* Push widget to bottom */
.sidebar > ul:first-of-type,
.sidebar > div:first-of-type,
nav.sidebar > ul:first-of-type {
  /* les items au-dessus prennent l'espace dispo */
}
.sidebar-download-widget {
  margin-top: auto;
}

.sdw-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sdw-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sdw-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  font-size: .72rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  line-height: 1.2;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.sdw-btn-available {
  background: var(--noir);
  color: var(--blanc);
  border: 1.5px solid var(--noir);
}
.sdw-btn-available:hover {
  background: #333;
  color: var(--blanc);
}

.sdw-btn-unavailable {
  background: var(--gris-light);
  color: var(--text-muted);
  border: 1.5px solid var(--gris-border);
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  cursor: default;
}

.sdw-nodispo {
  font-size: .63rem;
  color: #b0b0b0;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sdw-manage-link {
  display: block;
  text-align: center;
  margin-top: 9px;
  font-size: .68rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.sdw-manage-link:hover {
  color: var(--or);
}
