/* ================================================================
   TachoSinaps — app.css
   Design inspiré FOTA WEB : sidebar collapsible, topbar, cartes
   ================================================================ */

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

:root {
  --purple:      #624192;
  --purple-light:#6241921a;
  --purple-mid:  #62419240;
  --sidebar-w:   210px;
  --sidebar-w-sm: 52px;
  --topbar-h:    48px;
  --bg:          #f5f5f7;
  --surface:     #ffffff;
  --border:      #e5e5e8;
  --text:        #111;
  --text-2:      #555;
  --text-3:      #999;
  --green:       #1D9E75;
  --red:         #E24B4A;
  --amber:       #EF9F27;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--purple); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ================================================================
   LAYOUT SHELL
   ================================================================ */

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width .2s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-sm); }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--purple);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  opacity: 1;
  transition: opacity .15s;
}

.sidebar.collapsed .logo-text { opacity: 0; pointer-events: none; }

/* ── Nav ── */
nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0; }

.nav-group {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 14px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .15s;
}

.sidebar.collapsed .nav-group { opacity: 0; height: 0; padding: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin: 1px 6px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  transition: background .12s, color .12s;
}

.nav-item:hover { background: var(--bg); color: var(--text); }

.nav-item.active {
  background: var(--purple-light);
  color: var(--purple);
  font-weight: 500;
}

.nav-item.active .nav-icon { color: var(--purple); }

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-3);
  transition: color .12s;
}

.nav-item:hover .nav-icon { color: var(--text); }

.nav-item span {
  opacity: 1;
  transition: opacity .15s;
}

.sidebar.collapsed .nav-item span { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 9px 6px; margin: 1px 4px; gap: 0; }
.sidebar.collapsed .nav-icon { color: var(--text-2); }

/* ── Collapse button ── */
.sidebar-collapse {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}

.sidebar-collapse:hover { background: var(--bg); color: var(--text-2); }
.collapse-label { opacity: 1; transition: opacity .15s; }
.sidebar.collapsed .collapse-label { opacity: 0; }
.sidebar.collapsed .sidebar-collapse { justify-content: center; padding: 10px 0; }

/* ── Main wrap ── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.page-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  transition: background .12s, border-color .12s;
}

.topbar-btn:hover { background: var(--bg); border-color: #ccc; }

.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── View area ── */
.view-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ================================================================
   SKELETON LOADER
   ================================================================ */

.skeleton-wrap { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.sk-title  { height: 20px; width: 200px; margin-bottom: 8px; }
.sk-row    { height: 40px; width: 100%; }
.sk-short  { width: 60%; }

/* ================================================================
   DASHBOARD KPI
   ================================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.kpi-label-row {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.dashboard-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Cards ── */
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dash-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.dash-badge {
  font-size: 11px;
  background: var(--purple-light);
  color: var(--purple);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 500;
}

/* ── Donut ── */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-val {
  font-weight: 600;
  color: var(--text);
  margin-left: auto;
  padding-left: 8px;
}

/* ── Approval mini-list ── */
.mini-list { display: flex; flex-direction: column; gap: 8px; }

.mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius);
}

.mini-left { display: flex; align-items: center; gap: 10px; }

.mini-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mini-name  { font-size: 12px; font-weight: 500; color: var(--text); }
.mini-meta  { font-size: 11px; color: var(--text-3); }
.mini-right { display: flex; align-items: center; gap: 6px; }

/* ================================================================
   BADGES / PILLS
   ================================================================ */

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-driver  { background: var(--purple-light); color: var(--purple); }
.badge-company { background: #1D9E7520; color: #0F6E56; }
.badge-success { background: #1D9E7520; color: #0F6E56; }
.badge-warn    { background: #EF9F2720; color: #854F0B; }
.badge-danger  { background: #E24B4A20; color: #A32D2D; }
.badge-neutral { background: #8887801a; color: #5F5E5A; }

/* ================================================================
   TABLES
   ================================================================ */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.table-toolbar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* simple-datatables overrides */
.datatable-wrapper { font-size: 13px; }
.datatable-top, .datatable-bottom { padding: 10px 16px; }
.datatable-search input { border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 10px; font-size: 13px; }
.datatable-table { width: 100%; border-collapse: collapse; }
.datatable-table th { background: var(--bg); font-size: 12px; font-weight: 500; color: var(--text-2); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.datatable-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.datatable-table tbody tr:last-child td { border-bottom: none; }
.datatable-table tbody tr:hover td { background: #f9f9fb; }
.datatable-table tbody tr:hover { background: none; }

/* ── Assign select / button ── */
.assign-select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  max-width: 200px;
  cursor: pointer;
}

.assign-select:focus { outline: 2px solid var(--purple-mid); }

.btn-assign {
  padding: 4px 12px;
  border-radius: var(--radius);
  border: none;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: opacity .15s, background .12s;
}

.btn-assign:disabled { opacity: .35; cursor: default; }
.btn-assign:not(:disabled):hover { background: #4e3375; }

/* ── Inline action buttons ── */
.btn-sm {
  padding: 4px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}

.btn-sm:hover { background: var(--bg); border-color: #bbb; }

/* ================================================================
   STATES
   ================================================================ */

.view-error {
  color: #A32D2D;
  background: #E24B4A20;
  border-left: 3px solid #E24B4A;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
}

.view-empty {
  color: var(--text-3);
  text-align: center;
  padding: 3rem;
  font-size: 14px;
}

/* ================================================================
   MODAL LOGIN
   ================================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.modal-overlay[hidden] { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: min(380px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.modal-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.modal-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--purple);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-logo-text { font-size: 17px; font-weight: 600; color: var(--text); }

.modal-title { font-size: 15px; font-weight: 500; color: var(--text); }

.field-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

.field-label input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}

.field-label input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-light);
}

.btn-primary {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}

.btn-primary:hover { background: #4e3375; }
.btn-primary:disabled { opacity: .6; cursor: default; }

.login-error {
  background: #E24B4A15;
  color: #A32D2D;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
}

.login-error[hidden] { display: none; }

/* ================================================================
   AVATAR DROPDOWN MENU
   ================================================================ */

.avatar-menu-wrap {
  position: relative;
}

.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
  animation: menuIn .12s ease;
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.avatar-menu[hidden] { display: none; }

.avatar-menu-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.avatar-menu-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.avatar-menu-email { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.avatar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .1s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.avatar-menu-item:hover { background: var(--bg); color: var(--text); }
.avatar-menu-item.danger { color: var(--red); }
.avatar-menu-item.danger:hover { background: #E24B4A10; }

.avatar-menu-item svg { flex-shrink: 0; }

.avatar-menu-divider { height: 1px; background: var(--border); margin: 2px 0; }

/* ================================================================
   RESPONSIVE MOBILE — burger menu
   ================================================================ */

/* Burger button — caché sur desktop */
.burger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
}

.burger-btn:hover { background: var(--bg); }

/* Overlay sombre derrière la sidebar mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

.sidebar-overlay.visible { display: block; }

@media (max-width: 600px) {

  /* Sidebar devient un panneau glissant */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 100;
    width: var(--sidebar-w) !important;  /* ignore collapsed sur mobile */
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Sur mobile, les labels sont toujours visibles */
  .sidebar .nav-item span { opacity: 1 !important; width: auto !important; }
  .sidebar .nav-item       { justify-content: flex-start !important; padding: 9px 12px !important; gap: 10px !important; }
  .sidebar .nav-group      { opacity: 1 !important; height: auto !important; padding: 12px 14px 4px !important; }
  .sidebar .logo-text      { opacity: 1 !important; }
  .sidebar .collapse-label { opacity: 1 !important; }
  .sidebar-collapse        { display: none; } /* inutile sur mobile */

  /* Burger visible */
  .burger-btn { display: flex; }

  /* Masquer les boutons topbar secondaires */
  .topbar-btn { display: none; }

  .view-wrap { padding: 12px; }
  .dashboard-row2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 12px; }
}

/* ================================================================
   CALENDRIER ANNUEL D'ACTIVITÉS
   ================================================================ */

.act-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-2);
}

.cal-legend-dot {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Conteneur scrollable horizontalement si trop étroit */
.cal-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cal-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 700px;  /* évite l'écrasement sur mobile */
}

/* En-tête des jours */
.cal-day-hd {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  text-align: center;
  padding: 6px 2px;
  width: calc((100% - 70px) / 31);
  min-width: 22px;
  border-bottom: 1px solid var(--border);
}

/* En-tête des mois */
.cal-month-hd {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  text-align: right;
  padding: 3px 10px 3px 14px;
  white-space: nowrap;
  width: 70px;
  border-bottom: 1px solid var(--border);
}

/* Cellule générique */
.cal-cell {
  padding: 10px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: default;
  transition: transform .1s, box-shadow .1s;
}

.cal-cell:hover {
  transform: scale(1.25);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  z-index: 10;
  position: relative;
}

/* Jour vide (passé, pas de données) */
.cal-cell.cal-empty {
  background: var(--bg);
}

/* Jour futur */
.cal-cell.cal-future {
  background: transparent;
}

/* Jour inexistant (ex: 31 février) */
.cal-cell.cal-void {
  background: transparent;
  cursor: default;
}

/* Jour avec activité */
.cal-cell.cal-filled {
  cursor: pointer;
}

.cal-cell.cal-filled:hover {
  filter: brightness(.92);
}

/* Icône SVG dans la cellule */
.cal-cell svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 auto;
}

/* Ligne paire légèrement différenciée */
.cal-table tbody tr:nth-child(even) .cal-month-hd,
.cal-table tbody tr:nth-child(even) .cal-cell:not(.cal-void) {
  background-color: rgba(0,0,0,.015);
}

/* ================================================================
   PANNEAU DÉTAIL JOURNÉE
   ================================================================ */

.day-detail-panel {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: slideDown .2s ease;
}

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

.day-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.day-detail-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-transform: capitalize;
}

.day-detail-close {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: background .1s, color .1s;
}

.day-detail-close:hover {
  background: var(--border);
  color: var(--text);
}

/* Zone SVG scrollable horizontalement sur mobile */
.day-detail-svg {
  padding: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.day-detail-svg svg {
  min-width: 600px;
}

/* Tableau des évènements */
.day-detail-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cal-detail-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cal-detail-tbl th {
  background: var(--bg);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  text-align: left;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.cal-detail-tbl td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.cal-detail-tbl tbody tr:last-child td { border-bottom: none; }
.cal-detail-tbl tbody tr:hover td { background: #f9f9fb; }

/* ================================================================
   RANGE PICKER — sélection de période
   ================================================================ */

#period-picker-wrap { margin-top: 14px; }

.range-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.rp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  gap: 12px;
  flex-wrap: wrap;
}

.rp-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-transform: capitalize;
  flex: 1;
}

.rp-reset {
  font-size: 12px;
  color: var(--text-3);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 10px;
  cursor: pointer;
  transition: color .1s, background .1s;
}
.rp-reset:hover { color: var(--red); background: #E24B4A10; }

.rp-calendars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 640px) {
  .rp-calendars { grid-template-columns: 1fr; }
}

.rp-month {
  padding: 12px 14px;
  border-right: 1px solid var(--border);
}
.rp-month:last-child { border-right: none; }

.rp-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rp-month-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-transform: capitalize;
}

.rp-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
}
.rp-nav-btn:hover { background: var(--bg); }

.rp-table {
  width: 100%;
  border-collapse: collapse;
}

.rp-table thead th {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  text-align: center;
  padding: 4px 2px;
}

.rp-day {
  text-align: center;
  font-size: 12px;
  color: var(--text);
  padding: 5px 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .1s, color .1s;
  width: 32px;
}

.rp-day:hover:not(.rp-future) {
  background: var(--purple-light);
  color: var(--purple);
}

/* Jour de début */
.rp-day.rp-begin {
  background: var(--purple) !important;
  color: #fff !important;
  border-radius: 4px 0 0 4px;
}

/* Jour de fin */
.rp-day.rp-end {
  background: var(--purple) !important;
  color: #fff !important;
  border-radius: 0 4px 4px 0;
}

/* Début = fin (jour unique) */
.rp-day.rp-begin.rp-end,
.rp-day.rp-begin:not(.rp-in-range) {
  border-radius: 4px;
}

/* Dans la plage */
.rp-day.rp-in-range {
  background: var(--purple-light);
  color: var(--purple);
  border-radius: 0;
}

/* Aujourd'hui */
.rp-day.rp-today {
  font-weight: 700;
}

/* Jours futurs */
.rp-day.rp-future {
  color: var(--text-3);
  cursor: default;
  pointer-events: none;
}

/* ── SVG journée dans la zone détail ── */

.day-svg-wrap {
  border-bottom: 1px solid var(--border);
}

.day-svg-wrap:last-of-type {
  border-bottom: none;
}

.day-svg-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  padding: 8px 16px 0;
  text-transform: capitalize;
}