:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1c2530;
  --ink-soft: #3a4654;
  --muted: #6b7783;
  --border: #dde3e9;
  --primary: #d9642a;
  --primary-dark: #b64f1d;
  --accent: #2c5f8a;
  --warn-bg: #fff4e5;
  --warn-border: #f0b96b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.app-header {
  padding: 18px 20px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header h1 { margin: 0; font-size: 22px; }
.home-link { color: #b9c2cc; text-decoration: none; font-size: 14px; }
.home-link:hover { color: #fff; }

/* ---- Menu deroulant ---- */
.menu-wrap { position: relative; }
.menu-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.menu-btn:hover { background: rgba(255, 255, 255, 0.18); }
.menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  min-width: 210px;
  padding: 6px;
  z-index: 500;
  display: flex;
  flex-direction: column;
}
.menu-dropdown.hidden { display: none; }
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 6px;
  text-decoration: none;
}
.menu-item:hover { background: #f3f6f9; color: var(--primary-dark); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.app-brand { display: flex; align-items: center; gap: 12px; }
.app-logo { width: 40px; height: 40px; display: block; }
.app-brand h1 { margin: 0; font-size: 20px; }
.app-brand .tagline { color: var(--primary); }

/* ---- Nouveau devis : intro + etapes ---- */
.page-intro { text-align: center; padding: 26px 16px 6px; }
.page-intro-title { margin: 0 0 6px; font-size: 26px; }
.page-intro-sub { margin: 0; color: var(--muted); font-size: 15px; }

.step-card { box-shadow: none; }
.card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.card-head h2 { margin: 0; font-size: 18px; }
.card-hint { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.step-badge {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Zone de depot des photos */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 34px 20px;
  border: 2px dashed #e0b79f;
  border-radius: 14px;
  background: #fdf7f3;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
  margin: 0;
}
.dropzone:hover { border-color: var(--primary); background: #fbeee5; }
.dropzone.dragover { border-color: var(--primary); background: #f9e5d7; transform: scale(1.01); }
.dropzone-icon { font-size: 38px; line-height: 1; }
.dropzone-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); }
.dropzone-sub { font-size: 13px; }

/* Bouton d'analyse */
.btn-analyze {
  width: 100%;
  margin-top: 4px;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}
.btn-analyze:hover { background: var(--primary-dark); }
.btn-analyze:active { transform: translateY(1px); }
.btn-analyze:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.btn-analyze-icon { margin-right: 4px; }
.tagline { margin: 2px 0 0; font-size: 13px; color: #b9c2cc; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  background: var(--ink);
}
.tab-btn {
  border: none;
  background: transparent;
  color: #b9c2cc;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}
.tab-btn.active { background: var(--bg); color: var(--ink); font-weight: 600; }

main { max-width: 820px; margin: 0 auto; padding: 16px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 14px; font-size: 17px; }
.card h3 { margin: 0 0 8px; font-size: 14px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
input, textarea, select {
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.form-grid, .client-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.file-label {
  display: inline-block;
  padding: 10px 16px;
  border: 2px dashed var(--primary);
  border-radius: 8px;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.photo-thumb-wrap { position: relative; }
.photo-thumb {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.btn-primary, .btn-secondary {
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary { background: #eef1f4; color: var(--ink); }
.btn-secondary:hover { background: #e2e7ec; }

.status { margin: 10px 0 0; font-size: 13px; color: var(--muted); min-height: 18px; }
.status.error { color: #c0392b; }
.muted { color: var(--muted); }
.hidden { display: none; }

.result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.badge {
  background: var(--accent);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  text-transform: capitalize;
}
.resume { margin: 0; font-size: 14px; color: var(--muted); flex: 1; min-width: 200px; }

.notice {
  background: #eef4f9;
  border: 1px solid #cfe0ee;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.notice h3 { display: flex; align-items: center; gap: 6px; }
.notice h3::before { content: "💡"; }
.notice ul { margin: 0; padding-left: 20px; font-size: 13px; color: var(--ink-soft); }
.notice ul li { margin: 3px 0; }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-border); border-left-color: #e08a1e; }
.notice-warn h3::before { content: "⚠️"; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.items-table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
/* largeurs fixes : tout tient dans la largeur, aucun defilement horizontal */
.items-table th:nth-child(1), .items-table td:nth-child(1) { width: 28%; }
.items-table th:nth-child(2), .items-table td:nth-child(2) { width: 11%; }
.items-table th:nth-child(3), .items-table td:nth-child(3) { width: 10%; }
.items-table th:nth-child(4), .items-table td:nth-child(4) { width: 8%; }
.items-table th:nth-child(5), .items-table td:nth-child(5) { width: 12%; }
.items-table th:nth-child(6), .items-table td:nth-child(6) { width: 11%; }
.items-table th:nth-child(7), .items-table td:nth-child(7) { width: 20%; }
.items-table thead { background: #f6f8fa; }
.items-table th {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.items-table td { padding: 14px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.items-table tbody tr:last-child td { border-bottom: none; }
.items-table tbody tr:hover { background: #fdf7f3; }
.items-table input, .items-table select {
  margin-top: 0;
  padding: 7px 6px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
}
.items-table input:hover, .items-table select:hover { border-color: var(--border); background: #fff; }
.items-table input:focus, .items-table select:focus { border-color: var(--accent); background: #fff; }
.items-table input, .items-table select { width: 100%; box-sizing: border-box; }
.items-table input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.items-table input[type="number"]::-webkit-outer-spin-button,
.items-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Prix a 0€ (ex: lignes ajoutees depuis le plan 2D) : a renseigner avant impression */
.items-table td.price-missing { background: var(--warn-bg); }
.items-table td.price-missing input { border-color: var(--warn-border); background: #fff; }

/* Colonne designation : large et affichee en entier */
.items-table td.desig-cell { width: 28%; }
.desig-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  line-height: 1.35;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.desig-input:hover { border-color: var(--border); background: #fff; }
.desig-input:focus { border-color: var(--accent); background: #fff; outline: none; }

/* Actions par ligne : lien prix + suppression */
.row-actions { text-align: right; }
.supplier-links { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; text-align: left; }
.fournisseur-select {
  width: 100%;
  box-sizing: border-box;
  font-size: 11px;
  padding: 3px 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.price-link { font-size: 11px; color: var(--accent); text-decoration: none; font-weight: 600; }
.price-link:hover { text-decoration: underline; }
.row-remove {
  border: none;
  background: #f3d6d0;
  color: #c0392b;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.totals-block { margin-top: 16px; }
.totals-line { display: flex; justify-content: space-between; padding: 6px 18px; font-size: 14px; color: var(--ink-soft); }
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 10px;
  background: #f6f8fa;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}
.total-amount { font-size: 22px; color: var(--ink); font-weight: 700; }

.result-subhead {
  margin: 22px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.actions { display: flex; gap: 12px; margin-top: 18px; }
.actions button { flex: 1; padding: 13px 18px; font-size: 15px; }

.devis-list { display: flex; flex-direction: column; gap: 10px; }
.devis-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 40px 14px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 10px;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.devis-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.devis-item-top::after {
  content: "›";
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 22px;
  color: #c3ccd4;
}
.devis-item:hover {
  border-color: var(--primary);
  border-left-color: var(--primary);
  background: #fdf6f2;
  box-shadow: 0 6px 16px rgba(28, 37, 48, 0.08);
}
.devis-item:hover .devis-item-top::after { color: var(--primary); }
.devis-item-title { margin: 0; font-weight: 700; font-size: 15px; }
.devis-item-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.devis-item-amount { font-weight: 800; color: var(--primary); font-size: 16px; white-space: nowrap; }

.devis-item-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.devis-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--muted);
  margin-right: auto;
}
.devis-status-approuve { background: #e3f5e9; color: #1e7d43; }
.devis-status-refuse { background: #fbe7e5; color: #b3372b; }
.devis-status-btn { padding: 6px 12px; font-size: 12px; }
.devis-status-btn.active { background: var(--ink); color: #fff; }
.devis-delete-btn { margin-left: auto; color: #c0392b; }
.devis-delete-btn:hover { background: #fbe7e5; }
.devis-delete-btn.confirming { background: #c0392b; color: #fff; }
.devis-delete-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Etat vide */
.head-icon { background: #fdece2; font-size: 18px; box-shadow: none; }
.empty-state { text-align: center; padding: 36px 20px 28px; }
.empty-state-icon { font-size: 52px; line-height: 1; }
.empty-state p { color: var(--muted); margin: 14px 0 20px; font-size: 15px; }
.empty-cta { width: auto; display: inline-block; }

/* ---- Dossiers par client ---- */
.client-folder { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.client-folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  background: #f6f8fa;
  list-style: none;
}
.client-folder-head::-webkit-details-marker { display: none; }
.client-folder-name { font-size: 15px; }
.client-folder-total { color: var(--primary-dark); font-weight: 800; }
.client-folder-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }

/* ---- Caisse a outils ---- */
.tools-metier-label { display: block; max-width: 280px; margin-bottom: 18px; }
.tools-list { display: flex; flex-direction: column; gap: 8px; }
.tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.tool-name { font-weight: 600; }
.tool-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.tool-add-btn { padding: 6px 12px; font-size: 13px; }

/* Panier d'outils */
.tool-basket {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f7f9fb;
}
.basket-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 12px;
}
.basket-count { font-size: 13px; font-weight: 600; color: var(--muted); }
.basket-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.basket-name { flex: 1; min-width: 0; font-weight: 600; }
.basket-qty {
  width: 64px;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.basket-remove {
  border: none;
  background: #eef1f4;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.basket-remove:hover { background: #e2e7ec; color: var(--ink); }
.basket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.basket-clear { margin-left: auto; }
.basket-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.tools-search { margin-bottom: 18px; }
.tools-search-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.tools-search-row { display: flex; gap: 8px; }
.tools-search-row input { flex: 1; min-width: 0; }
.tools-search-row .btn-secondary { white-space: nowrap; }

/* ---- Abonnements ---- */
.pricing-intro { text-align: center; margin-bottom: 20px; }
.pricing-intro h2 { margin: 0 0 6px; font-size: 22px; }
.pricing-offer {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--primary-dark);
  font-weight: 600;
}
.billing-toggle {
  display: inline-flex;
  background: #e6ebf0;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.billing-opt {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
.billing-opt.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.save-badge {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 4px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.pricing-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.pricing-card.popular { border-color: var(--primary); box-shadow: 0 4px 16px rgba(217,100,42,0.18); }
.popular-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
}
.pricing-card h3 { margin: 0 0 10px; font-size: 18px; }
.price { margin-bottom: 14px; min-height: 40px; }
.price strong { font-size: 30px; color: var(--ink); }
.price small { color: var(--muted); font-size: 14px; }
.features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  font-size: 13px;
  text-align: left;
  flex: 1;
}
.features li { padding: 6px 0 6px 22px; position: relative; border-bottom: 1px solid var(--border); }
.features li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.pricing-card .btn-primary, .pricing-card .btn-secondary { width: 100%; }
.pricing-unit { text-align: center; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.custom-banner {
  margin-top: 20px;
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.custom-banner h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.custom-banner p { margin: 0; color: #c3ccd4; font-size: 14px; }
.custom-banner .btn-primary { white-space: nowrap; }
.custom-banner .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.custom-banner #est-request-status { flex-basis: 100%; color: #c3ccd4; }
.custom-banner #est-request-status.error { color: #ff8a7a; }

/* Demandes sur-mesure (admin) */
.sur-mesure-list { display: flex; flex-direction: column; gap: 10px; }
.sur-mesure-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.sur-mesure-title { margin: 0; font-weight: 700; font-size: 15px; }
.sur-mesure-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.sur-mesure-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sur-mesure-edit { display: flex; gap: 12px; flex-wrap: wrap; }
.sur-mesure-edit label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.sur-mesure-edit input { width: 120px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.custom-estimator-banner { flex-direction: column; align-items: stretch; text-align: left; }
.custom-estimator-banner .estimator { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin: 4px 0; }
.estimator label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #c3ccd4; }
.estimator input { width: 140px; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); color: #fff; font-size: 15px; }
.estimator input::placeholder { color: #8a97a3; }
.estimator-result { flex: 1; min-width: 200px; font-weight: 700; font-size: 15px; color: #fff; }
.custom-estimator-banner .btn-primary { align-self: flex-start; }

/* ---- Pieces ---- */
.rooms-field { margin-top: 4px; }
.rooms-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.rooms-input { display: flex; gap: 8px; align-items: stretch; }
.rooms-input input { flex: 1; }
.rooms-input .btn-secondary { white-space: nowrap; }
.rooms-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rooms-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.room-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fbfcfd; }
.room-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.room-card-name { font-weight: 700; color: var(--primary-dark); }
.room-card-surface { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.room-card-notes { width: 100%; box-sizing: border-box; font-family: inherit; }
.room-card-dims { display: flex; gap: 8px; margin-bottom: 8px; }
.room-card-dims input { flex: 1; min-width: 0; box-sizing: border-box; }
.room-card-pos { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.room-card-pos-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.room-card-pos input { flex: 1; min-width: 0; box-sizing: border-box; }

/* ---- Plan 2D ---- */
.plan2d-field { margin-top: 14px; }
.plan2d-area { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fff; overflow-x: auto; }
.plan2d-empty { color: var(--muted); font-size: 14px; margin: 0; }
.plan2d-legend { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.plan2d-rooms { display: flex; flex-wrap: wrap; gap: 20px; }
.plan2d-room { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.plan2d-room svg { display: block; }
.plan2d-house { display: flex; justify-content: center; }
.plan2d-house svg { display: block; max-width: 100%; }
.plan2d-room-label { font-size: 13px; color: var(--ink-soft); text-align: center; }
.plan2d-floor-total { margin-top: 16px; font-size: 13px; color: var(--muted); }
.plan2d-total { margin-top: 6px; font-weight: 700; font-size: 15px; color: var(--ink); }
.plan2d-add { margin-top: 12px; }

/* ---- Import plan 2D ---- */
.import-plan-field { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.import-plan-upload { display: block; font-size: 14px; color: var(--ink-soft); }
.import-plan-upload input { display: block; margin-top: 8px; }
.plan-import-area { margin-top: 14px; }
.import-plan-wrap { position: relative; max-width: 100%; margin-bottom: 12px; }
.import-plan-img { width: 100%; display: block; border: 1px solid var(--border); border-radius: 8px; }
.import-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 16px; }
.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fdece2;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
}
.room-chip-remove {
  border: none;
  background: none;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.room-row td {
  background: #eef3f8;
  padding: 10px 10px;
}
.room-row-name { font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
.room-row-total { float: right; font-weight: 800; color: var(--primary-dark); }
.room-select {
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  padding: 4px 6px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.devis-numero-label { display: block; max-width: 280px; margin-bottom: 4px; }
.logo-preview { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.logo-preview img { max-height: 60px; max-width: 160px; border: 1px solid var(--border); border-radius: 6px; padding: 4px; background: #fff; }
.logo-preview.hidden { display: none; }
.recommandations-label { display: block; margin-top: 14px; }
.recommandations-label textarea { width: 100%; box-sizing: border-box; }

/* ---- Agrandissement photo ---- */
.photo-thumb { cursor: zoom-in; }
.photo-zoom-hint {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(28, 37, 48, 0.72);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  pointer-events: none;
}
.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  cursor: zoom-out;
}
.photo-modal.hidden { display: none; }
.photo-modal-img {
  max-width: 95%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.photo-modal-close {
  position: absolute;
  top: 14px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}

#print-area { display: none; }

/* ---- Connexion / inscription ---- */
.org-name { color: #b9c2cc; font-size: 13px; margin-right: 4px; }
.auth-main { max-width: 420px; margin: 60px auto; padding: 0 16px; }
.auth-card { margin-bottom: 0; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-switch { margin: 16px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ---- Mon equipe ---- */
.team-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.team-role { font-size: 12px; color: var(--muted); font-weight: 600; }
.team-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.team-invite-link { flex: 1; min-width: 220px; font-size: 13px; color: var(--muted); }

/* ---- Quota d'utilisation ---- */
.quota-status { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.my-sur-mesure-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: left;
}
.my-sur-mesure-status .btn-primary { margin-left: auto; white-space: nowrap; }
.my-sur-mesure-status.hidden { display: none; }

@media (max-width: 560px) {
  .form-grid, .client-grid { grid-template-columns: 1fr; }
  .rooms-input { flex-direction: column; align-items: stretch; }
  .rooms-input .btn-secondary { width: 100%; }
  .tools-search-row { flex-direction: column; align-items: stretch; }
  .tools-search-row .btn-secondary { width: 100%; }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .app-header, .tabs, main { display: none; }
  #print-area { display: block; padding: 20px; }
}
