/* ============================================================
   I Need Pro Factures — habillage « app comptable » (style QuickBooks)
   Chargé APRÈS styles.css : n'affecte que la page /facturation/.
   ============================================================ */

.fact-body {
  margin: 0;
  background: #f2f4f5;
  min-height: 100dvh;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

#facturation-app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---------- En-tête vert foncé ---------- */
.fact-header {
  background: linear-gradient(180deg, #06301d 0%, #0e4d2c 78%, #14663a 100%);
  color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 0.9rem) 1rem 1.1rem;
}

.fact-header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fact-company {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.fact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #2ca01c;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex: none;
}

.fact-company-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fact-company-text strong {
  font-family: "Outfit", sans-serif;
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fact-updated {
  font-size: 0.75rem;
  opacity: 0.75;
}

.fact-header-link {
  color: #d9f2e2;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
}

.fact-header-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Contenu ---------- */
.fact-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.9rem 0.9rem calc(88px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.fact-view[hidden] {
  display: none !important;
}

/* ---------- Cartes ---------- */
.fact-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 40, 30, 0.08);
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
}

.fact-card-label {
  font-size: 0.78rem;
  color: #6b7a74;
  margin: 0 0 0.15rem;
}

.fact-card-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #17241e;
  margin: 0 0 0.35rem;
}

.fact-amount {
  font-family: "Outfit", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #17241e;
  margin: 0.1rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.fact-bar {
  height: 12px;
  border-radius: 6px;
  background: #e6eae8;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.fact-bar > span {
  display: block;
  height: 100%;
  border-radius: 6px;
}

.fact-bar--overdue > span {
  background: #f5931d;
}

.fact-bar--paid > span {
  background: #00c244;
}

.fact-bar--quote > span {
  background: #0d9488;
}

.fact-split {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #52625b;
  margin-bottom: 0.4rem;
}

.fact-split strong {
  color: #17241e;
}

.fact-doc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid #eef1f0;
}

.fact-doc-row-main {
  min-width: 0;
}

.fact-doc-row-name {
  font-weight: 600;
  color: #17241e;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.fact-doc-row-meta {
  font-size: 0.75rem;
  color: #8a978f;
}

.fact-doc-row-meta.is-overdue {
  color: #c2410c;
}

.fact-doc-row-amount {
  font-weight: 700;
  color: #17241e;
  white-space: nowrap;
}

.fact-card-footer {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.fact-link-btn {
  appearance: none;
  border: 1px solid #0e4d2c;
  background: #fff;
  color: #0e4d2c;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
}

.fact-link-btn:hover {
  background: #ecf6ef;
}

.fact-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.fact-kpi-grid .fact-card {
  margin-bottom: 0;
}

.fact-kpi-grid + .fact-card {
  margin-top: 0.9rem;
}

.fact-amount--sm {
  font-size: 1.45rem;
}

/* ---------- Carte vide / connexion ---------- */
.fact-empty {
  text-align: center;
  padding: 1.6rem 1.1rem;
}

.fact-empty p {
  color: #52625b;
}

.fact-login-card {
  text-align: center;
  margin-top: 2rem;
  padding: 2rem 1.25rem;
}

.fact-login-icon {
  border-radius: 18px;
}

.fact-login-card h1 {
  font-family: "Outfit", sans-serif;
  margin: 0.75rem 0 0.3rem;
}

.fact-login-btn {
  margin-top: 0.75rem;
}

.fact-login-alt {
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* ---------- Bouton flottant « + » ---------- */
.fact-fab-wrap {
  position: fixed;
  right: 1rem;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}

.fact-fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: #0e4d2c;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(9, 48, 28, 0.35);
  transition: transform 0.15s ease;
}

.fact-fab[aria-expanded="true"] {
  transform: rotate(45deg);
}

.fact-fab-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fact-fab-menu[hidden] {
  display: none;
}

.fact-fab-item {
  appearance: none;
  border: none;
  background: #fff;
  color: #0e4d2c;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(9, 48, 28, 0.22);
}

/* ---------- Barre de navigation basse ---------- */
.fact-bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  background: #fff;
  border-top: 1px solid #e3e8e5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.fact-bottomnav-item {
  appearance: none;
  border: none;
  background: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7a74;
  text-decoration: none;
  cursor: pointer;
}

.fact-bottomnav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.fact-bottomnav-item.is-active {
  color: #0e4d2c;
}

/* ---------- Le module documents (pro-invoice) dans l'app ---------- */
#facturation-docs-root {
  background: transparent;
}

@media (min-width: 760px) {
  .fact-main {
    padding-top: 1.4rem;
  }
}
