/* ============================================================
   CABINET ORELIA — ESPACE CLIENT
   Esthétique : ivoire / marine / ocre, serif éditorial
   ============================================================ */

:root {
  /* Palette */
  --ivory: #f5f1e8;
  --ivory-soft: #faf6ed;
  --ivory-deep: #ede5d3;
  --navy: #1a2332;
  --navy-soft: #2a3548;
  --ocre: #b8843f;
  --ocre-soft: #d4a868;
  --ocre-pale: #e8d4a8;
  --line: #d9cfb8;
  --line-soft: #e8e0cc;
  --text: #1a2332;
  --text-soft: #5a6478;
  --text-mute: #8a8474;
  --red: #b8493f;
  --green: #5a7848;
  --white: #ffffff;

  /* Typo */
  --font-serif: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --font-sans: 'Inter', -apple-system, sans-serif;

  /* Layout */
  --header-h: 64px;
  --tabnav-h: 72px;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-card: 0 1px 3px rgba(26, 35, 50, 0.04), 0 1px 2px rgba(26, 35, 50, 0.06);
  --shadow-elev: 0 4px 16px rgba(26, 35, 50, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--ocre); text-decoration: none; }
em { font-style: italic; color: var(--ocre); font-family: var(--font-serif); font-weight: 500; }

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--ivory-soft) 0%, var(--ivory) 100%);
}
.auth-container { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-mark {
  display: inline-block;
  font-size: 28px;
  color: var(--ocre);
  margin-bottom: 8px;
}
.logo-text {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.logo-tagline {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ocre);
  margin-top: 4px;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-card);
}
.auth-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 6px;
}
.auth-subtitle {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 24px;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
}
.form-field input, .form-field textarea, .form-field select {
  border: 1px solid var(--line);
  background: var(--ivory-soft);
  padding: 12px 14px;
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none;
  border-color: var(--ocre);
  background: var(--white);
}
.auth-error {
  background: rgba(184, 73, 63, 0.08);
  border: 1px solid rgba(184, 73, 63, 0.2);
  color: var(--red);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}
.auth-foot {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-soft);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all .15s ease;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--ocre);
  color: var(--white);
}
.btn-primary:hover { background: #a37533; }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--navy);
}
.btn-ghost:hover { background: var(--ivory-deep); border-color: var(--ocre); }
.btn-danger-ghost {
  background: transparent;
  border-color: rgba(184, 73, 63, 0.3);
  color: var(--red);
}
.btn-danger-ghost:hover { background: rgba(184, 73, 63, 0.06); }
.btn-block { width: 100%; }
.btn-link {
  background: none;
  color: var(--text-soft);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
  align-self: center;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app { min-height: 100vh; padding-bottom: calc(var(--tabnav-h) + env(safe-area-inset-bottom, 0)); }

/* HEADER */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ivory-soft);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
}
.header-logo .logo-mark { font-size: 20px; margin: 0; }
.header-logo-text {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
}
.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--navy);
  transition: background .15s;
}
.icon-btn:hover { background: var(--ivory-deep); }
.notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  background: var(--ocre);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.user-menu { position: relative; }
.user-btn { padding: 4px; border-radius: 50%; }
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--ivory);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev);
  padding: 8px;
  z-index: 100;
}
.dropdown-user { padding: 10px 12px; }
.dropdown-name { font-weight: 600; font-size: 14px; }
.dropdown-email { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.user-dropdown hr { border: none; border-top: 1px solid var(--line-soft); margin: 4px 0; }
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: var(--radius);
  transition: background .15s;
}
.dropdown-item:hover { background: var(--ivory-soft); }
.dropdown-item-danger { color: var(--red); }

/* TAB NAV (mobile = bottom, desktop = top) */
.tab-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tabnav-h);
  background: var(--white);
  border-top: 1px solid var(--line-soft);
  display: flex;
  z-index: 40;
  overflow-x: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1 0 auto;
  min-width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  position: relative;
  transition: color .15s;
}
.tab-btn span { font-weight: 500; }
.tab-btn.active { color: var(--ocre); }
.tab-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 2px;
  background: var(--ocre);
}
.tab-count {
  position: absolute;
  top: 4px;
  right: 14px;
  min-width: 16px;
  height: 16px;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* TAB CONTENT */
.tab-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}
.tab-panel { display: none; animation: fadeIn .3s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-head { margin-bottom: 28px; }
.panel-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ocre);
  font-weight: 600;
  margin-bottom: 12px;
}
.panel-title {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: 8px;
}
.panel-subtitle { color: var(--text-soft); font-size: 14px; }

.section-head { margin: 32px 0 16px; }
.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--navy);
}

/* ============================================================
   KPI GRID (accueil)
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.kpi-card.kpi-urgent {
  border-color: rgba(184, 73, 63, 0.25);
  background: linear-gradient(135deg, var(--white) 0%, rgba(184, 73, 63, 0.03) 100%);
}
.kpi-card.kpi-urgent .kpi-value { color: var(--red); }
.kpi-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
}
.kpi-value {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  color: var(--navy);
  line-height: 1;
  margin-top: 4px;
}
.kpi-value.kpi-text { font-size: 18px; }
.kpi-meta { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-list {
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ocre);
  margin-top: 7px;
  flex-shrink: 0;
}
.activity-content { flex: 1; }
.activity-text { font-size: 14px; color: var(--text); }
.activity-time { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

/* ============================================================
   QUICK ACCESS
   ============================================================ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.quick-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all .15s;
}
.quick-card:hover { border-color: var(--ocre); transform: translateY(-1px); }
.quick-icon { font-size: 28px; }
.quick-label { font-size: 13px; font-weight: 500; color: var(--navy); }

/* ============================================================
   DRIVE CARD (lien dossier partagé)
   ============================================================ */
.drive-card {
  background: linear-gradient(135deg, var(--ivory-soft) 0%, var(--ivory-deep) 100%);
  border: 1px solid var(--ocre-pale);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.drive-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.drive-icon { font-size: 32px; flex-shrink: 0; }
.drive-title { font-weight: 600; font-size: 14px; color: var(--navy); }
.drive-meta { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* ============================================================
   URGENT LIST
   ============================================================ */
.urgent-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.urgent-item {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.urgent-item.priority-high { border-left-color: var(--red); }
.urgent-item.priority-medium { border-left-color: var(--ocre); }
.urgent-item.priority-low { border-left-color: var(--green); }
.urgent-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.urgent-title { font-weight: 600; font-size: 15px; color: var(--navy); flex: 1; }
.urgent-deadline {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
  white-space: nowrap;
}
.urgent-desc { font-size: 14px; color: var(--text-soft); margin-bottom: 12px; }
.urgent-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   INVOICES
   ============================================================ */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.filters::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--text-soft);
  transition: all .15s;
}
.filter-chip.active {
  background: var(--navy);
  color: var(--ivory);
  border-color: var(--navy);
}

.invoice-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.invoice-item {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.invoice-info { flex: 1; min-width: 0; }
.invoice-title { font-weight: 600; font-size: 14px; color: var(--navy); }
.invoice-meta { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.invoice-right { text-align: right; flex-shrink: 0; }
.invoice-amount { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--navy); }
.invoice-status {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 4px;
}
.status-paid { background: rgba(90, 120, 72, 0.12); color: var(--green); }
.status-pending { background: rgba(184, 132, 63, 0.12); color: var(--ocre); }
.status-overdue { background: rgba(184, 73, 63, 0.12); color: var(--red); }

/* ============================================================
   AGENDA
   ============================================================ */
.agenda-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.agenda-item {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.agenda-date {
  flex-shrink: 0;
  width: 56px;
  text-align: center;
  padding: 8px 4px;
  background: var(--ivory-soft);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}
.agenda-day { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--navy); line-height: 1; }
.agenda-month {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ocre);
  font-weight: 600;
  margin-top: 2px;
}
.agenda-content { flex: 1; }
.agenda-title { font-weight: 600; font-size: 14px; color: var(--navy); }
.agenda-time { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* ============================================================
   DOCUMENTS
   ============================================================ */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.folder-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: left;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.folder-card:hover { border-color: var(--ocre); transform: translateY(-1px); }
.folder-icon { font-size: 28px; margin-bottom: 4px; }
.folder-name { font-weight: 600; font-size: 14px; color: var(--navy); }
.folder-count { font-size: 12px; color: var(--text-mute); }

/* ============================================================
   MESSAGES
   ============================================================ */
.messages-thread {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 300px;
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
}
.msg-bubble.from-cabinet {
  align-self: flex-start;
  background: var(--ivory-soft);
  border: 1px solid var(--line-soft);
  border-bottom-left-radius: 4px;
}
.msg-bubble.from-client {
  align-self: flex-end;
  background: var(--navy);
  color: var(--ivory);
  border-bottom-right-radius: 4px;
}
.msg-meta {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 4px;
}
.msg-bubble.from-client .msg-meta { color: rgba(245, 241, 232, 0.6); }
.message-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.message-form textarea {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px 12px;
  resize: none;
  min-height: 44px;
}
.message-form textarea:focus { outline: none; border-color: var(--ocre); }

/* ============================================================
   ACCOUNT (FICHE CLIENT)
   ============================================================ */
.account-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.account-head { display: flex; gap: 16px; align-items: center; }
.account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--ivory);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.account-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--navy);
}
.account-company { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.account-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ocre-pale);
  color: var(--ocre);
  margin-top: 6px;
}

.data-section {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.data-section-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.data-helper { font-size: 13px; color: var(--text-soft); margin-bottom: 12px; }
.data-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 14px; }
.data-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.data-row:last-child { border-bottom: none; }
.data-row dt {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
  flex-shrink: 0;
  align-self: center;
}
.data-row dd {
  font-size: 14px;
  color: var(--navy);
  text-align: right;
  word-break: break-word;
}

/* NOTES */
.notes-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.note-item {
  background: var(--ivory-soft);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ocre);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.note-text { font-size: 14px; color: var(--text); white-space: pre-wrap; }
.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 6px;
}
.note-delete {
  font-size: 12px;
  color: var(--red);
  padding: 2px 6px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--text-mute);
  font-size: 14px;
  font-style: italic;
  list-style: none;
}

/* ============================================================
   NOTIFICATIONS PANEL
   ============================================================ */
.notif-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: min(380px, 100%);
  max-height: calc(100vh - var(--header-h) - var(--tabnav-h));
  background: var(--white);
  border-left: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: var(--shadow-elev);
  z-index: 45;
  overflow-y: auto;
  animation: slideIn .2s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.notif-head h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--navy);
}
.notif-list { list-style: none; }
.notif-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notif-item.unread { background: var(--ivory-soft); }
.notif-item-dot {
  width: 8px;
  height: 8px;
  background: var(--ocre);
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.notif-item-content { flex: 1; }
.notif-item-text { font-size: 14px; }
.notif-item-time { font-size: 11px; color: var(--text-mute); margin-top: 4px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 50, 0.5);
  backdrop-filter: blur(4px);
}
.modal-dialog {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-elev);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 8px;
  padding-right: 32px;
}
.modal p { color: var(--text-soft); font-size: 14px; margin-bottom: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .folder-grid { grid-template-columns: repeat(3, 1fr); }
  .tab-nav {
    position: sticky;
    top: var(--header-h);
    bottom: auto;
    height: 56px;
    border-top: none;
    border-bottom: 1px solid var(--line-soft);
    background: var(--ivory-soft);
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
    padding: 0 16px;
  }
  .tab-btn {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 8px;
    padding: 0 16px;
    font-size: 13px;
  }
  .tab-btn.active::after { top: auto; bottom: 0; left: 0; right: 0; }
  .app { padding-bottom: 0; }
}

@media (min-width: 1024px) {
  .panel-title { font-size: 42px; }
}

/* ============================================================
   BANDEAU IMPAYÉ + PORTAL
   ============================================================ */
.payment-banner {
  background: linear-gradient(135deg, #b8493f 0%, #8a3530 100%);
  color: white;
  padding: 16px 0;
  position: sticky;
  top: 64px;
  z-index: 25;
  animation: slideDown .4s ease;
}
.payment-banner.warning {
  background: linear-gradient(135deg, #d4a868 0%, #b8843f 100%);
}
.payment-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.payment-banner-icon {
  font-size: 28px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.2);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.payment-banner-text {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.payment-banner-text strong {
  font-size: 15px;
  font-weight: 600;
}
.payment-banner-text span {
  font-size: 13px;
  opacity: 0.9;
}
.payment-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.payment-banner .btn-soft {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  color: white;
}
.payment-banner .btn-soft:hover {
  background: rgba(255,255,255,0.25);
  border-color: white;
}
.payment-banner .btn-primary {
  background: white;
  color: #b8493f;
}
.payment-banner .btn-primary:hover {
  background: var(--ivory);
  color: var(--navy);
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 640px) {
  .payment-banner-inner { padding: 0 16px; gap: 12px; }
  .payment-banner-icon { width: 36px; height: 36px; font-size: 20px; }
  .payment-banner-text strong { font-size: 14px; }
  .payment-banner-text span { font-size: 12px; }
}

.data-section-note {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 8px;
  text-align: center;
  font-style: italic;
}

.sub-status-active { color: var(--green); font-weight: 600; }
.sub-status-payment_failed { color: #b8843f; font-weight: 600; }
.sub-status-suspended { color: var(--red); font-weight: 600; }
.sub-status-cancelled { color: var(--text-mute); }
