/* ============================================================
   MA PAUSE CAFÉ — Portail — Styles globaux
   ============================================================ */

:root {
  --orange:       #D4622A;
  --orange-light: #F0824A;
  --orange-pale:  #FDF0E8;
  --brown:        #5C3317;
  --brown-light:  #8B5E3C;
  --cream:        #FFFAF5;
  --border:       #E8C9A8;
  --text:         #2D1B0E;
  --text-muted:   #8B6B4A;
  --success:      #2E7D32;
  --warning:      #E65100;
  --danger:       #C62828;
  --info:         #1565C0;
  --white:        #FFFFFF;
  --shadow:       0 2px 12px rgba(92,51,23,0.1);
  --shadow-lg:    0 8px 32px rgba(92,51,23,0.15);
  --radius:       10px;
  --radius-sm:    6px;
  --nav-h:        64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── LOGIN ─────────────────────────────────────────────────── */
.login-page {
  background: linear-gradient(135deg, #FDF0E8 0%, #FFF8F2 60%, #F5E8D8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.login-logo img { width: 60px; height: 60px; object-fit: contain; }

.login-brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brown);
}

.brand-title sup { font-size: 0.7em; }

.brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--orange);
  text-transform: uppercase;
}

.login-tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; }

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brown);
}

.field input,
.field select,
.field textarea {
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(212,98,42,0.12);
}

.field textarea { resize: vertical; min-height: 80px; }

.error-msg {
  background: #FFEBEE;
  color: var(--danger);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid #FFCDD2;
}

.login-footer {
  margin-top: 1rem;
  text-align: center;
}

.login-footer a {
  font-size: 0.85rem;
  color: var(--orange);
  text-decoration: none;
}

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

.confidentiality-note {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── BOUTONS ───────────────────────────────────────────────── */
.btn-primary {
  background: var(--orange);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
  width: 100%;
}

.btn-primary:hover  { background: var(--orange-light); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-secondary {
  background: var(--white);
  color: var(--orange);
  border: 1.5px solid var(--orange);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-secondary:hover { background: var(--orange-pale); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-ghost:hover { background: var(--orange-pale); color: var(--orange); }

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* ── NAVIGATION ────────────────────────────────────────────── */
.topnav {
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(92,51,23,0.08);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-brand img { width: 36px; height: 36px; object-fit: contain; }

.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brown);
}

.nav-brand-sub {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--orange);
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-tabs a {
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tabs a:hover,
.nav-tabs a.active {
  background: var(--orange-pale);
  color: var(--orange);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--orange);
  border: 2px solid var(--border);
  overflow: hidden;
}

.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

.badge-abonnement {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-expresso { background: #FFF3E0; color: #E65100; }
.badge-longo    { background: #E8F5E9; color: #2E7D32; }

/* ── LAYOUT PRINCIPAL ──────────────────────────────────────── */
.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brown);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title .icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* ── SERVICES GRID ─────────────────────────────────────────── */
.piliers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.pilier-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}

.pilier-card:hover {
  border-color: var(--orange);
  box-shadow: 0 4px 16px rgba(212,98,42,0.15);
  transform: translateY(-2px);
}

.pilier-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.pilier-pro    .pilier-icon { background: #FFF3E0; }
.pilier-perso  .pilier-icon { background: #E8F5E9; }
.pilier-fam    .pilier-icon { background: #E3F2FD; }
.pilier-aid    .pilier-icon { background: #F3E5F5; }

.pilier-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 0.4rem;
}

.pilier-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.pilier-services {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.service-tag {
  font-size: 0.72rem;
  background: var(--orange-pale);
  color: var(--orange);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-weight: 500;
}

/* ── DEMANDES TABLE ────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--orange-pale);
  color: var(--brown);
  font-weight: 700;
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:hover { background: var(--orange-pale); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 0.75rem 1rem;
  color: var(--text);
}

/* ── STATUTS ───────────────────────────────────────────────── */
.statut {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.statut::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.statut-nouvelle  { background: #E3F2FD; color: #1565C0; }
.statut-en-cours  { background: #FFF3E0; color: #E65100; }
.statut-traite    { background: #E8F5E9; color: #2E7D32; }
.statut-cloture   { background: #F5F5F5; color: #757575; }
.statut-annule    { background: #FFEBEE; color: #C62828; }

/* ── STATS MÉTRIQUES ───────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45,27,14,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--white);
  border-radius: 14px;
  padding: 1.75rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brown);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.3rem;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover { color: var(--orange); }

.form-grid {
  display: grid;
  gap: 1rem;
}

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

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* ── SIDEBAR SERVICES ──────────────────────────────────────── */
.services-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100vh;
  background: var(--white);
  box-shadow: -4px 0 24px rgba(92,51,23,0.15);
  z-index: 150;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 1.5rem;
}

.services-panel.open { right: 0; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.service-list { display: flex; flex-direction: column; gap: 0.5rem; }

.service-item {
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.service-item:hover {
  border-color: var(--orange);
  background: var(--orange-pale);
}

.service-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.service-item-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.surcoût-badge {
  font-size: 0.68rem;
  background: #FFF3E0;
  color: #E65100;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  font-weight: 600;
}

/* ── PROFIL ────────────────────────────────────────────────── */
.profil-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profil-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.profil-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--orange-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--orange);
  border: 3px solid var(--border);
}

.profil-info h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brown);
}

.profil-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── NOTIFICATION BANNER ───────────────────────────────────── */
.banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.banner-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.banner-info    { background: #E3F2FD; color: #1565C0; border: 1px solid #BBDEFB; }
.banner-warning { background: #FFF8E1; color: #F57F17; border: 1px solid #FFE082; }

/* ── LOADING ───────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-muted);
  gap: 0.5rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-tabs { display: none; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .page-content { padding: 1rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .services-panel { width: 100%; right: -100%; }
}
