/* Facturation - admin CSS */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f6f9;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

code { font-family: "SF Mono", Monaco, "Courier New", monospace; font-size: 12px; background: #eef0f5; padding: 1px 5px; border-radius: 3px; }

/* ============================================== Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  color: #fff;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.topbar .brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 16px;
}
.topbar .brand strong { letter-spacing: 0.5px; }
.company-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.topbar .mainnav { display: flex; gap: 2px; }
.topbar .mainnav a {
  color: #cbd5e1;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
}
.topbar .mainnav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.topbar .mainnav a.active { background: rgba(255,255,255,0.15); color: #fff; }
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #cbd5e1; }
.btn-logout {
  color: #fca5a5;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  font-size: 12px;
}

/* ============================================== Layout */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 60px;
}
.page-title {
  margin: 0 0 20px 0;
  font-size: 22px;
  font-weight: 700;
}
.admin-footer {
  text-align: center;
  color: #94a3b8;
  font-size: 11px;
  padding: 20px;
}

/* ============================================== Flash */
.flash {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }

/* ============================================== Cards */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 18px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #e5e7eb;
}
.card h2, .card h3 { margin-top: 0; }
.card.card-wide { grid-column: 1 / -1; }
.card.card-danger { border-left: 4px solid #dc2626; background: #fef2f2; }
.card-hint { font-size: 11px; color: #64748b; margin: 6px 0 0; font-style: italic; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.sap-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

/* SAP big display */
.sap-big {
  text-align: center;
  margin: 16px 0;
}
.sap-percent {
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
}
.sap-statut {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 12px;
}
.sap-breakdown {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  font-size: 13px;
}
.sap-breakdown li { padding: 4px 0; border-bottom: 1px dashed #e5e7eb; }

.card dl { margin: 0; }
.card dl dt { color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 6px; }
.card dl dd { margin: 0 0 4px 0; font-size: 14px; }

.center { text-align: center; }

/* ============================================== Stat tables */
.stat-table, .list-table, .mini-table {
  width: 100%;
  border-collapse: collapse;
}
.stat-table th, .list-table th, .mini-table th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 2px solid #e5e7eb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 600;
}
.stat-table td, .list-table td, .mini-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.stat-table th.right, .stat-table td.right,
.list-table th.right, .list-table td.right,
.mini-table th.right, .mini-table td.right { text-align: right; }
.empty { text-align: center; color: #94a3b8; padding: 20px; font-style: italic; }

.mini-table { margin-top: 10px; font-size: 12px; }

/* ============================================== Pills / Badges */
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #e5e7eb;
  color: #374151;
}
.pill-sap { background: #fef3c7; color: #92400e; }
.pill-warn { background: #fed7aa; color: #9a3412; }
.pill-impaye { background: #fee2e2; color: #991b1b; }
.pill-partiellement_paye { background: #fef3c7; color: #92400e; }
.pill-paye { background: #d1fae5; color: #065f46; }
.pill-annule_par_avoir { background: #e5e7eb; color: #6b7280; text-decoration: line-through; }

/* ============================================== Forms */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-end;
  background: #fff;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.filters-bar label { display: flex; flex-direction: column; font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.filters-bar input, .filters-bar select { padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px; min-width: 140px; }

button, .btn, .btn-primary, .btn-danger {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; color: #fff; text-decoration: none; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: #fff;
}
fieldset legend {
  padding: 0 8px;
  font-weight: 700;
  color: #374151;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
fieldset label { display: block; margin-bottom: 10px; font-size: 13px; }
fieldset input, fieldset select, fieldset textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.line-editor { width: 100%; }
.line-editor th { font-size: 10px; }
.line-editor input, .line-editor select { padding: 5px; font-size: 12px; min-width: 70px; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.inline-form input, .inline-form select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px; }

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

.catalog-edit { background: #f9fafb; padding: 14px; border-radius: 6px; margin-top: 10px; }
.catalog-edit label { display: block; margin-bottom: 8px; }

/* ============================================== Invoice view */
.invoice-view .invoice-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #fff;
  padding: 20px 24px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  margin-bottom: 16px;
}
.invoice-view .invoice-head h2 { margin-top: 0; }
.invoice-view .invoice-actions { display: flex; gap: 8px; }
.muted { color: #64748b; font-size: 12px; }

.event-list { list-style: none; padding: 0; margin: 0; }
.event-list li { padding: 6px 0; border-bottom: 1px dashed #e5e7eb; font-size: 12px; }
.event-list li code { font-size: 11px; }
.event-list pre { background: #f1f5f9; padding: 8px; border-radius: 4px; font-size: 11px; overflow-x: auto; }

/* ============================================== Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}
.login-box {
  background: #fff;
  padding: 32px 40px;
  border-radius: 12px;
  min-width: 360px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.login-box h1 { margin-top: 0; text-align: center; }
.login-company { text-align: center; font-weight: 700; margin: 0 0 18px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.login-box label { display: block; margin-bottom: 12px; font-size: 12px; color: #64748b; }
.login-box input { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; margin-top: 4px; }
.login-box button { width: 100%; background: #2563eb; color: #fff; border: none; padding: 11px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.login-box button:hover { background: #1d4ed8; }

/* ============================================== Year select */
.year-select { margin-bottom: 16px; }
.year-select form { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.year-select select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 5px; }

/* Responsive fallback */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .sap-detail-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; height: auto; padding: 10px; gap: 8px; }
  .topbar .mainnav { flex-wrap: wrap; justify-content: center; }
  .main-content { padding: 16px; }
}

/* ============================================================ */
/* INVOICE CREATE FORM — Refonte UX 2026-04                     */
/* ============================================================ */

.invoice-create-form fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: #fff;
}
.invoice-create-form legend {
  font-weight: 600;
  color: #475569;
  padding: 0 0.5rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* ----- Company switch ----- */
.invoice-create-form .company-switch {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.invoice-create-form .company-switch__btn {
  flex: 1;
  min-width: 160px;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, color 150ms;
}
.invoice-create-form .company-switch__btn:hover {
  border-color: var(--company-color, #94a3b8);
}
.invoice-create-form .company-switch__btn--active {
  background: var(--company-color, #0ea5e9);
  border-color: var(--company-color, #0ea5e9);
  color: #fff;
}
.invoice-create-form .company-info-card {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #475569;
}
.invoice-create-form .company-info-card strong { color: #1e293b; }
.invoice-create-form .company-info-card small { display: block; margin-top: 0.25rem; }

/* ----- Client picker ----- */
.invoice-create-form .client-picker {
  position: relative;
}
.invoice-create-form .client-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}
.invoice-create-form .client-search-input:focus {
  outline: 2px solid #0ea5e9;
  outline-offset: 1px;
  border-color: #0ea5e9;
}
.invoice-create-form .client-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  max-height: 400px;
  overflow-y: auto;
  z-index: 10;
}
.invoice-create-form .client-dropdown__item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.invoice-create-form .client-dropdown__item:last-child { border-bottom: none; }
.invoice-create-form .client-dropdown__item:hover,
.invoice-create-form .client-dropdown__item--highlighted {
  background: #f1f5f9;
}
.invoice-create-form .client-dropdown__name {
  font-weight: 600;
  color: #1e293b;
}
.invoice-create-form .client-dropdown__meta {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.125rem;
}
.invoice-create-form .client-dropdown__item--create {
  background: #fef3c7;
  color: #78350f;
  font-weight: 600;
}
.invoice-create-form .client-dropdown__item--create:hover {
  background: #fde68a;
}
.invoice-create-form .client-dropdown__empty,
.invoice-create-form .client-dropdown__more {
  padding: 0.75rem 1rem;
  color: #94a3b8;
  font-style: italic;
  font-size: 0.875rem;
}
.invoice-create-form .client-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  margin-left: 0.25rem;
}
.invoice-create-form .client-badge--aideclean { background: #1e8fc7; }
.invoice-create-form .client-badge--services-immo { background: #c93030; }

.invoice-create-form .client-selected-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border: 2px solid #0ea5e9;
  border-radius: 8px;
  background: #f0f9ff;
}
.invoice-create-form .client-selected-card[hidden] {
  display: none !important;
}
.invoice-create-form .client-dropdown[hidden] {
  display: none !important;
}
.invoice-create-form .client-selected-card__main strong {
  display: block;
  font-size: 1.0625rem;
  color: #0c4a6e;
  margin-bottom: 0.25rem;
}
.invoice-create-form .client-selected-card__main div {
  font-size: 0.875rem;
  color: #334155;
}
.invoice-create-form .client-selected-card__clear {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}
.invoice-create-form .client-selected-card__clear:hover { color: #dc2626; }

/* ----- Dates ----- */
.invoice-create-form .dates-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}
.invoice-create-form .dates-row__field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.invoice-create-form .dates-row__field span {
  font-size: 0.8125rem;
  color: #64748b;
}
.invoice-create-form .dates-row__field input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9375rem;
}
.invoice-create-form .date-lock-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1.125rem;
  height: 2.625rem;
  align-self: flex-end;
}
.invoice-create-form .date-lock-btn[data-state="linked"] {
  background: #f0fdf4;
  border-color: #86efac;
}
.invoice-create-form .date-lock-btn[data-state="unlinked"] {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ----- Lignes ----- */
.invoice-create-form .line-editor {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.invoice-create-form .line-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  background: #fafbfc;
}
.invoice-create-form .line-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #e2e8f0;
}
.invoice-create-form .line-card__header strong {
  color: #1e293b;
}
.invoice-create-form .line-card__remove {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}
.invoice-create-form .line-card__remove:hover { color: #dc2626; }
.invoice-create-form .line-card__content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.invoice-create-form .line-card__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.invoice-create-form .line-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.invoice-create-form .line-field span {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}
.invoice-create-form .line-field input,
.invoice-create-form .line-field select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9375rem;
  background: #fff;
}
.invoice-create-form .sap-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: #475569;
}
.invoice-create-form .line-total {
  text-align: right;
  font-size: 0.9375rem;
  color: #1e293b;
  padding-top: 0.5rem;
  border-top: 1px dashed #e2e8f0;
  font-weight: 600;
}
.invoice-create-form .line-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.invoice-create-form .btn-add-line {
  flex: 1 1 0;
  padding: 0.625rem 1rem;
  background: #fff;
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  font-weight: 500;
  cursor: pointer;
}
.invoice-create-form .btn-add-line:hover {
  border-color: #0ea5e9;
  color: #0ea5e9;
}

/* Bouton "Importer depuis configurateur" dans chaque line-card */
.invoice-create-form .line-card__import-btn {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  color: #0c4a6e;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}
.invoice-create-form .line-card__import-btn:not(:disabled):hover {
  background: #e0f2fe;
  border-color: #0ea5e9;
}
.invoice-create-form .line-card__import-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.invoice-create-form .invoice-lines-hint {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  color: #64748b;
}
.invoice-create-form .invoice-lines-hint small {
  font-size: 0.8125rem;
}
.invoice-create-form .totals-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #e2e8f0;
}
.invoice-create-form .totals-summary__row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
}
.invoice-create-form .totals-summary__row--ht strong,
.invoice-create-form .totals-summary__row--ttc strong {
  font-size: 1.125rem;
  color: #0c4a6e;
}

/* ----- Modale création client ----- */
.client-create-modal {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 560px;
  width: 92%;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.client-create-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.client-create-modal__form {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}
.client-create-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.client-create-modal__header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #0f172a;
}
.client-create-modal__close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.client-create-modal__body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}
.client-create-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.client-create-modal .field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.client-create-modal .field span {
  font-size: 0.8125rem;
  color: #475569;
  font-weight: 500;
}
.client-create-modal .field input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9375rem;
}
.client-create-modal .field-row {
  display: flex;
  gap: 0.75rem;
}
.client-create-modal .field--grow { flex: 1; }
.client-create-modal .radio-row {
  display: flex;
  gap: 1rem;
}
.client-create-modal .radio-row label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  color: #334155;
}
.client-create-modal .advanced-fields {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e2e8f0;
}
.client-create-modal .advanced-fields summary {
  cursor: pointer;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0;
}
.client-create-modal__error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

/* ----- Modale simulator (iframe metier) ----- */
.simulator-modal {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: 95vw;
  max-width: 1100px;
  height: 90vh;
  max-height: 900px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.35);
  overflow: hidden;
}
.simulator-modal::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
}
.simulator-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  height: 56px;
  box-sizing: border-box;
}
.simulator-modal__header h2 {
  margin: 0;
  font-size: 1.0625rem;
  color: #0f172a;
  font-weight: 600;
}
.simulator-modal__close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #64748b;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}
.simulator-modal__close:hover { color: #dc2626; }
.simulator-modal__body {
  position: relative;
  height: calc(100% - 56px);
  background: #f7f9fc;
}
.simulator-modal__iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.simulator-modal__iframe[hidden] { display: none; }
.simulator-modal__loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.9375rem;
  background: #f7f9fc;
}
.simulator-modal__loading[hidden] { display: none; }

@media (max-width: 700px) {
  .simulator-modal {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
  }
}

/* ----- Responsive mobile ----- */
@media (max-width: 600px) {
  .invoice-create-form .dates-row {
    flex-direction: column;
    align-items: stretch;
  }
  .invoice-create-form .date-lock-btn {
    align-self: flex-start;
  }
  .invoice-create-form .line-card__row {
    grid-template-columns: 1fr;
  }
  .invoice-create-form .company-switch {
    flex-direction: column;
  }
  .invoice-create-form .company-switch__btn {
    min-width: 0;
  }
  .client-create-modal .field-row {
    flex-direction: column;
  }
}
