/* =====================================================
   Regen Medical Dashboard — Design System
   ===================================================== */

:root {
  /* Primary accent — indigo */
  --primary:       #4f46e5;
  --primary-light: #818cf8;
  --primary-dark:  #4338ca;

  /* Legacy alias kept for inline styles throughout HTML */
  --navy:          #4f46e5;
  --navy-light:    #6366f1;

  /* Sidebar (dark) */
  --sidebar-bg:    #0f172a;

  /* Accent colors */
  --gold:          #f59e0b;
  --gold-light:    #fbbf24;
  --teal:          #0ea5e9;

  /* Surface & background */
  --cream:         #f8f7ff;
  --bg:            #f1f5f9;
  --white:         #ffffff;

  /* Text */
  --text:          #0f172a;
  --text-light:    #64748b;
  --text-muted:    #94a3b8;

  /* Borders */
  --border:        #e2e8f0;
  --border-light:  #f1f5f9;

  /* Status */
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;

  /* Layout */
  --sidebar-w:     240px;

  /* Radii */
  --radius:        8px;
  --radius-lg:     12px;
  --radius-xl:     16px;

  /* Shadows — softer, more modern */
  --shadow:        0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,.09), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:     0 16px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);

  /* Typography */
  --font-display:  'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, sans-serif;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ── Layout ── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,.05);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo h1 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: #fff;
}
.sidebar-logo span {
  font-size: 11px;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  padding: 16px 10px;
  flex: 1;
  list-style: none;
}
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,.55);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.9);
}
.sidebar-nav a.active {
  background: rgba(99,102,241,.18);
  color: #fff;
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px; bottom: 4px;
  width: 3px;
  background: var(--primary-light);
  border-radius: 0 3px 3px 0;
}
.sidebar-nav .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-footer .user-email {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0; /* prevent kanban/table overflow from expanding the page */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.page-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}
.page-header .sub { font-size: 13px; color: var(--text-light); margin-top: 2px; }

.page-body {
  padding: 28px 32px;
  flex: 1;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(79,70,229,.25);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(79,70,229,.35);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79,70,229,.3);
}

.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-light); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-actif    { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-perdu    { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge-archive  { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.badge-positif  { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-negatif  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  appearance: auto;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-control[readonly] {
  background: var(--bg);
  color: var(--text-light);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin: 24px 0 16px;
}

/* ── Computed value display ── */
.calc-display {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}
.calc-display.positive { background: var(--success); }
.calc-display.negative { background: var(--danger); }
.calc-display.neutral  { background: var(--text-light); }
.calc-label { font-size: 11px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }

/* ── Table ── */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  background: #fafafa;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
tr:hover td { background: #eef2ff; }
tr:last-child td { border-bottom: none; }

/* Sticky last column (action button always visible when scrolling) */
.table-wrapper { position: relative; }
table th:last-child,
table td:last-child {
  position: sticky;
  right: 0;
  background: var(--white);
  box-shadow: -2px 0 6px rgba(0,0,0,.05);
}
table th:last-child { background: #fafafa; }
tr:hover td:last-child { background: #eef2ff; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  position: relative;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

/* ── Kanban ── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 160px);
  align-items: flex-start;
}
.kanban-col {
  min-width: 240px;
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.kanban-col-header .col-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.kanban-col-header .col-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}
.kanban-col-header .col-count {
  background: var(--bg);
  border-radius: 100px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
  padding: 4px 0;
}

.kanban-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: grab;
  transition: box-shadow .2s, transform .2s;
  user-select: none;
  position: relative;
}
.kanban-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.kanban-card.sortable-ghost { opacity: .4; }
.kanban-card.sortable-drag  { box-shadow: var(--shadow-lg); cursor: grabbing; }

.kanban-card .card-laser   { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.kanban-card .card-serial  { font-size: 11px; color: var(--text-light); margin-bottom: 8px; }
.kanban-card .card-info    { display: flex; flex-direction: column; gap: 3px; }
.kanban-card .card-vendor  { font-size: 11px; color: var(--text-light); }
.kanban-card .card-cost    { font-size: 12px; font-weight: 600; color: var(--text); }
.kanban-card .card-margin  { font-size: 11px; font-weight: 700; }
.kanban-card .card-margin.pos { color: var(--success); }
.kanban-card .card-margin.neg { color: var(--danger); }
.kanban-card .card-link { font-size: 11px; color: var(--primary); font-weight: 600; margin-top: 6px; display: block; }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Filters / search bar ── */
.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.search-input {
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  width: 240px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath stroke-linecap='round' d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") 10px center / 16px no-repeat;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ── Alert ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* ── Loading spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Stat cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 6px; }
.stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.stat-sub   { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 48px rgba(0,0,0,.28);
  border-top: 3px solid var(--primary);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.login-logo p  { font-size: 13px; color: var(--text-light); }

/* ── Alert badge (nav sidebar) ── */
.alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  margin-left: auto;
}

/* ── Interaction log ── */
.interaction-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.interaction-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 12px;
}
.interaction-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.interaction-meta { color: var(--text-light); font-size: 11px; margin-top: 2px; }
.interaction-note { color: var(--text); margin-top: 3px; }
.interaction-form { background: var(--bg); border-radius: var(--radius); padding: 12px; margin-top: 8px; }

/* ── Dashboard KPI grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 8px; }
.kpi-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.kpi-sub   { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* Period selector */
.period-selector { display: flex; gap: 4px; flex-wrap: wrap; }
.period-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--white);
  color: var(--text-light);
  cursor: pointer;
  transition: all .15s;
}
.period-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.period-btn:hover:not(.active) { background: var(--bg); color: var(--text); }

/* Dashboard section */
.dashboard-section { margin-bottom: 28px; }
.dashboard-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Kanban alert dot */
.kanban-alert-dot {
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  position: absolute;
  top: 8px; right: 8px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   Hamburger — styles globaux (hidden on desktop)
   ═══════════════════════════════════════════════════ */

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .2s, width .2s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 99;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.sidebar-backdrop.open { display: block; }

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */

/* MacBook 13" — légèrement plus compact */
@media (max-width: 1360px) {
  :root { --sidebar-w: 220px; }
  .page-body { padding: 20px 24px; }
  .page-header { padding: 16px 24px; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .page-body { padding: 20px; }
  .page-header { padding: 16px 20px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Sidebar → drawer off-canvas */
  .sidebar {
    position: fixed !important;
    top: 0; left: 0;
    width: 280px !important;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1), box-shadow .28s;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    overflow-y: auto;
    min-height: unset !important;
    overscroll-behavior: contain;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 48px rgba(0,0,0,.35);
  }
  .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: visible;
    padding: 8px 12px;
    flex: 1;
  }
  .sidebar-nav a { padding: 13px 14px; font-size: 15px; }
  .sidebar-nav .nav-icon { font-size: 18px; }
  .sidebar-logo { padding: 22px 20px 16px; }
  .sidebar-footer { display: flex !important; }

  /* Layout */
  .hamburger-btn { display: flex; }
  .app { flex-direction: column; }
  .main { margin-left: 0; }

  /* Page header : sticky + compact */
  .page-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--white);
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    padding: 10px 14px !important;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .page-header > div { flex: 1; min-width: 0; }
  .page-header h2 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 10px;
    border-left-width: 2px;
  }
  .page-header .sub { font-size: 11px; }
  .page-body { padding: 14px !important; }

  /* Touch targets */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }

  /* Table */
  .table-wrapper { -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
  th { font-size: 10px; padding: 8px 10px; }
  td { padding: 10px; font-size: 13px; }

  /* Kanban */
  .kanban-board { gap: 10px; }
  .kanban-col { min-width: 210px; width: 210px; }

  /* Filters */
  .filters { flex-wrap: wrap; }
  .filters .search-input { width: 100%; }
}

@media (max-width: 480px) {
  .modal { max-width: 100%; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; overflow-y: auto; }
  .page-body { padding: 10px !important; }
}

/* ── Photos ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.photo-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
  transition: opacity .15s, transform .2s;
}

.photo-thumb:hover { opacity: .9; transform: scale(1.02); }

.photo-thumb-wrap:hover .photo-delete-btn { opacity: 1; }

.photo-delete-btn {
  position: absolute;
  top: 6px; right: 6px;
  width: 28px; height: 28px;
  min-width: 28px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}

.photo-spinner {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
}

.photo-status {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(255,255,255,.7);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}

.photo-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.photo-lightbox-close {
  position: absolute;
  top: 16px; right: 20px;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  transition: background .15s;
}
.photo-lightbox-close:hover { background: rgba(255,255,255,.22); }

.photo-lightbox-counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-weight: 600;
  background: rgba(0,0,0,.35);
  padding: 4px 14px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 36px;
  width: 52px; height: 72px;
  cursor: pointer;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  line-height: 1;
}
.photo-lightbox-nav:hover { background: rgba(255,255,255,.25); }
.photo-lightbox-nav.prev { left: 12px; }
.photo-lightbox-nav.next { right: 12px; }

@media (max-width: 768px) {
  .photo-lightbox-nav { display: none; }
  .photo-lightbox { touch-action: pan-y; }
}

.photo-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: var(--text-light);
}

.photo-upload-zone:hover {
  border-color: var(--primary);
  background: rgba(79,70,229,.04);
  color: var(--primary);
}

/* Photos — Page standalone (pas de sidebar) */
.photos-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}

.photos-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}
.photos-header-title { flex: 1; min-width: 0; }
.photos-header-title h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* FAB — bouton d'upload flottant (visible sur mobile uniquement) */
.photo-fab {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(79,70,229,.45);
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.photo-fab:active { transform: scale(.9); box-shadow: 0 2px 8px rgba(79,70,229,.35); }

@media (max-width: 768px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .photo-delete-btn { opacity: 1; width: 38px; height: 38px; font-size: 16px; top: 5px; right: 5px; }
  .photos-page { padding: 12px; padding-bottom: 88px; }
  .photos-header { margin-bottom: 14px; }
  .photo-fab { display: flex; }
  .photo-upload-card { display: none; }
}

@media (max-width: 480px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}
