/* ============================================================
   app-shell.css — Layout sidebar + main partagé
   Utilisé par : /dashboard/* et /accounts/* (zone connectée)
   ============================================================ */

.app-shell { display: flex; min-height: calc(100vh - 200px); background: #F9FAFB; }

.app-sidebar {
  width: 240px; flex-shrink: 0; background: #FFFFFF;
  border-right: 1px solid #E5E7EB; padding: 1.75rem 1rem;
}
.app-sidebar h3 {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: #9CA3AF; font-weight: 700; margin: 0 0.75rem 0.75rem;
}
.app-sidebar ul { list-style: none; padding: 0; margin: 0 0 2rem; }
.app-sidebar a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.85rem; border-radius: 10px;
  color: #374151; text-decoration: none; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.app-sidebar a:hover { background: #F3F4F6; color: var(--primary); }
.app-sidebar a.active { background: rgba(79,70,229,0.10); color: var(--primary); font-weight: 600; }
.app-sidebar i { width: 18px; text-align: center; }

.app-main { flex: 1; padding: 2rem 2.5rem; min-width: 0; }
.app-main--narrow { max-width: 820px; }

.app-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem; }
.app-header h1 { font-size: 1.7rem; margin: 0 0 0.3rem; color: #111827; }
.app-header p { color: #6B7280; margin: 0; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.1rem; border: 1.5px solid var(--primary);
  color: var(--primary); background: transparent;
  border-radius: 10px; font-weight: 600; text-decoration: none;
  transition: background 0.15s;
}
.btn-outline:hover { background: rgba(79,70,229,0.08); }

.panel {
  background: #FFFFFF; border: 1px solid #E5E7EB;
  border-radius: 14px; padding: 1.75rem; margin-bottom: 1.5rem;
}
.panel h2 { font-size: 1.05rem; margin: 0 0 0.4rem; color: #111827; }
.panel-sub { font-size: 0.88rem; color: #6B7280; margin: 0 0 1.25rem; }

.btn-sm {
  padding: 0.55rem 1rem; border-radius: 9px;
  font-size: 0.88rem; font-weight: 600;
  border: 1.5px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-sm.primary { background: var(--primary); color: #FFFFFF; }
.btn-sm.primary:hover { background: #4338CA; }
.btn-sm.outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-sm.outline:hover { background: rgba(79,70,229,0.08); }
.btn-sm.danger { background: transparent; color: #DC2626; border-color: #FECACA; }
.btn-sm.danger:hover { background: #FEE2E2; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; color: #374151; margin-bottom: 0.4rem; font-size: 0.9rem; }
.field input[type="email"],
.field input[type="text"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%; padding: 0.7rem 0.95rem;
  border: 1px solid #D1D5DB; border-radius: 10px;
  font-size: 1rem; box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #FFFFFF;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}
.field .help { display: block; margin-top: 0.3rem; color: #6B7280; font-size: 0.82rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card {
  background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 14px;
  padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 1rem;
}
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.kpi-icon.violet { background: rgba(79,70,229,0.12); color: var(--primary); }
.kpi-icon.cyan { background: rgba(6,182,212,0.12); color: var(--accent); }
.kpi-icon.amber { background: rgba(245,158,11,0.14); color: #B45309; }
.kpi-label { font-size: 0.78rem; color: #6B7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.1rem; }
.kpi-value { font-size: 1.6rem; font-weight: 800; color: #111827; line-height: 1; }

/* Email rows */
.email-list { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.email-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1rem; border: 1px solid #E5E7EB;
  border-radius: 10px; margin-bottom: 0.6rem;
  transition: border-color 0.15s, background 0.15s; cursor: pointer;
}
.email-row:hover { border-color: var(--primary); background: rgba(79,70,229,0.025); }
.email-row input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; }
.email-text { flex: 1; color: #111827; font-weight: 500; word-break: break-all; }
.email-text small { display: block; color: #6B7280; font-weight: 400; font-size: 0.8rem; margin-top: 0.15rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600;
}
.badge.primary { background: rgba(79,70,229,0.12); color: var(--primary); }
.badge.verified { background: rgba(16,185,129,0.12); color: #059669; }
.badge.unverified { background: rgba(245,158,11,0.14); color: #B45309; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Auth card (login/signup centered pages) */
.auth-card-wrap { min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center; padding: 4rem 1.5rem; background: #F9FAFB; }
.auth-card { width: 100%; max-width: 460px; background: #FFFFFF; padding: 2.5rem; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.auth-card h1 { font-size: 1.65rem; margin-bottom: 0.4rem; text-align: center; color: #111827; }
.auth-card .auth-sub { color: #6B7280; text-align: center; margin-bottom: 1.75rem; }
.auth-card .auth-footer { text-align: center; margin-top: 1.5rem; color: #6B7280; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: #6B7280; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; color: var(--primary); }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: #111827; font-weight: 700; }
.empty-state p { margin-bottom: 1.5rem; }

@media (max-width: 900px) {
  /* mobile : la sidebar de nav compte n'est plus cachee mais empilee en haut
     (barre horizontale scrollable) -> acces Mes projets / Credits / Profil. */
  .app-shell { flex-direction: column; }
  .app-sidebar {
    width: auto; flex-shrink: 0; border-right: none;
    border-bottom: 1px solid #E5E7EB; padding: 1rem 1.25rem;
  }
  .app-sidebar h3 { margin: 0 0.25rem 0.5rem; }
  .app-sidebar ul { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
  .app-sidebar a { padding: 0.5rem 0.8rem; }
  .app-main { padding: 1.5rem 1.25rem; }
  .kpi-grid { grid-template-columns: 1fr; }
}
