/* ============================================================
   OFFICEA — ONGLET COMPTA
   ============================================================ */

/* ── Sélecteur d'année ── */
.compta-year-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0 24px;
}

.compta-year-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: white;
  border: 1px solid #d9cfb8;
  font-size: 22px;
  font-weight: 600;
  color: #1a2942;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.compta-year-btn:hover { background: #faf6ed; }

.compta-year-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  color: #1a2942;
  min-width: 90px;
  text-align: center;
}

/* ── Warning profil fiscal non défini ── */
.compta-warning {
  background: linear-gradient(135deg, #faf6ed 0%, #f5edd6 100%);
  border-left: 4px solid #d4a868;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}
.compta-warning p {
  margin: 0 0 12px;
  font-size: 14px;
  color: #5a4828;
  line-height: 1.5;
}
.compta-warning em {
  color: #b8843f;
  font-style: italic;
}

/* ── KPI cards ── */
.compta-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.compta-kpi {
  background: white;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #ede5d3;
  position: relative;
}

.compta-kpi-ca       { border-top: 3px solid #5a7848; }
.compta-kpi-charges  { border-top: 3px solid #b8493f; }
.compta-kpi-marge    { border-top: 3px solid #1a2942; }
.compta-kpi-month    { border-top: 3px solid #b8843f; }

.compta-kpi-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8474;
  font-weight: 600;
  margin-bottom: 6px;
}

.compta-kpi-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  color: #1a2942;
  line-height: 1.1;
  margin-bottom: 4px;
}

.compta-kpi-sub {
  font-size: 12px;
  color: #8a8474;
}

/* ── Sections ── */
.compta-section {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #ede5d3;
}

.compta-section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  color: #1a2942;
  margin: 0 0 14px;
}

/* ── Estimations ── */
.compta-estim-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compta-estim-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: #faf6ed;
  border-radius: 8px;
  border-left: 3px solid #b8843f;
}

.compta-estim-info {
  background: #f0f4f5;
  border-left-color: #5a6478;
}

.compta-estim-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.compta-estim-content {
  flex: 1;
  min-width: 0;
}

.compta-estim-label {
  font-size: 12px;
  color: #6a6478;
  margin-bottom: 4px;
  font-weight: 500;
}

.compta-estim-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  color: #1a2942;
  line-height: 1.1;
}

.compta-estim-value-text {
  font-size: 13px;
  color: #5a6478;
  line-height: 1.4;
}

.compta-estim-sub {
  font-size: 11px;
  color: #8a8474;
  margin-top: 3px;
}

/* ── Tableau mois ── */
.compta-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compta-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8474;
  padding: 8px 6px;
  border-bottom: 1px solid #ede5d3;
}

.compta-table th:nth-child(n+2) {
  text-align: right;
}

.compta-table td {
  padding: 10px 6px;
  border-bottom: 1px solid #f5f1e8;
  color: #1a2942;
}

.compta-table tfoot td {
  border-top: 2px solid #1a2942;
  border-bottom: none;
  padding-top: 12px;
}

.compta-month-name {
  font-weight: 500;
}

.compta-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.compta-marge {
  color: #5a7848;
  font-weight: 600;
}

/* ── Empty ── */
.compta-empty {
  font-size: 14px;
  color: #8a8474;
  text-align: center;
  padding: 20px;
  background: #faf6ed;
  border-radius: 8px;
  line-height: 1.5;
  margin: 0;
}

/* ── Disclaimer ── */
.compta-disclaimer {
  background: #faf6ed;
  border-left: 3px solid #d4a868;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: #8a8474;
  line-height: 1.5;
  margin-top: 16px;
}
.compta-disclaimer strong {
  color: #b8843f;
}

/* ============================================================
   ACTIONS RAPIDES (Émettre facture, Pack comptable)
   ============================================================ */
.compta-actions-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.compta-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: white;
  border: 1px solid #ede5d3;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.compta-action-card:hover { background: #faf6ed; }
.compta-action-card:active { transform: scale(0.98); }

.compta-action-primary {
  background: linear-gradient(135deg, #1a2942 0%, #2d3e5c 100%);
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(26, 41, 66, 0.12);
}
.compta-action-primary:hover {
  background: linear-gradient(135deg, #243454 0%, #36486a 100%);
}

.compta-action-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(184, 132, 63, 0.2);
}

.compta-action-content { flex: 1; min-width: 0; }

.compta-action-title {
  font-size: 15px;
  font-weight: 600;
  color: white;
  margin-bottom: 2px;
}

.compta-action-card:not(.compta-action-primary) .compta-action-title {
  color: #1a2942;
}

.compta-action-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.compta-action-card:not(.compta-action-primary) .compta-action-sub {
  color: #8a8474;
}

.compta-action-arrow {
  font-size: 24px;
  color: #d4a868;
  font-weight: 300;
  flex-shrink: 0;
}

.compta-action-card:not(.compta-action-primary) .compta-action-arrow {
  color: #b8843f;
}

/* ============================================================
   MODALE EXPORT PACK COMPTABLE
   ============================================================ */
.compta-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.compta-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.compta-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 41, 66, 0.5);
  backdrop-filter: blur(4px);
}

.compta-modal-card {
  position: relative;
  background: #f5f1e8;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px;
  padding-top: 32px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  -webkit-overflow-scrolling: touch;
}
.compta-modal.is-open .compta-modal-card {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .compta-modal { align-items: center; }
  .compta-modal-card {
    border-radius: 16px;
    max-height: 85vh;
    transform: scale(0.95);
  }
  .compta-modal.is-open .compta-modal-card {
    transform: scale(1);
  }
}

.compta-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(26, 41, 66, 0.08);
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #1a2942;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

html.compta-modal-open { overflow: hidden; }

.compta-modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  color: #1a2942;
  margin: 0 0 6px;
  padding-right: 40px;
}
.compta-modal-title em { color: #b8843f; font-style: italic; }

.compta-modal-sub {
  font-size: 13px;
  color: #6a6478;
  margin: 0 0 18px;
  line-height: 1.5;
}

.compta-modal-section {
  margin-bottom: 18px;
}

.compta-modal-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8474;
  font-weight: 600;
  margin-bottom: 8px;
}

.compta-modal-select, .compta-modal-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  border: 1px solid #d9cfb8;
  border-radius: 10px;
  color: #1a2942;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.compta-modal-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23b8843f' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.compta-modal-hint {
  font-size: 11px;
  color: #8a8474;
  margin: 6px 2px 0;
}

.compta-modal-types {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: white;
  border-radius: 10px;
  padding: 6px;
}

.compta-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.compta-type-row:hover { background: #faf6ed; }

.compta-type-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #b8843f;
  cursor: pointer;
}

.compta-type-icon { font-size: 18px; }

.compta-type-label {
  flex: 1;
  font-size: 14px;
  color: #1a2942;
}

.compta-type-count {
  font-size: 12px;
  color: #8a8474;
  font-variant-numeric: tabular-nums;
}

.compta-modal-error {
  background: #fde8e6;
  color: #b8493f;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
  border-left: 3px solid #b8493f;
}

.compta-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.compta-btn-primary, .compta-btn-ghost {
  flex: 1;
  padding: 13px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s, background 0.15s;
}

.compta-btn-primary {
  background: #1a2942;
  color: white;
}
.compta-btn-primary:hover { background: #2a3a52; }
.compta-btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.compta-btn-ghost {
  background: transparent;
  color: #1a2942;
  border: 1px solid #d5cdb8;
}
.compta-btn-ghost:hover { background: #faf6ed; }

/* ─── Modale résultat ─── */
.compta-result-icon {
  font-size: 48px;
  text-align: center;
  margin: 0 0 6px;
}

.compta-result-summary {
  background: white;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #1a2942;
}

.compta-result-info {
  font-size: 13px;
  color: #5a6478;
  background: #faf6ed;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid #d4a868;
  line-height: 1.5;
  margin: 14px 0;
}

/* Icône action ocre (Pack comptable) */
.compta-action-icon-ocre {
  background: rgba(184, 132, 63, 0.15) !important;
}
