/* =====================================================================
   Agenda partagé et Signalements — affichage téléphone et tablette.
   Chargé en dernier, pour tous les designs. Aucune option retirée :
   les filtres, boutons et informations sont les mêmes, simplement mieux
   rangés (filtres sur une ligne, pastille de date, cartes lisibles).
   ===================================================================== */

/* ---------- Éléments qui n'existent que pour le téléphone ---------- */
.ag-dbadge,.ag-monthlist{display:none}
.ag-dtext{display:inline}
.ticket-list .empty-state .empty-ico{display:block;font-size:34px;margin-bottom:4px}
.ticket-list .empty-state{text-align:center;display:grid;gap:2px;justify-items:center;padding:26px 16px}
.ticket-list .empty-state small{color:var(--muted,#5d766f);font-size:14px}
.filter-count{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;margin-left:4px;border-radius:999px;background:#e5484d;color:#fff;font-size:11.5px;font-style:normal}

html body .header-actions .btn:not(.primary){color:var(--ink,#17332c)}

/* ---------- Ordinateur : mêmes pastilles de filtre que sur téléphone ---------- */
.ag-f-lbl{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (min-width:921px){
html body .ag-filters{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 14px;padding:0;background:none!important;border:0;box-shadow:none}
html body .ag-filters label{display:inline-flex;align-items:center;gap:8px;min-height:46px;margin:0;padding:0 16px;border:1px solid var(--line,#dce6e2);border-radius:999px;background:var(--surface,#fff);color:var(--ink,#18332d);font-size:15px;font-weight:700;white-space:nowrap;box-shadow:var(--shadow-s,none)}
html body .ag-filters select{min-width:0;width:auto;height:auto;margin:0;padding:0 22px 0 0;border:0;background-color:transparent;box-shadow:none;color:inherit;font-size:15px;font-weight:700}
html body .ag-filters input[type=checkbox]{width:20px;height:20px;margin:0;padding:0}
html body .ag-filters label.on{background:color-mix(in srgb,var(--brand,#1e6654) 14%,var(--surface,#fff));border-color:var(--brand,#1e6654);color:var(--brand,#1e6654)}
html.aurora[data-theme=dark] body .ag-filters label.on{color:color-mix(in srgb,var(--brand2,#34a186) 55%,#fff)}

html body .ticket-filters{display:flex!important;flex-wrap:wrap;gap:8px!important;margin:0 0 10px!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
html body .ticket-filters a{display:inline-flex;align-items:center;gap:4px;min-height:40px;padding:0 14px!important;border:1px solid var(--line,#dce6e2);border-radius:999px!important;background:var(--surface,#fff)!important;box-shadow:var(--shadow-s,none);color:var(--ink,#18332d)!important;font-size:13.5px!important;font-weight:800}
html body .ticket-filters a.active{background:var(--brand,var(--primary,#1e6654))!important;border-color:transparent;color:#fff!important}
html body .team-filters{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px!important;margin:0 0 12px!important;padding:4px!important;border:1px solid var(--line,#dce6e2)!important;border-radius:16px!important;background:var(--surface2,#eef3f1)!important;box-shadow:none!important}
html body .team-filters a{display:flex!important;align-items:center;justify-content:center;gap:4px;min-height:38px;padding:4px 2px!important;border-radius:12px!important;background:transparent!important;color:var(--ink,#18332d)!important;font-size:13.5px!important;font-weight:800}
html body .team-filters a.active{background:var(--brand,var(--primary,#1e6654))!important;color:#fff!important}
.team-filters a:nth-child(2)::before{content:"🛠️"}.team-filters a:nth-child(3)::before{content:"🧹"}
html body .ticket-search{min-height:46px;border-radius:14px;background:var(--surface,#fff);box-shadow:var(--shadow-s,none)}
html body .ticket-search input{border:0!important;box-shadow:none!important;background:transparent!important;outline:0;font-size:15px}
html body .ticket-swipe{background:transparent!important}
html body .ticket-swipe .ticket-copy b{font-size:15.5px!important}
html body .ticket-swipe .ticket-copy small{font-size:13px!important}
html body .ticket-swipe .ticket-copy small::before{content:"📍 "}
html body .ticket-swipe .ticket-copy time{font-size:12px!important}
html body .ticket-swipe .status{font-size:11.5px!important;padding:5px 10px!important}
html body .ticket-swipe.p-urgent .ticket-card{background:color-mix(in srgb,#e5484d 8%,var(--surface,#fff))}
html body .ticket-swipe.p-high .ticket-card{background:color-mix(in srgb,#f59e0b 8%,var(--surface,#fff))}
html body .ticket-card{border-radius:18px}
html body .ticket-swipe .ticket-card{display:grid!important;grid-template-columns:46px minmax(0,1fr) 14px!important;grid-template-areas:"icon copy chev" "icon status chev";gap:3px 12px!important;align-items:center;padding:12px 12px 12px 16px!important;min-height:0!important}
html body .ticket-swipe .ticket-team-icon{grid-area:icon;align-self:start;width:46px;height:46px;border-radius:15px;font-size:23px}
html body .ticket-swipe .ticket-copy{grid-area:copy}
html body .ticket-swipe .ticket-copy b{white-space:normal;line-height:1.25;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
html body .ticket-swipe .status{grid-area:status;grid-column:2;justify-self:start;margin-top:3px}
html body .ticket-swipe .ticket-chevron{grid-area:chev;align-self:center}
html body .comment-box{grid-template-columns:1fr 1fr}
html body .comment-box>label:first-of-type,html body .comment-box>.btn{grid-column:1/-1}
html body .ticket-detail-head .ticket-badges{order:-1;justify-content:flex-start}
html body .ticket-detail-head{flex-direction:column;align-items:stretch;gap:8px}
}

@media (max-width:920px){

/* ================= AGENDA PARTAGÉ ================= */
html body .app-main.ag-main{padding-top:14px!important;max-width:none}

/* En-tête : titre, puis deux boutons de même hauteur côte à côte */
html body .ag-main .page-header.ag-head{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:10px!important;margin:0 0 12px!important}
html body .ag-main .ag-head .eyebrow{display:block!important;margin:0;font-size:12px;letter-spacing:.09em}
html body .ag-main .ag-head h1{margin:2px 0 0!important;font-size:30px!important;line-height:1.1}
html body .ag-main .ag-head .muted{display:none!important}
html body .ag-main .ag-head .header-actions{display:flex!important;flex-wrap:nowrap!important;gap:10px;width:100%!important}
html body .ag-main .ag-head .header-actions .btn{flex:1 1 0;min-width:0;min-height:50px;width:auto!important;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 10px!important;border-radius:16px!important;font-size:14.5px!important;line-height:1.15;text-align:center;font-weight:800;aspect-ratio:auto!important}
html body .ag-main .ag-head .header-actions .ag-btn-add{flex:1.35 1 0}
html body .ag-main .ag-head .hero-add-btn::after{content:none!important}

/* Les trois affichages : un seul bloc, comme un vrai agenda */
html body .ag-views{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px;margin:0 0 12px;border-radius:18px;background:var(--surface2,#eef3f1);border:1px solid var(--line,#dce6e2)}
html body .ag-views a{display:flex;align-items:center;justify-content:center;gap:4px;min-height:46px;padding:6px 2px;border:0;border-radius:14px;background:transparent;box-shadow:none;color:var(--ink,#18332d);font-size:14px;font-weight:800;white-space:nowrap;text-align:center}
html body .ag-views a.active{background:var(--brand,var(--primary,#1e6654));color:#fff;box-shadow:0 6px 16px color-mix(in srgb,var(--brand,#1e6654) 38%,transparent)}

/* Filtres : une ligne de pastilles à faire glisser (au lieu d'un grand cadre) */
html body .ag-filters{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;overflow-x:auto;margin:0 -14px 8px;padding:2px 14px 8px;background:none!important;border:0;border-radius:0;box-shadow:none;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.ag-filters::-webkit-scrollbar{display:none}
html body .ag-filters label{flex:none;display:inline-flex;align-items:center;gap:8px;min-height:44px;margin:0;padding:0 14px;border:1px solid var(--line,#dce6e2);border-radius:999px;background:var(--surface,#fff);color:var(--ink,#18332d);font-size:14.5px;font-weight:700;white-space:nowrap;box-shadow:var(--shadow-s,none)}
.ag-f-lbl{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
html body .ag-filters select{width:auto;min-width:0;height:auto;margin:0;padding:0 20px 0 0;border:0;background-color:transparent;box-shadow:none;color:inherit;font-size:14.5px;font-weight:700}
html body .ag-filters input[type=checkbox]{width:20px;height:20px;margin:0;padding:0;flex:none}
html body .ag-filters label.on{background:color-mix(in srgb,var(--brand,#1e6654) 14%,var(--surface,#fff));border-color:var(--brand,#1e6654);color:var(--brand,#1e6654)}
html.aurora[data-theme=dark] body .ag-filters label.on{color:color-mix(in srgb,var(--brand2,#34a186) 55%,#fff)}

/* Période : précédent / titre / suivant sur une ligne */
html body .ag-nav{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;margin:4px 0 16px}
html body .ag-nav h2{margin:0;font-size:17px;line-height:1.2;text-align:center}
html body .ag-nav .btn{min-height:46px;padding:0 14px;border-radius:14px;font-size:14.5px;font-weight:800;white-space:nowrap}

/* Une journée = une pastille de date à gauche, les rendez-vous à droite */
html body .ag-day{display:grid;grid-template-columns:62px minmax(0,1fr);column-gap:12px;align-items:start;margin:0 0 14px}
html body .ag-day h3{display:flex;flex-direction:column;align-items:center;gap:6px;margin:0;font-size:0}
.ag-dbadge{display:flex;flex-direction:column;align-items:center;justify-content:center;width:62px;padding:9px 0 8px;border-radius:18px;background:var(--surface,#fff);border:1px solid var(--line,#dce6e2);box-shadow:var(--shadow-s,0 1px 4px rgba(0,0,0,.06));line-height:1}
.ag-dbadge small{font-size:11.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#5d766f)}
.ag-dbadge b{margin:4px 0 3px;font-size:27px;font-weight:900;color:var(--ink,#18332d)}
.ag-day.is-today .ag-dbadge{background:linear-gradient(160deg,var(--brand2,#34a186),var(--brand,#1e6654));border-color:transparent;box-shadow:0 8px 18px color-mix(in srgb,var(--brand,#1e6654) 35%,transparent)}
.ag-day.is-today .ag-dbadge small,.ag-day.is-today .ag-dbadge b{color:#fff}
.ag-day.is-past .ag-dbadge{opacity:.72}
.ag-dtext{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
html body .ag-day h3 .ag-today{font-size:10.5px;padding:3px 6px;line-height:1.1;white-space:nowrap}
html body .ag-list{gap:10px;min-width:0}

/* Une carte de rendez-vous : heure, pastille de réponse, titre, détails */
html body .ag-item{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"time badge" "body body";gap:5px 8px;align-items:center;padding:12px 14px 13px;border-radius:18px;border:1px solid var(--line,#dce6e2);border-left:6px solid var(--c,var(--brand,#1e6654));box-shadow:var(--shadow-s,0 2px 8px rgba(24,51,45,.05));transform:none!important}
html body .ag-item .ag-time{grid-area:time;display:flex;align-items:center;gap:7px;font-size:14px;font-weight:800;color:color-mix(in srgb,var(--c,#2e7d68) 70%,var(--ink,#18332d))}
html body .ag-item .ag-time::before{content:"";flex:none;width:9px;height:9px;border-radius:50%;background:var(--c,var(--brand,#1e6654))}
html body .ag-item .ag-body{grid-area:body;gap:3px}
html body .ag-item .ag-body b{font-size:17.5px;line-height:1.25;overflow-wrap:anywhere}
html body .ag-item .ag-body small{font-size:14px;line-height:1.35}
html body .ag-item .ag-badge{grid-area:badge;justify-self:end;padding:5px 11px;font-size:12.5px}
html body .ag-item.ag-room{--c:#9aa9a5}

/* Vue « Mois » : vraie grille de calendrier + liste des rendez-vous dessous */
html body .ag-month{border-spacing:3px;width:calc(100% + 6px);margin:0 -3px 4px}
html body .ag-month th{padding:2px 0 4px;font-size:11.5px;text-align:center;letter-spacing:.04em;background:transparent!important;border:0!important}
html body .ag-month .ag-chip{width:9px;height:9px;margin:2px 1.5px}
html body .ag-month td{height:58px;padding:4px 1px 2px;border-radius:12px;text-align:center;vertical-align:top;overflow:hidden}
html body .ag-month td.today{border:1.5px solid var(--brand,#1e6654)}
html body .ag-daynum{display:grid;place-items:center;width:30px;height:30px;margin:0 auto 2px;border-radius:50%;font-size:15px}
html body .ag-month td.today .ag-daynum{background:var(--brand,#1e6654);color:#fff}
html body .ag-month .ag-more{display:block;font-size:11px;line-height:1.1;white-space:nowrap}
.ag-more-txt{display:none}
.ag-monthlist{display:block;margin-top:16px}
.ag-monthlist h2{margin:0 0 12px;font-size:18px}
.ag-empty-line{margin:0 0 12px;padding:16px;border:1px dashed var(--line,#dce6e2);border-radius:16px;text-align:center;color:var(--muted,#5d766f)}
html body .ag-empty{padding:34px 16px}

/* ================= EN-TÊTES DE PAGE (toutes les pages) ================= */
/* Un bouton placé dans l'en-tête (« ← Accueil », « Importer… ») passe sous le titre au lieu de le recouvrir */
html body .page-header:not(.maintenance-header){flex-wrap:wrap!important;align-items:flex-start!important;row-gap:10px!important}
html body .page-header:not(.maintenance-header)>div:first-child{flex:1 1 100%!important}
html body .page-header:not(.maintenance-header)>.btn{flex:0 0 auto;width:auto!important;min-height:46px;padding:0 18px!important;border-radius:14px!important;font-size:15px!important}
html body .page-header.ag-head>.hero-add-btn{width:100%!important;flex:1 1 100%;min-height:52px;font-size:15.5px!important;border-radius:16px!important}
html body .page-header>.hero-add-btn::after{content:none!important}

/* Comptes rendus : filtres en deux colonnes */
html body .min-filters{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(0,1fr);gap:10px 12px;align-items:end;margin:0 0 14px}
html body .min-filters label{min-width:0;margin:0;font-size:13.5px;font-weight:800}
html body .min-filters select,html body .min-filters input{width:100%;min-height:48px;font-size:16px}
html body .min-filters .min-search{grid-column:1/-1}
html body .min-filters>.btn{grid-column:1/-1;min-height:48px;border-radius:14px;font-size:15px}

/* Assistant « Nouvel événement » : les étapes tiennent sur une seule ligne */
html body .ag-steps{flex-wrap:nowrap;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -14px 12px;padding:2px 14px 4px}
html body .ag-steps li{flex:none}
html body .ag-steps li:not(.cur) button{padding:4px;gap:0;min-width:44px;min-height:44px;justify-content:center}
html body .ag-steps li.cur button{padding:4px 14px 4px 4px;min-height:44px}
html body .ag-steps .n{width:34px;height:34px;font-size:15px}

/* ================= SIGNALEMENTS ================= */
html body .app-main.maintenance-main{padding-top:14px!important}
html body .maintenance-main .page-header{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:10px!important;margin:0 0 12px!important}
html body .maintenance-main .page-header .eyebrow{display:block!important;margin:0;font-size:12px;letter-spacing:.09em}
html body .maintenance-main .page-header h1{margin:2px 0 0!important;font-size:28px!important;line-height:1.1}
html body .maintenance-main .page-header .muted{display:block!important;margin:4px 0 0;font-size:14.5px!important;font-weight:500!important;color:var(--muted,#5d766f)}
html body .maintenance-main .header-actions{display:flex!important;flex-wrap:nowrap!important;gap:10px;width:100%!important}
html body .maintenance-main .header-actions .btn{flex:1 1 0;min-width:0;min-height:50px;width:auto!important;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 10px!important;border-radius:16px!important;font-size:14.5px!important;font-weight:800;line-height:1.15;text-align:center;aspect-ratio:auto!important}
html body .maintenance-main .header-actions .hero-add-btn{flex:1.5 1 0}
html body .maintenance-main .hero-add-btn::after{content:none!important}

/* Filtres de statut : pastilles qui passent à la ligne (rien ne dépasse de l'écran), l'onglet actif en couleur */
html body .ticket-filters{display:flex!important;flex-wrap:wrap;position:static!important;gap:8px!important;overflow:visible!important;margin:0 0 10px!important;padding:2px 0!important;background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.ticket-filters::-webkit-scrollbar{display:none}
html body .ticket-filters a{flex:1 1 auto;justify-content:center;display:inline-flex!important;align-items:center;gap:4px;min-height:44px!important;padding:0 12px!important;border:1px solid var(--line,#dce6e2)!important;border-radius:999px!important;background:var(--surface,#fff)!important;box-shadow:var(--shadow-s,none)!important;color:var(--ink,#18332d)!important;font-size:14.5px!important;font-weight:800;white-space:nowrap}
html body .ticket-filters a.active{background:var(--brand,var(--primary,#1e6654))!important;border-color:transparent!important;color:#fff!important}

/* Équipe : un seul bloc à trois choix */
html body .team-filters{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px!important;margin:0 0 12px!important;padding:4px!important;overflow:visible!important;border:1px solid var(--line,#dce6e2)!important;border-radius:16px!important;background:var(--surface2,#eef3f1)!important;box-shadow:none!important}
html body .team-filters a{display:flex!important;align-items:center;justify-content:center;gap:4px;min-height:44px!important;padding:4px 2px!important;border:0!important;border-radius:12px!important;background:transparent!important;color:var(--ink,#18332d)!important;font-size:14.5px!important;font-weight:800;box-shadow:none!important}
html body .team-filters a.active{background:var(--brand,var(--primary,#1e6654))!important;color:#fff!important}
.team-filters a:nth-child(2)::before{content:"🛠️"}.team-filters a:nth-child(3)::before{content:"🧹"}

/* Recherche */
html body .ticket-search{min-height:50px;margin:0 0 12px;padding:0 14px;border-radius:16px;background:var(--surface,#fff);box-shadow:var(--shadow-s,none)}
html body .ticket-search>span{font-size:20px;color:var(--muted,#5d766f)}
html body .ticket-search input{font-size:16px;min-height:48px;padding:0;border:0!important;box-shadow:none!important;background:transparent!important;outline:0}

/* Cartes de signalement lisibles : titre sur deux lignes, lieu, date, état */
html body .ticket-list{display:grid;gap:10px!important}
html body .ticket-swipe{border-radius:20px!important;background:transparent!important}
html body .ticket-swipe .ticket-card{display:grid!important;grid-template-columns:50px minmax(0,1fr) 16px!important;grid-template-areas:"icon copy chev" "icon status chev";gap:4px 12px!important;align-items:center;min-height:0!important;padding:13px 12px 13px 18px!important;border:1px solid var(--line,#dce6e2)!important;border-radius:20px!important;background:var(--surface,#fff);box-shadow:var(--shadow-s,0 5px 16px rgba(24,51,45,.06))!important;overflow:hidden}
html body .ticket-swipe .ticket-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:6px;background:#8fa39d}
html body .ticket-swipe.technical .ticket-card::before{background:#2378bd}
html body .ticket-swipe.cleaning .ticket-card::before{background:#7251a8}
html body .ticket-swipe.p-urgent .ticket-card{background:color-mix(in srgb,#e5484d 8%,var(--surface,#fff))}
html body .ticket-swipe.p-high .ticket-card{background:color-mix(in srgb,#f59e0b 8%,var(--surface,#fff))}
html body .ticket-swipe .ticket-team-icon{grid-area:icon;width:50px;height:50px;border-radius:16px;font-size:25px;align-self:start}
html body .ticket-swipe .ticket-copy{grid-area:copy;min-width:0}
html body .ticket-swipe .ticket-copy b{font-size:16.5px!important;line-height:1.25;white-space:normal;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
html body .ticket-swipe .ticket-copy small{margin-top:4px;font-size:14px!important;line-height:1.3}
html body .ticket-swipe .ticket-copy small::before{content:"📍 "}
html body .ticket-swipe .ticket-copy time{margin-top:3px;font-size:13px!important;color:var(--muted,#5d766f)}
html body .ticket-swipe .status{grid-area:status;justify-self:start;margin-top:3px;padding:5px 11px!important;font-size:12.5px!important;grid-column:2}
html body .ticket-swipe .ticket-chevron{grid-area:chev;align-self:center;font-size:24px;color:var(--muted,#5d766f)}
html body .ticket-card.selected{box-shadow:0 0 0 2px var(--brand,#1e6654)!important}

/* Fiche d'un signalement (plein écran sur téléphone) */
html body.ticket-detail-open .maintenance-layout>section:nth-child(2){bottom:0!important;padding:10px 10px calc(118px + env(safe-area-inset-bottom))!important;background:var(--bg,#eaf1ee)!important}
html body .mobile-detail-back{display:flex;align-items:center;gap:8px;min-height:50px;margin:0 0 10px;padding:0 16px;border-radius:16px;background:linear-gradient(135deg,var(--brand,#1e6654),var(--brand-deep,#0b2f27));color:#fff!important;font-size:15.5px;font-weight:800;box-shadow:var(--shadow-s,none)}
html body .ticket-detail{border:1px solid var(--line,#dce6e2)!important;border-radius:22px!important;background:var(--surface,#fff)!important;box-shadow:var(--shadow-m,none)!important}
html body .ticket-detail-head{display:flex!important;flex-direction:column;gap:8px;padding:16px!important;background:linear-gradient(150deg,color-mix(in srgb,var(--brand2,#34a186) 16%,var(--surface,#fff)),var(--surface,#fff) 75%)!important}
html body .ticket-detail-head .ticket-badges{order:-1;justify-content:flex-start;gap:8px}
html body .ticket-detail-head h2{margin:2px 0 6px;font-size:23px!important;line-height:1.2}
html body .ticket-detail-head small{font-size:13.5px}
html body .ticket-detail-head p{margin:0;font-size:14.5px;line-height:1.4;color:var(--muted,#5d766f)}
html body .ticket-badges .status,html body .ticket-badges .prio{padding:6px 12px!important;font-size:13px!important}
html body .ticket-description{padding:16px!important;font-size:16.5px!important;line-height:1.55}
html body .ticket-photos{padding:0 16px 14px}
html body .quick-actions{padding:14px 16px;gap:10px}
html body .quick-actions .btn{min-height:50px;border-radius:16px;font-size:15.5px}
html body .quick-actions .finish-form input{min-height:50px;font-size:16px;border-radius:14px}
html body .management-details>summary{min-height:50px;display:flex;align-items:center;padding:0 16px;font-size:15px}
html body .management-box,html body .comment-box{padding:14px 16px!important;gap:12px!important}
html body .management-box label,html body .comment-box label{font-size:14px!important;font-weight:800;gap:6px}
html body .comment-box input[type=file]{width:100%;padding:7px 8px;font-size:13px;border:1px dashed var(--line,#c8d8d2);border-radius:14px;background:var(--surface,#fff)}
html body .comment-box input[type=file]::file-selector-button{margin-right:8px;padding:9px 11px;border:0;border-radius:12px;background:color-mix(in srgb,var(--brand,#1e6654) 14%,var(--surface,#fff));color:var(--brand,#1e6654);font-weight:800;font-size:13px}
html body .timeline{padding:16px!important}
html body .timeline h3{font-size:17px!important}
html body .timeline p{font-size:15px!important;line-height:1.45}
html body .timeline b{font-size:15px}
html body .timeline small{font-size:13px}
html body .ticket-delete-box{padding:14px 16px!important}

/* Rien de sélectionné : pas de grand cadre vide sous la liste */
html body .maintenance-layout>section:nth-child(2):has(>.ticket-placeholder){display:none}
html body .ticket-placeholder{display:none}
}

/* Tablette : les signalements passent déjà sur une colonne en dessous de 1000px */
@media (max-width:1000px){
html body .ticket-placeholder{display:none}
}

/* ---------- Agenda : le haut reste en place, seuls les rendez-vous défilent ---------- */
.ag-long{display:inline}
.ag-short{display:none}
@media (max-width:920px){
.ag-long{display:none}
/* le corps de page ne doit pas être un conteneur de défilement, sinon rien ne peut rester collé en haut */
html body.ag-page{overflow-x:clip!important;overflow-y:visible!important}
html body .ag-main .ag-top{position:sticky;top:0;z-index:40;margin:-18px -14px 12px;padding:max(10px,env(safe-area-inset-top)) 14px 6px;background:color-mix(in srgb,var(--bg,#f4f8f6) 95%,transparent);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-bottom:1px solid var(--line,#dce6e2);box-shadow:0 6px 16px rgba(16,36,31,.06)}
/* titre à gauche, boutons à droite : une seule ligne */
html body .ag-main .ag-top .page-header.ag-head{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:10px!important;margin:0 0 8px!important}
html body .ag-main .ag-top .page-header.ag-head>div:first-child{flex:1 1 auto!important;min-width:0}
html body .ag-main .ag-top .ag-head .eyebrow{display:none!important}
html body .ag-main .ag-top .ag-head h1{margin:0!important;font-size:25px!important;white-space:nowrap}
html body .ag-main .ag-top .ag-head .header-actions{flex:0 0 auto;width:auto!important;gap:8px}
html body .ag-main .ag-top .ag-head .header-actions .btn{flex:0 0 auto;min-height:46px;padding:0 14px!important;font-size:15px!important}
html body .ag-main .ag-top .ag-head .header-actions .ag-btn-phone{width:46px!important;padding:0!important;font-size:20px!important}
html body .ag-main .ag-top .ag-views{margin:0 0 8px}
html body .ag-main .ag-top .ag-views a{min-height:42px}
html body .ag-main .ag-top .ag-filters{margin:0 -14px 4px;padding:0 14px 6px}
html body .ag-main .ag-top .ag-filters label{min-height:40px}
html body .ag-main .ag-top .ag-nav{margin:0 0 2px}
html body .ag-main .ag-top .ag-nav .btn{min-height:42px}
html body .ag-main .ag-top .ag-nav h2{font-size:16px}
html body .ag-main .ag-scroll{padding-top:6px}
}

/* ---------- Agenda : haut encore plus compact ---------- */
@media (max-width:920px){
.ag-short{display:inline}
html body .ag-main .ag-top{padding-top:max(6px,env(safe-area-inset-top));padding-bottom:4px;margin-bottom:8px}
html body .ag-main .ag-top .page-header.ag-head{margin:0 0 6px!important}
html body .ag-main .ag-top .ag-head h1{font-size:23px!important}
html body .ag-main .ag-top .ag-head .header-actions .btn{min-height:40px;font-size:14px!important;padding:0 12px!important;border-radius:13px!important}
html body .ag-main .ag-top .ag-head .header-actions .ag-btn-phone{width:40px!important;font-size:18px!important}
html body .ag-main .ag-top .ag-views{margin:0 0 6px;padding:3px;border-radius:15px}
html body .ag-main .ag-top .ag-views a{min-height:36px;font-size:13.5px;border-radius:12px}
/* filtres : pastilles basses, cases masquées (la pastille se colore quand le filtre est actif) */
html body .ag-main .ag-top .ag-filters{margin:0 -14px 4px;padding:0 14px 4px;gap:6px}
html body .ag-main .ag-top .ag-filters label{min-height:34px;padding:0 11px;gap:5px;font-size:13px;box-shadow:none}
html body .ag-main .ag-top .ag-filters select{font-size:13px!important;padding:0 16px 0 0!important;min-height:0!important;height:auto!important;line-height:1.2}
html body .ag-main .ag-top .ag-filters input[type=checkbox]{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
html body .ag-main .ag-top .ag-filters label.on.ag-f-chk{font-weight:800}
/* période : flèches rondes + titre sur une ligne */
html body .ag-main .ag-top .ag-nav{grid-template-columns:auto minmax(0,1fr) auto;gap:6px;margin:0}
html body .ag-main .ag-top .ag-nav .btn{min-height:34px;min-width:44px;padding:0 12px;font-size:20px;line-height:1;border-radius:999px}
html body .ag-main .ag-top .ag-nav h2{font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body .ag-main .ag-top .ag-filters select{width:auto!important;max-width:100px;text-overflow:ellipsis}
html body .ag-main .ag-top .ag-filters label{padding:0 8px;gap:3px}
html body .ag-main .ag-top .ag-filters select{padding-right:14px!important}
html body .ag-main .ag-top .ag-filters{gap:5px}
}

/* Comptes rendus : réunions à documenter (vice-président) */
html body .min-live{margin:0 0 18px}
html body .min-live h2{margin:0 0 10px;font-size:20px}

@media (max-width:920px){
html body .ag-item .ag-side{grid-area:badge;justify-self:end}
html body .ag-item .ag-side .ag-badge{justify-self:auto}
html body .ag-item .ag-side:has(.ag-who-row) .ag-badge{grid-area:badge;justify-self:end}
html body .ag-item .ag-who-row{grid-area:auto;grid-column:1/-1;justify-self:start}
}
@media (max-width:520px){
html body .ag-item:has(.ag-who){grid-template-areas:"time badge" "body body" "who who"}
html body .ag-item .ag-side{display:contents}
html body .ag-item .ag-side .ag-badge{grid-area:badge;justify-self:end}
html body .ag-item .ag-who{grid-area:who;justify-self:start;margin-top:2px}
html body .home-card .ag-item .ag-side{display:inline-flex}
}
