/* VigiCash – style logiciel de compta / tableur */

.vigicash-app {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

.vigicash-app-maintenance {
  display: flex;
  flex-direction: column;
}
.vigicash-app-maintenance .page-service-unavailable {
  flex: 1;
}

/* ——— Layout avec menu à gauche (style compta) ——— */
.vigicash-app-with-sidebar {
  display: flex;
  flex-direction: row;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.vigicash-sidebar {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  max-height: 100vh;
  min-height: 0;
  background: #022c22;
  color: #e2fdf5;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.vigicash-sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid #0f766e;
}

.vigicash-sidebar-header .vigicash-logo {
  color: #e2fdf5;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.vigicash-sidebar-header .vigicash-logo:hover {
  color: #6ee7b7;
}

.vigicash-logo-img {
  display: inline-block;
  width: 32px;
  height: 32px;
  vertical-align: middle;
}

.vigicash-logo-text {
  display: inline-block;
  line-height: 1;
}

.vigicash-sidebar-period {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #0f766e;
}

.vigicash-sidebar-period-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.vigicash-period-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.vigicash-period-select {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.25rem;
  font-size: 0.8rem;
  border: 1px solid #0f766e;
  border-radius: 4px;
  background: #022c22;
  color: #e2fdf5;
}

.vigicash-period-btn {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  background: #09b17e;
  color: #022c22;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.vigicash-period-btn:hover {
  background: #0f766e;
}

.vigicash-sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.vigicash-sidebar-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6ee7b7;
  padding: 0.75rem 1rem 0.25rem;
}

.vigicash-sidebar-link {
  display: block;
  padding: 0.5rem 1rem;
  color: #bae6fd;
  text-decoration: none;
  font-size: 0.85rem;
}

.vigicash-sidebar-link:hover {
  background: #022c22;
  color: #e2fdf5;
}

.vigicash-sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #0f766e;
}

.vigicash-sidebar-user {
  display: block;
  padding: 0.25rem 1rem;
  font-size: 0.75rem;
  color: #6ee7b7;
  word-break: break-all;
}

.vigicash-workspace {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0; /* obligatoire en flex pour que overflow fonctionne */
  background: #fff;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  /* zone de scroll : seul le contenu défile, le menu reste fixe */
}

/* Bouton menu mobile (caché sur desktop) */
.vigicash-menu-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1001;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 6px;
  background: #1e293b;
  color: #f8fafc;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.vigicash-menu-toggle-icon {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.vigicash-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}

.vigicash-mobile-header {
  display: none;
  height: 3.5rem;
  flex-shrink: 0;
  align-items: center;
  padding: 0 1rem 0 3.5rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.vigicash-mobile-logo {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ——— Zone tableur (style Excel / compta) ——— */
.vigicash-sheet-container {
  padding: 1rem 1.5rem 2rem;
}

.vigicash-sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.vigicash-sheet-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.vigicash-sheet-actions {
  display: flex;
  gap: 0.5rem;
}

.vigicash-sheet {
  margin-bottom: 1.5rem;
}

.vigicash-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid #cbd5e1;
}

.vigicash-grid caption {
  text-align: left;
  padding: 0.5rem 0 0.35rem;
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
}

.vigicash-grid th,
.vigicash-grid td {
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.vigicash-grid th {
  background: #f1f5f9;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

/* ——— Aide VigiCash ——— */
.vigicash-help {
  max-width: 960px;
  margin: 0 auto;
}

.vigicash-help-intro {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: #64748b;
  max-width: 52rem;
}

.vigicash-help-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 0.75rem;
}

.vigicash-help-nav-title {
  flex-basis: 100%;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.vigicash-help-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #e5e7eb;
  background: rgba(15, 118, 110, 0.3);
  text-decoration: none;
  white-space: nowrap;
}

.vigicash-help-nav-link:hover {
  background: #22c55e;
  color: #022c22;
}

.vigicash-help-section {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.vigicash-help-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.vigicash-help-faq {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vigicash-help-faq details {
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.5rem 0.75rem;
}

.vigicash-help-faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  position: relative;
  padding-right: 1.5rem;
}

.vigicash-help-faq summary::-webkit-details-marker {
  display: none;
}

.vigicash-help-faq summary::after {
  content: '▾';
  position: absolute;
  right: 0.25rem;
  font-size: 0.8rem;
  color: #64748b;
  transform-origin: center;
  transition: transform 0.2s ease;
}

.vigicash-help-faq details[open] summary::after {
  transform: rotate(180deg);
}

.vigicash-help-answer {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #334155;
}

.vigicash-help-answer p {
  margin: 0 0 0.5rem;
}

.vigicash-help-answer ul,
.vigicash-help-answer ol {
  margin: 0 0 0.5rem 1.1rem;
  padding: 0;
}

.vigicash-help-answer li {
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .vigicash-help-section {
    padding: 1rem 1rem;
    margin-bottom: 1.5rem;
  }

  .vigicash-help-nav {
    padding: 0.75rem 0.75rem;
  }

  .vigicash-help-nav-link {
    white-space: normal;
  }
}

.vigicash-grid tbody tr:nth-child(even) {
  background: #f8fafc;
}

.vigicash-grid tbody tr:hover {
  background: #f1f5f9;
}

.vigicash-grid tr.vigicash-row-recurring {
  background: #f8fafc;
}
.vigicash-grid tbody tr.vigicash-row-recurring:nth-child(even) {
  background: #f1f5f9;
}
.vigicash-grid tr.vigicash-row-recurring:hover {
  background: #e2e8f0;
}

/* Ligne ticket (magasin) + détail dépliable */
.vigicash-grid tr.vigicash-row-ticket {
  background: #f1f5f9;
  font-weight: 500;
}
.vigicash-grid tr.vigicash-row-ticket:hover { background: #e2e8f0; }
.vigicash-ticket-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.25rem 0 0;
  font-size: 0.7rem;
  color: #64748b;
  vertical-align: middle;
}
.vigicash-ticket-toggle:hover { color: #0f172a; }
.vigicash-grid tr.vigicash-row-detail td:first-child { padding-left: 1.5rem; }
.vigicash-grid tr.vigicash-row-detail .vigicash-col-desc { font-style: italic; }

.vigicash-grid .vigicash-col-date { width: 110px; min-width: 90px; white-space: nowrap; }
.vigicash-grid .vigicash-col-cat { min-width: 140px; }
.vigicash-grid .vigicash-col-desc { min-width: 160px; }
.vigicash-grid .vigicash-col-num { width: 100px; min-width: 80px; text-align: right; white-space: nowrap; }
.vigicash-grid .vigicash-col-actions { width: 1%; white-space: nowrap; }
.vigicash-inline-form { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; }
.vigicash-inline-form .vigicash-btn { margin: 0; }
.vigicash-inline-form .vigicash-btn-danger { margin-top: 0; }

.vigicash-money {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.vigicash-positive { color: #15803d; }
.vigicash-negative { color: #b91c1c; }

.vigicash-grid .vigicash-empty {
  color: #94a3b8;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

.vigicash-total-row,
.vigicash-solde-row {
  background: #e2e8f0 !important;
  font-weight: 600;
}

.vigicash-total-row td,
.vigicash-solde-row td {
  border-top: 2px solid #94a3b8;
  padding: 0.5rem 0.6rem;
  white-space: nowrap;
}

.vigicash-solde .vigicash-grid {
  max-width: 500px;
}

/* Pages internes (formulaires) dans le workspace */
.vigicash-workspace .vigicash-page {
  max-width: none;
  padding: 1rem 1.5rem 2rem;
}

.vigicash-header-slim {
  padding: 0.75rem 1.5rem;
  background: #1e293b;
}

.vigicash-header-slim .vigicash-logo {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 700;
}

.vigicash-main-auth {
  max-width: none;
}

.vigicash-header {
  background: #0f172a;
  color: #f8fafc;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.vigicash-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vigicash-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vigicash-logo {
  font-weight: 700;
  font-size: 1.35rem;
  color: #f8fafc;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.vigicash-logo:hover {
  color: #94a3b8;
}

.vigicash-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.vigicash-nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.vigicash-nav a:hover {
  color: #f8fafc;
}

.vigicash-user {
  font-size: 0.85rem;
  color: #94a3b8;
}

.vigicash-main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Auth (connexion / inscription) */
.vigicash-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
}

.vigicash-auth-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  padding: 2rem;
  width: 100%;
  max-width: 380px;
}

.vigicash-auth-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.vigicash-auth-subtitle {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: #64748b;
}

.vigicash-form-group {
  margin-bottom: 1rem;
}

.vigicash-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.35rem;
}

.vigicash-form-group input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}

.vigicash-form-group input:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.vigicash-form .vigicash-btn-primary {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
}

.vigicash-auth-footer {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  color: #64748b;
  text-align: center;
}

.vigicash-auth-footer a {
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
}

.vigicash-auth-footer a:hover {
  text-decoration: underline;
}

.vigicash-msg-err {
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Boutons */
.vigicash-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.vigicash-btn-primary {
  background: #09b17e;
  color: #022c22;
}

.vigicash-btn-primary:hover {
  background: #0f766e;
}

.vigicash-btn-outline {
  background: transparent;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.vigicash-btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.vigicash-btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.vigicash-btn-icon {
  padding: 0.4rem 0.75rem;
  font-size: 1.1rem;
}

/* Dashboard */
.vigicash-dashboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.vigicash-dashboard h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.vigicash-month-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vigicash-month-label {
  font-weight: 600;
  color: #334155;
  min-width: 140px;
  text-align: center;
}

.vigicash-dashboard-desc {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

.vigicash-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.vigicash-module {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.vigicash-module h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: #0f172a;
}

.vigicash-module p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.4;
}

.vigicash-module-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.vigicash-module-links li { margin: 0; }

.vigicash-muted {
  font-size: 0.85rem;
  color: #94a3b8;
}

.vigicash-workspace .vigicash-table,
.vigicash-workspace .vigicash-grid {
  margin: 1rem 0;
}

.vigicash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 1rem 0;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.vigicash-table th,
.vigicash-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border: 1px solid #e2e8f0;
}

.vigicash-table th {
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
}

.vigicash-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.vigicash-table tbody tr:hover {
  background: #f1f5f9;
}

.vigicash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.vigicash-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
}

.vigicash-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.vigicash-placeholder {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
}

.vigicash-footer {
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  background: #e2e8f0;
  margin-top: auto;
}

.vigicash-footer a {
  color: #0f172a;
  font-weight: 500;
  text-decoration: none;
}

.vigicash-footer a:hover {
  text-decoration: underline;
}

/* Pages formulaire */
.vigicash-page {
  max-width: 520px;
}

.vigicash-page h1 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.vigicash-form-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  border: 1px solid #e2e8f0;
}

.vigicash-ocr-block {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}
.vigicash-ocr-label {
  font-size: 0.9rem;
  color: #475569;
  margin: 0 0 0.5rem;
}
.vigicash-ocr-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.vigicash-ocr-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.vigicash-ocr-preview {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

/* Choix type de saisie (ticket / élément unique) */
.vigicash-expense-choice { margin-bottom: 1.5rem; }
.vigicash-choice-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.vigicash-btn-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.vigicash-btn-card:hover {
  border-color: #0f172a;
  background: #f8fafc;
}
.vigicash-choice-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.vigicash-choice-desc { font-size: 0.85rem; color: #64748b; }

/* Autocomplete suggestions */
.vigicash-autocomplete-wrap { position: relative; }
.vigicash-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.vigicash-suggestion-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.vigicash-suggestion-item:hover { background: #f1f5f9; }

/* Ligne ticket (une ligne = nom, catégorie, qté, prix) */
.vigicash-ticket-line {
  display: grid;
  grid-template-columns: 2fr 1.5fr 80px 100px 40px;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.vigicash-ticket-line .vigicash-form-group { margin-bottom: 0; }
.vigicash-ticket-line-actions .vigicash-btn-remove-line {
  min-width: 2rem;
  padding: 0.4rem 0.5rem;
  color: #b91c1c;
  border-color: #fecaca;
}
.vigicash-ticket-line-actions .vigicash-btn-remove-line:hover {
  background: #fef2f2;
  border-color: #b91c1c;
}
@media (max-width: 640px) {
  .vigicash-ticket-line {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .vigicash-ticket-line .vigicash-form-group {
    width: 100%;
  }
  .vigicash-ticket-line-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
  }
}

.vigicash-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.vigicash-form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}

.vigicash-form-check label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}

.vigicash-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.vigicash-msg-warn {
  background: #fffbeb;
  color: #92400e;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.vigicash-msg-ok {
  background: #f0fdf4;
  color: #166534;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.vigicash-link-back {
  font-size: 0.9rem;
  color: #64748b;
  text-decoration: none;
}

.vigicash-link-back:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* Profil */
.vigicash-profil .vigicash-card {
  margin-bottom: 1.5rem;
}
.vigicash-profil-info p {
  margin: 0.35rem 0;
  font-size: 0.95rem;
}
.vigicash-profil-danger {
  border-color: #fecaca;
  background: #fef2f2;
}
.vigicash-profil-danger h2 {
  color: #b91c1c;
}
.vigicash-profil-warning,
.vigicash-profil-warning-end {
  margin: 0.75rem 0;
  font-size: 0.95rem;
  color: #991b1b;
}
.vigicash-profil-warning-list {
  margin: 0.5rem 0 1rem 1.25rem;
  color: #b91c1c;
}
.vigicash-form-delete {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #fecaca;
}
.vigicash-form-delete .vigicash-form-group {
  margin-bottom: 0;
}
.vigicash-confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 400;
  color: #7f1d1d;
}
.vigicash-confirm-label input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #b91c1c;
}
.vigicash-confirm-label span {
  flex: 1;
  min-width: 0;
}
.vigicash-btn-danger {
  background: #b91c1c;
  color: #fff;
  margin-top: 0.75rem;
}
.vigicash-btn-danger:hover {
  background: #991b1b;
}

/* Formulaire dépense : champs essence, détails, tags */
.vigicash-page-desc {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.vigicash-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  background: #f8fafc;
}
.vigicash-fieldset legend {
  font-weight: 600;
  font-size: 0.9rem;
  color: #334155;
  padding: 0 0.5rem;
}
.vigicash-select-multi {
  width: 100%;
  max-width: 320px;
  margin-bottom: 0.5rem;
}
.vigicash-hint {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.25rem 0 0.35rem;
}
.vigicash-input-full {
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
}
.vigicash-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.vigicash-detail-label { min-width: 0; }
.vigicash-detail-amount { width: 5rem; }
.vigicash-detail-qty { width: 4rem; }
.vigicash-detail-up { width: 4.5rem; }
.vigicash-detail-unit { width: 3.5rem; }
@media (max-width: 640px) {
  .vigicash-detail-row {
    grid-template-columns: 1fr 1fr;
  }
  .vigicash-detail-qty, .vigicash-detail-up, .vigicash-detail-unit {
    width: 100%;
  }
}

/* Catégories */
.vigicash-desc {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.vigicash-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.vigicash-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 1rem;
  font-weight: 400;
  cursor: pointer;
}

.vigicash-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: #334155;
}

.vigicash-list li {
  margin-bottom: 0.25rem;
}

/* ——— Responsive : tablette et mobile ——— */
@media (max-width: 768px) {
  .vigicash-menu-toggle {
    display: flex;
  }

  .vigicash-mobile-header {
    display: flex;
  }

  .vigicash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 85vw;
    min-width: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }

  body.vigicash-sidebar-open .vigicash-sidebar {
    transform: translateX(0);
  }

  .vigicash-sidebar-backdrop {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.vigicash-sidebar-open .vigicash-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .vigicash-sheet-container,
  .vigicash-workspace .vigicash-page {
    padding: 1rem;
  }

  .vigicash-sheet-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .vigicash-sheet-title {
    font-size: 1.1rem;
  }

  .vigicash-grid {
    font-size: 0.8rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .vigicash-grid th,
  .vigicash-grid td {
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
  }

  .vigicash-grid .vigicash-col-date { width: 90px; white-space: nowrap; }
  .vigicash-grid .vigicash-col-cat { min-width: 120px; }
  .vigicash-grid .vigicash-col-desc { min-width: 140px; }
  .vigicash-grid .vigicash-col-num { width: 80px; }

  .vigicash-table {
    font-size: 0.8rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .vigicash-table th,
  .vigicash-table td {
    padding: 0.35rem 0.5rem;
  }

  .vigicash-form-card,
  .vigicash-auth-card {
    padding: 1rem;
  }

  .vigicash-modules {
    grid-template-columns: 1fr;
  }

  .vigicash-categories-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .vigicash-dashboard-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .vigicash-cards {
    grid-template-columns: 1fr;
  }
  .vigicash-form-row {
    grid-template-columns: 1fr;
  }
  .vigicash-sheet-actions {
    flex-wrap: wrap;
  }
  .vigicash-detail-row {
    grid-template-columns: 1fr 1fr;
  }
  .vigicash-sidebar-period .vigicash-period-form {
    flex-direction: column;
  }
  .vigicash-sidebar-period .vigicash-period-select {
    min-width: 100%;
  }
}

/* ——— Page Statistiques & graphiques ——— */
.vigicash-stats-page {
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}
.vigicash-stats-section {
  margin-bottom: 2.5rem;
}
.vigicash-stats-section h2 {
  font-size: 1.1rem;
  color: #475569;
  margin-bottom: 1rem;
  font-weight: 600;
}
.vigicash-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.vigicash-stats-grid-full {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 768px) {
  .vigicash-stats-grid-full {
    grid-template-columns: 1fr;
  }
}
.vigicash-stats-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.vigicash-stats-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin: 0 0 0.75rem;
}
.vigicash-chart-wrap {
  position: relative;
  min-height: 200px;
}
.vigicash-chart-pie {
  min-height: 240px;
}
.vigicash-chart-mini {
  min-height: 120px;
  max-width: 160px;
  margin: 0.5rem auto 0;
}
.vigicash-chart-tall {
  min-height: 280px;
}
.vigicash-stats-kpi .vigicash-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.25rem 0 0;
}
.vigicash-stats-waste-rate {
  font-size: 1.75rem;
  font-weight: 700;
  color: #b91c1c;
  margin: 0;
}

/* ——— Inventaire ——— */
.vigicash-inventory-page {
  max-width: 720px;
}
.vigicash-inventory-alerts {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.vigicash-inventory-alerts-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #b91c1c;
  margin: 0 0 0.5rem;
}
.vigicash-inventory-alerts-list {
  margin: 0;
  padding-left: 1.25rem;
}
.vigicash-inventory-alerts-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.vigicash-inventory-alert-form {
  margin: 0;
}
.vigicash-inventory-alert-text {
  flex: 1;
  min-width: 0;
}
.vigicash-inventory-alert-empty { color: #b91c1c; font-weight: 600; }
.vigicash-inventory-alert-low { color: #92400e; }
.vigicash-inventory-alert-close {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 0 0.25rem;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 4px;
}
.vigicash-inventory-alert-close:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.vigicash-inventory-add-card {
  margin-bottom: 1.5rem;
}
.vigicash-inventory-add-title {
  font-size: 1.05rem;
  margin: 0 0 1rem;
  color: #0f172a;
}
.vigicash-inventory-add-form .vigicash-form-group {
  margin-bottom: 1rem;
}
.vigicash-inventory-list-title {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  color: #334155;
}
.vigicash-inventory-search-wrap {
  margin-bottom: 1rem;
}
.vigicash-inventory-search {
  width: 100%;
  max-width: 320px;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}
.vigicash-inventory-search:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.1);
}
.vigicash-inventory-search::placeholder {
  color: #94a3b8;
}
.vigicash-inventory-no-result {
  color: #64748b;
  font-style: italic;
  margin: 0.75rem 0;
}
.vigicash-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.vigicash-inventory-category-block {
  margin-bottom: 1.25rem;
}
.vigicash-inventory-category-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e2e8f0;
}
.vigicash-inventory-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vigicash-inventory-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.vigicash-inventory-item-low { border-color: #fcd34d; background: #fffbeb; }
.vigicash-inventory-item-empty { border-color: #fecaca; background: #fef2f2; }
.vigicash-inventory-item-name { font-weight: 500; }
.vigicash-inventory-item-cat { font-size: 0.85rem; color: #64748b; }
.vigicash-inventory-item-qty { font-variant-numeric: tabular-nums; font-weight: 500; }
.vigicash-inventory-item-remove { margin: 0; }
.vigicash-inventory-item-delete { margin: 0; }
.vigicash-btn-remove-one { min-width: 2.25rem; }
.vigicash-btn-delete-item { color: #b91c1c; border-color: #fca5a5; }
.vigicash-btn-delete-item:hover { background: #fef2f2; color: #991b1b; }
@media (max-width: 640px) {
  .vigicash-inventory-item {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }
  .vigicash-inventory-item-cat { grid-column: 1; font-size: 0.8rem; }
  .vigicash-inventory-item-qty { grid-column: 1; }
  .vigicash-inventory-item-remove { grid-column: 2; grid-row: 1 / -1; align-self: center; }
  .vigicash-inventory-item-delete { grid-column: 2; grid-row: 1 / -1; align-self: center; }
}
