/* ============================================================================
   BATAYCOK OS — feuille de style partagee
   (espace tatoueur + espace client)
   Charte : noir & blanc strict, aucune couleur, jamais d'arrondi.
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }
/* filet de sécurité anti-scroll horizontal : quel que soit l'élément qui
   déborderait (bouton trop large, ligne non prévue pour le mobile...), la
   page elle-même ne doit jamais pouvoir défiler horizontalement. */
html, body { overflow-x: hidden; }
html, body { margin: 0; padding: 0; height: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
/* filet de sécurité : nos icônes SVG n'ont pas de width/height propres (seulement
   un viewBox) — sans cette règle, un svg oublié dans un contexte sans style dédié
   peut s'étirer à la taille de son conteneur. Les règles plus spécifiques
   (.btn svg, .prep-list svg, etc.) prennent le dessus grâce à leur spécificité. */
svg { width: 16px; height: 16px; flex-shrink: 0; }
fieldset { border: none; margin: 0; padding: 0; }

:root {
  --white:      #FFFFFF;
  --paper:      #FFFFFF;
  --paper-2:    #F4F4F2;
  --paper-3:    #E9E9E6;
  --black:      #0D0D0C;

  --ink:        var(--black);
  --ink-60:     rgba(13,13,12,0.62);
  --ink-40:     rgba(13,13,12,0.42);
  --ink-15:     rgba(13,13,12,0.13);
  --ink-08:     rgba(13,13,12,0.07);
  --surface:    var(--white);
  --surface-2:  var(--paper-2);
  --border:     rgba(13,13,12,0.16);
  --border-2:   rgba(13,13,12,0.10);

  /* anciennes teintes rouge/jaune/bleu remplacées par des intensités de gris —
     le seul contraste qui compte est celui entre l'encre et le papier */
  --strong-bg:  var(--ink);
  --strong-fg:  var(--white);
  --mid-bg:     var(--ink-08);
  --soft-bg:    rgba(13,13,12,0.045);

  --radius-s:   0px;
  --radius-m:   0px;
  --radius-l:   0px;
  --radius-full: 0px;

  --shadow-soft: 0 1px 0 rgba(13,13,12,0.08);
  --shadow-modal: 0 18px 44px rgba(13,13,12,0.22);

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:  'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-w: 264px;
  --topbar-h: 72px;
  --bottomnav-h: 64px;
}

body {
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; font-style: italic; margin: 0 0 6px; color: var(--ink); }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
h4 { font-size: 16px; }
p { margin: 0 0 10px; }

.label-mono { font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-60); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Boutons & champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-m); border: 1px solid transparent; padding: 11px 18px; font-size: 13.5px; font-weight: 500; line-height: 1.2; min-height: 42px; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: #262624; }
/* accent = motif "double cadre" du fichier de marque : un liseré blanc puis noir, sans couleur */
.btn-accent { background: var(--ink); color: var(--white); box-shadow: 0 0 0 3px var(--white), 0 0 0 4px var(--ink); }
.btn-accent:hover { background: #262624; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: var(--ink-08); }
.btn-ghost { background: transparent; color: var(--ink-60); border-color: transparent; padding: 8px 12px; min-height: 36px; }
.btn-ghost:hover { background: var(--ink-08); color: var(--ink); }
.btn-danger { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-danger:hover { background: var(--ink); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 7px 13px; font-size: 12.5px; }
.btn-icon { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: var(--radius-full); background: transparent; border: 1px solid var(--border); color: var(--ink); }
.btn-icon:hover { background: var(--ink-08); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-60); }
.field input, .field textarea, .field select { border: 1px solid var(--border); border-radius: var(--radius-s); padding: 11px 13px; background: var(--white); font-size: 14.5px; color: var(--ink); width: 100%; }
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-hint { font-size: 12px; color: var(--ink-40); }
.required-mark { color: var(--ink); font-weight: 600; }
.field-error { font-size: 12.5px; color: var(--ink); font-weight: 500; margin: -8px 0 14px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; padding: 6px 11px; border-radius: var(--radius-full); font-weight: 500; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; background: currentColor; flex-shrink: 0; }
/* fort — nouvelle demande, contrôle à prévoir : noir plein */
.badge-rouge { background: var(--strong-bg); color: var(--strong-fg); }
/* attention — acompte en attente, préparation, cicatrisation : contour tireté */
.badge-jaune { background: transparent; color: var(--ink); border: 1px dashed var(--ink-40); }
/* confirmé — accepté, acompte payé, rdv confirmé, terminé : gris clair */
.badge-bleu  { background: var(--mid-bg); color: var(--ink); }
/* réalisé : contour plein */
.badge-noir  { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
/* neutre — archivé */
.badge-gris  { background: transparent; color: var(--ink-40); border: 1px solid var(--border-2); }

.pill-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--ink); color: var(--white); font-size: 11px; font-weight: 700; font-family: var(--sans); }

/* Ecran de connexion */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 24px; }
.auth-box { width: 380px; max-width: 100%; background: var(--surface-2); border-radius: var(--radius-l); padding: 34px 30px; }
.auth-box .logo-mark { width: 44px; height: 44px; border-radius: var(--radius-s); background: var(--ink); color: var(--white); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-size: 23px; margin-bottom: 16px; }
.auth-box .sub { color: var(--ink-60); font-size: 13.5px; margin-bottom: 22px; }

/* Structure generale — shell tatoueur */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; min-height: 100vh; }
.sidebar { grid-row: 1 / 3; grid-column: 1; background: var(--ink); color: var(--white); display: flex; flex-direction: column; padding: 26px 18px; position: sticky; top: 0; height: 100vh; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 26px; }
.sidebar-logo .logo-mark { width: 38px; height: 38px; border-radius: var(--radius-s); background: var(--white); color: var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-size: 21px; font-weight: 500; }
.sidebar-logo .logo-text { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.1; color: var(--white); }
.sidebar-logo .logo-sub { font-family: var(--mono); font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.5); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav .nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: var(--radius-s); color: rgba(255,255,255,0.72); font-size: 14px; font-weight: 400; background: transparent; border: none; width: 100%; text-align: left; }
.sidebar-nav .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.sidebar-nav .nav-item.active { background: var(--white); color: var(--ink); font-weight: 500; }
.sidebar-nav .nav-item.active svg { opacity: 1; }
.sidebar-nav .nav-item .pill-count { margin-left: auto; background: var(--white); color: var(--ink); }
.sidebar-nav .nav-item.active .pill-count { background: var(--ink); color: var(--white); }

.sidebar-foot { border-top: 1px solid rgba(255,255,255,0.14); padding-top: 16px; margin-top: 12px; }
.sidebar-foot .studio-line { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.42); line-height: 1.7; }

.topbar { grid-row: 1; grid-column: 2; background: var(--surface-2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.topbar-search { flex: 1; max-width: 420px; position: relative; }
.topbar-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-40); }
.topbar-search input { width: 100%; border: 1px solid var(--border); background: var(--white); border-radius: var(--radius-full); padding: 10px 14px 10px 38px; font-size: 13.5px; }
.topbar-search input:focus { border-color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-mode-toggle { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 8px 14px; background: var(--white); }
.notif-wrap { position: relative; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; background: var(--ink); border: 2px solid var(--surface-2); }
.profile-chip { display: flex; align-items: center; gap: 9px; padding: 6px 10px 6px 6px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--white); }
.profile-chip .avatar { width: 30px; height: 30px; border-radius: var(--radius-full); background: var(--ink); color: var(--white); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-size: 15px; }
.profile-chip .who { display: flex; flex-direction: column; line-height: 1.2; }
.profile-chip .who strong { font-size: 12.5px; font-weight: 500; }
.profile-chip .who span { font-size: 10.5px; color: var(--ink-40); }

.main-content { grid-row: 2; grid-column: 2; padding: 30px 32px 90px; overflow-y: auto; }
.view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view-header .eyebrow { display: block; margin-bottom: 4px; }

.bottom-nav { display: none; }

.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 32px; }
.stat-card { background: var(--white); border: 1px solid var(--border-2); border-radius: var(--radius-m); padding: 18px 16px; }
.stat-card .stat-value { font-family: var(--serif); font-style: italic; font-size: 32px; font-weight: 500; line-height: 1; margin-bottom: 8px; color: var(--ink); }
/* fort — signal prioritaire : trait plein sous la valeur au lieu d'une couleur */
.stat-card.accent-rouge { border-bottom: 2px solid var(--ink); }
.stat-card.accent-jaune .stat-value { color: var(--ink-60); }
.stat-card.accent-bleu .stat-value { color: var(--ink); }
.stat-card .stat-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60); }

.section-title-row { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 14px; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { background: var(--white); border: 1px solid var(--border-2); border-radius: var(--radius-m); padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.project-card:hover { border-color: var(--ink); box-shadow: var(--shadow-soft); }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.project-card-client { display: flex; align-items: center; gap: 10px; }
.project-card-client .avatar { width: 38px; height: 38px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-size: 17px; flex-shrink: 0; border: 1px solid var(--border-2); }
.project-card-client .names { line-height: 1.25; }
.project-card-client .names strong { display: block; font-size: 15px; font-weight: 500; }
.project-card-client .names span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ink-40); text-transform: uppercase; }
.project-card-formula { font-size: 13px; color: var(--ink-60); }
.project-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; border-top: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2); padding: 12px 0; }
.project-card-meta .meta-item { display: flex; flex-direction: column; gap: 2px; }
.project-card-meta .meta-item .k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-40); }
.project-card-meta .meta-item .v { font-size: 13px; font-weight: 500; }
.project-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.unread-indicator { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-60); }

.project-header { background: var(--white); border: 1px solid var(--border-2); border-radius: var(--radius-l); padding: 22px 24px; margin-bottom: 20px; }
.project-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.project-header-id { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-40); text-transform: uppercase; }
.project-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.project-header-meta { display: flex; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.project-header-meta .meta-item .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-40); display: block; margin-bottom: 3px; }
.project-header-meta .meta-item .v { font-size: 14px; font-weight: 500; }
.readonly-flag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-40); background: var(--ink-08); padding: 6px 12px; border-radius: var(--radius-full); margin-top: 14px; }
.readonly-flag svg { width: 13px; height: 13px; }

.status-select-wrap { position: relative; display: inline-block; }
.status-select { appearance: none; -webkit-appearance: none; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--white); padding: 9px 32px 9px 14px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.status-select-wrap svg { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; pointer-events: none; }

.tabs-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tabs-nav .tab-btn { background: transparent; border: none; padding: 12px 16px; font-size: 13.5px; font-weight: 500; color: var(--ink-60); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs-nav .tab-btn:hover { color: var(--ink); }
.tabs-nav .tab-btn.active { color: var(--ink); border-bottom-color: var(--ink); }

.panel-card { background: var(--white); border: 1px solid var(--border-2); border-radius: var(--radius-m); padding: 20px; }

.discussion-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.chat-panel { background: var(--white); border: 1px solid var(--border-2); border-radius: var(--radius-m); display: flex; flex-direction: column; height: 62vh; min-height: 440px; }
/* dans l'espace client, le panneau de discussion occupe tout l'espace restant : pas de scroll de page, seule la liste de messages défile */
.client-tab-content .chat-panel { flex: 1 1 auto; height: auto; min-height: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.chat-day-sep { text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-40); margin: 6px 0; }
.msg-row { display: flex; }
.msg-row.from-client { justify-content: flex-start; }
.msg-row.from-tatoueur { justify-content: flex-end; }
.msg-row.from-system { justify-content: center; }
.msg-bubble { max-width: 70%; padding: 11px 14px; border-radius: var(--radius-m); font-size: 13.5px; line-height: 1.55; }
.msg-row.from-client .msg-bubble { background: var(--surface-2); border: 1px solid var(--border-2); }
.msg-row.from-tatoueur .msg-bubble { background: var(--ink); color: var(--white); }
.msg-row.from-system .msg-bubble { background: var(--ink-08); color: var(--ink-60); font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; border-radius: var(--radius-full); padding: 8px 16px; }
.msg-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 10.5px; }
.msg-row.from-client .msg-meta { color: var(--ink-40); }
.msg-row.from-tatoueur .msg-meta { color: rgba(255,255,255,0.55); justify-content: flex-end; }
.msg-unread-dot { width: 6px; height: 6px; background: var(--ink); display: inline-block; }
.msg-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-attach-chip { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.5); border: 1px solid var(--border-2); border-radius: var(--radius-s); padding: 6px 9px; font-size: 11.5px; }
.msg-row.from-tatoueur .msg-attach-chip { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); color: var(--white); }
.msg-attach-chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.msg-attach-img { width: 160px; height: 120px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--border-2); margin-top: 8px; display: block; cursor: pointer; }

.composer { border-top: 1px solid var(--border-2); padding: 12px 14px; }
.composer-readonly { padding: 16px; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-40); display: flex; align-items: center; justify-content: center; gap: 6px; }
.composer-readonly svg { width: 14px; height: 14px; }
.composer-pending { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.composer-pending .pending-chip { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-s); padding: 5px 8px; font-size: 11.5px; }
.composer-pending .pending-chip button { background: none; border: none; color: var(--ink-40); display: flex; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer-row textarea { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-m); padding: 10px 13px; resize: none; min-height: 44px; max-height: 120px; font-size: 13.5px; }
.composer-row textarea:focus { border-color: var(--ink); }
.composer-tools { display: flex; gap: 4px; }
.composer-suggest-wrap { position: relative; }
.suggest-popover { position: absolute; bottom: 46px; right: 0; width: 280px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-m); box-shadow: var(--shadow-modal); padding: 10px; z-index: 30; }
.suggest-popover .suggest-item { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 10px 10px; border-radius: var(--radius-s); font-size: 12.5px; line-height: 1.5; }
.suggest-popover .suggest-item:hover { background: var(--surface-2); }
.suggest-popover .suggest-item .tag { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60); margin-bottom: 3px; }

.summary-card { border: 1px solid var(--border-2); border-radius: var(--radius-m); padding: 16px; background: var(--surface-2); }
.summary-card h4 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; }
.summary-row { padding: 9px 0; border-bottom: 1px solid var(--border-2); }
.summary-row:last-of-type { border-bottom: none; }
.summary-row .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60); display: block; margin-bottom: 3px; }
.summary-row .v { font-size: 13px; }
.summary-updated { font-size: 11px; color: var(--ink-40); margin-top: 10px; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 22px; }
.info-item .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-40); display: block; margin-bottom: 5px; }
.info-item .v { font-size: 14.5px; font-weight: 500; }
.info-item.full { grid-column: 1 / -1; }
.internal-notes-box { margin-top: 24px; border: 1px dashed var(--ink); background: var(--ink-08); border-radius: var(--radius-m); padding: 16px 18px; }
.internal-notes-box .flag { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); margin-bottom: 8px; font-weight: 500; }
.internal-notes-box .flag svg { width: 13px; height: 13px; }

.file-category { margin-bottom: 28px; }
.file-category h4 { display: flex; align-items: center; gap: 8px; }
.file-category .count { font-family: var(--mono); font-size: 10.5px; color: var(--ink-40); font-style: normal; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 12px; }
.file-tile { border: 1px solid var(--border-2); border-radius: var(--radius-m); overflow: hidden; background: var(--surface-2); }
.file-tile a.thumb-link { display: block; }
.file-tile .thumb { height: 96px; display: flex; align-items: center; justify-content: center; background: var(--paper-3); color: var(--ink-40); overflow: hidden; }
.file-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-tile .thumb svg { width: 26px; height: 26px; }
.file-tile .fname { font-size: 11px; padding: 8px 9px; word-break: break-word; }
.add-file-tile { border: 1px dashed var(--border); border-radius: var(--radius-m); height: 100%; min-height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-40); font-size: 11.5px; cursor: pointer; text-align: center; padding: 10px; }
.add-file-tile:hover { border-color: var(--ink); color: var(--ink); }
.hidden-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.rdv-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.rdv-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; margin-bottom: 20px; }
.prep-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.prep-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.prep-list svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--ink); }

.timeline { display: flex; flex-direction: column; }
.timeline-step { display: flex; gap: 14px; position: relative; padding-bottom: 26px; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step .dot-col { display: flex; flex-direction: column; align-items: center; }
.timeline-step .dot { width: 22px; height: 22px; border-radius: var(--radius-full); border: 2px solid var(--border); background: var(--white); display: flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; }
.timeline-step.done .dot { background: var(--ink); border-color: var(--ink); color: var(--white); }
.timeline-step .dot svg { width: 12px; height: 12px; }
.timeline-step .line { width: 2px; flex: 1; background: var(--border); margin-top: 2px; }
.timeline-step.done .line { background: var(--ink); }
.timeline-step .content { padding-top: 2px; }
.timeline-step .content strong { display: block; font-size: 14px; font-weight: 500; }
.timeline-step .content span { font-size: 12px; color: var(--ink-40); }
.timeline-step:not(.done) .content strong { color: var(--ink-40); font-weight: 400; }

.overlay-scrim { position: fixed; inset: 0; background: rgba(13,13,12,0.5); z-index: 90; display: flex; justify-content: flex-end; animation: fadeIn 0.15s ease; }
.drawer { width: 460px; max-width: 92vw; height: 100%; background: var(--surface-2); overflow-y: auto; padding: 26px 26px 40px; animation: slideIn 0.2s ease; }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.fieldset-title { margin: 22px 0 12px; }

.modal-scrim { position: fixed; inset: 0; background: rgba(13,13,12,0.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.15s ease; }
.modal-box { background: var(--white); border-radius: var(--radius-l); box-shadow: var(--shadow-modal); width: 480px; max-width: 100%; max-height: 88vh; overflow-y: auto; padding: 26px; }
.modal-box.wide { width: 560px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.copy-row { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-s); padding: 10px 12px; margin: 10px 0; }
.copy-row code { flex: 1; font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.email-preview { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-m); padding: 16px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; margin: 12px 0; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0; }
.status-line svg { width: 16px; height: 16px; }
.status-ok { color: var(--ink); }
.status-warn { color: var(--ink); font-style: italic; }

.notif-panel { position: absolute; top: 58px; right: 28px; width: 340px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-m); box-shadow: var(--shadow-modal); z-index: 40; max-height: 420px; overflow-y: auto; }
.notif-panel-head { padding: 14px 16px; border-bottom: 1px solid var(--border-2); display: flex; justify-content: space-between; align-items: center; }
.notif-item { display: flex; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border-2); background: transparent; width: 100%; text-align: left; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--ink-08); }
.notif-item .icn { width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink-60); }
.notif-item .icn svg { width: 15px; height: 15px; }
.notif-item .txt p { margin: 0; font-size: 12.5px; line-height: 1.5; }
.notif-item .txt span { font-size: 10.5px; color: var(--ink-40); }

#toast-region { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--white); padding: 12px 20px; border-radius: var(--radius-full); font-size: 13px; box-shadow: var(--shadow-modal); display: flex; align-items: center; gap: 8px; animation: toastIn 0.2s ease; }
.toast svg { width: 15px; height: 15px; color: var(--white); flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.client-shell { height: 100vh; background: var(--surface-2); display: flex; flex-direction: column; overflow: hidden; }
.client-topbar { flex: 0 0 auto; background: var(--ink); color: var(--white); padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 20; }
.client-topbar .brand { display: flex; align-items: center; gap: 10px; }
.client-topbar .brand .logo-mark { width: 32px; height: 32px; border-radius: var(--radius-s); background: var(--white); color: var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-size: 17px; }
.client-topbar .brand-text { font-family: var(--serif); font-style: italic; font-size: 16px; }
.secure-flag { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.secure-flag svg { width: 12px; height: 12px; }
.client-content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; max-width: 880px; width: 100%; margin: 0 auto; padding: 18px 20px 16px; }
.client-project-head { flex: 0 0 auto; background: var(--white); border: 1px solid var(--border-2); border-radius: var(--radius-l); padding: 16px 20px; margin-bottom: 14px; }
.client-tabs { flex: 0 0 auto; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.client-tab-content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.client-locked { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; background: var(--ink); color: var(--white); }
.client-locked .box { max-width: 380px; }
.client-locked .box svg { width: 34px; height: 34px; margin-bottom: 14px; color: var(--white); }

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-8 { display: flex; gap: 8px; align-items: center; }
.flex-gap-12 { display: flex; gap: 12px; align-items: center; }
.muted { color: var(--ink-60); }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-40); }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 12px; opacity: 0.6; }
.divider { height: 1px; background: var(--border-2); margin: 20px 0; border: none; }
.loading-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--ink-40); font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .discussion-layout { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .rdv-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr; }
  .sidebar { display: none; }
  .main-content { grid-column: 1; padding: 18px 16px 100px; max-width: 100vw; overflow-x: hidden; }
  .topbar { grid-column: 1; padding: 0 10px; gap: 6px; }
  .topbar-search { display: none; }
  .topbar-search.mobile-open { display: block; position: fixed; top: var(--topbar-h); left: 0; right: 0; max-width: none; background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--border); z-index: 25; }
  /* La barre du haut ne doit jamais forcer un débordement horizontal de toute
     la page : sur mobile, chaque contrôle passe en icône seule (texte masqué). */
  .topbar-actions { gap: 6px; }
  .topbar-mode-toggle span, .topbar-actions .btn-accent span { display: none; }
  .topbar-mode-toggle { padding: 8px 10px; }
  .topbar-actions .btn-accent { padding: 0; width: 40px; height: 40px; }
  .profile-chip { padding: 6px; }
  .profile-chip .who { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card-meta { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; max-width: 100%; }
  .modal-box { width: 100%; }

  /* Navigation basse sans scroll : icônes seules, réparties sur toute la
     largeur (flex:1) — les 7 sections restent toutes visibles d'un coup,
     jamais besoin de faire défiler la barre elle-même. */
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottomnav-h); background: var(--ink); z-index: 50; border-top: 1px solid rgba(255,255,255,0.1); }
  .bottom-nav .nav-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: transparent; border: none; color: rgba(255,255,255,0.55); font-size: 9.5px; font-family: var(--mono); letter-spacing: 0.04em; position: relative; padding: 0 2px; }
  .bottom-nav .nav-item span:not(.pill-count) { display: none; }
  .bottom-nav .nav-item svg { width: 20px; height: 20px; }
  .bottom-nav .nav-item.active { color: var(--white); }
  .bottom-nav .nav-item .pill-count { position: absolute; top: 2px; right: 22%; min-width: 15px; height: 15px; font-size: 9px; background: var(--white); color: var(--ink); }
  .notif-panel { right: 14px; width: calc(100vw - 28px); }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .msg-bubble { max-width: 84%; }
  .project-header-actions { width: 100%; }
  .project-header-actions .btn { flex: 1; }
}
