/* Lotivela — turquoise, pervenche et corail, sans changer le sens des états métier. */
:root {
  --ink: #253a41;
  --text: #253a41;
  --muted: #607179;
  --line: #dfe7eb;
  --paper: #fff;
  --canvas: #f5f8fa;
  --accent: #286f69;
  --soft-accent: #e8f5f1;
  --green: #286f69;
  --green-soft: #e8f5f1;
  --sage: #286f69;
  --lotivela-teal: #389d92;
  --lotivela-teal-ink: #286f69;
  --lotivela-teal-soft: #e8f5f1;
  --lotivela-purple: #8c83dc;
  --lotivela-purple-ink: #5d529b;
  --lotivela-purple-soft: #f0edfc;
  --lotivela-coral: #f19c87;
  --lotivela-coral-soft: #fff0e9;
  --sidebar: 264px;
  font-family: ui-rounded, "Avenir Next", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

body { background: var(--canvas); }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { color: var(--ink); }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--lotivela-purple-ink);
  outline-offset: 4px;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--lotivela-teal-ink); }

/* Une navigation claire : le logo garde ses couleurs sur un fond lumineux. */
.sidebar {
  background: #fff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 27px 18px 20px;
  overflow-y: auto;
  max-height: 100vh;
  max-height: 100dvh;
  scrollbar-width: thin;
  scrollbar-color: #cbdcdd transparent;
}
.brand { padding: 0 12px 27px; }
.brand-name { color: var(--ink); font-weight: 700; }
.brand-studio, .brand-agency, .agency-name { color: var(--muted); overflow-wrap: anywhere; }
.auth-agency-name { color: #57726d; font-size: 15px; line-height: 1.7; margin-top: 9px; overflow-wrap: anywhere; max-width: 100%; }
.site-print-brand > span { letter-spacing: .02em; font-size: 13px; line-height: 1.6; max-width: 100%; overflow-wrap: anywhere; color: #52676e; }
.site-print-header > div:first-child { min-width: 0; max-width: 60%; }
.brand > img { background: #f5f7f4; border: 1px solid #e6eeeb; }
.lotivela-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; min-width: 0; }
.lotivela-brand > .lotivela-wordmark { display: block; width: min(100%, 181px); max-width: 100%; height: auto; object-fit: contain; background: transparent; border: 0; border-radius: 0; }
.agency-display-name { font-size: 14px; font-weight: 550; color: var(--muted); line-height: 1.6; letter-spacing: 0; max-width: 100%; overflow-wrap: anywhere; }
.agency-settings-intro { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 16px; padding-bottom: 20px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.agency-settings-intro > img { width: 210px; max-width: 100%; height: auto; object-fit: contain; }
.agency-settings-intro p { color: var(--muted); font-size: 15px; line-height: 1.8; }
.sidebar-section { color: #6d788e; font-size: 12px; letter-spacing: .08em; padding-top: 18px; }
.nav-divider { border-color: #e5ecef; margin-top: 17px; }
.nav-item {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 13px;
  color: #5a6d75;
  font-size: 15px;
  gap: 12px;
}
.nav-item .icon { color: #71888d; stroke-width: 1.8; }
.nav-item:hover { background: #f0f7f6; color: var(--ink); }
.nav-item.active {
  background: var(--lotivela-teal-soft);
  color: #225d58;
  box-shadow: none;
  font-weight: 650;
}
.nav-item.active .icon { color: var(--lotivela-teal-ink); }
.sidebar-bottom { padding-top: 24px; }
.sidebar-bottom > .button { width: 100%; justify-content: flex-start; margin-bottom: 14px; }
.prototype-label { border: 1px solid #e2e9ed; background: #f8fafc; color: #485f69; border-radius: 12px; }
.prototype-label strong { font-size: 14px; }
.prototype-label span { color: var(--muted); font-size: 12px; }
.profile { border-color: var(--line); font-size: 14px; align-items: flex-start; }
.profile > div { min-width: 0; overflow-wrap: anywhere; }
.profile small { color: var(--muted); line-height: 1.6; }
.avatar { background: var(--lotivela-purple-soft); color: var(--lotivela-purple-ink); width: 38px; height: 38px; }

/* Les actions restent reconnaissables et suffisamment grandes au toucher. */
.topbar { border-bottom-color: var(--line); min-height: 78px; }
.icon-btn { border-radius: 11px; width: 42px; height: 42px; }
.icon-btn:hover { background: var(--lotivela-purple-soft); border-color: #dcd7f2; }
.mode-switch { border-radius: 12px; background: #f5f6fa; }
.mode-switch button { border-radius: 9px; min-height: 34px; }
.mode-switch button.selected { color: var(--lotivela-purple-ink); box-shadow: 0 1px 4px #29354f0c; }
.breadcrumb { font-size: 14px; }
.button {
  min-height: 44px;
  border-radius: 11px;
  border-color: #d8e3e7;
  color: #334f59;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 550;
}
.button:hover { background: #eff7f5; border-color: #bddbd5; }
.button.primary { background: var(--lotivela-teal-ink); border-color: var(--lotivela-teal-ink); color: #fff; }
.button.primary:hover { background: #205e59; border-color: #205e59; }
.button.small { min-height: 40px; border-radius: 9px; font-size: 14px; }
.button.text { color: var(--lotivela-teal-ink); }
.button.danger { color: #9a3d2f; border-color: #eccdc5; background: #fff; }
.button.danger:hover { background: #fff1ec; border-color: #d9a89b; }
.button:disabled { opacity: .6; }
.tabs { gap: 6px; }
.tab { min-height: 42px; font-size: 14px; border-radius: 10px; padding: 9px 14px; }
.tab:hover { background: #ecf5f2; }
.tab.selected { color: var(--lotivela-purple-ink); background: var(--lotivela-purple-soft); }
.search-box, .select-wrap select { border-radius: 11px; border-color: #d9e4e8; }
.search-box input, .select-wrap select { font-size: 15px; }
.search-box:focus-within { outline: 3px solid #8174c2; outline-offset: 2px; }

/* Des cartes aérées : les accents de marque soulignent la hiérarchie. */
.page-heading h1 { font-weight: 600; letter-spacing: -1px; }
.page-subtitle { font-size: 16px; line-height: 1.7; color: var(--muted); }
.eyebrow { color: #6c7091; letter-spacing: .1em; }
.panel, .stat-card, .access-stat, .ledger-stat, .docs-stat, .plan-stat, .site-stat, .project-card,
.report-card, .site-report-card, .site-photo-card, .plan-card, .docs-group-card,
.docs-version-card, .docs-comparison-card, .project-summary-line, .project-banner,
.onboarding-empty-card { border-color: var(--line); border-radius: 16px; }
.panel, .stat-card, .access-stat, .ledger-stat, .project-card, .report-card {
  box-shadow: 0 3px 14px #253a4104;
}
.panel-head h2, .section-title h2, .widget-heading h2 { font-weight: 600; }
.panel-head p, .stat-caption { font-size: 13px; line-height: 1.7; }
.stat-label { font-size: 14px; line-height: 1.6; }
.stat-value { font-weight: 550; letter-spacing: -.8px; }
.stat-card.emphasis, .ledger-stat.emphasis, .access-stat.emphasis,
.docs-stat.emphasis, .plan-stat.emphasis, .site-stat.emphasis {
  background: #e4f4ef;
  border-color: #c9e8df;
  color: #254b48;
}
.stat-card.emphasis .stat-label, .stat-card.emphasis .stat-label .icon,
.stat-card.emphasis .stat-caption, .ledger-stat.emphasis > span,
.ledger-stat.emphasis > small, .access-stat.emphasis > span,
.access-stat.emphasis > small, .docs-stat.emphasis > span, .docs-stat.emphasis > small,
.plan-stat.emphasis > span, .plan-stat.emphasis > small,
.site-stat.emphasis > span, .site-stat.emphasis > small { color: #456c68; }
.overview-finance-card:first-child { background: #f3faf7; border-color: #dbece6; }
.overview-finance-card:nth-child(2) { background: #f8f6fe; border-color: #e5e0f4; }
.overview-finance-card h2 { font-weight: 600; }
.overview-finance-card > header > .icon { color: var(--lotivela-purple-ink); }
.overview-money-row > span { font-size: 14px; }
.overview-money-notes { font-size: 13px; }
.overview-money-badge:not(.pending) { background: #e8eef9; color: #506487; }
.advance-summary { border-color: #cce6de; background: #ecf8f3; border-radius: 15px; }
.advance-summary > div:first-child { border-color: #cce6de; }
.budget-live-total { background: #286f69; border-radius: 12px; color: #dcefea; }
.budget-live-total strong { color: #fff; }
.project-mark, .activity-icon { background: var(--lotivela-purple-soft); color: var(--lotivela-purple-ink); border-radius: 13px; }
.project-card-art, .banner-art { background: #e4f3ee; color: #63938b; }
.project-card-art.clay { background: #fbe9e2; color: #a67467; }
.project-card-art.slate { background: #ece9fb; color: #8e83b5; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px #253a4110; border-color: #c7ded9; }
.project-card h2 { font-weight: 600; }
.project-card-location { font-size: 14px; line-height: 1.7; }
.project-card-footer { font-size: 13px; }
.progress-track, .bar-track { background: #e7eeee; border-radius: 99px; }
.progress-fill { background: var(--lotivela-teal); }
.bar-fill { border-radius: 99px; }
.date-block { background: #f0edfc; border-color: #e1dcf5; border-radius: 10px; }
.date-block strong { color: #5d529b; }
.status, .ledger-badge, .access-status, .docs-badge, .plan-badge, .site-badge,
.budget-quote-status { border-radius: 7px; }
.client-notice { background: #eaf6f1; border-color: #d0e8dd; color: #305f55; border-radius: 12px; font-size: 14px; }
.table-note, .financial-hint, .ledger-explanation { color: var(--muted); }

/* La lecture financière prime sur les effets de couleur. */
.data-table { font-size: 16px; }
.data-table th { background: #f7f9fc; color: #60717c; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 550; }
.data-table td { border-bottom-color: #eaf0f2; font-size: 16px; }
.data-table .total td { background: #f0f7f4; }
.data-table .numeric, .ledger-table .numeric { font-size: 16px; font-variant-numeric: tabular-nums; }
.doc-open { min-height: 40px; border-radius: 9px; font-size: 14px; }
.ledger-post-title, .doc-name, .advance-purpose { font-size: 16px; }
.ledger-supplier, .ledger-family, .doc-version { color: var(--muted); }
.ledger-detail-metrics, .expense-payment-preview { background: #f5f8fc; border-radius: 12px; }
.budget-quote-card { border-radius: 14px; }
.budget-quote-card.is-retained { border-color: #90c4b9; background: #f2faf6; }
.budget-quote-card.is-retained .budget-quote-status { background: #e4f2e8; }

/* Formulaires et boîtes de dialogue : même vocabulaire que l’espace projet. */
.modal-overlay { background: #233a4a80; backdrop-filter: blur(4px); }
.modal { border-radius: 20px; box-shadow: 0 24px 80px #243b5029; }
.modal-header { background: #fbfcfe; border-bottom-color: var(--line); }
.modal-header h2 { font-size: 19px; font-weight: 600; }
.form-field { font-size: 15px; line-height: 1.6; }
.form-field > span { font-weight: 550; }
.form-field input, .form-field select, .form-field textarea,
.budget-edit-table input:not([type="checkbox"]) {
  min-height: 48px;
  font-size: 16px;
  border-color: #d2e0e5;
  border-radius: 10px;
  padding: 11px 13px;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: #8b7ed0;
  outline: 3px solid #ded8f7;
  outline-offset: 2px;
}
.form-field input[readonly], .budget-edit-table input[readonly] { background: #f1f6f8; color: #536b75; border-color: #dce6e9; }
.form-help, .project-form-section > p { font-size: 14px; line-height: 1.8; }
.form-error, .budget-form-note, .storage-notice { border-radius: 11px; }
.form-submit { gap: 11px; }
.access-preview-note, .access-permission-note, .access-private-note { background: #eef7f4; border-color: #d5e9e2; color: #3d665c; border-radius: 12px; }
.access-project-option { background: #fbfcfe; border-color: #dce5ec; border-radius: 11px; }
.access-project-option:has(input:checked) { border-color: #95cbbf; background: #edf8f3; }
.access-link-field textarea { background: #f4f7fc; border-color: #d9e3ed; color: #456475; border-radius: 11px; }
.access-project-chips > span { background: #f0edfc; border-color: #e3dcf7; color: #65558f; border-radius: 7px; }
.access-explainer-icon, .access-result-icon { background: #e7f5f0; color: #2d7466; }
.onboarding-empty-mark, .site-empty-icon { background: #edf7f3; color: #327d71; border-radius: 18px; }
.ledger-filter-count, .docs-filter-count, .plan-filter-count, .site-filter-count { background: #edf0f7; color: #61718a; border-radius: 6px; }
.tab.selected .ledger-filter-count, .tab.selected .docs-filter-count,
.tab.selected .plan-filter-count, .tab.selected .site-filter-count { background: #dfd9f5; color: #5d529b; }
.toast { background: #263e47; color: #fff; border-radius: 13px; padding: 14px 19px; font-size: 14px; }
.bottom-caption { color: #61747d; font-size: 12px; }

/* Une entrée chaleureuse avec les trois couleurs du symbole. */
.auth-shell { background: #f6f8fc; color: var(--ink); font-family: inherit; }
.auth-introduction { background: #e8f5f1; color: var(--ink); }
.auth-introduction::before {
  content: "";
  position: absolute;
  top: 18%;
  right: -100px;
  width: 260px;
  height: 260px;
  border-radius: 42% 58% 53% 47%;
  background: #ddd6fa;
  opacity: .55;
  pointer-events: none;
}
.auth-introduction::after { right: 20px; bottom: -150px; width: 320px; height: 320px; background: #f7cdbd; border: 0; opacity: .45; }
.access-brand-icon { width: 64px; height: 64px; padding: 0; border-color: #d8e7e1; border-radius: 17px; }
.access-brand-copy > strong { color: var(--ink); font-weight: 750; letter-spacing: .5px; }
.access-brand-copy > span { color: #57726d; font-size: 13px; letter-spacing: .2px; }
.auth-eyebrow { color: #52628d; font-size: 13px; letter-spacing: .08em; }
.auth-intro-copy > h1 { color: #253f46; font-weight: 600; letter-spacing: -1.7px; }
.auth-intro-copy > p { color: #526f72; }
.auth-intro-points { color: #3c5c64; font-size: 16px; }
.auth-intro-points .icon { color: #6b5ca8; opacity: 1; }
.auth-intro-footer { color: #5d7775; font-size: 13px; }
.auth-card { border-color: #e0e6ee; border-radius: 22px; box-shadow: 0 16px 50px #394b6f09; }
.auth-card-mark { background: #f0edfc; color: #675aab; border-radius: 14px; width: 46px; height: 46px; }
.auth-card > h2 { color: var(--ink); font-size: 28px; font-weight: 600; }
.auth-subtitle { color: var(--muted); }
.auth-field { font-size: 15px; font-weight: 550; }
.auth-field > input, .auth-password-wrap > input { border-color: #d3dfe8; border-radius: 11px; min-height: 50px; font-family: inherit; color: var(--ink); }
.auth-field input:focus { outline: 3px solid #ded8f7; border-color: #8b7ed0; outline-offset: 2px; }
.auth-password-toggle { border-radius: 9px; color: #5f6e88; font-size: 13px; }
.auth-password-toggle:focus-visible { outline-color: #8b7ed0; }
.auth-help { border-color: var(--line); color: var(--muted); }
.auth-help strong { color: #526f84; }
.auth-footer, .auth-install-section > p { color: #5e6f82; font-size: 13px; }
.auth-identity { background: #f4f2fc; border-color: #e5dff6; border-radius: 11px; }
.auth-identity > span, .auth-identity > small, .auth-password-help, .auth-account-note { color: var(--muted); }
.auth-empty-icon { background: #edf7f2; border-color: #d9eade; color: #438274; border-radius: 15px; }
.auth-empty-copy { color: var(--muted); }
.auth-install-section > .auth-install { border-color: #cfc6ee; background: #f1edfc; color: #5d529b; border-radius: 12px; }
.auth-install-section > .auth-install:hover { background: #e9e3fa; }

/* Installation : les mêmes formes, sans masquer la nécessité de connexion. */
.lotivela-install-overlay { background: #233a4a80; backdrop-filter: blur(4px); }
.lotivela-install-dialog { border-radius: 22px; color: var(--ink); font-family: inherit; font-size: 16px; box-shadow: 0 24px 80px #243b5029; }
.lotivela-install-dialog h2 { color: var(--ink); font-weight: 600; }
.lotivela-install-close { border-radius: 10px; }
.lotivela-install-close:hover { background: #f0edfc; }
.lotivela-install-close:focus-visible, .lotivela-install-done:focus-visible { outline-color: var(--lotivela-purple-ink); }
.lotivela-install-note { color: var(--muted); border-color: var(--line); font-size: 14px; }
.lotivela-install-done { background: var(--lotivela-teal-ink); border-color: var(--lotivela-teal-ink); border-radius: 11px; }
.lotivela-network-notice { font-family: inherit; }

@media (max-width: 1200px) {
  :root { --sidebar: 240px; }
  .brand { padding-left: 8px; padding-right: 8px; }
  .nav-item { padding-left: 12px; font-size: 14px; }
  .stat-value { font-size: 25px; }
}
@media (max-width: 1000px) {
  :root { --sidebar: 224px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { padding-left: 8px; padding-right: 8px; }
  .nav-item { gap: 10px; }
  .stat-card { padding: 19px; }
  .auth-shell { grid-template-columns: minmax(300px,.85fr) minmax(400px,1.15fr); }
  .auth-introduction { padding-left: 32px; padding-right: 32px; }
}
@media (max-width: 760px) {
  :root { --sidebar: 264px; }
  .sidebar { padding: 27px 18px 20px; box-shadow: 12px 0 36px #233c4a15; }
  .menu-shade.visible { background: #233c4a66; }
  .topbar { min-height: 70px; height: auto; padding-top: 12px; padding-bottom: 12px; }
  .main { padding: 24px 18px 34px; }
  .page-heading { flex-wrap: wrap; }
  .page-heading h1 { font-size: 28px; }
  .page-subtitle { font-size: 15px; line-height: 1.7; }
  .heading-actions { flex-wrap: wrap; width: 100%; justify-content: flex-start; padding: 0; }
  .heading-actions .button { font-size: 14px; min-height: 44px; }
  .button.small, .doc-open { min-height: 44px; }
  .stat-grid { gap: 12px; }
  .stat-card { border-radius: 14px; padding: 17px 15px; min-height: 145px; }
  .stat-label { font-size: 14px; }
  .stat-value { font-size: clamp(21px, 5.6vw, 27px); }
  .stat-caption { font-size: 13px; }
  .widget-grid .panel { border-radius: 16px; }
  .panel-head h2, .widget-heading h2 { font-size: 18px; }
  .project-card h2 { font-size: 21px; }
  .project-card-body { padding: 22px; }
  .data-table td, .data-table .numeric, .ledger-table .numeric { font-size: 15px; }
  .data-table th { font-size: 14px; }
  .table-note, .financial-hint { font-size: 13px; line-height: 1.7; }
  .overview-money-row > span { font-size: 14px; }
  .overview-money-row > strong { font-size: 17px; }
  .overview-money-notes { font-size: 13px; }
  .modal-overlay { padding: 12px; }
  .modal { border-radius: 17px; max-height: calc(100dvh - 24px); }
  .modal-header { padding: 18px 20px; }
  .modal-content { padding: 22px 20px; }
  .form-submit .button { min-height: 46px; font-size: 15px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-introduction { padding: 28px 25px 31px; }
  .auth-introduction::before { top: -50px; right: -80px; width: 210px; height: 210px; }
  .auth-introduction::after { right: 24px; bottom: -135px; width: 230px; height: 230px; opacity: .4; }
  .access-brand-icon { width: 55px; height: 55px; border-radius: 15px; }
  .access-brand-copy > strong { font-size: 26px; letter-spacing: .4px; }
  .access-brand-copy > span { font-size: 12px; }
  .auth-intro-copy { margin-top: 30px; }
  .auth-intro-copy > h1 { font-size: 34px; line-height: 1.2; margin-top: 10px; margin-bottom: 14px; letter-spacing: -1px; }
  .auth-intro-copy > p { font-size: 16px; line-height: 1.7; }
  .auth-content { padding: 23px 16px 25px; }
  .auth-card { border-radius: 19px; padding: 27px 24px; }
  .auth-card > h2 { font-size: 25px; }
  .auth-field > input, .auth-password-wrap > input { font-size: 16px; }
  .auth-footer { padding-left: 5px; padding-right: 5px; }
  .auth-install-section > .auth-install { min-height: 46px; font-size: 15px; }
  .lotivela-install-dialog { border-radius: 19px; padding: 24px 21px; }
}
@media (max-width: 380px) {
  .main { padding-left: 14px; padding-right: 14px; }
  .topbar { padding-left: 14px; padding-right: 14px; gap: 9px; }
  .page-heading h1 { font-size: 26px; }
  .stat-card { padding: 16px 12px; }
  .stat-label { font-size: 13px; }
  .stat-value { font-size: 21px; }
  .stat-caption { font-size: 12px; }
  .overview-money-row { align-items: flex-start; flex-direction: column; gap: 3px; }
  .overview-money-row > strong { font-size: 18px; }
  .auth-card { padding: 25px 20px; }
  .auth-introduction { padding-left: 22px; padding-right: 22px; }
  .access-brand { gap: 11px; }
  .auth-card > h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .project-card:hover { transform: none; }
}
@media print {
  :root { --ink: #17221b; --text: #17221b; --muted: #525b56; --line: #bbb; --paper: #fff; --canvas: #fff; }
  body, .panel, .stat-card, .ledger-stat, .access-stat, .overview-finance-card,
  .advance-summary, .project-summary-line { background: #fff; color: #17221b; box-shadow: none; border-color: #bbb; border-radius: 0; }
  .stat-card.emphasis, .ledger-stat.emphasis, .access-stat.emphasis,
  .docs-stat.emphasis, .plan-stat.emphasis, .site-stat.emphasis { background: #fff; color: #17221b; border-color: #bbb; }
  .stat-card.emphasis .stat-label, .stat-card.emphasis .stat-caption,
  .ledger-stat.emphasis > span, .ledger-stat.emphasis > small,
  .access-stat.emphasis > span, .access-stat.emphasis > small,
  .docs-stat.emphasis > span, .docs-stat.emphasis > small,
  .plan-stat.emphasis > span, .plan-stat.emphasis > small,
  .site-stat.emphasis > span, .site-stat.emphasis > small { color: #525b56; }
  .data-table th, .data-table td, .data-table .numeric, .ledger-table .numeric { font-size: 10px; }
  .data-table th, .data-table .total td { background: #fff; color: #17221b; }
  .modal, .lotivela-install-dialog { box-shadow: none; }
  .site-print-brand > span { font-size: 12px; color: #525b56; letter-spacing: 0; }
}
