/* DevisVox — Agenda — Mobile (rebuilt r115) */

/* ── Conteneur page ─────────────────────────────────────── */
#planning-page { overflow: hidden; }
#ag-page {
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--bottom-nav-height, 64px));
  overflow: hidden; background: var(--bg);
}

/* ── Header ─────────────────────────────────────────────── */
.ag-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top, 0px)) 20px 12px;
  padding-top: max(36px, calc(env(safe-area-inset-top, 0px) + 16px));
  flex-shrink: 0;
}
.ag-title { font-size: 28px; font-weight: 900; color: var(--text); letter-spacing: -.5px; }

/* ── Tabs vue ───────────────────────────────────────────── */
.ag-tabs {
  display: flex; background: var(--b, #e5e5ea);
  border-radius: 99px; padding: 3px;
}
.ag-tab {
  padding: 5px 11px; border-radius: 99px; border: none;
  background: transparent; font-size: 11px; font-weight: 600;
  color: var(--text2); cursor: pointer; font-family: inherit;
  transition: all .18s; white-space: nowrap;
}
.ag-tab.ag-tab-on {
  background: var(--card, #fff); color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 700;
}

/* ── Corps scrollable ───────────────────────────────────── */
.ag-body { flex: 1; overflow-y: auto; padding-bottom: 88px; }
.ag-body::-webkit-scrollbar { display: none; }

/* ── Navigation mois ────────────────────────────────────── */
.ag-cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 20px 12px;
}
.ag-cal-label {
  font-size: 15px; font-weight: 800; color: var(--text);
  text-transform: capitalize; flex: 1; text-align: center;
}
.ag-nav-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1.5px solid var(--b2, #d1d1d6); background: var(--card, #fff);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  flex-shrink: 0;
}
.ag-nav-btn svg { stroke: var(--text2); fill: none; }
.ag-nav-btn:active { background: var(--b); }

/* ── Grille calendrier ──────────────────────────────────── */
.ag-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 0 10px; gap: 1px;
}
.ag-col-hdr {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--text3); padding: 4px 0 8px;
  text-transform: uppercase; letter-spacing: .05em;
}
.ag-day {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 2px 6px; cursor: pointer;
  min-height: 48px; border-radius: 8px;
  transition: background .12s;
}
.ag-day:active { background: var(--b); }
.ag-day.ag-day-empty { pointer-events: none; }
.ag-day-num {
  font-size: 13px; font-weight: 600; color: var(--text);
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ag-day.ag-day-today .ag-day-num {
  background: var(--accent, #ff6b00); color: #fff; font-weight: 800;
}
.ag-day.ag-day-selected:not(.ag-day-today) .ag-day-num {
  background: rgba(255, 107, 0, .15); color: var(--accent, #ff6b00); font-weight: 700;
}
.ag-day.ag-day-weekend .ag-day-num { color: var(--text3); }
.ag-day-dots { display: flex; gap: 3px; margin-top: 3px; justify-content: center; }
.ag-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

/* ── Section label ──────────────────────────────────────── */
.ag-section-lbl {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .07em;
  padding: 18px 20px 10px;
}

/* ── État vide ──────────────────────────────────────────── */
.ag-empty {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
}
.ag-empty span { font-size: 14px; color: var(--text3); }

/* ── Carte intervention ─────────────────────────────────── */
.ag-int-card {
  display: flex; gap: 14px; padding: 14px 16px;
  background: var(--card, #fff);
  border-left: 4px solid var(--accent, #ff6b00);
  margin: 0 16px 10px; border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  cursor: pointer;
}
.ag-int-card:active { opacity: .85; }
.ag-int-left {
  display: flex; flex-direction: column; align-items: center;
  gap: 1px; flex-shrink: 0; min-width: 38px; padding-top: 2px;
}
.ag-int-dayname {
  font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .04em;
}
.ag-int-date {
  font-size: 12px; font-weight: 700; color: var(--text);
  text-align: center; line-height: 1.3;
}
.ag-int-time { font-size: 11px; color: var(--text3); margin-top: 2px; }
.ag-int-body { flex: 1; min-width: 0; }
.ag-int-client {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ag-int-meta {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap; font-size: 12px; color: var(--text2); line-height: 1.4;
}
.ag-int-meta svg { stroke: var(--text3); fill: none; flex-shrink: 0; }

/* ── Vue Semaine : en-têtes de jour ────────────────────── */
.ag-week-day-hdr {
  padding: 14px 20px 6px;
  font-size: 12px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .05em;
  border-top: 1px solid var(--b);
}
.ag-week-day-hdr:first-child { border-top: none; }
.ag-day-empty-hint { padding: 6px 20px 8px; font-size: 13px; color: var(--text3); }

/* ── FAB bouton "+" ─────────────────────────────────────── */
.ag-fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height, 64px) + 17px);
  right: 20px;
  width: 54px; height: 54px;
  border-radius: 50%; border: none;
  background: var(--accent, #ff6b00); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255,107,0,.38);
  z-index: 100;
}
.ag-fab:active { transform: scale(.93); }
.ag-fab svg { stroke: #fff; fill: none; }

/* ══ NOUVEAU CHANTIER — Fullscreen ══════════════════════════ */
#nch-fs {
  position: fixed; inset: 0; z-index: 9990;
  background: var(--bg); display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
#nch-fs.nch-fs-open { transform: translateY(0); }

/* Header */
.nch-header {
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top,0px) + 14px) 16px 14px;
  border-bottom: 1px solid var(--b); flex-shrink: 0; background: var(--card);
}
.nch-back {
  width: 36px; height: 36px; border: none; background: var(--b);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; color: var(--text); padding: 0;
}
.nch-title { font-size: 17px; font-weight: 800; color: var(--text); flex: 1; }

/* Body */
.nch-body {
  flex: 1; overflow-y: auto; padding: 14px 16px 8px;
  display: flex; flex-direction: column; gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.nch-body::-webkit-scrollbar { display: none; }

/* Cards */
.nch-card {
  background: var(--card); border-radius: 14px;
  padding: 14px 14px 6px; display: flex; flex-direction: column;
}
.nch-equipe-card { padding-bottom: 10px; }

/* Labels */
.nch-lbl {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .06em;
  display: block; margin-bottom: 7px;
}

/* Inputs */
.nch-input {
  height: 46px; border: 1.5px solid var(--b2); border-radius: 10px;
  padding: 0 14px; width: 100%; box-sizing: border-box;
  font-size: 15px; color: var(--text); background: var(--bg);
  font-family: inherit; outline: none; transition: border-color .15s;
  min-height: unset; min-width: unset; margin-bottom: 8px;
}
.nch-input:focus { border-color: var(--accent); }

.nch-textarea {
  border: 1.5px solid var(--b2); border-radius: 10px;
  padding: 12px 14px; width: 100%; box-sizing: border-box;
  font-size: 15px; color: var(--text); background: var(--bg);
  font-family: inherit; outline: none; resize: none; line-height: 1.5;
  transition: border-color .15s; margin-bottom: 8px;
}
.nch-textarea:focus { border-color: var(--accent); }

/* 2-col grid */
.nch-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Color palette */
.nch-color-grid { display: flex; gap: 7px; flex-wrap: nowrap; overflow-x: auto; margin-bottom: 4px; padding-top: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nch-color-grid::-webkit-scrollbar { display: none; }
.nch-color-swatch {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform .14s, border-color .14s;
  padding: 0; outline: none; min-height: unset; min-width: unset;
}
.nch-color-swatch.nch-color-on { border-color: rgba(0,0,0,.22); transform: scale(1.13); }

/* Équipe button */
.nch-equipe-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 46px; border: 1.5px dashed var(--b2);
  border-radius: 10px; padding: 0 14px;
  background: var(--bg); font-size: 14px; font-weight: 600;
  color: var(--accent); cursor: pointer; font-family: inherit;
  transition: border-color .14s; margin-bottom: 8px;
  min-height: unset; min-width: unset;
}
.nch-equipe-btn:active { background: var(--b); }
.nch-equipe-btn svg { stroke: var(--accent); flex-shrink: 0; }

/* Équipe chips */
.nch-equipe-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.nch-emp-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,107,0,.1); color: var(--accent);
  border-radius: 99px; padding: 5px 8px 5px 12px;
  font-size: 13px; font-weight: 600;
}
.nch-emp-chip button {
  border: none; background: transparent; color: var(--accent);
  cursor: pointer; font-size: 12px; padding: 0; line-height: 1;
  display: flex; align-items: center; min-height: unset; min-width: unset;
}

/* Footer */
.nch-footer {
  display: flex; flex-direction: row; gap: 10px;
  padding: 12px 16px calc(env(safe-area-inset-bottom,0px) + 12px);
  border-top: 1px solid var(--b); background: var(--card); flex-shrink: 0;
}
.nch-btn-cancel {
  flex: 1; height: 52px; border-radius: 14px;
  border: 1.5px solid var(--b2); background: transparent;
  font-size: 15px; font-weight: 700; color: var(--text2);
  cursor: pointer; font-family: inherit; min-height: unset; min-width: unset;
}
.nch-btn-save {
  flex: 1; height: 52px; border-radius: 14px; border: none;
  background: #16a34a; color: #fff; font-size: 15px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 16px rgba(22,163,74,.28); min-height: unset; min-width: unset;
}
.nch-btn-save:active { opacity: .88; transform: scale(.98); }
.nch-btn-save:disabled { opacity: .55; transform: none; cursor: default; }

/* ══ Bottom sheet assignation équipe ════════════════════════ */
#nch-equipe-bs {
  position: fixed; inset: 0; z-index: 9995;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.nch-bs-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.nch-bs-drawer {
  position: relative; background: var(--bg);
  border-radius: 20px 20px 0 0; max-height: 75dvh;
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.nch-bs-drawer.nch-bs-drawer-open { transform: translateY(0); }
.nch-bs-handle { width: 40px; height: 4px; background: var(--b2); border-radius: 2px; margin: 12px auto 4px; flex-shrink: 0; }
.nch-bs-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 20px 14px; border-bottom: 1px solid var(--b); flex-shrink: 0; }
.nch-bs-title { font-size: 16px; font-weight: 800; color: var(--text); }
.nch-bs-close { width: 32px; height: 32px; border: none; background: var(--b); border-radius: 50%; font-size: 14px; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; min-height: unset; min-width: unset; }
.nch-bs-list { flex: 1; overflow-y: auto; padding: 0 20px; -webkit-overflow-scrolling: touch; }
.nch-bs-list::-webkit-scrollbar { display: none; }
.nch-bs-emp-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--b); cursor: pointer; }
.nch-bs-emp-row:last-child { border-bottom: none; }
.nch-bs-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,107,0,.12); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.nch-bs-emp-info { flex: 1; min-width: 0; }
.nch-bs-emp-name { font-size: 15px; font-weight: 600; color: var(--text); }
.nch-bs-emp-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.nch-bs-chk { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--b2); background: transparent; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .14s; }
.nch-bs-chk.nch-bs-chk-on { background: var(--accent); border-color: var(--accent); }
.nch-bs-empty { text-align: center; padding: 32px 20px; color: var(--text3); font-size: 14px; font-family: inherit; }
.nch-bs-foot { padding: 14px 20px calc(env(safe-area-inset-bottom,0px) + 14px); border-top: 1px solid var(--b); flex-shrink: 0; }
.nch-bs-confirm { width: 100%; height: 52px; border-radius: 14px; border: none; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit; min-height: unset; }
.nch-bs-confirm:active { opacity: .88; transform: scale(.98); }

/* ── Modifier chantier modal — footer 3 boutons (Supprimer | Annuler | Enregistrer) ─── */
#modal-edit-event .modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding: 16px 16px calc(env(safe-area-inset-bottom,0px) + 14px); border-top: 1px solid var(--b); flex-shrink: 0; }
#modal-edit-event .modal-actions button { width: 100%; flex: none; }

/* ── Day-events bottom sheet (agd-) ─────────────────── */
.agd-handle { width: 40px; height: 4px; background: var(--b2); border-radius: 2px; margin: 12px auto 0; flex-shrink: 0; }
.agd-sh-hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--b); flex-shrink: 0; }
.agd-sh-hdr-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.agd-sh-ico { display: flex; align-items: center; color: var(--accent); flex-shrink: 0; }
.agd-sh-date { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -.3px; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agd-sh-close { width: 32px; height: 32px; border: none; background: var(--b); border-radius: 50%; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: unset; min-width: unset; }
.agd-sh-close:active { opacity: .7; }
.agd-sh-body { flex: 1; overflow-y: auto; padding: 12px 20px 8px; -webkit-overflow-scrolling: touch; }
.agd-sh-body::-webkit-scrollbar { display: none; }
.agd-sh-empty { text-align: center; color: var(--text3); font-style: italic; font-size: 14px; padding: 28px 0 18px; margin: 0; }
.agd-ev-card { padding: 12px 14px; background: var(--bg); border-radius: 12px; margin-bottom: 8px; }
.agd-ev-title { display: block; font-size: 15px; font-weight: 700; color: var(--text); }
.agd-ev-time { display: block; font-size: 12px; color: var(--text3); margin-top: 3px; }
.agd-sh-foot { padding: 12px 20px calc(env(safe-area-inset-bottom, 0px) + 14px); border-top: 1px solid var(--b); flex-shrink: 0; display: flex; justify-content: center; }
.agd-sh-add { display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 28px; border: none; border-radius: 14px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; box-shadow: 0 3px 12px rgba(255,107,0,.30); min-height: unset; min-width: unset; }
.agd-sh-add:active { transform: scale(.97); opacity: .9; }

/* ── Modal "Modifier chantier" — plein écran ── */
#modal-edit-event { align-items: stretch; }
#modal-edit-event .modal-content {
  height: 100dvh; max-height: 100dvh;
  border-radius: 0; max-width: 100%;
  padding: 14px 16px 20px; padding-top: 20px; overflow-y: auto;
  display: flex; flex-direction: column;
}
#modal-edit-event .modal-header {
    margin-bottom: 14px;
}
#modal-edit-event #edit-event-description {
    min-height: 100px;
    resize: vertical;
}
.btn-danger {
  flex: 1; height: 52px; border-radius: var(--r);
  background: var(--er-bg); color: var(--er);
  border: 1.5px solid var(--er); font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-danger svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-success { height: 52px; background: linear-gradient(135deg, #34D399, var(--ok), var(--ok-d)); color: #fff; border: none; border-radius: var(--r); font-weight: 800; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
