/* ═══════════════════════════════════════════════════════════════════
   NYOMA — Feuille de style principale
   Charte graphique inspirée de nyoma.ch
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --cream:        #F6EDD9;
  --cream-light:  #FBF6EC;
  --cream-dark:   #EDE0C4;
  --brown-deep:   #2C1810;
  --brown-mid:    #5C3D2E;
  --brown-light:  #8B6355;
  --sage:         #6A8C6A;
  --sage-light:   #E4EDE4;
  --sage-mid:     #9DB89D;
  --terra:        #C4745A;
  --terra-light:  #F0DDD7;
  --gold:         #B8923A;
  --gold-light:   #F2E6C8;
  --white:        #FFFDF8;
  --border:       rgba(92,61,46,0.12);
  --border-mid:   rgba(92,61,46,0.20);
  --border-strong:rgba(92,61,46,0.28);
  --shadow:       0 1px 8px rgba(44,24,16,0.07);
  --shadow-lg:    0 6px 32px rgba(44,24,16,0.10);
  --radius:       10px;
  --radius-lg:    14px;
  --sidebar-w:    246px;
  --topbar-h:     60px;
  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-sans:    'DM Sans', system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); background: var(--cream); color: var(--brown-deep); min-height: 100vh; display: flex; line-height: 1.6; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brown-deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-logo { padding: 26px 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.sidebar-logo-link { text-decoration: none; }
.sidebar-logo h1 { font-family: var(--font-serif); font-size: 26px; font-weight: 600; color: var(--cream-light); letter-spacing: 1.5px; line-height: 1.1; }
.sidebar-logo p  { font-size: 10px; color: rgba(246,237,217,0.4); letter-spacing: 2.5px; text-transform: uppercase; margin-top: 4px; }
.sidebar-section { padding: 14px 0 2px; }
.sidebar-section-title { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(246,237,217,0.3); padding: 0 20px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  color: rgba(246,237,217,0.60);
  cursor: pointer; font-size: 13px; font-weight: 400;
  transition: all 0.15s;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: rgba(246,237,217,0.06); color: rgba(246,237,217,0.9); }
.nav-item.active { background: rgba(184,146,58,0.14); color: var(--gold-light); border-left-color: var(--gold); font-weight: 500; }
.nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.8; }
.sidebar-bottom { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.07); }
.user-badge { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: white; flex-shrink: 0; }
.user-info strong { display: block; font-size: 12.5px; color: var(--cream-light); font-weight: 500; line-height: 1.3; }
.user-info p { font-size: 11px; color: rgba(246,237,217,0.5); line-height: 1.3; }
.btn-logout { background: none; border: 1px solid rgba(255,255,255,0.15); color: rgba(246,237,217,0.5); padding: 5px 12px; border-radius: 6px; font-family: var(--font-sans); font-size: 11px; cursor: pointer; transition: all 0.15s; width: 100%; text-align: center; }
.btn-logout:hover { background: rgba(255,255,255,0.07); color: var(--cream-light); }

/* ── Main ─────────────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 0 28px; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: var(--brown-deep); font-style: italic; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-saison { font-size: 12px; color: var(--brown-light); }
.page-content { padding: 28px; flex: 1; }

/* ── Flash messages ────────────────────────────────────────────── */
.flash { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; font-size: 13.5px; border-bottom: 1px solid transparent; }
.flash-success { background: var(--sage-light); color: #1a6b1a; border-color: rgba(106,140,106,0.2); }
.flash-error   { background: var(--terra-light); color: #8b1a1a; border-color: rgba(196,116,90,0.2); }
.flash-close   { background: none; border: none; cursor: pointer; font-size: 18px; opacity: 0.5; padding: 0 4px; line-height: 1; }
.flash-close:hover { opacity: 1; }

/* ── Alertes formulaire ────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 18px; line-height: 1.6; }
.alert-error   { background: var(--terra-light); color: #8b1a1a; border: 1px solid rgba(196,116,90,0.25); }
.alert-warning { background: var(--gold-light); color: #6b4e10; border: 1px solid rgba(184,146,58,0.25); }
.alert p { margin-bottom: 4px; }
.alert p:last-child { margin-bottom: 0; }

/* ── Boutons ───────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-family: var(--font-sans); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; text-decoration: none; border: none; line-height: 1.4; white-space: nowrap; }
.btn-primary { background: var(--brown-deep); color: var(--cream-light); }
.btn-primary:hover { background: var(--brown-mid); }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--brown-mid); }
.btn-outline:hover { background: var(--cream-dark); }
.btn-outline.active { background: var(--brown-deep); color: var(--cream-light); border-color: var(--brown-deep); }
.btn-sage { background: var(--sage); color: white; }
.btn-sage:hover { background: #537053; }
.btn-danger { background: var(--terra); color: white; }
.btn-danger:hover { background: #a35842; }
.btn-warn { color: var(--terra); border-color: rgba(196,116,90,0.4); }
.btn-warn:hover { background: var(--terra-light); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.card-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.card-title { font-family: var(--font-serif); font-size: 18px; font-weight: 500; font-style: italic; color: var(--brown-deep); }
.card-body { padding: 20px; }

/* ── Tableaux ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
  text-align: left; padding: 9px 14px;
  font-size: 11px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--brown-light); background: var(--cream-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table thead th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.data-table thead th a:hover { color: var(--brown-deep); }
.sort-icon { font-size: 10px; opacity: 0.4; }
.sort-icon.active { opacity: 1; color: var(--brown-deep); }
.data-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--brown-deep); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--cream-light); }
.data-table tfoot td { padding: 10px 14px; background: var(--cream-light); }
.actions-cell { white-space: nowrap; text-align: right; }

/* ── Badges ────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-green { background: var(--sage-light); color: #2a5e2a; }
.badge-gold  { background: var(--gold-light); color: #6b4e10; }
.badge-terra { background: var(--terra-light); color: #7a3020; }
.badge-gray  { background: var(--cream-dark); color: var(--brown-mid); }
.badge-brown { background: rgba(92,61,46,0.12); color: var(--brown-mid); }

/* ── Formulaires ────────────────────────────────────────────────── */
.form-page { max-width: 820px; }
.form-section { margin-bottom: 28px; }
.form-section-title { font-family: var(--font-serif); font-size: 17px; font-weight: 500; font-style: italic; color: var(--brown-deep); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid-4 { grid-template-columns: auto 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group-full { grid-column: 1 / -1; }
.form-group-sm { max-width: 100px; }
.form-group-lg { }
label { font-size: 11.5px; font-weight: 500; letter-spacing: 0.5px; color: var(--brown-mid); text-transform: uppercase; }
.req { color: var(--terra); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"], input[type="search"],
textarea, select {
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 13.5px;
  background: var(--white); color: var(--brown-deep);
  outline: none; transition: border-color 0.15s; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--sage); }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--brown-light); margin-top: 3px; }
.form-actions { display: flex; align-items: center; gap: 10px; padding-top: 12px; margin-top: 4px; flex-wrap: wrap; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--brown-deep); cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; }
.checkbox-label input[type="checkbox"] { width: auto; }
.input-password-wrap { position: relative; }
.input-password-wrap input { padding-right: 38px; }
.toggle-password { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 4px; color: var(--brown-light); }

/* ── Toolbar / Filtres ──────────────────────────────────────────── */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; max-width: 280px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--brown-light); pointer-events: none; }
.search-input { padding-left: 34px !important; }
.filter-select { padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-family: var(--font-sans); font-size: 13px; background: var(--white); color: var(--brown-deep); outline: none; cursor: pointer; }

/* ── Stats mini ─────────────────────────────────────────────────── */
.stats-mini { display: flex; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-mini { display: flex; flex-direction: column; align-items: center; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 20px; min-width: 80px; }
.stat-mini-val { font-family: var(--font-serif); font-size: 26px; font-weight: 600; line-height: 1; }
.stat-mini-label { font-size: 11px; color: var(--brown-light); text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; }

/* ── Pagination ─────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); }
.pagination-info { font-size: 12px; color: var(--brown-light); }
.pagination-links { display: flex; gap: 4px; }

/* ── Cell avec avatar ────────────────────────────────────────────── */
.cell-with-avatar { display: flex; align-items: center; gap: 10px; }
.table-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; color: white; flex-shrink: 0; }
.table-avatar.sage  { background: var(--sage); }
.table-avatar.terra { background: var(--terra); }
.table-avatar.gold  { background: var(--gold); }
.table-avatar.brown { background: var(--brown-mid); }

/* ── Client header ───────────────────────────────────────────────── */
.client-header-block { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.client-header-main { display: flex; align-items: center; gap: 18px; }
.client-avatar { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: white; flex-shrink: 0; }
.client-avatar.sage  { background: var(--sage); }
.client-avatar.terra { background: var(--terra); }
.client-avatar.gold  { background: var(--gold); }
.client-header-info h2 { font-family: var(--font-serif); font-size: 26px; font-weight: 600; color: var(--brown-deep); }
.client-meta { font-size: 13px; color: var(--brown-light); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.meta-sep { color: var(--border-strong); }
.client-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Onglets ─────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 22px; }
.tab { padding: 10px 20px; font-size: 13.5px; font-weight: 400; color: var(--brown-light); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--brown-deep); }
.tab.active { color: var(--brown-deep); border-bottom-color: var(--brown-deep); font-weight: 500; }
.tab-content { }

/* ── Info list (fiche client) ────────────────────────────────────── */
.info-list { display: flex; flex-direction: column; gap: 0; }
.info-row { display: flex; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row dt { font-size: 12px; font-weight: 500; color: var(--brown-light); text-transform: uppercase; letter-spacing: 0.5px; min-width: 140px; padding-top: 2px; }
.info-row dd { font-size: 13.5px; color: var(--brown-deep); flex: 1; }
.info-pathologies { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.info-label { font-size: 11.5px; font-weight: 500; color: var(--brown-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.info-text { font-size: 13.5px; color: var(--brown-deep); line-height: 1.7; background: var(--cream-light); padding: 10px 14px; border-radius: var(--radius); border-left: 3px solid var(--sage); }

/* ── Présences ───────────────────────────────────────────────────── */
.presence-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.presence-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--brown-mid); }
.presence-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.presence-item { text-align: center; }
.presence-date { font-size: 10px; color: var(--brown-light); margin-bottom: 4px; }
.presence-cell { width: 34px; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.presence-P   { background: #d4f4d4; color: #1a6b1a; }
.presence-A   { background: #fde8e8; color: #8b1a1a; }
.presence-R   { background: #e8f0fe; color: #1a3d8b; }
.presence-NI  { background: var(--cream-dark); color: var(--brown-mid); }
.presence-DA  { background: #fff3cd; color: #7a5e1a; }
.presence-RA  { background: #e8f7ff; color: #1a5c7a; }
.presence-empty { background: var(--cream); color: rgba(92,61,46,0.25); }
.presence-clickable { cursor: pointer; transition: transform 0.1s, opacity 0.1s; }
.presence-clickable:hover { transform: scale(1.1); opacity: 0.85; }
.presence-summary { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.presence-sum-item { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.sum-val { font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1; }
.sum-label { font-size: 11px; color: var(--brown-light); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 3px; }
.sum-P .sum-val  { color: #1a6b1a; }
.sum-A .sum-val  { color: #8b1a1a; }
.sum-R .sum-val  { color: #1a3d8b; }
.sum-NI .sum-val { color: var(--brown-mid); }
.sum-DA .sum-val { color: #7a5e1a; }
.sum-RA .sum-val { color: #1a5c7a; }

/* ── Finance ─────────────────────────────────────────────────────── */
.finance-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.finance-block { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; border-top: 3px solid var(--border-mid); }
.finance-block-sage  { border-top-color: var(--sage); }
.finance-block-terra { border-top-color: var(--terra); }
.finance-block-gold  { border-top-color: var(--gold); }
.finance-label  { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brown-light); margin-bottom: 6px; }
.finance-amount { font-family: var(--font-serif); font-size: 28px; font-weight: 600; color: var(--brown-deep); }
.finance-block-sage  .finance-amount { color: var(--sage); }
.finance-block-terra .finance-amount { color: var(--terra); }

/* ── Breadcrumb ──────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--brown-light); margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a { color: var(--brown-mid); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--brown-light); }

/* ── Two-col layout ────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Collapsible panel ────────────────────────────────────────── */
.collapsible-panel { }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--brown-light); }
.empty-state p { font-size: 13.5px; }

/* ── Login ───────────────────────────────────────────────────── */
.login-body { background: var(--brown-deep); display: flex; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex: 1; padding: 20px; }
.login-card { background: var(--white); border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 390px; text-align: center; }
.login-logo { font-family: var(--font-serif); font-size: 40px; font-weight: 600; color: var(--brown-deep); letter-spacing: 2px; }
.login-tagline { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--brown-light); margin-top: 4px; margin-bottom: 28px; }
.login-ornament { width: 36px; height: 2px; background: var(--gold); margin: 0 auto 26px; border-radius: 1px; }
.login-card .form-group { text-align: left; margin-bottom: 12px; }
.login-btn { width: 100%; padding: 12px; background: var(--brown-deep); color: var(--cream-light); border: none; border-radius: var(--radius); font-family: var(--font-sans); font-size: 14px; font-weight: 500; cursor: pointer; margin-top: 6px; letter-spacing: 0.5px; transition: background 0.15s; }
.login-btn:hover { background: var(--brown-mid); }
.login-footer { font-size: 11.5px; color: var(--brown-light); margin-top: 20px; }
.login-footer a { color: var(--brown-mid); text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* ── Utilitaires ─────────────────────────────────────────────── */
.text-sage  { color: var(--sage); }
.text-terra { color: var(--terra); }
.text-gold  { color: var(--gold); }
.text-muted { color: var(--brown-light); }
.font-500   { font-weight: 500; }
.link-subtle { color: var(--brown-mid); text-decoration: none; }
.link-subtle:hover { text-decoration: underline; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
