/* ============================================
   EVENTORA — Design System & Global Styles
   ============================================ */

/* ---- Design Tokens ---- */
:root {
  /* Brand */
  --ff-primary: #0d9488;
  --ff-primary-dark: #0f766e;
  --ff-primary-light: #ccfbf1;
  --ff-accent: #d97706;
  --ff-accent-light: #fef3c7;

  /* Surfaces */
  --ff-bg: #f0f4f8;
  --ff-bg-subtle: #f8fafc;
  --ff-card: #ffffff;
  --ff-surface: #ffffff;
  --ff-text: #1e293b;
  --ff-muted: #64748b;
  --ff-text-muted: var(--ff-muted);
  --ff-border: #e2e8f0;
  --ff-bg-secondary: #eef2f7;

  /* Semantic */
  --ff-success: #10b981;
  --ff-danger: #ef4444;
  --ff-warning: #f59e0b;
  --ff-info: #3b82f6;

  /* Radius */
  --ff-radius-sm: 8px;
  --ff-radius: 12px;
  --ff-radius-lg: 16px;
  --ff-radius-full: 9999px;

  /* Shadows */
  --ff-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.04);
  --ff-shadow-hover: 0 4px 12px rgba(0,0,0,.08), 0 12px 28px rgba(0,0,0,.06);

  /* Typography */
  --ff-font: 'Inter', system-ui, -apple-system, sans-serif;
  --ff-font-display: 'Playfair Display', Georgia, serif;

  /* Type scale */
  --ff-text-xs: .72rem;
  --ff-text-sm: .82rem;
  --ff-text-base: .9rem;
  --ff-text-lg: 1.1rem;
  --ff-text-xl: 1.5rem;
  --ff-text-2xl: 1.8rem;

  /* Sidebar */
  --ff-sidebar-w: 260px;
  --ff-sidebar-bg-start: #0f172a;
  --ff-sidebar-bg-end: #1e293b;
}

/* ---- Dark Mode ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ff-bg: #0c1322;
    --ff-bg-subtle: #162032;
    --ff-card: #1a2436;
    --ff-surface: #1a2436;
    --ff-text: #e2e8f0;
    --ff-muted: #94a3b8;
    --ff-text-muted: #94a3b8;
    --ff-border: #2d3b50;
    --ff-bg-secondary: #1e2d42;
    --ff-shadow: 0 1px 3px rgba(0,0,0,.2), 0 4px 12px rgba(0,0,0,.15);
    --ff-shadow-hover: 0 4px 12px rgba(0,0,0,.25), 0 12px 28px rgba(0,0,0,.2);
    --ff-sidebar-bg-start: #070d18;
    --ff-sidebar-bg-end: #0f1726;
  }
}
[data-theme="dark"] {
  --ff-bg: #0c1322;
  --ff-bg-subtle: #162032;
  --ff-card: #1a2436;
  --ff-surface: #1a2436;
  --ff-text: #e2e8f0;
  --ff-muted: #94a3b8;
  --ff-text-muted: #94a3b8;
  --ff-border: #2d3b50;
  --ff-bg-secondary: #1e2d42;
  --ff-shadow: 0 1px 3px rgba(0,0,0,.2), 0 4px 12px rgba(0,0,0,.15);
  --ff-shadow-hover: 0 4px 12px rgba(0,0,0,.25), 0 12px 28px rgba(0,0,0,.2);
  --ff-sidebar-bg-start: #070d18;
  --ff-sidebar-bg-end: #0f1726;
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--ff-font);
  background: var(--ff-bg);
  color: var(--ff-text);
  min-height: 100vh;
  display: flex;
}

/* ---- Accessibility ---- */
.ff-skip-nav {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--ff-primary);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: 0 0 var(--ff-radius) var(--ff-radius);
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
}
.ff-skip-nav:focus { top: 0; }

:focus-visible {
  outline: 2px solid var(--ff-primary);
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--ff-primary);
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   SIDEBAR
   ============================================ */
.ff-sidebar {
  width: var(--ff-sidebar-w);
  background: linear-gradient(180deg, var(--ff-sidebar-bg-start) 0%, var(--ff-sidebar-bg-end) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform .3s ease;
}
[dir="rtl"] .ff-sidebar { left: auto; right: 0; }

.ff-sidebar-brand {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  position: relative;
}
.ff-sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: 0; left: 1.5rem; right: 1.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--ff-accent), var(--ff-primary));
  border-radius: 1px;
}
.ff-sidebar-brand img { width: 38px; height: 38px; border-radius: var(--ff-radius-sm); }
.ff-sidebar-brand span {
  font-family: var(--ff-font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.ff-sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.ff-sidebar-nav::-webkit-scrollbar { width: 4px; }
.ff-sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.ff-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.ff-sidebar-section { padding: 0 1rem; margin-bottom: .25rem; }
.ff-sidebar-section-label {
  font-size: var(--ff-text-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.35);
  padding: .75rem .75rem .4rem;
  font-weight: 600;
}

.ff-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--ff-radius-sm);
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .87rem;
  font-weight: 500;
  transition: all .2s ease;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}
[dir="rtl"] .ff-nav-link { border-left: none; border-right: 3px solid transparent; }
.ff-nav-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  padding-left: calc(.75rem + 3px);
}
[dir="rtl"] .ff-nav-link:hover { padding-left: .75rem; padding-right: calc(.75rem + 3px); }
.ff-nav-link.active {
  background: rgba(13,148,136,.2);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--ff-primary);
}
[dir="rtl"] .ff-nav-link.active { border-left-color: transparent; border-right-color: var(--ff-primary); }
.ff-nav-link i { width: 20px; text-align: center; font-size: .9rem; }

.ff-sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.ff-sidebar-user { display: flex; align-items: center; gap: .75rem; }
.ff-sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: var(--ff-radius-sm);
  background: var(--ff-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
}
.ff-sidebar-username { font-size: .85rem; font-weight: 600; }
.ff-sidebar-role { font-size: .72rem; color: rgba(255,255,255,.45); }

.ff-logout-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.55);
  padding: .4rem .85rem;
  border-radius: var(--ff-radius-sm);
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.ff-logout-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.ff-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  z-index: 999;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.ff-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--ff-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[dir="rtl"] .ff-main { margin-left: 0; margin-right: var(--ff-sidebar-w); }

.ff-topbar {
  background: var(--ff-card);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 999;
}
.ff-topbar-left { display: flex; align-items: center; gap: 1rem; }
.ff-topbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--ff-text);
  cursor: pointer;
  padding: .25rem;
}
.ff-breadcrumb { font-size: .85rem; color: var(--ff-muted); }
.ff-breadcrumb a { color: var(--ff-primary); text-decoration: none; font-weight: 500; }
.ff-breadcrumb .ff-bc-sep {
  display: inline-block;
  margin: 0 .4rem;
  font-size: .6rem;
  vertical-align: middle;
  color: var(--ff-muted);
  opacity: .6;
}

.ff-topbar-right { display: flex; align-items: center; gap: .75rem; }

.ff-content { flex: 1; padding: 1.5rem; }

.ff-footer {
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: .78rem;
  color: var(--ff-muted);
  border-top: 1px solid var(--ff-border);
}

/* ---- Theme Toggle ---- */
.ff-theme-toggle {
  background: var(--ff-bg);
  border: 1px solid var(--ff-border);
  width: 34px; height: 34px;
  border-radius: var(--ff-radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ff-muted);
  transition: all .15s;
  font-size: .85rem;
}
.ff-theme-toggle:hover { color: var(--ff-accent); border-color: var(--ff-accent); }

/* ---- Language Switch (topbar) ---- */
.ff-lang-topbar {
  display: flex;
  gap: .2rem;
  background: var(--ff-bg);
  padding: .2rem;
  border-radius: var(--ff-radius-sm);
}
.ff-lang-topbar button {
  padding: .3rem .6rem;
  border: none;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--ff-muted);
  transition: all .15s;
}
.ff-lang-topbar button.active { background: var(--ff-primary); color: #fff; }

/* ---- Alert Messages ---- */
.ff-alert {
  padding: .75rem 1rem;
  border-radius: var(--ff-radius);
  margin-bottom: 1rem;
  font-size: .88rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.ff-alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.ff-alert-error, .ff-alert-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.ff-alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.ff-alert-info { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

/* ============================================
   PAGE HEADER
   ============================================ */
.ff-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: .75rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--ff-border);
  position: relative;
}
.ff-page-header::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 60px; height: 2px;
  background: linear-gradient(90deg, var(--ff-primary), var(--ff-accent));
  border-radius: 2px;
}
.ff-page-title {
  font-family: var(--ff-font-display);
  font-size: var(--ff-text-xl);
  font-weight: 800;
  color: var(--ff-text);
  letter-spacing: -.02em;
}
.ff-page-subtitle {
  font-size: .88rem;
  color: var(--ff-muted);
  margin-top: .25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.ff-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.15rem;
  border-radius: var(--ff-radius-sm);
  font-size: .88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  letter-spacing: .01em;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  position: relative;
  overflow: hidden;
}
.ff-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.ff-btn:active { transform: scale(.97); }
.ff-btn-primary {
  background: linear-gradient(135deg, var(--ff-primary), var(--ff-primary-dark));
  color: #fff;
}
.ff-btn-primary:hover {
  background: linear-gradient(135deg, var(--ff-primary-dark), #0a6b62);
  color: #fff;
  box-shadow: 0 4px 16px rgba(13,148,136,.3);
  transform: translateY(-1px);
}
.ff-btn-accent {
  background: linear-gradient(135deg, var(--ff-accent), #b45309);
  color: #fff;
}
.ff-btn-accent:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
  color: #fff;
  box-shadow: 0 4px 16px rgba(217,119,6,.3);
  transform: translateY(-1px);
}
.ff-btn-outline {
  background: var(--ff-card);
  color: var(--ff-text);
  border: 1.5px solid var(--ff-border);
}
.ff-btn-outline::after { display: none; }
.ff-btn-outline:hover { border-color: var(--ff-primary); color: var(--ff-primary); background: rgba(13,148,136,.04); transform: translateY(-1px); }
.ff-btn-success { background: linear-gradient(135deg, var(--ff-success), #059669); color: #fff; }
.ff-btn-success:hover { background: linear-gradient(135deg, #059669, #047857); box-shadow: 0 4px 16px rgba(16,185,129,.3); transform: translateY(-1px); }
.ff-btn-danger { background: linear-gradient(135deg, var(--ff-danger), #dc2626); color: #fff; }
.ff-btn-danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 4px 16px rgba(239,68,68,.25); transform: translateY(-1px); }
.ff-btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: var(--ff-radius-sm);
}

/* ============================================
   FORMS
   ============================================ */
.ff-form-group { margin-bottom: 1rem; }
.ff-form-group label, .ff-form-label {
  display: block;
  font-size: var(--ff-text-sm);
  font-weight: 600;
  color: var(--ff-text);
  margin-bottom: .35rem;
}
.ff-form-control {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--ff-border);
  border-radius: var(--ff-radius-sm);
  font-size: var(--ff-text-base);
  font-family: var(--ff-font);
  transition: border-color .25s, background .25s, box-shadow .25s;
  background: var(--ff-bg);
  color: var(--ff-text);
}
.ff-form-control:hover { border-color: rgba(13,148,136,.4); }
.ff-form-control:focus {
  outline: none;
  border-color: var(--ff-primary);
  background: var(--ff-card);
  box-shadow: 0 0 0 3px rgba(13,148,136,.1), 0 2px 6px rgba(13,148,136,.06);
}
.ff-form-control::placeholder { color: var(--ff-muted); opacity: .7; }
select.ff-form-control { appearance: auto; }
textarea.ff-form-control { resize: vertical; }

.ff-form-card {
  background: var(--ff-card);
  border-radius: var(--ff-radius-lg);
  padding: 1.75rem;
  box-shadow: var(--ff-shadow);
  border: 1px solid var(--ff-border);
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s;
}
.ff-form-card:hover { box-shadow: var(--ff-shadow-hover); }
.ff-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) { .ff-form-grid { grid-template-columns: 1fr; } }

/* ============================================
   DATA TABLE
   ============================================ */
.ff-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--ff-card);
  border-radius: var(--ff-radius);
  overflow: hidden;
  box-shadow: var(--ff-shadow);
  border: 1px solid var(--ff-border);
}
.ff-data-table thead th {
  background: linear-gradient(180deg, var(--ff-bg-subtle), var(--ff-bg));
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ff-muted);
  font-weight: 700;
  padding: .85rem 1rem;
  border-bottom: 2px solid var(--ff-border);
  text-align: left;
  white-space: nowrap;
}
[dir="rtl"] .ff-data-table thead th { text-align: right; }
.ff-data-table tbody tr { transition: background .15s; }
.ff-data-table tbody tr:nth-child(even) { background: rgba(0,0,0,.015); }
.ff-data-table tbody tr:hover { background: rgba(13,148,136,.04); }
.ff-data-table tbody td {
  padding: .75rem 1rem;
  font-size: .88rem;
  border-bottom: 1px solid var(--ff-border);
  vertical-align: middle;
}
.ff-data-table tbody tr:last-child td { border-bottom: none; }

.ff-data-table--compact thead th { padding: .5rem .75rem; }
.ff-data-table--compact tbody td { padding: .5rem .75rem; font-size: .85rem; }

/* Sort indicator affordance */
.ff-data-table th[data-sort] { cursor: pointer; user-select: none; }
.ff-data-table th[data-sort]::after {
  content: '\f0dc';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: .4rem;
  opacity: .3;
  font-size: .65rem;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.ff-status::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: .35rem;
  flex-shrink: 0;
}
.ff-status {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: var(--ff-radius-full);
  font-size: .75rem;
  font-weight: 600;
}
.ff-status.payee, .ff-status.success { background: #d1fae5; color: #065f46; }
.ff-status.confirme, .ff-status.info { background: #dbeafe; color: #1e40af; }
.ff-status.en_attente, .ff-status.warning { background: #fef3c7; color: #92400e; }
.ff-status.annule, .ff-status.annulee, .ff-status.danger { background: #fee2e2; color: #991b1b; }
.ff-status.brouillon { background: #f3f4f6; color: #4b5563; }
.ff-status.envoye { background: #e0e7ff; color: #3730a3; }
.ff-status.accepte, .ff-status.convertie { background: #d1fae5; color: #065f46; }
.ff-status.refuse { background: #fce7f3; color: #9d174d; }
.ff-status.expire, .ff-status.expiree { background: #fef3c7; color: #92400e; }
.ff-status.active { background: #dbeafe; color: #1e40af; }

/* ============================================
   KPI CARDS
   ============================================ */
.ff-kpi {
  background: var(--ff-card);
  border-radius: var(--ff-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--ff-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.ff-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
}
.ff-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--ff-shadow-hover);
}
.ff-kpi .ff-kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--ff-radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: .75rem;
}
.ff-kpi .ff-kpi-label {
  font-size: var(--ff-text-sm);
  color: var(--ff-muted);
  font-weight: 500;
  margin-bottom: .25rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ff-kpi .ff-kpi-value {
  font-family: var(--ff-font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}
.ff-kpi .ff-kpi-sub {
  font-size: .78rem;
  color: var(--ff-muted);
  margin-top: .35rem;
}

.ff-kpi.green { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: #065f46; }
.ff-kpi.green::before { background: var(--ff-success); }
.ff-kpi.green .ff-kpi-icon { background: rgba(16,185,129,.15); color: var(--ff-success); }
.ff-kpi.red { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #991b1b; }
.ff-kpi.red::before { background: var(--ff-danger); }
.ff-kpi.red .ff-kpi-icon { background: rgba(239,68,68,.15); color: var(--ff-danger); }
.ff-kpi.blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #1e3a8a; }
.ff-kpi.blue::before { background: var(--ff-info); }
.ff-kpi.blue .ff-kpi-icon { background: rgba(59,130,246,.15); color: var(--ff-info); }
.ff-kpi.teal { background: linear-gradient(135deg, #f0fdfa, #ccfbf1); color: #134e4a; }
.ff-kpi.teal::before { background: var(--ff-primary); }
.ff-kpi.teal .ff-kpi-icon { background: rgba(13,148,136,.15); color: var(--ff-primary); }

/* ============================================
   CHART BOX
   ============================================ */
.ff-chart-box {
  background: var(--ff-card);
  border-radius: var(--ff-radius);
  padding: 1.5rem;
  box-shadow: var(--ff-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ff-chart-box:hover {
  transform: translateY(-1px);
  box-shadow: var(--ff-shadow-hover);
}
.ff-chart-box .ff-chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ff-text);
  margin-bottom: .5rem;
}

/* Chart skeleton loading */
.ff-chart-skeleton {
  background: var(--ff-bg-subtle);
  border-radius: var(--ff-radius-sm);
  animation: ff-pulse 1.5s ease-in-out infinite;
  min-height: 200px;
}
@keyframes ff-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* ============================================
   SECTION HEADER
   ============================================ */
.ff-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.ff-section-title {
  font-size: var(--ff-text-lg);
  font-weight: 700;
  color: var(--ff-text);
}

.ff-card {
  background: var(--ff-card);
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow);
  border: 1px solid var(--ff-border);
  transition: box-shadow .15s;
}
.ff-card:hover { box-shadow: var(--ff-shadow-hover); }

/* Card header pattern (icon + title) */
.ff-card-header {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.ff-card-header i { font-size: .95rem; }

/* ============================================
   HERO BANNER
   ============================================ */
.ff-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.ff-hero-title {
  font-family: var(--ff-font-display);
  font-size: var(--ff-text-xl);
  font-weight: 800;
  color: var(--ff-text);
  letter-spacing: -.02em;
}
.ff-hero-sub {
  color: var(--ff-muted);
  font-size: .9rem;
  margin-top: .25rem;
}

/* ============================================
   FILTER BAR / ROW
   ============================================ */
.ff-filter-bar, .ff-filter-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.ff-filter-bar .form-control,
.ff-filter-bar .form-select {
  border-radius: var(--ff-radius-sm);
  border: 1px solid var(--ff-border);
  font-size: .85rem;
  padding: .45rem .75rem;
}
.ff-filter-bar .btn {
  border-radius: var(--ff-radius-sm);
  font-size: .85rem;
  padding: .45rem 1rem;
  font-weight: 600;
}

/* ============================================
   EVENT CARD
   ============================================ */
.ff-event-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--ff-bg-subtle);
  border-radius: var(--ff-radius);
  margin-bottom: .5rem;
  transition: background .15s, transform .15s;
  text-decoration: none;
  color: inherit;
}
.ff-event-card:hover {
  background: var(--ff-border);
  transform: translateX(4px);
}
.ff-event-card .ff-event-time { min-width: 60px; text-align: center; font-weight: 700; font-size: .85rem; }
.ff-event-card .ff-event-info { flex: 1; }
.ff-event-card .ff-event-name { font-weight: 600; font-size: .95rem; }
.ff-event-card .ff-event-person { font-size: .8rem; color: var(--ff-muted); }

/* ============================================
   CALENDAR
   ============================================ */
.ff-calendar {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
}
.ff-calendar th {
  background: var(--ff-primary);
  color: #fff;
  padding: .75rem .5rem;
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  border-radius: var(--ff-radius-sm);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ff-calendar td {
  vertical-align: top;
  background: var(--ff-card);
  border-radius: var(--ff-radius);
  padding: .5rem;
  min-height: 120px;
  height: 140px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .15s;
}
.ff-calendar td:hover { box-shadow: var(--ff-shadow-hover); }
.ff-calendar td.empty-day { background: var(--ff-bg-subtle); opacity: .5; }
.ff-calendar td.today { box-shadow: inset 0 0 0 2px var(--ff-primary); }
.ff-calendar .day-number { font-weight: 700; font-size: .9rem; color: var(--ff-text); margin-bottom: .35rem; }
.ff-calendar .cal-event {
  display: block;
  padding: .3rem .5rem;
  border-radius: var(--ff-radius-sm);
  font-size: .78rem;
  margin-bottom: .25rem;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  transition: opacity .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ff-calendar .cal-event:hover { opacity: .85; }
.ff-calendar .cal-event.matin { background: #3b82f6; }
.ff-calendar .cal-event.midi { background: var(--ff-accent); }
.ff-calendar .cal-event.soir { background: var(--ff-danger); }
.ff-calendar .cal-add {
  display: inline-block;
  margin-top: .25rem;
  font-size: .75rem;
  color: var(--ff-muted);
  text-decoration: none;
  padding: .2rem .4rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.ff-calendar .cal-add:hover { background: var(--ff-primary); color: #fff; }

.ff-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.ff-cal-nav .ff-cal-title {
  font-family: var(--ff-font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ff-text);
  text-transform: capitalize;
  letter-spacing: -.02em;
}
.ff-cal-nav-btns { display: flex; gap: .4rem; flex-wrap: wrap; }
.ff-cal-btn {
  padding: .5rem 1rem;
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-sm);
  font-size: .85rem;
  font-weight: 600;
  color: var(--ff-text);
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
}
.ff-cal-btn:hover, .ff-cal-btn.active {
  background: var(--ff-primary);
  color: #fff;
  border-color: var(--ff-primary);
}

/* ============================================
   PAGINATION
   ============================================ */
.ff-pagination {
  display: flex;
  justify-content: center;
  gap: .3rem;
  margin-top: 1.5rem;
}
.ff-pagination a, .ff-pagination span {
  padding: .45rem .85rem;
  border-radius: var(--ff-radius-sm);
  font-size: .85rem;
  text-decoration: none;
  font-weight: 600;
}
.ff-pagination a {
  background: var(--ff-card);
  color: var(--ff-text);
  border: 1px solid var(--ff-border);
}
.ff-pagination a:hover { border-color: var(--ff-primary); color: var(--ff-primary); }
.ff-pagination .current {
  background: var(--ff-primary);
  color: #fff;
  border: 1px solid var(--ff-primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.ff-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ff-muted);
  background: var(--ff-bg);
  border-radius: var(--ff-radius-lg);
  border: 2px dashed var(--ff-border);
}
.ff-empty i {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  display: block;
  opacity: .35;
  background: linear-gradient(135deg, var(--ff-primary), var(--ff-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ff-empty p { font-size: .9rem; }

/* ============================================
   AMOUNT DISPLAY
   ============================================ */
.ff-amount-plus { color: var(--ff-success); font-weight: 700; }
.ff-amount-minus { color: var(--ff-danger); font-weight: 700; }
.ff-text-success { color: var(--ff-success); }
.ff-text-danger { color: var(--ff-danger); }
.ff-row-danger { background: rgba(239,68,68,.06); }
.ff-text-warning { color: var(--ff-warning); }
.ff-text-info { color: var(--ff-info); }
.ff-text-primary { color: var(--ff-primary); }
.ff-text-muted { color: var(--ff-muted); }

/* ============================================
   PROGRESS BAR
   ============================================ */
.ff-progress {
  background: var(--ff-border);
  border-radius: var(--ff-radius-full);
  height: 10px;
  overflow: hidden;
}
.ff-progress-bar {
  height: 100%;
  border-radius: var(--ff-radius-full);
  background: var(--ff-success);
  transition: width .4s ease;
}

/* ============================================
   CONFIRM DIALOG
   ============================================ */
.ff-dialog {
  border: none;
  border-radius: var(--ff-radius-lg);
  padding: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  max-width: 400px;
  width: 90%;
  background: var(--ff-card);
  color: var(--ff-text);
}
.ff-dialog::backdrop { background: rgba(0,0,0,.4); }
.ff-dialog-body { padding: 2rem; text-align: center; }
.ff-dialog-icon {
  font-size: 2.5rem;
  color: var(--ff-warning);
  margin-bottom: 1rem;
  display: block;
}
.ff-dialog-body p { font-size: .95rem; margin-bottom: 1.5rem; line-height: 1.5; }
.ff-dialog-actions { display: flex; gap: .75rem; justify-content: center; }

/* ============================================
   UTILITY CLASSES
   ============================================ */
.ff-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) { .ff-grid-2 { grid-template-columns: 1fr; } }

/* ============================================
   PWA INSTALL BANNER
   ============================================ */
.ff-pwa-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--ff-card);
  padding: .85rem 1.25rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-top: 2px solid var(--ff-primary);
}

/* ---- Bottom Navigation (mobile PWA) ---- */
.ff-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--ff-card);
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  z-index: 1500;
  justify-content: space-around;
  align-items: center;
  padding: .35rem 0;
  padding-bottom: max(.35rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--ff-border);
}
.ff-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  text-decoration: none;
  color: var(--ff-muted);
  font-size: .65rem;
  font-weight: 600;
  padding: .25rem .5rem;
  transition: color .15s;
}
.ff-bnav-item { position: relative; }
.ff-bnav-item i { font-size: 1.15rem; }
.ff-bnav-badge {
  position: absolute;
  top: -2px; right: 4px;
  background: var(--ff-danger, #ef4444);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 0 0 2px var(--ff-card);
}
.ff-bnav-item.active { color: var(--ff-primary); }
.ff-bnav-item.ff-bnav-add {
  background: var(--ff-primary);
  color: #fff;
  width: 48px; height: 48px;
  border-radius: 50%;
  margin-top: -20px;
  box-shadow: 0 4px 12px rgba(13,148,136,.3);
  justify-content: center;
}
.ff-bnav-item.ff-bnav-add i { font-size: 1.3rem; }

@media (max-width: 768px) {
  .ff-bottom-nav { display: flex; }
  .ff-footer { padding-bottom: 70px; }
}
@media print {
  .ff-bottom-nav, .ff-pwa-banner, .ff-sidebar, .ff-topbar, .ff-sidebar-overlay, .ff-footer, .no-print { display: none !important; }
  .ff-main { margin-left: 0 !important; margin-right: 0 !important; }
  a[href]::after { content: none !important; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
  .ff-sidebar { transform: translateX(-100%); }
  [dir="rtl"] .ff-sidebar { transform: translateX(100%); }
  .ff-sidebar.open { transform: translateX(0); }
  .ff-main { margin-left: 0 !important; margin-right: 0 !important; }
  .ff-topbar-toggle { display: block; }
  .ff-sidebar-overlay.open { display: block; }
  .ff-content { padding: 1rem; }
}
@media (max-width: 768px) {
  .ff-hero { flex-direction: column; align-items: flex-start; }
  .ff-filter-bar, .ff-filter-row { width: 100%; }
  .ff-kpi .ff-kpi-value { font-size: 1.3rem; }
  .ff-calendar td { min-height: 70px; height: auto; padding: .3rem; }
  .ff-calendar th { padding: .5rem .25rem; font-size: .72rem; letter-spacing: 0; }
  .ff-calendar .day-number { font-size: .78rem; }
  .ff-calendar .cal-event { font-size: .7rem; padding: .25rem .4rem; }
  .ff-calendar .cal-add { padding: .35rem .5rem; font-size: .85rem; }
  .ff-cal-nav { flex-direction: column; align-items: stretch; gap: .75rem; }
  .ff-cal-nav > div:first-child { justify-content: center; }
  .ff-cal-nav .ff-cal-title { font-size: 1.15rem; }
  .ff-cal-nav-btns { justify-content: center; flex-wrap: wrap; gap: .35rem; }
  .ff-cal-jump { display: none !important; }
  .ff-cal-stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .ff-cal-stat { padding: .6rem .5rem; }
  .ff-cal-stat .stat-val { font-size: 1.15rem; }
  .ff-cal-stat .stat-lbl { font-size: .65rem; }
  .ff-cal-toolbar { flex-direction: column; gap: .75rem; }
  .ff-cal-filters { width: 100%; }
  .ff-cal-filters select { flex: 1; max-width: none !important; }
  .ff-legend { gap: .5rem .75rem; font-size: .75rem; }
  .ff-legend-dot { width: 10px; height: 10px; }
  .ff-cal-list-item { padding: .75rem; gap: .65rem; }
  .ff-cal-list-shift { width: 6px; height: 36px; }
  .ff-cal-list-title { font-size: .85rem; }
  .ff-cal-list-meta { font-size: .75rem; }
  .ff-cal-list-amount { font-size: .8rem; }
  .ff-hide-mobile { display: none !important; }
  .ff-show-mobile { display: flex !important; }
  .ff-page-title { font-size: 1.3rem; }

  /* ---- Responsive table → cards ---- */
  .ff-data-table.ff-table-cards thead { display: none; }
  .ff-data-table.ff-table-cards,
  .ff-data-table.ff-table-cards tbody { display: block; }
  .ff-data-table.ff-table-cards tr {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .75rem;
    padding: .85rem 1rem;
    margin-bottom: .5rem;
    border-radius: var(--ff-radius);
    border: 1px solid var(--ff-border);
    background: var(--ff-card);
    position: relative;
    align-items: center;
  }
  .ff-data-table.ff-table-cards tr:nth-child(even) { background: var(--ff-card) !important; }
  .ff-data-table.ff-table-cards td {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem 0;
    border-bottom: none;
    font-size: .85rem;
  }
  .ff-data-table.ff-table-cards td::before {
    content: attr(data-label);
    font-size: .72rem;
    font-weight: 700;
    color: var(--ff-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
  }
  .ff-data-table.ff-table-cards td:empty { display: none; }
  .ff-data-table.ff-table-cards td.ff-td-title {
    width: 100%;
    font-weight: 700;
    font-size: .95rem;
    padding-bottom: .25rem;
    border-bottom: 1px solid var(--ff-border);
    margin-bottom: .15rem;
  }
  .ff-data-table.ff-table-cards td.ff-td-title::before { display: none; }
  .ff-data-table.ff-table-cards td.ff-td-actions {
    position: absolute;
    top: .75rem;
    right: .75rem;
  }
  .ff-data-table.ff-table-cards td.ff-td-actions::before { display: none; }

  /* ---- Filter bar mobile ---- */
  .ff-filter-row, .ff-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .ff-filter-row .ff-form-control,
  .ff-filter-bar .ff-form-control { max-width: none !important; }
  .ff-filter-row .ff-btn,
  .ff-filter-bar .btn { width: 100%; justify-content: center; }

  /* ---- Page header mobile ---- */
  .ff-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
  }
  .ff-page-header .ff-btn { width: 100%; justify-content: center; }

  /* ---- Detail page forms mobile ---- */
  .ff-detail-card form[style*="display:flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .ff-detail-card form[style*="display:flex"] .ff-form-group {
    min-width: 0 !important;
    width: 100% !important;
  }
  .ff-detail-card form[style*="display:flex"] .ff-btn {
    width: 100% !important;
    justify-content: center;
  }

  /* ---- Bottom nav padding ---- */
  .ff-content { padding-bottom: 80px; }
}

/* ============================================
   RESERVATION DETAIL
   ============================================ */
.ff-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .ff-detail-grid { grid-template-columns: 1fr; } }
.ff-detail-card {
  position: relative;
  overflow: hidden;
  background: var(--ff-card);
  border-radius: var(--ff-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--ff-shadow);
  border: 1px solid var(--ff-border);
  transition: box-shadow .2s;
}
.ff-detail-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ff-primary), var(--ff-accent));
}
.ff-detail-card:hover { box-shadow: var(--ff-shadow-hover); }
.ff-detail-card + .ff-detail-card,
.ff-detail-card + .ff-detail-grid { margin-top: 1.5rem; }
.ff-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .65rem 0;
  border-bottom: 1px solid var(--ff-border);
  font-size: .9rem;
  gap: .5rem;
}
.ff-detail-row:last-child { border-bottom: none; }
.ff-detail-label { color: var(--ff-muted); font-weight: 600; font-size: .85rem; }
.ff-detail-value { font-weight: 600; text-align: right; }
.ff-detail-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  padding-bottom: .65rem;
  border-bottom: 2px solid var(--ff-border);
  display: flex;
  align-items: center;
}
.ff-detail-section-title i {
  margin-right: .5rem;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem;
  background: rgba(13,148,136,.08);
}
.ff-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.ff-detail-meta-item {
  min-width: 100px;
  padding: .5rem .75rem;
  background: var(--ff-bg);
  border-radius: var(--ff-radius-sm);
}
.ff-detail-meta-label {
  font-size: .7rem;
  text-transform: uppercase;
  color: var(--ff-muted);
  letter-spacing: .4px;
  font-weight: 600;
}
.ff-detail-meta-value { font-weight: 700; font-size: 1.05rem; }
.ff-detail-summary {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.1rem;
  background: var(--ff-bg);
  border-radius: var(--ff-radius);
  border: 1px solid var(--ff-border);
  margin-bottom: 1rem;
}
.ff-detail-summary-item { flex: 1; min-width: 100px; }
.ff-progress {
  background: var(--ff-border);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
  margin-top: .5rem;
  position: relative;
}
.ff-progress::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 4px,
    rgba(255,255,255,.08) 4px, rgba(255,255,255,.08) 8px
  );
  border-radius: 20px;
}
.ff-progress-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--ff-success), #34d399);
  transition: width .4s cubic-bezier(.4,0,.2,1);
  position: relative;
}

/* ============================================
   CALENDAR — Stats, Legend, Tooltips, List View
   ============================================ */
.ff-cal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.ff-cal-stat {
  background: var(--ff-card);
  border-radius: var(--ff-radius);
  padding: .85rem 1rem;
  box-shadow: var(--ff-shadow);
  text-align: center;
}
.ff-cal-stat .stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--ff-font-display);
  line-height: 1;
}
.ff-cal-stat .stat-lbl {
  font-size: .72rem;
  color: var(--ff-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-top: .25rem;
}
.ff-view-toggle {
  display: inline-flex;
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: 10px;
  overflow: hidden;
}
.ff-view-toggle a {
  padding: .45rem .85rem;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ff-muted);
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.ff-view-toggle a:hover { color: var(--ff-text); }
.ff-view-toggle a.active { background: var(--ff-primary); color: #fff; }
.ff-legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.ff-legend-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--ff-muted);
}
.ff-legend-dot { width: 12px; height: 12px; border-radius: 4px; }
.cal-event-wrap { position: relative; }
.cal-tooltip {
  display: none;
  position: fixed;
  background: var(--ff-text);
  color: #fff;
  padding: .6rem .85rem;
  border-radius: 10px;
  font-size: .78rem;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  pointer-events: none;
  max-width: 320px;
}
.cal-event-wrap:hover .cal-tooltip { display: block; }
.cal-event-status {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}
.cal-event-status.st-payee { background: var(--ff-success); }
.cal-event-status.st-confirme { background: var(--ff-info); }
.cal-event-status.st-en_attente { background: var(--ff-warning); }
.cal-event-status.st-annule { background: var(--ff-danger); }
.ff-cal-list-group { margin-bottom: 1.25rem; }
.ff-cal-list-date {
  font-weight: 700;
  font-size: .92rem;
  color: var(--ff-text);
  padding: .5rem 0;
  border-bottom: 2px solid var(--ff-border);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.ff-cal-list-date .day-badge {
  background: var(--ff-primary);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
}
.ff-cal-list-date.is-today .day-badge { background: var(--ff-danger); }
.ff-cal-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem .85rem;
  background: var(--ff-card);
  border-radius: 10px;
  margin-bottom: .35rem;
  box-shadow: var(--ff-shadow);
  text-decoration: none;
  color: var(--ff-text);
  transition: box-shadow .15s;
}
.ff-cal-list-item:hover { box-shadow: var(--ff-shadow-hover); color: var(--ff-text); }
.ff-cal-list-shift { width: 8px; height: 40px; border-radius: 4px; flex-shrink: 0; }
.ff-cal-list-shift.matin { background: var(--ff-info); }
.ff-cal-list-shift.midi { background: var(--ff-warning); }
.ff-cal-list-shift.soir { background: var(--ff-danger); }
.ff-cal-list-info { flex: 1; min-width: 0; }
.ff-cal-list-title { font-weight: 700; font-size: .9rem; }
.ff-cal-list-meta { font-size: .78rem; color: var(--ff-muted); }
.ff-cal-list-amount { font-weight: 700; font-size: .9rem; text-align: right; white-space: nowrap; }
.ff-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.ff-cal-filters {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.ff-hide-mobile {}
.ff-show-mobile { display: none; }

/* ============================================
   RESERVATION FORM
   ============================================ */
.rf-card {
  background: var(--ff-card);
  border-radius: var(--ff-radius-lg);
  padding: 1.75rem;
  box-shadow: var(--ff-shadow);
  margin-bottom: 1.35rem;
  border: 1px solid var(--ff-border);
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s;
}
.rf-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--ff-primary), var(--ff-accent));
  border-radius: 4px 0 0 4px;
}
.rf-card:hover { box-shadow: var(--ff-shadow-hover); }
.rf-section-title {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--ff-text);
  margin-bottom: 1.35rem;
  padding-bottom: .8rem;
  border-bottom: 2px solid var(--ff-border);
  position: relative;
}
.rf-section-title::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 40px; height: 2px;
  background: var(--ff-primary);
  border-radius: 2px;
}
.rf-section-title i { color: var(--ff-primary); }
.rf-section-title i {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(13,148,136,.12), rgba(13,148,136,.04));
  font-size: .85rem;
  flex-shrink: 0;
}
.rf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rf-full { grid-column: 1 / -1; }
.rf-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ff-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: .35rem;
}
.rf-input {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid var(--ff-border);
  border-radius: 10px;
  font-size: .92rem;
  font-family: var(--ff-font);
  color: var(--ff-text);
  background: var(--ff-bg);
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.rf-input:hover {
  border-color: rgba(13,148,136,.4);
}
.rf-input:focus {
  outline: none;
  border-color: var(--ff-primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,.12), 0 2px 8px rgba(13,148,136,.06);
  background: var(--ff-card);
}
select.rf-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.2rem;
}
textarea.rf-input { resize: vertical; min-height: 80px; }
/* ── Pack radio grid ── */
.rf-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: .85rem;
  margin-top: .75rem;
}
.rf-pack-option { position: relative; cursor: pointer; display: flex; }
.rf-pack-option input { position: absolute; opacity: 0; pointer-events: none; }
.rf-pack-option .rf-pack-card {
  border: 2px solid var(--ff-border);
  border-radius: var(--ff-radius-lg, 14px);
  padding: 1.1rem .85rem .9rem;
  text-align: center;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  background: var(--ff-bg-subtle);
  min-height: 100px;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .25rem;
  position: relative;
  overflow: hidden;
}
.rf-pack-option .rf-pack-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ff-primary), var(--ff-accent, #f59e0b));
  opacity: 0;
  transition: opacity .25s;
}
.rf-pack-option input:checked + .rf-pack-card::before,
.rf-pack-option .rf-pack-card:hover::before { opacity: 1; }
.rf-pack-option input:checked + .rf-pack-card {
  border-color: var(--ff-primary);
  background: rgba(13,148,136,.07);
  box-shadow: 0 0 0 3px rgba(13,148,136,.13), 0 4px 16px rgba(13,148,136,.08);
}
.rf-pack-option .rf-pack-card:hover {
  border-color: var(--ff-primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}
.rf-pack-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(13,148,136,.12), rgba(13,148,136,.04));
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; color: var(--ff-primary);
  margin-bottom: .2rem;
  flex-shrink: 0;
}
.rf-pack-name {
  font-weight: 700; font-size: .92rem;
  color: var(--ff-text);
  margin-bottom: .15rem;
  line-height: 1.2;
  height: 2.25rem;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rf-pack-price {
  font-size: .95rem;
  color: var(--ff-primary);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.rf-pack-shift {
  font-size: .68rem;
  color: var(--ff-muted);
  background: rgba(13,148,136,.06);
  padding: .15rem .45rem;
  border-radius: 6px;
  margin-top: .2rem;
  display: inline-block;
}
.rf-pack-qty {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .4rem;
  opacity: .55;
  transition: opacity .2s;
}
.rf-pack-option input:checked + .rf-pack-card .rf-pack-qty { opacity: 1; }
.rf-pack-qty-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--ff-border);
  background: var(--ff-bg-card, #fff);
  color: var(--ff-text);
  font-size: .8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.rf-pack-qty-btn:hover {
  border-color: var(--ff-primary);
  background: var(--ff-primary);
  color: #fff;
}
.rf-pack-qty-count {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  color: var(--ff-text);
}
.rf-pack-check {
  position: absolute;
  top: .45rem; right: .45rem;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ff-primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  box-shadow: 0 2px 8px rgba(13,148,136,.3);
  animation: rf-pop .25s cubic-bezier(.34,1.56,.64,1);
}
.rf-pack-option input:checked ~ .rf-pack-check { display: flex; }

/* ── Checkbox grid (supplements / services) ── */
.rf-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .7rem;
  margin-top: .6rem;
}
.rf-check-option { position: relative; cursor: pointer; }
.rf-check-option input { position: absolute; opacity: 0; pointer-events: none; }
.rf-check-option .rf-check-card {
  border: 2px solid var(--ff-border);
  border-radius: var(--ff-radius-lg, 12px);
  padding: .85rem .7rem .75rem;
  text-align: center;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  background: var(--ff-bg-subtle);
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .15rem;
  position: relative;
  overflow: hidden;
}
.rf-check-option .rf-check-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ff-primary), var(--ff-accent, #f59e0b));
  opacity: 0;
  transition: opacity .25s;
}
.rf-check-option input:checked + .rf-check-card::before { opacity: 1; }
.rf-check-option input:checked + .rf-check-card {
  border-color: var(--ff-primary);
  background: rgba(13,148,136,.07);
  box-shadow: 0 0 0 3px rgba(13,148,136,.13), 0 4px 12px rgba(13,148,136,.06);
}
.rf-check-option .rf-check-card:hover {
  border-color: var(--ff-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.07);
}
.rf-check-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  margin-bottom: .15rem;
  flex-shrink: 0;
}
.rf-check-icon--supp {
  background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(168,85,247,.04));
  color: #a855f7;
}
.rf-check-icon--svc {
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(59,130,246,.04));
  color: #3b82f6;
}
.rf-check-name {
  font-weight: 650; font-size: .84rem;
  color: var(--ff-text);
  margin-bottom: .1rem;
  line-height: 1.2;
}
.rf-check-price {
  font-size: .82rem;
  color: var(--ff-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rf-check-cat {
  font-size: .66rem;
  color: var(--ff-muted);
  background: rgba(59,130,246,.06);
  padding: .1rem .4rem;
  border-radius: 5px;
  margin-top: .15rem;
  display: inline-block;
}
.rf-check-mark {
  position: absolute;
  top: .35rem; right: .35rem;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--ff-primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  box-shadow: 0 2px 8px rgba(13,148,136,.3);
  animation: rf-pop .25s cubic-bezier(.34,1.56,.64,1);
}
.rf-check-option input:checked ~ .rf-check-mark { display: flex; }

@keyframes rf-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.rf-shift-group { display: flex; gap: .4rem; }
.rf-shift-option { flex: 1; position: relative; cursor: pointer; }
.rf-shift-option input { position: absolute; opacity: 0; pointer-events: none; }
.rf-shift-option .rf-shift-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .6rem .4rem;
  border: 2px solid var(--ff-border);
  border-radius: 10px;
  background: var(--ff-bg);
  transition: all .2s;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ff-muted);
}
.rf-shift-option .rf-shift-btn i { font-size: 1.1rem; }
.rf-shift-option input:checked + .rf-shift-btn {
  border-color: var(--ff-primary);
  background: rgba(13,148,136,.06);
  color: var(--ff-primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
.rf-shift-option .rf-shift-btn:hover { border-color: var(--ff-primary-dark); }
@keyframes rf-flash {
  0% { background-color: rgba(13,148,136,.2); box-shadow: 0 0 0 3px rgba(13,148,136,.15); }
  100% { background-color: transparent; box-shadow: none; }
}
.rf-flash { animation: rf-flash 1s ease-out; border-radius: 10px; }
.rf-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--ff-primary);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(13,148,136,.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: rf-toast-in .3s ease-out;
}
@keyframes rf-toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.rf-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem 1.35rem;
  background: linear-gradient(135deg, rgba(13,148,136,.05), rgba(13,148,136,.1));
  border-radius: var(--ff-radius);
  border: 1px solid rgba(13,148,136,.18);
  flex-wrap: wrap;
  margin-top: 1.25rem;
  position: relative;
  overflow: hidden;
}
.rf-summary::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--ff-primary), var(--ff-success));
  border-radius: 4px;
}
.rf-summary-item { display: flex; flex-direction: column; gap: .15rem; padding-left: .25rem; }
.rf-summary-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ff-muted);
  font-weight: 700;
}
.rf-summary-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ff-primary-dark);
  font-variant-numeric: tabular-nums;
}
.rf-actions { display: flex; gap: .85rem; margin-top: .5rem; }
.rf-actions .ff-btn { padding: .75rem 1.75rem; font-size: .92rem; }
.rf-input-icon {
  position: relative;
}
.rf-input-icon i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ff-muted);
  font-size: .8rem;
}
.rf-input-icon .rf-input { padding-left: 2.2rem; }
.rf-input-suffix {
  position: relative;
}
.rf-input-suffix .rf-input { padding-right: 2.8rem; }
.rf-input-suffix span {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .8rem;
  font-weight: 700;
  color: var(--ff-muted);
}
@media (max-width: 640px) {
  .rf-grid { grid-template-columns: 1fr; }
  .rf-shift-group { flex-wrap: wrap; }
  .rf-pack-grid { grid-template-columns: 1fr 1fr; }
  .rf-summary { flex-direction: column; gap: .6rem; }
}

/* ============================================
   QUICK-ADD BUTTONS
   ============================================ */
.ff-qa-wrap { display: flex; gap: .4rem; align-items: stretch; }
.ff-qa-wrap select,
.ff-qa-wrap .rf-input,
.ff-qa-wrap .ff-form-control { flex: 1; min-width: 0; }
.ff-qa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  background: var(--ff-primary);
  color: #fff;
  border: none;
  border-radius: var(--ff-radius-sm);
  cursor: pointer;
  font-size: .85rem;
  transition: background .15s, transform .1s;
}
.ff-qa-btn:hover { background: var(--ff-primary-dark); transform: scale(1.05); }
.ff-qa-btn:active { transform: scale(.95); }

/* ============================================
   DARK MODE — STATUS BADGES
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ff-status.payee { background: rgba(16,185,129,.15); color: #6ee7b7; }
  :root:not([data-theme="light"]) .ff-status.confirme { background: rgba(59,130,246,.15); color: #93c5fd; }
  :root:not([data-theme="light"]) .ff-status.en_attente { background: rgba(245,158,11,.15); color: #fcd34d; }
  :root:not([data-theme="light"]) .ff-status.annule, :root:not([data-theme="light"]) .ff-status.annulee { background: rgba(239,68,68,.15); color: #fca5a5; }
  :root:not([data-theme="light"]) .ff-status.brouillon { background: rgba(107,114,128,.15); color: #d1d5db; }
  :root:not([data-theme="light"]) .ff-status.envoye { background: rgba(99,102,241,.15); color: #a5b4fc; }
  :root:not([data-theme="light"]) .ff-status.accepte, :root:not([data-theme="light"]) .ff-status.convertie { background: rgba(16,185,129,.15); color: #6ee7b7; }
  :root:not([data-theme="light"]) .ff-status.refuse { background: rgba(236,72,153,.15); color: #f9a8d4; }
  :root:not([data-theme="light"]) .ff-status.expire, :root:not([data-theme="light"]) .ff-status.expiree { background: rgba(245,158,11,.15); color: #fcd34d; }
  :root:not([data-theme="light"]) .ff-status.active { background: rgba(59,130,246,.15); color: #93c5fd; }
}
:root[data-theme="dark"] .ff-status.payee { background: rgba(16,185,129,.15); color: #6ee7b7; }
:root[data-theme="dark"] .ff-status.confirme { background: rgba(59,130,246,.15); color: #93c5fd; }
:root[data-theme="dark"] .ff-status.en_attente { background: rgba(245,158,11,.15); color: #fcd34d; }
:root[data-theme="dark"] .ff-status.annule, :root[data-theme="dark"] .ff-status.annulee { background: rgba(239,68,68,.15); color: #fca5a5; }
:root[data-theme="dark"] .ff-status.brouillon { background: rgba(107,114,128,.15); color: #d1d5db; }
:root[data-theme="dark"] .ff-status.envoye { background: rgba(99,102,241,.15); color: #a5b4fc; }
:root[data-theme="dark"] .ff-status.accepte, :root[data-theme="dark"] .ff-status.convertie { background: rgba(16,185,129,.15); color: #6ee7b7; }
:root[data-theme="dark"] .ff-status.refuse { background: rgba(236,72,153,.15); color: #f9a8d4; }
:root[data-theme="dark"] .ff-status.expire, :root[data-theme="dark"] .ff-status.expiree { background: rgba(245,158,11,.15); color: #fcd34d; }
:root[data-theme="dark"] .ff-status.active { background: rgba(59,130,246,.15); color: #93c5fd; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ff-data-table tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }
  :root:not([data-theme="light"]) .ff-data-table tbody tr:hover { background: rgba(13,148,136,.06); }
}
:root[data-theme="dark"] .ff-data-table tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }
:root[data-theme="dark"] .ff-data-table tbody tr:hover { background: rgba(13,148,136,.06); }

/* ============================================
   RTL SUPPORT
   ============================================ */
[dir="rtl"] .ff-kpi::before { left: auto; right: 0; }
[dir="rtl"] .ff-event-card:hover { transform: translateX(-4px); }
[dir="rtl"] .ff-hero { direction: rtl; }
[dir="rtl"] .ff-data-table thead th,
[dir="rtl"] .ff-data-table tbody td { text-align: right; }
[dir="rtl"] .ff-section-header { direction: rtl; }
[dir="rtl"] .ff-filter-bar, [dir="rtl"] .ff-filter-row { direction: rtl; }
[dir="rtl"] .ff-cal-nav { direction: rtl; }
[dir="rtl"] .ff-calendar { direction: rtl; }
[dir="rtl"] .ff-sidebar { border-right: none; border-left: 1px solid rgba(255,255,255,.08); }
[dir="rtl"] .ff-kpi-value,
[dir="rtl"] .ff-kpi-currency,
[dir="rtl"] .ff-detail-value,
[dir="rtl"] .ff-cal-list-amount,
[dir="rtl"] .ff-cal-stat .stat-val,
[dir="rtl"] .ff-stat-mini .num,
[dir="rtl"] .ff-data-table td {
  direction: ltr;
  unicode-bidi: isolate;
}
