/* ========== Variables & Reset ========== */
* { box-sizing: border-box; }
:root {
  --control-h: 44px;      /* hauteur uniforme des champs */
  --v-gap: 10px;          /* écart vertical entre blocs */
  --field-gap: 16px;      /* écart vertical entre champs de saisie */
  --bg: #22405e;          /* fond clair global */
  --bg-accent: #1f2f4e;   /* accent clair pour dégradés */
  --card: #ffffff;        /* cartes claires */
  --text: #0f172a;       /* slate-900 */
  --muted: #6b7280;      /* gray-500 */
  --border: #e5e7eb;     /* gray-200 */
  --soft-border: #eceff300;

  --accent: #2F5B95;     /* navy deep */
  --accent-700:#2F5B95;
  --accent-600:#2F5B95;

  --color-grad-01: linear-gradient(45deg, #356CA5, #2B4A84);
  --color-grad-02: linear-gradient(45deg, #262626, #333333);

  --ring: rgba(17, 24, 39, 0.1);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --shadow-soft: 0 6px 18px rgba(2, 6, 23, 0.06);
  --tl-row-h: 36px;       /* hauteur d'une heure dans la timeline */

  /* Search fields theme (detached from other controls) */
  --search-bg: #eef2f7;
  --search-border: #dbe3ee;
  --search-text: #0f172a;
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% -10%, var(--bg-accent), transparent),
              radial-gradient(1200px 800px at 120% 120%, var(--bg-accent), var(--bg));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden; /* ✅ on évite le scroll global, on scrolle la colonne gauche */
}

body.page-documents,
body.page-revenus,
body.page-calendar,
body.page-storage {
  overflow-y: auto;
}

.page-dashboard {
  overflow-y: auto;
}
.page-dashboard .app {
  display: block;
  overflow: visible;
  min-height: auto;
  height: auto;
}
.page-dashboard .brand-card { margin-bottom: 0px; }


/* Assure la typographie Urbanist partout */
input, button, select, textarea { font-family: inherit; }

/* ========== Layout global ========== */
.app {
  display: flex;
  flex-direction: column;
  width: auto;
  height: auto;            /* occupe le reste via flex */
  flex: 1;
  margin: 10px;            /* même marge sur les 4 côtés (doublée) */
  background: var(--card);
  border-radius: 5px;
  box-shadow: var(--shadow);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--soft-border);
  gap: 0;
  min-height: 0;
  padding: 16px;           /* padding interne comme une carte */
}

.page-documents .app,
.page-revenus .app,
.page-calendar .app {
  overflow: visible;
  min-height: auto;
}

#main-barre{
  background: var(--color-grad-01);
  padding: 16px;
}



/* Row that contains the left form and right preview inside the main card */
.main-row { display: flex; flex: 1 1 auto; min-height: 0; margin: 0; }
/* Mail page split: 1/3 inbox, 2/3 message */
.mail-split { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; align-items: stretch; min-height: 0; }
.mail-split .form-container,
.mail-split .preview-container { padding: 0; background: transparent; border: 0; min-height: 0; }
.mail-split .form-container { overflow: auto; }
.mail-split .preview-container { display:flex; flex-direction: column; overflow: hidden; min-height: 0; }
.mail-split .preview-container > .card { flex: 1 1 auto; min-height: 0; overflow: auto; }

/* ========== Colonne gauche : Formulaire ========== */
.form-container {
  flex: 3;
  padding: 0; /* no inner padding — spacing handled by .app */
  border-right: 1px solid var(--soft-border);
  overflow-y: auto;
  min-height: 0;
  background: linear-gradient(180deg, #fff, #fff 60%, #fafbfc);
}


.form-container h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 6px 0 12px;
}

/* Labels & Inputs */
label {
  display: block;
  margin-top: 3px;
  margin-bottom: 3px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="file"],
input[type="password"],
input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--soft-border);
  border-radius: 5px;
  font-size: 14px;
  outline: none;
  background: #f9fafb;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  margin-bottom: var(--field-gap);
  height: var(--control-h);
  line-height: calc(var(--control-h) - 2px);
  appearance: none;
  -webkit-appearance: none;
}

/* Selects: aspect discret, harmonisé avec les inputs */
select {
  height: var(--control-h);
  padding: 10px 12px;
  border: 1px solid var(--soft-border);
  border-radius: 6px;
  background: #f9fafb;
  color: #334155;
  font-size: 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
select:focus { border-color: var(--accent-600); box-shadow: 0 0 0 4px rgba(18, 52, 107, 0.12); background: #fff; }

/* Toolbar fields (Documents page): compacts et alignés */
.toolbar-field {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #334155;
  font-size: 13px;
  border-radius: 6px;
  box-shadow: none;
  outline: none;
  width: auto;
  margin: 0;
}
.toolbar-field:focus { border-color: var(--accent-600); box-shadow: 0 0 0 3px rgba(18,52,107,0.12); background: #fff; }
select.toolbar-field { padding: 0 10px; }
/* Search fields: isolated theming */
.search-field {
  background: var(--search-bg) !important;
  border-color: var(--search-border) !important;
  color: var(--search-text);
}
.search-field:focus {
  border-color: var(--accent-600) !important;
  box-shadow: 0 0 0 3px rgba(18,52,107,0.12);
  background: #fff !important;
}

#clientsSearch, #presetsSearch, #docSearch, #fltSearch, #mailSearch {
  max-height: 36px;
  width: 240px;
}
/* Override form input global margin for the search field specifically */
input.toolbar-field[type="text"] { margin-bottom: 0 !important; }
input.toolbar-field[type="date"] { margin-bottom: 0 !important; }

/* Viewer actions bar: align controls and remove extra top margins */
.viewer-actions .btn { margin-top: 0 !important; }
.viewer-actions .toolbar-field { margin-top: 0 !important; margin-bottom: 0 !important; }
.mail-toolbar { display:flex; align-items:center; gap:8px; width: 100%; flex-wrap: nowrap; }
.toggle-group { display:inline-flex; align-items:center; gap:8px; padding:0px 3px; margin:0; flex: 1 1 auto; width: 100%; flex-wrap: nowrap; }
.toggle-btn { height: 36px; padding: 0 16px; display:inline-flex; align-items:center; justify-content:center; flex: 1 1 0; }
.toggle-group input[type="radio"]:checked + .toggle-btn {
  background: #e7f0ff !important; /* fond de couleur actif */
  color: #0f172a !important;
  box-shadow: none;
  border: 1px solid #3b82f6;
}
.toggle-group .toggle-btn:hover {
  background: rgba(231, 240, 255, 0.6);
  color: #0f172a;
}
/*.mail-toolbar #mailSearch { flex: 0 0 20%; max-width: 20%; min-width: 220px; height: 36px; margin: 0; }*/
.mail-toolbar .btn { margin-top: 0; height: 36px; width: auto; }

.mail-toolbar .mail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 40%;
  max-width: 40%;
  min-width: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
  justify-content: flex-end;
  margin-left: 0;
}
.mail-toolbar .mail-actions .toolbar-field {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
.mail-toolbar .mail-actions .btn {
  flex: 0 0 auto;
}

.mail-toolbar .mail-folders-toggle {
  flex: 0 1 60%;
  max-width: 60%;
  min-width: 0;
  width: 100%;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: thin;
}
.mail-toolbar .mail-folders-toggle::-webkit-scrollbar {
  height: 6px;
}
.mail-toolbar .mail-folders-toggle::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}
.mail-toolbar .mail-folders-toggle .toggle-option {
  flex: 1 1 0;
  min-width: 0;
}
.mail-toolbar .mail-folders-toggle .toggle-btn {
  flex: 1 1 auto;
  width: 100%;
  white-space: nowrap;
  justify-content: center;
}

.page-mailbox .mail-toolbar .toggle-group {
  max-width: 60%;
}

/* Email body rendering */
.email-body {
  background: #f7fafc;
  padding: 12px;
  margin-top: 20px;
  color: #0f172a;
  overflow: visible;
  border-radius: 2px;
  font-size: 14px;
  line-height: 1.5;
}
.email-body, .email-body * { font-family: inherit !important; color: #0f172a; }
.email-body img { max-width: 100%; height: auto; }
.email-body table { width: 100%; border-collapse: collapse; }
.email-plain {
  white-space: pre-wrap;
  margin: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
}



/* Mailbox section titles */
.mail-section-title {
  margin: 0 0 8px !important;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}
/* Ensure identical title style for both cards on mail page */
h2.mail-section-title { font-size: 1.15rem; font-weight: 700; color: #0f172a; }

/* Remove top margin for the first message card in the right column */
.preview-container > .card:first-child { margin-top: 0 !important; }
/* And for the first list card in the left column */
.form-container > .card:first-child { margin-top: 0 !important; }
/* Mail page: restore top margin for Message card */
.mail-split .preview-container > .card:first-child { margin-top: var(--v-gap) !important; }

/* Increase contrast for the date field in preview popup */
#viDate.toolbar-field {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  height: 36px !important;   /* aligne la hauteur avec les boutons */
  padding: 0 12px;            /* padding cohérent avec les boutons */
}
.viewer-actions .btn { height: 36px; } /* boutons même hauteur que le champ date */
/* même logique pour les textareas du formulaire */
.form-container textarea { margin-bottom: var(--field-gap); }

/* Calendar toolbar + legend */
.calendar-toolbar { display:flex; align-items:center; gap: 10px; flex-wrap: wrap; margin: 0px 0 16px; }
.calendar-toolbar .left { display:flex; align-items:center; gap: 6px; }
.calendar-toolbar .right { display:flex; align-items:center; gap: 8px; margin-left:auto; }
.calendar-toolbar .cal-current { font-weight: 700; min-width: 220px; text-align:center; }
.calendar-toolbar .chk { display:inline-flex; align-items:center; gap:6px; font-size:13px; }
.calendar-toolbar .btn { margin-top: 0 !important; }
.calendar-legend { display:flex; align-items:center; gap: 10px; color:#64748b; font-size: 12px; }
.calendar-legend .legend-item { display:inline-flex; align-items:center; gap:6px; }
.calendar-legend .legend-dot { width:10px; height:10px; border-radius:50%; display:inline-block; background:#0f172a; }
.calendar-legend .legend-dot.devis { background:#ef4444; }
.calendar-legend .legend-dot.facture { background:#3b82f6; }

input[type="text"]::placeholder,
input[type="number"]::placeholder {
  color: #9ca3af;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
input[type="password"]:focus,
input[type="date"]:focus {
  border-color: var(--accent-600);
  box-shadow: 0 0 0 4px rgba(18, 52, 107, 0.12);
  background: #fff;
}

/* Textarea style harmonized with inputs */
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--soft-border);
  border-radius: 5px;
  font-size: 14px;
  outline: none;
  background: #f9fafb;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  margin-bottom: var(--field-gap);
  min-height: 140px;
}
textarea:focus { border-color: var(--accent-600); box-shadow: 0 0 0 4px rgba(18,52,107,0.12); background: #fff; }

/* Compose overlay: center file button inside field */
.compose-form input[type="file"] { height: 50px; margin-bottom: var(--field-gap); background: #f9fafb; }
.compose-form input[type="file"]::file-selector-button,
.compose-form input[type="file"]::-webkit-file-upload-button {
  height: 36px;
  padding: 0 12px;
  margin: 0 12px 0 0;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  top: -10px; /* remonte de 10px */
}

/* Harmonise le bouton calendrier natif */
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.75; }
input[type="date"]::-webkit-inner-spin-button { display: none; }
input[type="date"]::-webkit-clear-button { display: none; }

/* ========== Boutons d'action (Générer / Télécharger) ========== */
.btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, transform .05s ease;
  box-shadow: var(--shadow-soft);
  text-decoration: none;            /* pas de soulignement sur les liens .btn */
  display: inline-flex;             /* alignement vertical centré */
  align-items: center;
  justify-content: center;
  white-space: nowrap;              /* texte sur une seule ligne */
}
/* Icône dans les boutons */
.btn .icon { width: 18px; height: 18px; margin-right: 8px; flex: 0 0 auto; }
.btn:hover { background: var(--accent-700); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--accent-600); box-shadow: var(--shadow-soft); }
.btn.danger { background: #ea443cdb; }
.btn.danger:hover { background: #b5342edb; }
.btn.ghost { background: #00000010; color: #334155; border: 1px solid var(--soft-border); box-shadow: none; }
.btn.ghost:hover { background: #f2f4f7; }
/* Small button */
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn.narrow { padding: 0 6px; font-size: 12px; }

/* Documents list specific */
.table-download, .table-actions { vertical-align: middle; }
.download-btn { height: 36px; padding: 0 12px; width: 140px; }
#docsTable .actions-cell .btn { width: auto; flex: 0 0 auto; }
.actions-cell { display: flex; gap: 8px; justify-content: flex-start; align-items: center; }
#docsTable tbody td { vertical-align: middle; }
#docsTable .btn.sm, #docsTable .download-btn, #docsTable .icon-btn { height: 36px; }
#docsTable .btn { margin-top: 0 !important; }
#docsTable { table-layout: fixed; }
#docsTable th, #docsTable td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#docsTable tr.highlight-doc-row td { background: rgba(37, 99, 235, 0.14) !important; transition: background-color .6s ease; }
.actions-cell { display: flex; gap: 8px; justify-content: flex-start; align-items: center; flex-wrap: nowrap; }
.table-download.actions-cell { justify-content: flex-start; }
/* Colonne Actions suffisamment large pour 4 boutons */
#docsTable th.actions-col, #docsTable td.actions-col { width: 420px; }
.actions-cell { display: flex; gap: 8px; justify-content: flex-start; align-items: center; }
.invoice-paid-toggle { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; border:1px solid var(--soft-border); background:#f1f5f9; font-size:13px; font-weight:600; color:#1f2937; cursor:pointer; transition:background .2s ease, border-color .2s ease, color .2s ease; }
.invoice-paid-toggle input { width:16px; height:16px; accent-color: var(--accent); cursor:pointer; }
.invoice-paid-toggle span { line-height:1; }
.invoice-paid-toggle.is-checked { background:#dcfce7; border-color:#86efac; color:#166534; }
tr.is-paid, tr.in-folder.is-paid { background-image: linear-gradient(90deg, rgba(16,185,129,0.08), rgba(255,255,255,0)); }
tr.is-paid .actions-left .download-btn, tr.in-folder.is-paid .actions-left .download-btn { background: rgba(16,185,129,0.16); color:#047857; border-color: rgba(16,185,129,0.25); }
tr.is-paid .actions-left .download-btn:hover, tr.in-folder.is-paid .actions-left .download-btn:hover { background: rgba(16,185,129,0.24); }

/* Dossiers (documents.php) */
.folder-row td { vertical-align: middle; }
.folder-toggle { border: 1px solid var(--soft-border); background: #f2f4f7; border-radius: 6px; }
.folder-toggle:hover { background: #eef2f7; }
.in-folder td { background: #e7e9ec; /* léger fond pour contraster les éléments d'un dossier */ }

/* Badges de statut (URSSAF) */
.status-badge {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255,255,255,0.15);
  text-transform: uppercase;
}
.status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .95;
}
.status-badge.gray { background:#e5e7eb; color:#111827; border: 1px solid #cbd5e1; }
.status-badge.green { background:#16a34a; color:#ffffff; border: 1px solid #0f8f3a; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 3px rgba(34,197,94,0.18); }
.status-badge.red { background:#dc2626; color:#ffffff; border: 1px solid #b91c1c; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 3px rgba(239,68,68,0.18); animation: statusPulse 1.5s ease-in-out infinite; }

@keyframes statusPulse {
  0% { box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 0 rgba(239,68,68,0.18); }
  70% { box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 8px rgba(239,68,68,0.0); }
  100% { box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 0 rgba(239,68,68,0.0); }
}

/* Détail années (revenus.php): contraste accru quand déplié */
.year-details { background: #f3f6fb !important; }
.year-details td { background: #f3f6fb !important; }
.year-details table { background: transparent !important; }
.year-details tbody tr { background: transparent !important; }
.year-details td[colspan] { border-left: 3px solid #c3dafc; }

/* Pastilles marque (ELS Studio / Production) */
.brand-icon { width:14px; height:14px; margin-left:8px; vertical-align:middle; display:inline-block; flex: 0 0 auto; }
.brand-icon.folder { margin-left:0; margin-right:4px; color:#1f2937; }
.brand-icon.studio { fill:#ef4444; }
.brand-icon.prod   { fill:#3b82f6; }
/* Wrapper */
.brand-chip { display:inline-flex; align-items:center; }

/* Presets overlay: larger description field for module creation */
#presetsOverlay .item-desc { min-height: 180px; }

/* Calendar (removed) */
/* Icon-only button for actions */
.icon-btn { background: transparent; border: 0; padding: 0; width: 36px; height: 36px; line-height: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn .icon { margin-right: 0; width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(0,0,0,0.05); }
.danger-icon .icon { color: #dc2626; }
/* Harmonise les icônes (retour, réglages, logout) en gris */
.brand-actions .icon-btn .icon { color: #64748b; }

/* Global subtle rounding for fields and buttons */
button,
.btn,
.icon-btn,
.menu-btn,
.toggle-btn,
.toggle-group,
.toggle-btn,
.toggle-inline,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
.file-btn,
.download-btn {
  border-radius: 100px;
}

/* Override header button height when using .sm */
.brand-actions .btn.sm { height: 36px !important; }

/* PDF viewer overlay */
.pdf-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; z-index: 10000; align-items: center; justify-content: center; }
.viewer-card { background: #ffffff; width: min(92vw, 1000px); height: min(90vh, 800px); border: 1px solid #e5e7eb; box-shadow: 0 20px 60px rgba(0,0,0,0.15); display: flex; flex-direction: column; }
.viewer-toolbar { display:flex; align-items:center; justify-content: space-between; padding: 8px 10px; background: #f8fafc; color:#0f172a; border-bottom: 1px solid #e5e7eb; }
.viewer-toolbar .title { font-weight: 600; font-size: 14px; }

/* Overlay form fields (consistency/margins) */
.overlay-body .toolbar-field { margin: 8px 0 !important; }
.overlay-body textarea.toolbar-field { min-height: 80px; line-height: 1.35; padding: 10px 12px; }
.viewer-close { background: transparent; border: 0; color: #0f172a; padding: 6px; cursor: pointer; }
.viewer-frame { flex: 1; border: 0; background: #fff; }
.overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.90); /* no blur */ display: none; z-index: 10000; align-items: center; justify-content: center; }
.overlay-card { background: #ffffff; color:#0f172a; width: min(92vw, 1000px); min-height: 60vh; max-height: 100vh; overflow: hidden; border: 1px solid #e5e7eb; box-shadow: 0 20px 60px rgba(0,0,0,0.15); display: flex; flex-direction: column; }
.overlay-card-message { background: #ffffff; color:#0f172a; width: min(92vw, 1000px); height: auto; overflow: hidden; border: 1px solid #e5e7eb; box-shadow: 0 20px 60px rgba(0,0,0,0.15); display: flex; flex-direction: column; }
.overlay-header { display:flex; align-items:center; justify-content: space-between; padding: 10px 12px; background: linear-gradient(45deg, #366DA7, #2B4A83); border-bottom: 1px solid #e5e7eb; }
.overlay-title { font-weight: 700; font-size: 15px; color: white;}
.overlay-close { background: transparent; border: 0; color: #ffffff; padding: 6px; cursor: pointer; font-size: 22px; line-height: 1; }
.overlay-body { padding: 12px; overflow:auto; background: #fff; flex: 1 1 auto; }
.overlay-card .overlay-body { max-width: 980px; margin: 0 0; }
.overlay-footer { padding: 10px 12px; display:flex; justify-content: flex-start; gap: 8px; background: #f8fafc; border-top: 1px solid #e5e7eb; }
.overlay-footer #createClientBtn { width: 20%; min-width: 120px; }
.overlay-footer #createPresetBtn { width: 20%; min-width: 120px; }
.overlay-footer .btn { margin-top: 0; }

/* Btn Supprimer */

#ccDiscardBtn {
  background-color: #ea443cdb;
  color: #ffffff;
}

.btn.secondary.nav-mail.active {
background-color: #12346b;
color: #0ea5e9;
}
.btn.secondary.nav-cal.active {
background-color: #12346b;
color: #0ea5e9;
}
.btn.secondary.nav-rev.active {
background-color: #12346b;
color: #0ea5e9;
}
.btn.secondary.nav-gen.active {
background-color: #12346b;
color: #0ea5e9;
}
.btn.secondary.nav-home.active {
background-color: #12346b;
color: #0ea5e9;
}
.btn.secondary.nav-docs.active {
background-color: #12346b;
color: #0ea5e9;
}
.btn.secondary.nav-clients.active {
background-color: #12346b;
color: #0ea5e9;
}
.btn.secondary.nav-storage.active {
background-color: #12346b;
color: #0ea5e9;
}

.btn.secondary.nav-home:hover {
background-color: #ffffff35;
color: #ffffff;
}
.btn.secondary.nav-docs:hover {
background-color: #ffffff35;
color: #ffffff;
}
.btn.secondary.nav-rev:hover {
background-color: #ffffff35;
color: #ffffff;
}
.btn.secondary.nav-cal:hover {
background-color: #ffffff35;
color: #ffffff;
}
.btn.secondary.nav-mail:hover {
background-color: #ffffff35;
color: #ffffff;
}
.btn.secondary.nav-gen:hover {
background-color: #ffffff35;
color: #ffffff;
}
.btn.secondary.nav-clients:hover {
background-color: #ffffff35;
color: #ffffff;
}
.btn.secondary.nav-storage:hover {
background-color: #ffffff35;
color: #ffffff;
}



/* Settings overlay sections */
.settings-section { margin: 0; }
.settings-summary { display:flex; align-items:center; gap:8px; list-style:none; font-weight:700; cursor:pointer; padding:8px 10px; border: 1px solid var(--soft-border); border-radius: 10px; background: #f2f4f7; }
.settings-summary::-webkit-details-marker { display:none; }
.settings-summary .chev { width: 16px; height: 16px; transition: transform .15s ease; }
.settings-section[open] .settings-summary .chev { transform: rotate(90deg); }
.settings-section[open] .settings-summary { background: #eef2f7; }
.settings-body { margin-top: 8px; padding: 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #ffffff; }
.settings-section[open] .settings-body { background: #f7fafc; }

/* Inputs visibles dans le panneau paramètres */
#settingsOverlay .settings-body input[type="text"],
#settingsOverlay .settings-body input[type="number"],
#settingsOverlay .settings-body input[type="email"],
#settingsOverlay .settings-body input[type="password"] {
  background: #ffffff;
  border-color: #cbd5e1;
}
#settingsOverlay .settings-body input[type="color"] { height: 36px; width: 100%; padding: 0; border:1px solid #cbd5e1; border-radius: 8px; background:#fff; }
.clients-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.clients-grid-page { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dashboard-main { display:flex; flex-direction:column; gap:18px; padding:18px 0 36px; }
.page-dashboard .dashboard-main { display:flex; flex:1 1 auto; flex-direction:column; padding:0; gap:0; min-height:0; }
.dashboard-toolbar { display:flex; justify-content:flex-end; margin-bottom:18px; flex:0 0 auto; }
.dashboard-toolbar .btn { width:auto; }
.dashboard-intro { padding:18px 22px; background: linear-gradient(135deg, rgba(15,23,42,0.08), rgba(59,130,246,0.1)); border-radius:18px; border:1px solid rgba(148,163,184,0.25); }
.dashboard-intro-body { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:20px; }
.dashboard-intro h1 { margin:0; font-size:24px; color:#0f172a; }
.dashboard-intro p { margin:4px 0 0; max-width:560px; color:#475569; }
.dashboard-intro .intro-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.dashboard-board { background:transparent; border:none; box-shadow:none; padding:0; margin:0; flex:1 1 auto; display:flex; flex-direction:column; min-height:0; }
.board-grid { position:relative; flex:1 1 auto; min-height:0; border:1px solid rgba(148,163,184,0.25); border-radius:12px; background:#fff; overflow:auto; }
.board-grid, .board-grid * { user-select: none; }
.board-grid::before { content:none; }
.board-grid:focus { outline:2px solid #2563eb; outline-offset:4px; }
.board-empty { position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); color:#64748b; font-size:15px; text-align:center; pointer-events:auto; }
.dashboard-widget { position:absolute; top:0; left:0; display:flex; flex-direction:column; border-radius:6px; border:1px solid rgba(15,23,42,0.06); box-shadow:0 12px 24px rgba(15,23,42,0.12); background:rgba(255,255,255,0.95); backdrop-filter:blur(6px); transition:box-shadow .2s ease, transform .2s ease; overflow:hidden; }
.dashboard-widget:hover { box-shadow:0 16px 32px rgba(15,23,42,0.16); transform:translateY(-1px); }
.widget-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 12px; background: var(--color-grad-01); color:#f8fafc; cursor:grab; touch-action:none; border-top-left-radius:6px; border-top-right-radius:6px; }
.widget-header:active { cursor:grabbing; }
.widget-title { font-weight:700; font-size:15px; letter-spacing:0.04em; text-transform:uppercase; }
.widget-actions { display:flex; gap:6px; }
.widget-actions .icon-btn { background:transparent; border:0; color:#f8fafc; width:28px; height:28px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.widget-actions .icon-btn:hover { background:rgba(255,255,255,0.18); }
.widget-actions .icon-btn svg { width:16px; height:16px; stroke:currentColor; stroke-width:2; fill:none; }
.widget-body { padding:16px; flex:1 1 auto; display:flex; flex-direction:column; gap:12px; color:#0f172a; overflow:auto; }
.widget-body .widget-link { color:#2563eb; font-weight:600; text-decoration:none; }
.widget-body .widget-link:hover { text-decoration:underline; }
.widget-resizer { position:absolute; width:18px; height:18px; right:8px; bottom:8px; border-radius:4px; background:rgba(148,163,184,0.6); cursor:se-resize; touch-action:none; }
.widget-resizer::after { content:""; position:absolute; inset:3px; border-bottom:2px solid rgba(255,255,255,0.9); border-right:2px solid rgba(255,255,255,0.9); border-radius:2px; }
.widget-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.widget-list.compact { gap:6px; }
.dashboard-widget[data-widget-type="documents_recents"] .widget-list .widget-list-item { cursor:pointer; transition:background-color .2s ease; min-height:80px; display:flex; flex-direction:column; justify-content:space-between; }
.dashboard-widget[data-widget-type="documents_recents"] .widget-list-item .list-meta { margin-top:auto; align-self:flex-end; }
.dashboard-widget[data-widget-type="documents_recents"] .widget-list-item:hover { background:rgba(37,99,235,0.08); }
.dashboard-widget[data-widget-type="documents_recents"] .widget-list-item:focus { outline:2px solid rgba(37,99,235,0.35); outline-offset:2px; }
.dashboard-widget[data-widget-type="documents_recents"] .list-title { font-size:16px; font-weight:700; color:#0f172a; }
.dashboard-widget[data-widget-type="documents_recents"] .list-sub { font-size:13px; color:#475569; }
.dashboard-widget[data-widget-type="documents_recents"] .list-meta { font-size:13px; color:#0f172a; }
.dashboard-widget[data-widget-type="quick_actions"] .widget-body { gap:16px; overflow:hidden; justify-content:center; }
.quick-actions-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); grid-auto-rows:minmax(64px, 1fr); gap:12px; align-content:stretch; align-items:stretch; height:100%; }
.quick-action-btn { display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:12px; background:rgba(15,23,42,0.04); border:1px solid rgba(15,23,42,0.08); color:#0f172a; font-weight:600; text-decoration:none; transition:transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.quick-action-btn:hover { background:rgba(37,99,235,0.12); box-shadow:0 12px 24px rgba(37,99,235,0.12); transform:translateY(-1px); }
.quick-action-btn:focus { outline:2px solid rgba(37,99,235,0.35); outline-offset:3px; }
.quick-action-btn .qa-icon { width:36px; height:36px; border-radius:12px; background:linear-gradient(135deg, rgba(37,99,235,0.16), rgba(6,182,212,0.18)); display:flex; align-items:center; justify-content:center; color:#1d4ed8; flex:0 0 auto; }
.quick-action-btn .qa-icon svg { width:22px; height:22px; }
.quick-action-btn .qa-label { flex:1 1 auto; min-width:0; }
.dashboard-widget[data-widget-type="revenus_snapshot"] .widget-body { gap:12px; overflow:hidden; display:flex; flex-direction:column; padding:12px; box-sizing:border-box; min-height:0; }
.revenus-clients { display:flex; flex-direction:column; gap:10px; flex:1 1 auto; min-height:0; }
.revenus-clients-title { font-size:14px; margin-top: 20px; font-weight:700; color:#0f172a; }
.revenus-clients-empty { font-size:13px; color:#64748b; padding:10px 12px; border:1px dashed rgba(148,163,184,0.6); border-radius:10px; background:rgba(248,250,252,0.6); }
.revenus-clients-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; flex:1 1 auto; min-height:0; overflow:auto; }
.revenus-client-item { display:flex; align-items:center; gap:12px; padding:8px 10px; border-radius:12px; background:rgba(241,245,249,0.9); border:1px solid rgba(226,232,240,0.9); }
.revenus-client-item .client-rank { width:24px; height:24px; border-radius:50%; background:#1d4ed8; color:#ffffff; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:12px; }
.revenus-client-item .client-info { display:flex; flex-direction:column; gap:2px; flex:1 1 auto; min-width:0; }
.revenus-client-item .client-name { font-weight:600; color:#0f172a; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.revenus-client-item .client-meta { font-size:12px; color:#64748b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.revenus-client-item .client-amount { font-weight:700; color:#1d4ed8; font-size:14px; flex:0 0 auto; margin-left:auto; text-align:right; }
.revenus-main-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:12px; flex:0 0 auto; }
.revenus-main-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:12px; flex:0 0 auto; }
.revenus-main-cards > * { min-height:0; }
.revenus-card { padding:14px; border-radius:12px; border:1px solid rgba(15,23,42,0.08); background:linear-gradient(135deg, rgba(15,23,42,0.06), rgba(59,130,246,0.08)); display:flex; flex-direction:column; gap:6px; box-shadow:0 8px 18px rgba(15,23,42,0.08); }
.revenus-card-label { font-size:11px; letter-spacing:0.08em; text-transform:uppercase; color:#1d4ed8; font-weight:700; }
.revenus-card-value { font-size:22px; font-weight:800; color:#0f172a; }
.revenus-card-sub { font-size:12px; color:#475569; }
.revenus-brand-cards { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); grid-auto-rows:1fr; gap:12px; flex:1 1 auto; min-height:0; align-items:stretch; }
.revenus-brand-card { position:relative; border-radius:12px; border:1px solid rgba(15,23,42,0.08); background:rgba(255,255,255,0.95); box-shadow:0 8px 16px rgba(15,23,42,0.08); padding:12px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; text-align:center; height:100%; min-height:0; }
.revenus-brand-value { font-size:18px; font-weight:800; color:#0f172a; }
.dashboard-widget[data-widget-type="mailbox_status"] .widget-body { gap:12px; padding:12px; box-sizing:border-box; overflow:hidden; min-height:0; display:flex; flex-direction:column; }
.mailbox-widget-info { font-size:13px; color:#475569; }
.mailbox-widget-error { font-size:13px; color:#b91c1c; }
.mailbox-preview-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; min-height:0; overflow:auto; flex:1 1 auto; }
.mailbox-preview { border-radius:12px; border:1px solid rgba(15,23,42,0.08); background:rgba(248,250,252,0.95); padding:10px 12px; display:flex; flex-direction:column; gap:6px; box-shadow:0 6px 14px rgba(15,23,42,0.08); cursor:pointer; transition:background-color .2s ease, box-shadow .2s ease; }
.mailbox-preview:hover { background:rgba(37,99,235,0.08); box-shadow:0 10px 18px rgba(15,23,42,0.12); }
.mailbox-preview:focus { outline:2px solid rgba(37,99,235,0.35); outline-offset:2px; }
.mailbox-preview.unseen .mailbox-preview-subject { font-weight:700; }
.mailbox-preview-subject { font-size:15px; color:#0f172a; font-weight:600; }
.mailbox-preview-meta { font-size:12px; color:#64748b; }
.mailbox-preview-body { font-size:13px; color:#475569; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.dashboard-widget[data-widget-type="calendar_agenda"] .widget-body { gap:12px; padding:12px; box-sizing:border-box; overflow:hidden; min-height:0; display:flex; flex-direction:column; }
.agenda-week-grid { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:10px; flex:1 1 auto; min-height:0; }
.agenda-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.agenda-toolbar-label { flex:1 1 auto; text-align:center; font-size:14px; font-weight:600; color:#0f172a; }
.agenda-nav-btn { width:32px; height:32px; border-radius:10px; border:1px solid rgba(148,163,184,0.4); background:#fff; color:#1e293b; display:inline-flex; align-items:center; justify-content:center; font-size:18px; line-height:1; cursor:pointer; transition:background-color .2s ease, border-color .2s ease, color .2s ease; }
.agenda-nav-btn:hover:not(:disabled) { background:rgba(37,99,235,0.12); border-color:rgba(37,99,235,0.3); color:#2563eb; }
.agenda-nav-btn:disabled { opacity:0.4; cursor:not-allowed; }
.agenda-body { display:flex; flex-direction:column; gap:12px; flex:1 1 auto; height:100%; }
.agenda-day { border-radius:12px; border:1px solid rgba(148,163,184,0.25); background:rgba(248,250,252,0.95); padding:10px 12px; display:flex; flex-direction:column; gap:8px; min-height:0; }
.agenda-day-header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.agenda-day-name { font-size:13px; font-weight:700; color:#1e293b; }
.agenda-day-date { font-size:18px; font-weight:800; color:#0f172a; }
.agenda-events { flex:1 1 auto; display:flex; flex-direction:column; gap:8px; min-height:0; overflow:auto; }
.agenda-event { border-radius:10px; border:1px solid rgba(15,23,42,0.08); background:#fff; padding:8px 10px; display:flex; flex-direction:column; gap:4px; box-shadow:0 4px 10px rgba(15,23,42,0.08); cursor:pointer; transition:background-color .2s ease, box-shadow .2s ease; }
.agenda-event:hover { background:rgba(37,99,235,0.08); box-shadow:0 6px 14px rgba(37,99,235,0.12); }
.agenda-event:focus { outline:2px solid rgba(37,99,235,0.35); outline-offset:2px; }
.agenda-event-title { font-size:10px; font-weight:600; color:#0f172a; }
.agenda-event-time { font-size:8px; color:#64748b; }
.agenda-empty { font-size:12px; color:#94a3b8; text-align:center; padding:8px 0; }
.revenus-brand-title { font-size:10px; letter-spacing:0.05em; text-transform:uppercase; color:#1e293b; font-weight:700; }
.revenus-brand-value { font-size:20px; font-weight:800; color:#0f172a; }
.dashboard-widget[data-widget-type="urssaf_status"] .widget-body { gap:16px; display:flex; flex-direction:column; padding:16px; box-sizing:border-box; overflow:hidden; min-height:0; }
.urssaf-status-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.urssaf-period-nav { display:flex; align-items:center; gap:8px; flex:1 1 auto; min-width:0; }
.urssaf-nav-btn { appearance:none; border:1px solid rgba(148,163,184,0.45); background:rgba(241,245,249,0.9); color:#0f172a; width:34px; height:34px; border-radius:999px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; transition:background-color .2s ease, border-color .2s ease, color .2s ease; flex-shrink:0; }
.urssaf-nav-btn:hover { background:rgba(59,130,246,0.12); border-color:rgba(37,99,235,0.35); color:#2563eb; }
.urssaf-nav-btn:active { background:rgba(37,99,235,0.18); border-color:rgba(37,99,235,0.4); color:#1d4ed8; }
.urssaf-nav-btn:disabled { opacity:0.4; cursor:not-allowed; background:rgba(241,245,249,0.65); color:#94a3b8; border-color:rgba(148,163,184,0.3); }
.urssaf-nav-btn svg { width:18px; height:18px; }
.urssaf-period-block { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; }
.urssaf-period { font-size:15px; font-weight:700; color:#0f172a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.urssaf-current-banner { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:13px; color:#1e293b; }
.urssaf-current-indicator { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; font-size:11px; font-weight:600; color:#1d4ed8; background:rgba(37,99,235,0.14); border:1px solid rgba(37,99,235,0.24); text-transform:uppercase; letter-spacing:0.06em; }
.urssaf-current-indicator::before { content:''; width:6px; height:6px; border-radius:50%; background:#2563eb; }
.urssaf-current-label { font-weight:700; color:#0f172a; }
.status-badge { display:inline-flex; align-items:center; padding:6px 14px; border-radius:999px; font-weight:600; font-size:13px; border:1px solid transparent; flex-shrink:0; }
.status-open { background:rgba(34,197,94,0.16); border-color:rgba(34,197,94,0.35); color:#047857; }
.status-closed { background:rgba(148,163,184,0.2); border-color:rgba(148,163,184,0.45); color:#1f2937; }
.status-pending { background:rgba(251,191,36,0.16); border-color:rgba(251,191,36,0.35); color:#92400e; }
.widget-list-item { display:flex; flex-direction:column; gap:2px; padding:8px 10px; border-radius:12px; background:rgba(248,250,252,0.85); border:1px solid rgba(226,232,240,0.7); }
.widget-list-item .list-title { font-weight:600; font-size:14px; color:#0f172a; }
.widget-list-item .list-sub { font-size:12px; color:#64748b; }
.widget-list-item .list-meta { margin-top:4px; align-self:flex-end; font-weight:600; font-size:13px; color:#2563eb; }
.widget-columns { display:flex; gap:16px; flex-wrap:wrap; }
.widget-col { flex:1 1 160px; display:flex; flex-direction:column; gap:8px; }
.widget-col h4 { margin:0; font-size:14px; font-weight:700; color:#1e293b; text-transform:uppercase; letter-spacing:0.04em; }
.widget-kpi, .widget-stat-block { display:flex; flex-direction:column; gap:4px; padding:12px 14px; border-radius:14px; background:linear-gradient(135deg, rgba(37,99,235,0.12), rgba(6,182,212,0.12)); border:1px solid rgba(37,99,235,0.2); }
.widget-kpi .kpi-label { font-size:12px; letter-spacing:0.04em; text-transform:uppercase; color:#2563eb; }
.widget-kpi .kpi-value { font-size:20px; font-weight:800; color:#0f172a; }
.stat-value { font-size:28px; font-weight:800; color:#0f172a; }
.stat-label { font-size:12px; color:#475569; letter-spacing:0.03em; text-transform:uppercase; }
.widget-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px,1fr)); gap:12px; }
.widget-note { padding:12px 14px; border-radius:14px; background:rgba(15,23,42,0.05); border:1px solid rgba(15,23,42,0.08); font-size:13px; color:#1e293b; }
.widget-note .note-title { font-weight:700; margin-bottom:6px; color:#0f172a; }
.widget-note .note-line { margin-top:4px; }
.widget-badge { display:inline-flex; align-items:center; padding:6px 12px; border-radius:999px; font-weight:600; font-size:13px; }
.widget-badge.ok { background:rgba(34,197,94,0.16); color:#047857; border:1px solid rgba(16,185,129,0.4); }
.widget-badge.warning { background:rgba(251,191,36,0.18); color:#92400e; border:1px solid rgba(217,119,6,0.35); }
.widget-links { display:flex; gap:12px; flex-wrap:wrap; }
.widget-links .widget-link { padding:8px 12px; border-radius:10px; background:rgba(37,99,235,0.12); border:1px solid rgba(37,99,235,0.2); }
.widget-links .widget-link:hover { background:rgba(37,99,235,0.2); }
.widget-library-card { width:min(92vw, 520px); max-height:90vh; }
.widget-library-card .overlay-header { padding:16px 20px; }
.widget-library-card .overlay-title { font-size:18px; }
.widget-library-body { padding:12px 20px 20px; overflow-y:auto; display:flex; flex-direction:column; gap:12px; }
.widget-library-item { position:relative; display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:12px 14px; border-radius:14px; border:1px solid rgba(148,163,184,0.35); background:#f8fafc; text-align:left; }
.widget-library-item:hover { border-color:#2563eb; box-shadow:0 10px 24px rgba(37,99,235,0.18); background:#fff; }
.widget-library-info { display:flex; flex-direction:column; gap:6px; max-width:70%; }
.widget-library-title { font-weight:700; font-size:15px; color:#0f172a; }
.widget-library-desc { font-size:13px; color:#475569; }
.widget-library-meta { font-size:12px; color:#64748b; }
.card-subtitle { margin:4px 0 0; color:#475569; font-size:0.95rem; }
.widget-library-add { position:absolute; right:12px; bottom:12px; width:36px; height:36px; border-radius:12px; border:1px solid rgba(37,99,235,0.2); background:rgba(37,99,235,0.1); color:#2563eb; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.widget-library-add svg { width:18px; height:18px; }
.widget-library-item:hover .widget-library-add { background:rgba(37,99,235,0.18); }
.widget-badge + .widget-link { align-self:flex-start; }
.widget-body::-webkit-scrollbar { width:8px; }
.widget-body::-webkit-scrollbar-thumb { background:rgba(148,163,184,0.6); border-radius:999px; }
.storage-layout { display:grid; grid-template-columns: minmax(280px, 1fr); gap:20px; margin-top:18px; }
@media (min-width: 1024px) {
  .storage-layout { grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.2fr); }
}
.storage-upload, .storage-list {
  display:flex;
  flex-direction:column;
  gap:18px;
}
.storage-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.storage-card-head .card-title { margin:0; font-size:1.15rem; }
.storage-card-head .card-subtitle { font-size:0.95rem; }
.dashboard-widget[data-widget-type="storage_quick"] .widget-body { display:flex; flex-direction:column; gap:12px; padding:16px; box-sizing:border-box; }
.dashboard-widget[data-widget-type="payments_tracker"] .widget-body { display:flex; flex-direction:column; gap:12px; padding:16px; box-sizing:border-box; overflow:hidden; min-height:0; }
.dashboard-widget[data-widget-type="quick_tasks"] .widget-body { display:flex; flex-direction:column; gap:12px; padding:16px; box-sizing:border-box; overflow:hidden; min-height:0; }

.payments-widget { display:flex; flex-direction:column; gap:12px; height:100%; min-height:0; }
.payments-summary { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:12px; }
.payments-card { border-radius:10px; border:1px solid rgba(15,23,42,0.08); padding:12px; background:#f8fafc; display:flex; flex-direction:column; gap:6px; box-shadow: 0 1px 2px rgba(15,23,42,0.03); }
.payments-card.overdue { background:#fef2f2; border-color:#fecaca; color:#b91c1c; }
.payments-card.upcoming { background:#fffbeb; border-color:#fde68a; color:#92400e; }
.payments-card.outstanding { background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
.payments-card-title { font-size:13px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; color:inherit; }
.payments-card-amount { font-size:20px; line-height:1.2; color:inherit; }
.payments-card-count { font-size:13px; color:rgba(15,23,42,0.7); }
.payments-caption { margin:0; font-size:12px; color:#64748b; }
.payments-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; flex:1; overflow:auto; }
.payments-item { border:1px solid var(--soft-border); border-radius:10px; padding:12px 14px; display:flex; flex-direction:column; gap:8px; background:#ffffff; box-shadow:0 1px 2px rgba(15,23,42,0.04); }
.payments-item.status-overdue { border-color:rgba(220,38,38,0.4); }
.payments-item.status-upcoming { border-color:rgba(217,119,6,0.4); }
.payments-item.status-ok { border-color:rgba(37,99,235,0.35); }
.payments-item-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.payments-number { font-weight:700; color:#0f172a; font-size:15px; }
.payments-amount { font-weight:700; color:#0f172a; font-size:15px; }
.payments-client { font-size:14px; font-weight:600; color:#1f2937; }
.payments-meta { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.payments-due { font-size:13px; color:#475569; }
.payments-meta-right { display:flex; align-items:center; gap:8px; }
.payments-status { display:inline-flex; align-items:center; justify-content:center; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; border:1px solid rgba(15,23,42,0.12); background:#f1f5f9; color:#0f172a; }
.payments-status.status-overdue { background:#fee2e2; border-color:#fecaca; color:#b91c1c; }
.payments-status.status-upcoming { background:#fef3c7; border-color:#fde68a; color:#b45309; }
.payments-status.status-ok { background:#dbeafe; border-color:#bfdbfe; color:#1d4ed8; }
.payments-view { margin-top:0 !important; width:auto; }
.payments-empty { padding:14px; text-align:center; font-size:14px; color:#94a3b8; border:1px dashed var(--soft-border); border-radius:8px; }

.tasks-widget { display:flex; flex-direction:column; gap:12px; height:100%; min-height:0; }
.tasks-form { display:flex; gap:8px; align-items:center; }
.tasks-input { flex:1; height:36px; max-height:36px; margin:0 !important; padding:0 12px; border-radius:8px; border:1px solid var(--soft-border); font-size:14px; background:#ffffff; color:#0f172a; display:flex; align-items:center; }
.tasks-input:focus { outline:2px solid rgba(37,99,235,0.35); outline-offset:1px; }
.tasks-form .btn { margin-top:0; width:auto; height:36px; display:inline-flex; align-items:center; }
.tasks-counter { margin:0; font-size:13px; color:#64748b; }
.tasks-counter.is-empty { color:#94a3b8; }
.tasks-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; flex:1; overflow:auto; }
.tasks-item { display:flex; height:38px; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--soft-border); border-radius:8px; background:#f6f6f6; transition:background .2s ease, border-color .2s ease, opacity .2s ease; }
.tasks-item.is-complete { opacity:0.65; }
.tasks-entry { display:flex; align-items:center; gap:10px; flex:1; cursor:pointer; }
.tasks-entry input[type="checkbox"] { width:18px; height:18px; cursor:pointer; accent-color: var(--accent); }
.tasks-text { font-size:14px; color:#0f172a; }
.tasks-item.is-complete .tasks-text { text-decoration:line-through; color:#64748b; }
.tasks-remove { border:0; background:transparent; color:#94a3b8; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:6px; transition:background .2s ease, color .2s ease; }
.tasks-remove:hover { background:#f1f5f9; color:#1f2937; }
.tasks-remove svg { width:18px; height:18px; stroke:currentColor; stroke-width:2; fill:none; }
.tasks-empty { padding:12px; font-size:14px; color:#94a3b8; text-align:center; border:1px dashed var(--soft-border); border-radius:8px; background:#f8fafc; }
.storage-widget { display:flex; flex-direction:column; gap:12px; min-height:0; }
.storage-widget-messages { display:flex; flex-direction:column; gap:8px; }
.storage-widget-form { display:flex; flex-direction:column; gap:12px; }
.storage-widget-drop {
  border:2px dashed rgba(59,130,246,0.35);
  border-radius:14px;
  padding:24px 16px;
  background:rgba(59,130,246,0.06);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  transition:border-color .2s ease, background .2s ease;
  text-align:center;
}
.storage-widget-drop.is-dragover {
  border-color:rgba(37,99,235,0.9);
  background:rgba(37,99,235,0.12);
}
.storage-widget-illustration svg { width:40px; height:40px; stroke:#2563eb; }
.storage-widget-hint { margin:0; font-size:0.85rem; color:#475569; }
.storage-widget-meta { font-size:0.9rem; color:#475569; }
.storage-widget-controls { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.storage-widget-controls .btn { margin-top:0; }
.storage-widget-pick { cursor:pointer; }
.storage-widget-selected { font-size:0.85rem; color:#475569; }
.storage-widget-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; }
.storage-widget-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; max-height:220px; overflow:auto; }
.storage-widget-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border-radius:10px; border:1px solid rgba(148,163,184,0.3); background:#f8fafc; }
.storage-widget-file { display:flex; flex-direction:column; gap:4px; }
.storage-widget-file .name { font-weight:600; color:#0f172a; }
.storage-widget-file .meta { font-size:0.85rem; color:#64748b; }
.storage-widget-download { flex-shrink:0; }
.storage-widget-empty { padding:14px 12px; border:1px dashed rgba(148,163,184,0.35); border-radius:10px; text-align:center; color:#64748b; font-size:0.9rem; }
.storage-alert {
  border-radius:12px;
  padding:12px 14px;
  font-size:0.95rem;
  line-height:1.4;
  transition:opacity 0.4s ease, transform 0.4s ease;
}
.storage-alert.fade-out { opacity:0; transform:translateY(-6px); }
.storage-alert.success { background:rgba(34,197,94,0.16); color:#065f46; border:1px solid rgba(34,197,94,0.35); }
.storage-alert.error { background:rgba(239,68,68,0.16); color:#7f1d1d; border:1px solid rgba(239,68,68,0.35); }
.storage-alert ul { margin:0; padding-left:18px; }
.upload-form { display:flex; flex-direction:column; gap:16px; }
.upload-drop {
  border:2px dashed rgba(59,130,246,0.35);
  border-radius:16px;
  padding:30px 20px;
  text-align:center;
  background:rgba(59,130,246,0.06);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  transition:border-color .2s ease, background .2s ease;
}
.upload-drop.is-dragover {
  border-color:rgba(37,99,235,0.9);
  background:rgba(37,99,235,0.12);
}
.drop-illustration svg { width:48px; height:48px; stroke:#2563eb; }
.drop-title { font-weight:700; font-size:1rem; color:#1f2937; margin:0; }
.drop-sub { margin:0; font-size:0.9rem; color:#64748b; }
.drop-button { cursor:pointer; gap:8px; width:auto; }
.drop-button.btn { width:auto; }
.drop-button input { display:none; }
.drop-hint { margin:0; font-size:0.85rem; color:#475569; }
.drop-warning { margin:0; font-size:0.85rem; color:#b45309; font-weight:600; }
.upload-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.upload-list li {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:10px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,0.3);
  font-size:0.9rem;
}
.upload-list li.over-limit { border-color:rgba(239,68,68,0.6); background:rgba(239,68,68,0.12); color:#7f1d1d; }
.upload-list .file-path { flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.upload-list .file-size { flex:0 0 auto; font-weight:600; color:#0f172a; }
.upload-summary { font-size:0.9rem; color:#475569; display:none; }
.upload-summary strong { color:#0f172a; }
.upload-actions { display:flex; justify-content:flex-end; }
.storage-table-wrapper { overflow:auto; }
.storage-table { width:100%; border-collapse:collapse; font-size:0.95rem; }
.storage-table th,
.storage-table td { padding:10px 12px; text-align:left; border-bottom:1px solid rgba(148,163,184,0.25); }
.storage-table th.actions { width:210px; }
.storage-table tbody tr:last-child td { border-bottom:none; }
.storage-empty { text-align:center; padding:32px 0; color:#64748b; }
.storage-name { display:inline-flex; align-items:center; gap:8px; font-weight:600; color:#0f172a; }
.storage-name::before { content:'📄'; font-size:1rem; }
.storage-name.dir::before { content:'📁'; }
.storage-table .btn.sm { margin-top:0; }
.storage-table .inline-form { display:inline-block; margin:0; }
.storage-table .btn.ghost { border:1px solid rgba(148,163,184,0.4); }
.storage-table .btn.ghost.sm { padding:0 10px; }
.storage-table .actions-cell { display:flex; gap:8px; align-items:center; justify-content:flex-start; flex-wrap:nowrap; }
.storage-table .inline-form { display:flex; align-items:center; }
.storage-table .storage-delete-form { margin:0; }
@media (max-width: 720px) {
  .storage-layout { grid-template-columns: 1fr; }
  .storage-table th, .storage-table td { font-size:0.85rem; }
  .storage-table th.actions { width:auto; }
  .storage-table .btn.sm { font-size:0.8rem; }
}
@media (max-width: 900px) {
  .dashboard-widget { min-width:220px; }
  .widget-columns { flex-direction:column; }
}
@media (max-width: 720px) {
  .revenus-brand-cards { grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); }
  .agenda-week-grid { grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .revenus-brand-cards { grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); }
  .agenda-week-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
.ca-bubble-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 60px;
  justify-content: center;
  align-content: center;
  align-items: flex-start;
  padding: 32px 0 12px;
}
.ca-bubble {
  position: relative;
  flex: 0 0 auto;
  width: var(--bubble-size, 160px);
  height: var(--bubble-size, 160px);
  --bubble-offset-x: 0px;
  --bubble-offset-y: 0px;
  border-radius: 50%;
  background-color: rgba(15, 23, 42, 0.16);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: overlay;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(var(--bubble-offset-x, 0px), var(--bubble-offset-y, 0px));
  transition: transform .2s ease, box-shadow .2s ease;
}
.ca-bubble::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  opacity: .55;
  pointer-events: none;
}
.ca-bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(205deg, rgba(15, 23, 42, 0.25), rgba(15, 23, 42, 0.65));
  mix-blend-mode: normal;
  opacity: .92;
  pointer-events: none;
}
.ca-bubble:hover {
  transform: translate(
      var(--bubble-offset-x, 0px),
      calc(var(--bubble-offset-y, 0px) - 6px)
    ) scale(1.02);
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.2);
}
.ca-bubble-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 0 12px;
  color: #f8fafc;
  text-shadow: 0 4px 18px rgba(15, 23, 42, 0.55);
}
.ca-bubble-name {
  font-weight: 700;
  font-size: clamp(14px, calc(var(--bubble-size, 160px) / 9), 26px);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ca-bubble-amount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.82);
  color: #0f172a;
  font-weight: 600;
  font-size: clamp(13px, calc(var(--bubble-size, 160px) / 12), 18px);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.1);
}
.ca-bubble.no-logo {
  background: radial-gradient(circle at top, rgba(148, 163, 184, 0.85) 0%, rgba(100, 116, 139, 0.65) 40%, rgba(15, 23, 42, 0.7) 100%);
}
.ca-bubble.no-logo::after {
  background: linear-gradient(205deg, rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.7));
  mix-blend-mode: normal;
}
.ca-bubble-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: calc(var(--bubble-size, 160px) / 2.6);
  color: rgba(15, 23, 42, 0.25);
  z-index: 0;
  pointer-events: none;
  text-transform: uppercase;
}
@media (max-width: 780px) {
  .ca-bubble-cloud { gap: 18px; }
  .ca-bubble {
    width: calc(var(--bubble-size, 160px) * 0.85);
    height: calc(var(--bubble-size, 160px) * 0.85);
  }
}
.presets-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.client-card,
.preset-card,
.mail-client-card {
  position: relative;
  border-radius: 20px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 200px;
  background: rgba(17, 24, 40, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.client-card::before,
.preset-card::before,
.mail-client-card::before {
  content: none;
}
.client-card > *, .preset-card > *, .mail-client-card > * { position: relative; z-index: 1; }
.client-card.selected, .mail-client-card.selected {
  box-shadow:
    inset 0 0 0 3px rgba(91, 154, 255, 0.6),
    0 8px 32px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 42px 21px rgba(255, 255, 255, 0.21);
}
.preset-card { min-height: 160px; }
.preset-card.with-bg { background-size: cover; background-position: center; background-repeat: no-repeat; }
.preset-card .client-actions { margin-top: auto;}
.preset-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
}
.preset-count.inactive { background: #e2e8f0; color: #334155; border: 1px solid #dbe3ee; }
.preset-count.active { background: var(--accent-600); color: #fff; }
/* Boutons plus / moins autour du compteur — mêmes dimensions */
.preset-op {
  background: #e9eef5 !important;
  color: #0f172a !important;
  border: 1px solid #dbe3ee !important;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.preset-op:hover { background: #dfe7f2 !important; }
/* Aligne bouton −, compteur, bouton + avec le même espacement */
.client-actions .right { display: inline-flex; align-items: center; gap: 8px; }
/* Aligne bouton + compteur sur une ligne dans la colonne droite des cartes */
.client-actions .right { display: inline-flex; align-items: center; gap: 8px; }
.client-card > * { position: relative; z-index: 1; }
/* Logo en haut à droite de la carte client */
/* Logo intégré dans le bloc texte */
/* Bloc infos + logo sur une même ligne 70% / 30% */
.client-content.two-col { display: flex; align-items: stretch; gap: 0; border-radius: 7px;}
.client-info { flex: 0 0 70%; max-width: 70%; min-width: 0; padding-right: 10px; box-sizing: border-box; }
.client-info h4 { margin: 0 0 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-logo-col { flex: 0 0 30%; max-width: 30%; display: flex; align-items: stretch; justify-content: flex-start; padding: 0; margin: 0; }
.client-logo-fit { width: 100%; height: 100%; object-fit: cover; background: transparent; border: 0; padding: 0; border-radius: 0; box-shadow: none; }

.logo-upload { display:flex; align-items:center; justify-content:center; height: 120px; border: 1px dashed #cbd5e1; background: #f8fafc; }
.logo-drop { display:flex; align-items:center; justify-content:center; gap:8px; color:#334155; cursor:pointer; padding: 10px 14px; }
.logo-drop .icon { width: 18px; height: 18px; }
.logo-name { display:block; margin-top: 6px; font-size: 12px; color:#64748b; text-align:center; }
.preview-thumb { display:block; width: 100%; height: 100px; object-fit: contain; background:#fff; border:1px solid #e5e7eb; margin-top: 6px; }

.client-card h4 { font-size: 14px; color: #0f172a; }
.client-card p { margin: 0; font-size: 12px; color: #475569; }
.client-content { background: rgba(255,255,255,0.85); padding: 10px; }
.client-actions { display:flex; gap: 8px; justify-content: space-between; margin-top: 0; align-items:center; }
.client-card .client-actions { margin-top: auto; }
.client-actions .btn { margin-top: 0; height: 36px; padding: 0 12px; }
.client-fav-toggle { position:absolute; right:12px; bottom:12px; width:30px; height:30px; border-radius:999px; border:1px solid rgba(148, 163, 184, 0.45); background:rgba(255, 255, 255, 0.85); display:flex; align-items:center; justify-content:center; color:rgba(51, 65, 85, 0.72); cursor:pointer; transition: transform .15s ease, color .15s ease, border-color .15s ease, background .15s ease; }
.client-fav-toggle:hover { transform:translateY(-1px); color:#f97316; border-color:rgba(249, 115, 22, 0.55); background:rgba(255, 255, 255, 0.95); }
.client-fav-toggle svg { width:18px; height:18px; }
.client-fav-toggle svg path { fill:none; stroke:currentColor; }
.client-fav-toggle.active { color:#ea580c; border-color:rgba(234, 88, 12, 0.6); background:rgba(255, 255, 255, 0.92); }
.client-fav-toggle.active:hover { color:#c2410c; border-color:rgba(234, 88, 12, 0.75); }
.client-actions .left { display:flex; gap:6px; align-items:center; position: relative; }
.menu-btn { background: #f2f4f7; border: 1px solid #e5e7eb; padding: 0; width: 36px; height: 36px; border-radius: 3px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.menu-btn:hover { background: #eef2f7; }
.menu-btn .icon { width: 18px; height: 18px; margin: 0; color:#334155; }
.client-menu { position: absolute; top: 32px; left: 0; background:#fff; border:1px solid #e5e7eb; box-shadow: 0 10px 30px rgba(0,0,0,0.12); padding:6px; display:none; flex-direction:column; gap:4px; z-index: 11000; }
.client-menu.show { display: flex; }
.client-card { position: relative; }
.client-menu .menu-item { background:#f8fafc; border:1px solid #e5e7eb; padding:6px 8px; font-size:12px; cursor:pointer; text-align:left; }
.client-menu .menu-item:hover { background:#eef2f7; }
.inline-form { display:grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
/* Plus d'espace entre la zone grid-2 (champs côte à côte) et les actions du formulaire client */
#clientsOverlay .inline-form .grid-2 { margin-bottom: 24px; }
#clientsOverlay .inline-form .client-actions { margin-top: 24px; }
/* Aligne les marges du formulaire Modules sur celles des Clients */
#presetsOverlay .inline-form .grid-2 { margin-bottom: 24px; }
#presetsOverlay .inline-form .client-actions { margin-top: 24px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.brand-actions .btn { width: auto; margin: 0; height: var(--control-h); }
.brand-actions .btn:link,
.brand-actions .btn:visited { text-decoration: none; }

/* Bouton Aperçu (1/2 largeur, style toggle) */
.preview-btn {
  width: 100%;
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: none;
}
.preview-btn:hover { background: var(--accent-700); }
.preview-btn:active,
.preview-btn:focus {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

/* ========== Boutons toggle (DEVIS / FACTURE) ========== */
.toggle-group { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 10px; margin-bottom: var(--v-gap); background: #f2f4f7; border: 1px solid rgb(209, 217, 230); padding: 0px 3px; overflow: hidden; }
.toggle-group input[type="radio"] { display: none; }
.toggle-btn { text-align: center; padding: 10px 16px; border: 0; background: rgba(154, 188, 255, 0); color: #334155; font-weight: 600; font-size: 14px; cursor: pointer; transition: all .2s ease; user-select: none; width: 100%; }
/*.toggle-btn:hover { color: #111827; background-color: #E7F0FF; }
.toggle-group input[type="radio"]:checked + .toggle-btn { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 0 0 1px rgba(148,163,184,0.35) inset; }*/

/* Calendar header: force view toggles (Année/Mois/Jour) on one line */
.cal-tools .toggle-group { display: inline-flex !important; align-items: center; gap: 6px; padding: 4px; margin: 0; grid-template-columns: none; flex-wrap: nowrap; white-space: nowrap; width: auto; max-width: none; }
.cal-tools .toggle-btn { width: auto !important; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; }
.cal-header { display:flex; align-items:center; gap:10px; justify-content: space-between; flex-wrap: nowrap; }

.mail-folders-toggle{
  width: 60%;
}
/* ========== Lignes d'articles ========== */
.items-header {
  display: grid;
  grid-template-columns: 1fr 120px 90px 70px 40px;
  align-items: center;
  gap: 10px;
  margin-top: var(--v-gap);
  padding: 10px 12px;
  background: #f5f7fa;
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
  color: #475569;
  letter-spacing: .02em;
}
.items {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.item-row {
  display: grid;
  grid-template-columns: 1fr 120px 90px 70px 40px;
  gap: 10px;
  align-items: center;
}
.item-row input[type="text"],
.item-row input[type="number"] {
  border-radius: 12px;
  height: var(--control-h);
}
/* Champ Description/Projet plus grand + auto-fit */
.item-row textarea.item-desc {
  width: 100%;
  min-height: 45px;          /* hauteur par défaut */
  line-height: 1.35;
  font-size: 14px;
  padding: 12px 14px;
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  outline: none;
  background: #f9fafb;
  overflow: hidden;          /* masque le scroll interne */
  resize: none;              /* pas de poignée, la hauteur s’ajuste en JS */
}
.item-row textarea.item-desc {
  width: 100%;
  min-height: 45px;
  line-height: 1.35;
  font-size: 14px;
  font-family: inherit;        /* ✅ reprend la même police que les inputs */
  padding: 12px 14px;
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  outline: none;
  background: #f9fafb;
  overflow: hidden;            /* pas de scrollbar interne */
  resize: none;                /* empêche l’utilisateur de tirer manuellement */
}

.item-row textarea.item-desc {
  width: 100%;
  min-height: 45px;
  line-height: 1.35;
  font-size: 14px;
  font-family: inherit;        /* ✅ reprend la même police que les inputs */
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: #fff;
  overflow: hidden;            /* pas de scrollbar interne */
  resize: none;                /* empêche l’utilisateur de tirer manuellement */
}

.item-row textarea.item-desc::placeholder {
  color: #9ca3af;
}

.item-row textarea.item-desc:focus {
  border-color: var(--blue-navy);
  box-shadow: 0 0 0 4px rgba(0,31,63,0.14);
}


.item-remove {
  width: 40px;
  height: var(--control-h);
  border: 1px solid var(--soft-border);
  background: #fff;
  color: #b91c1c;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-size: 18px;
  -webkit-appearance: none;
  appearance: none;
  transform: translateY(-9px);
}
.item-remove:hover { background: #fff5f5; }

/* Bouton ajouter ligne (style toggle-like clair, sans arrondi) */
.items-actions { margin-top: 10px; }
.toggle-like {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--soft-border);
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s ease;
}
.toggle-like:hover { background: #f7f8fb; }

/* ========== Colonne droite : Aperçu PDF ========== */
.preview-container {
  flex: 2;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;           /* ✅ laisse respirer la colonne gauche (scroll) */
}
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.preview-toolbar h2 { margin: 0; }
.preview-container h2 {
  margin: 0 0 12px;
  color: #64748b;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}
/* Ensure identical card titles in mailbox split */
.mail-split h2.mail-section-title { margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; color: #0f172a; font-weight: 700; font-size: 1.15rem; }
#pdfPreview {
  flex: 1;                 /* ✅ prend toute la hauteur dispo à droite */
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  background: #fff;
  width: 100%;
  height: 100%;
  min-height: 0;           /* ✅ important en flex pour éviter d’imposer la hauteur */
  box-shadow: var(--shadow-soft);
}

.form-logo {
  display: block;
  max-width: 88px;
  height: auto;
  margin-top: 8px;
  margin-bottom: 6px;
  margin-left: 10px;
}

#header-btn {
  fill: none;
  stroke: white;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Brand intégré dans la carte */
.brand { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.brand-info { display: none !important; }
.brand-title { margin-left: 38px; font-size: 16px; font-weight: 800; color: #ffffff; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
/* Ligne d'entête avec bouton delogout */
.brand-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.logout-btn { justify-self: end; width: auto; margin: 0; padding: 10px 14px; white-space: nowrap; }
.brand-actions { display: flex; gap: 8px; align-items: center; }

/* Full-width top bar on the main page */
.topbar { width: 100%; margin: var(--v-gap) 0; border-radius: 8px; }
/* conserve la marge du logo par défaut pour une hauteur cohérente */
.topbar .form-logo { margin-top: 8px; margin-bottom: 6px; margin-left: 10px;}

/* Cards */
.card { background: #fff; border: 1px solid var(--soft-border); border-radius: 8px; padding-left: 16px; padding-bottom: 16px; padding-right: 16px; padding-top: 16px; margin: var(--v-gap) 0; box-shadow: var(--shadow-soft); }
.card-title { margin: 0 0 30px; font-size: 1.15rem; font-weight: 700; color: #0f172a; }
.card.dashboard-board { margin:0; padding:0; border:none; box-shadow:none; background:transparent; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
/* La marge entre blocs ne dépend pas des labels */
.form-footer { position: static; margin-top: 12px; padding-top: 0; padding-bottom: 0; display: flex; flex-direction: column; gap: 8px; background: transparent; border-top: 0; box-shadow: none; }
/* Réduit l'espacement entre les boutons dans le footer */
.form-footer .btn { margin-top: 0; }
.actions-row { display: flex; gap: 8px; }
.actions-row .btn { flex: 1 1 0; }


/* Upload logo dans l'esprit du toggle */
.file-upload { display: flex; align-items: center; gap: 5px; border: 1px solid var(--soft-border); background: #f2f4f7; padding: 0; height: var(--control-h); margin-bottom: var(--field-gap); }
.file-btn { display: flex; align-items: center; justify-content: center; height: 100%; padding: 0 16px; background: #fff; color: #0f172a; font-weight: 600; cursor: pointer; user-select: none; border: 1px solid rgba(148,163,184,0.35); line-height: 1; box-sizing: border-box;}
.file-btn:hover { background: #f7f8fb; }
.file-name { display: flex; align-items: center; height: 100%; color: #64748b; font-size: 13px; padding: 0 8px; box-sizing: border-box; }

/* Auth overlay */
/* (auth overlay styles removed) */



/* ========== Responsive ========== */
/* ========== Toast notifications ========== */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.98); width: min(92vw, 520px); padding: 16px 18px; background: #111827; color: #f9fafb; box-shadow: 0 20px 50px rgba(0,0,0,0.35); opacity: 0; transition: opacity .2s ease, transform .2s ease; z-index: 10000; pointer-events: none; border: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 15px; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast.success { background: #065f46; border-color: rgba(16,185,129,0.35); }
.toast.error { background: #7f1d1d; border-color: rgba(239,68,68,0.35); }

/* Loading overlay */
#loadingOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; z-index: 9999; }
.loading-card { background: #0f172a; color: #fff; padding: 16px 20px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 16px 40px rgba(0,0,0,0.4); display: flex; align-items: center; gap: 12px; }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Calendar ========== */
.calendar-root { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: stretch; }
.calendar-grid { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--soft-border); border-radius: 8px; overflow: hidden; background: #fff; box-shadow: var(--shadow-soft); }
.calendar-grid { height: 100%; grid-template-rows: auto repeat(6, 1fr); }
.calendar-grid .cal-head { background: #f8fafc; font-weight: 700; text-align: center; padding: 6px 6px; font-size: 13px; line-height: 1.2; border-right: 1px solid #eef2f7; }
.calendar-grid .cal-head:nth-child(7n) { border-right: 0; }
.calendar-cell { min-height: 98px; border-right: 1px solid #eef2f7; border-top: 1px solid #eef2f7; padding: 6px; position: relative; background: #ffffff; }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell .date { font-size: 12px; color: #475569; font-weight: 700; }
.calendar-cell.outside { background: #fafbfc; color: #94a3b8; }
.calendar-cell.today { background: #dbeafe; }
.calendar-cell.selected { background: #e5efff; box-shadow: inset 0 0 0 2px #bfdbfe; }
.event-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.event-chip { min-width: 18px; height: 20px; padding: 0 8px; border-radius: 8px; display:inline-flex; align-items:center; justify-content:center; gap:6px; color:#ffffff; background:#64748b; box-shadow: 0 0 0 1px rgba(15,23,42,0.08); }
.event-chip.sm { height: 20px; border-radius: 8px; }
.event-chip.lg { height: 24px; border-radius: 10px; padding: 0 10px; gap: 8px; }
.event-chip.studio { background: #ef4444; }
.event-chip.production { background: #3b82f6; }
.event-chip.neutral { background: #334155; }
.chip-del { appearance:none; border:0; background: rgba(255,255,255,0.2); color:#fff; width:18px; height:18px; line-height:16px; border-radius: 4px; font-weight: 700; cursor: pointer; display:inline-flex; align-items:center; justify-content:center; }
.chip-del:hover { background: rgba(255,255,255,0.3); }
.event-chip.neutral { background: #334155; }
.chip-svg { width: 12px; height: 12px; display:block; color:#ffffff; }
.event-chip.lg .chip-svg { width: 14px; height: 14px; }
.chip-icon { font-weight: 800; font-size: 12px; line-height: 1; color:#ffffff; display:inline-block; }
.event-chip.lg .chip-icon { font-size: 14px; }
.chip-label { color:#ffffff; font-weight: 800; font-size: 11px; letter-spacing: .02em; }
.event-chip.lg .chip-label { font-size: 12px; }
.calendar-cell .more { margin-top: 8px; font-size: 12px; color:#334155; cursor: pointer; }

/* Small indicator for saved documents (top-left dot) */
.doc-dot { width: 6px; height: 6px; border-radius: 50%; background: #ef4444; display: inline-block; margin-left: 4px; vertical-align: middle; }

/* Events preview in month grid */
.grid-events { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.grid-event { width: 100%; height: 18px; line-height: 18px; border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.grid-event.c1 { background: #2563eb; }
.grid-event.c2 { background: #16a34a; }
.grid-event.c3 { background: #ef4444; }
.grid-event.c4 { background: #9333ea; }
.grid-event.c5 { background: #f59e0b; }
.grid-event.c6 { background: #0ea5e9; }
.month-overlay { position: absolute; inset: 0; pointer-events: none; }
.mg-block { position: absolute; height: 18px; line-height: 18px; border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 700; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; pointer-events: auto; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.mg-block.c1 { background: #2563eb; }
.mg-block.c2 { background: #16a34a; }
.mg-block.c3 { background: #ef4444; }
.mg-block.c4 { background: #9333ea; }
.mg-block.c5 { background: #f59e0b; }
.mg-block.c6 { background: #0ea5e9; }
.grid-span { align-self: start; margin-top: 6px; height: 18px; line-height: 18px; border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 700; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.grid-span.c1 { background: #2563eb; }
.grid-span.c2 { background: #16a34a; }
.grid-span.c3 { background: #ef4444; }
.grid-span.c4 { background: #9333ea; }
.grid-span.c5 { background: #f59e0b; }
.grid-span.c6 { background: #0ea5e9; }
.calendar-daylist { border: 1px solid var(--soft-border); border-radius: 8px; background:#fff; box-shadow: var(--shadow-soft); padding: 10px; min-height: 120px; }
.calendar-daylist { height: 100%; display: flex; flex-direction: column; }
.calendar-daylist .daylist-title { font-weight: 700; color:#0f172a; margin-bottom: 8px; }
.calendar-daylist .event-item { padding: 8px; border: 1px solid #e5e7eb; border-radius: 6px; margin-bottom: 8px; display:flex; align-items:center; justify-content: space-between; gap: 8px; }
.calendar-daylist .event-item .meta { display:flex; align-items:center; gap:8px; }
.day-section { margin: 10px 0; }
.section-header { display:flex; align-items:center; justify-content: space-between; margin-bottom: 8px; }
.section-header .section-actions { display:flex; gap:8px; }
.inline-event-form { border: 1px dashed #cbd5e1; padding: 8px; border-radius: 8px; background: #f8fafc; margin-top: 8px; }
.inline-event-form .ief-row { display:flex; align-items:center; gap: 10px; margin-bottom: 6px; }
.inline-event-form .ief-time { flex: 0 0 auto; }
.inline-event-form .ief-allday { flex: 0 0 auto; color:#334155; font-size: 13px; }
.inline-event-form .ief-actions { display:flex; gap: 8px; }

/* Timeline */
.timeline-list { position: relative; padding-left: 0; min-height: calc(var(--tl-row-h) * 24); }
.tl-row { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: stretch; padding: 0; border-top: 1px solid #eef2f7; height: var(--tl-row-h); }
.timeline-list .tl-row:first-child { border-top: 0; }
.tl-time { font-size: 12px; color: #475569; text-align: right; display:flex; align-items:flex-start; justify-content:flex-end; padding-top: 6px; padding-right: 2px; }
.tl-content { background:#fff; border:1px solid #e5e7eb; border-radius: 6px; padding: 6px 8px; display:flex; align-items:center; gap: 8px; flex-wrap: wrap; height: calc(var(--tl-row-h) - 12px); margin: 6px 0; }
.tl-content .meta { display:flex; align-items:center; gap: 6px; }
.tl-label { font-weight: 600; color:#0f172a; }
.tl-actions { margin-left: auto; }
.tl-content.empty { background: transparent; border: 0; min-height: 10px; padding: 0; }
.tl-entry { display:block; }
.tl-entry + .tl-entry { margin-top: 6px; }
.tl-row.selected { background: #f8fafc; }

/* Overlay blocks over the timeline content */
.tl-overlay { position: absolute; z-index: 5; left: 64px; right: 0; top: 0; height: calc(var(--tl-row-h) * 24); pointer-events: none; }
.tl-block { position: absolute; left: 6px; right: 6px; background: rgba(18,52,107,0.18); border: 1px solid #9ab0d6; border-left: 4px solid #12346b; color: #0f172a; border-radius: 8px; display:flex; flex-direction: column; align-items:center; justify-content: center; text-align:center; padding: 6px 8px; box-shadow: 0 4px 10px rgba(2,6,23,0.08); pointer-events: auto; cursor: pointer; overflow: hidden; }
.tl-block.selected { background: rgba(18,52,107,0.36); border-color: #7a97c9; }
.tl-block .tlb-title { font-weight: 700; font-size: 12px; margin: 0 0 2px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-block .tlb-time { font-size: 11px; color: #334155; opacity: 0.6; }
.tl-block.with-desc { justify-content: center; text-align: center; }
.tl-block .tlb-desc { font-size: 12px; font-weight: 600; color: #0f172a; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sub-cards inside daylist */
.calendar-daylist .subcard { border: 1px solid var(--soft-border); border-radius: 8px; background: #ffffff; padding: 10px; }
.calendar-daylist .doc-list { display:flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.calendar-daylist .doc-item { display:flex; align-items:center; gap: 8px; }
.calendar-daylist .doc-link { color:#0f172a; text-decoration: none; font-size: 13px; }
.calendar-daylist .doc-link:hover { text-decoration: underline; }

/* Event colors (6 options) */
.tl-block.c1 { background: rgba(37,99,235,0.18); border-left-color: #2563eb; border-color: rgba(37,99,235,0.35); }
.tl-block.c1.selected { background: rgba(37,99,235,0.32); border-color: #2563eb; }
.tl-block.c2 { background: rgba(22,163,74,0.18); border-left-color: #16a34a; border-color: rgba(22,163,74,0.35); }
.tl-block.c2.selected { background: rgba(22,163,74,0.32); border-color: #16a34a; }
.tl-block.c3 { background: rgba(239,68,68,0.18); border-left-color: #ef4444; border-color: rgba(239,68,68,0.35); }
.tl-block.c3.selected { background: rgba(239,68,68,0.32); border-color: #ef4444; }
.tl-block.c4 { background: rgba(147,51,234,0.18); border-left-color: #9333ea; border-color: rgba(147,51,234,0.35); }
.tl-block.c4.selected { background: rgba(147,51,234,0.32); border-color: #9333ea; }
.tl-block.c5 { background: rgba(245,158,11,0.18); border-left-color: #f59e0b; border-color: rgba(245,158,11,0.35); }
.tl-block.c5.selected { background: rgba(245,158,11,0.32); border-color: #f59e0b; }
.tl-block.c6 { background: rgba(14,165,233,0.18); border-left-color: #0ea5e9; border-color: rgba(14,165,233,0.35); }
.tl-block.c6.selected { background: rgba(14,165,233,0.32); border-color: #0ea5e9; }

/* Color palette in popup */
.color-palette { display:flex; gap: 8px; align-items:center; margin: 12px 0 30px; flex-wrap: wrap; }
.color-swatch { width: 24px; height: 24px; border-radius: 6px; border: 2px solid #ffffff; box-shadow: 0 0 0 1px rgba(0,0,0,0.15); cursor: pointer; }
.color-swatch.active { box-shadow: 0 0 0 2px #0f172a; }
.color-swatch.c1 { background: #2563eb; }
.color-swatch.c2 { background: #16a34a; }
.color-swatch.c3 { background: #ef4444; }
.color-swatch.c4 { background: #9333ea; }
.color-swatch.c5 { background: #f59e0b; }
.color-swatch.c6 { background: #0ea5e9; }
.badge { display:inline-flex; align-items:center; gap:6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.devis { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }
.badge.facture { background:#dbeafe; color:#1e3a8a; border:1px solid #bfdbfe; }
.badge.studio { background:#fee2e2; color:#b91c1c; border:1px solid #fecaca; }
.badge.production { background:#dbeafe; color:#1e3a8a; border:1px solid #bfdbfe; }
.calendar-list-empty { color:#64748b; font-size: 13px; }

@media (max-width: 960px) {
  .calendar-root { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 16px; }
  .calendar-grid { min-height: 520px; }
  .calendar-daylist { height: auto; min-height: 0; max-height: min(520px, 55vh); overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 820px) {
  .calendar-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .calendar-toolbar .left { width: 100%; justify-content: center; flex-wrap: wrap; row-gap: 6px; }
  .calendar-toolbar .right { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  #fltBrand { flex: 1 1 160px; min-width: 0; }
  #fltSearch { flex: 1 1 220px; width: 100%; max-width: none; }
}

@media (max-width: 640px) {
  .calendar-grid { min-height: 480px; }
  .calendar-toolbar .left { justify-content: center; }
  .calendar-toolbar .cal-current { order: 3; flex-basis: 100%; min-width: 0; text-align: center; font-size: 15px; }
  .calendar-toolbar .right { flex-direction: column; align-items: stretch; gap: 8px; }
  #fltBrand, #fltSearch { width: 100%; flex: 1 1 auto; }
  .calendar-grid .cal-head { font-size: 11px; padding: 4px 2px; }
  .calendar-cell { min-height: 80px; padding: 4px; }
  .calendar-cell .date { font-size: 11px; }
}

@media (max-width: 480px) {
  .calendar-grid { min-height: 440px; }
  #calPrev, #calNext { padding: 0 10px; }
  #calToday { width: 100%; }
  .calendar-toolbar .btn.sm,
  .calendar-toolbar .btn.ghost.sm { width: 100%; }
}

@media (max-width: 960px) {
  .app { flex-direction: column; height: 100vh; }
  .form-container { max-height: 55vh; }  /* limite visuelle, reste scrollable */
  .preview-container { height: 45vh; }

  .items-header,
  .item-row {
    grid-template-columns: 1fr 110px 80px 60px 36px;
  }
}

/* Dark mode disabled: keep light theme regardless of OS preference */

/* ========== Coins vifs (aucun arrondi) ========== */

#docsTable .actions-cell { justify-content: flex-start !important; }
#docsTable td.actions-col { text-align: left; }
@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700&display=swap');
/* Group actions: left for download, right for the rest */
.actions-left { display: flex; gap: 8px; }
.actions-right { display: flex; gap: 8px; margin-left: auto; align-items: center; }
/* Signed badge */
.badge-signed {
  display:inline-block;
  background:#ecfdf5;
  color:#065f46;
  border:1px solid #a7f3d0;
  border-radius:999px;
  padding:2px 8px;
  font-size:12px;
  font-weight:600;
  margin-right:6px;
}
.urssaf-status-meta { font-size:13px; color:#475569; }
.urssaf-metrics { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:4px; flex:1 1 auto; min-height:0; }
.urssaf-card { border-radius:12px; border:1px solid rgba(15,23,42,0.08); background:rgba(248,250,252,0.95); padding:16px; display:flex; flex-direction:column; justify-content:space-between; gap:clamp(6px, 1.4vh, 14px); box-shadow:0 10px 20px rgba(15,23,42,0.07); min-height:0; width:100%; box-sizing:border-box; }
.urssaf-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:6px; width:100%; flex-wrap:wrap; }
.urssaf-card-title { font-size:13px; letter-spacing:0.05em; text-transform:uppercase; font-weight:700; color:#1e293b; line-height:1.3; }
.urssaf-card-label { font-size:8px; letter-spacing:0.08em; text-transform:uppercase; color:#475569; font-weight:600; white-space:nowrap; }
.urssaf-card-amount { font-size:clamp(16px, 3vw, 20px); font-weight:800; color:#0f172a; word-break:break-word; text-align:right; margin-left:auto; }
.urssaf-card-legend { margin-top:auto; font-size:12px; color:#475569; line-height:1.35; text-align:left; width:100%; align-self:flex-start; overflow-wrap:anywhere; }
.toggle-group.toggle-inline {
  display:inline-flex;
  gap:6px;
  align-items:center;
  flex-wrap:nowrap;
  width:auto;
  flex:0 0 auto;
  background:#f2f4f7;
  border:1px solid #d1d9e6;
  padding:1px;
  margin:0;
}
.toggle-group .toggle-option { display:flex; align-items:center; flex:0 0 auto; }
.toggle-group .toggle-option input[type="radio"] { display:none; }
.toggle-group .toggle-option .toggle-btn { margin:0; width:auto; background:transparent; padding:8px 14px; }
.toggle-group .toggle-option input[type="radio"]:checked + .toggle-btn {
  background:#ffffff;
  color:#0f172a;
  box-shadow:0 1px 2px rgba(15,23,42,0.08);
}
