:root{--bg:#0e1b2a;--bg2:#10243a;--panel:#13273f;--line:#26435f;--txt:#e9f1ff;--muted:#90a6be;--brand:#9bd1ff;--accent:#1e9eff}
*{box-sizing:border-box} html,body{height:100%}
body{margin:0;font-family:Roboto,system-ui,-apple-system,Segoe UI,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--txt)}
a{color:var(--brand);text-decoration:none} a:hover{text-decoration:underline}
.container-auth{min-height:100vh;display:grid;place-items:center;padding:2rem}
.card{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:1rem}
.card-title{font-weight:700;margin-bottom:.5rem}
label{display:block;font-weight:700;margin:.5rem 0 .25rem}
input[type="text"],input[type="email"],input[type="password"],input[type="date"],select{width:100%;padding:.65rem .75rem;border:1px solid var(--line);border-radius:8px;background:#0c1a2a;color:#e9f1ff}
.btn{background:var(--accent);border:0;color:#001424;padding:.6rem 1rem;border-radius:8px;cursor:pointer}
.topbar{height:56px;display:flex;align-items:center;justify-content:space-between;padding:0 1rem;border-bottom:1px solid var(--line);background:var(--bg2);position:sticky;top:0;z-index:5}
.topbar .brand a{font-weight:700;color:#fff} .topbar .sep{color:var(--muted)}
.layout{display:grid;grid-template-columns:260px 1fr;min-height:calc(100vh - 56px)}
.sidebar{border-right:1px solid var(--line);background:linear-gradient(180deg,#0f2237,#0d1e31)}
.sb-scroll{height:100%;overflow:auto;padding:1rem .75rem}
.sb-section{margin-bottom:1rem}
.sb-title{font-size:16px;text-transform:uppercase;color:var(--muted);margin:.25rem .5rem .5rem}
.sb-link{display:block;padding:.45rem .6rem;border-radius:8px;color:#e9f1ff} .sb-link:hover{background:#12314f}
.content{padding:1.2rem}
.cards-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:1rem}
.kpi{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:1rem}
.kpi-hero{font-size:2rem;font-weight:700}
.kpi-sub{color:var(--muted);margin-top:.3rem}
.kpi-note{grid-column:1/-1}
.alert{background:#5a1a1a;border:1px solid #9e2b2b;padding:.7rem;border-radius:6px;margin:1rem 0}
@media (max-width:760px){.layout{grid-template-columns:1fr}.sidebar{display:none}}

/* fine-tune settings form */
.settings-form label{font-weight:700;margin-top:.6rem;display:block}
.muted{opacity:.85}

/* simple table blocks */
.table{display:block}
.tr{display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:.5rem;padding:.25rem 0;border-bottom:1px solid rgba(255,255,255,.08)}
.tr .th{font-weight:700}
.tr .td,.tr .th{padding:.2rem .1rem}
.cards-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}
.kpi .kpi-val{font-size:1.6rem;font-weight:800}
.kpi .kpi-label{opacity:.9;margin-top:.25rem}
/* Companies page */
.vertical label{display:block;margin:.4rem 0 .2rem}
.vertical input, .vertical textarea{width:100%}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media(max-width:960px){ .grid-3{grid-template-columns:1fr} }

/* === Companies form tune === */
.settings-form label{display:block;margin:.45rem 0 .25rem;font-weight:700}
.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="tel"],
.settings-form input[type="file"],
.settings-form textarea,
.settings-form select{
  width:100%;
  background:#fff !important; /* evita input blu scuri */
  color:#0a0a0a;
  border:1px solid rgba(0,0,0,.15);
  border-radius:8px;
  padding:.55rem .7rem;
  box-sizing:border-box;
}
.settings-form input[type="file"]{ padding:.35rem; }
.settings-form .card-actions{ margin-top:.8rem }

/* === DMP: dark inputs (Companies & Settings) === */
.dmp-dark-form .dmp-input{
  background:#0f2235; color:#fff;
  border:1px solid #15324d; border-radius:6px;
  padding:.55rem .7rem; outline:none; width:100%;
}
.dmp-dark-form .dmp-input::placeholder{ color:#b7c7d8; opacity:.85; }
.dmp-dark-form label{ font-weight:700; margin:.45rem 0 .25rem; display:block; }
.dmp-dark-form .btn{ padding:.55rem 1.0rem; }

/* === LOCATIONS (dark form) === */
.card .vertical input,
.card .vertical select,
.card .vertical textarea {
  background:#0f2437!important; color:#fff!important; border:1px solid rgba(255,255,255,.08); border-radius:8px;
}
.card .vertical input::placeholder{ color:#9db4cc; opacity:.9 }
.table-wrap{ overflow:auto }
.btn-danger{ background:#b33a3a; color:#fff; }

/* === LOCATIONS (dark form) === */
.card .vertical input,
.card .vertical select,
.card .vertical textarea { background:#0f2437!important; color:#fff!important; border:1px solid rgba(255,255,255,.08); border-radius:8px; }
.card .vertical input::placeholder{ color:#9db4cc; opacity:.9 }
.table-wrap{ overflow:auto }

/* === LOCATIONS UI v3 === */
.vertical input, .vertical select, .vertical textarea { min-height:44px; padding:.55rem .7rem; border-radius:8px; }
.vertical input[type="time"] { min-height:38px; }

.table-lined thead th { border-bottom:1px solid rgba(255,255,255,.12); }
.table-lined tbody td { border-top:1px solid rgba(255,255,255,.06); }
.table-actions { white-space:nowrap; }
.table-actions .icon, .btn.btn-icon, .table-actions button.icon {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:36px; min-height:36px; border-radius:8px; text-decoration:none;
}
.table-actions button.icon { background:transparent; border:none; cursor:pointer; }

.card-actions { display:flex; align-items:center; justify-content:space-between; }
.card-actions .actions-right .btn-icon { margin-left:.4rem; }

/* Drawer */
.drawer-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:4000; }
.drawer { position:absolute; right:0; top:0; height:100%; width:min(560px,100%); background:#0f2231; box-shadow:-12px 0 28px rgba(0,0,0,.45); display:flex; flex-direction:column; }
.drawer-head { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid rgba(255,255,255,.08); }
.drawer-title { font-weight:700; }
.drawer-close { font-size:28px; line-height:1; text-decoration:none; }
.drawer-body { padding:16px; overflow:auto; }
.divider { height:1px; background:rgba(255,255,255,.08); margin:.6rem 0; }
.card-subtitle { font-weight:700; opacity:.9; }


/* === P3 LOCATIONS V4 === */
.table.lined thead th{border-bottom:1px solid rgba(255,255,255,.12)}
.table.lined td{border-top:1px solid rgba(255,255,255,.06)}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;border-radius:10px;padding:0 .4rem;border:1px solid rgba(255,255,255,.15);background:transparent;color:#e7f0ff;text-decoration:none}
.icon-btn.sm{min-width:30px;height:30px;border-radius:8px;font-size:.95rem}
.icon-btn.ghost{background:transparent;border-color:transparent}
.icon-btn.danger{border-color:rgba(255,88,88,.35);color:#ffb3b3}
.icon-btn:hover{background:rgba(255,255,255,.07)}

.drawer{position:fixed;top:72px;right:0;width:520px;max-width:95vw;height:calc(100vh - 84px);background:rgba(72,102,138,.35);backdrop-filter:blur(8px);box-shadow:-6px 0 20px rgba(0,0,0,.35);border-left:1px solid rgba(255,255,255,.08);transform:translateX(100%);transition:transform .25s ease;z-index:50}
.drawer.open{transform:translateX(0)}
.drawer-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.08)}
.drawer-title{font-weight:700}
.drawer-body{padding:16px;overflow:auto;height:calc(100% - 60px)}
.subcard{margin-top:12px;padding:12px;border:1px solid rgba(255,255,255,.08);border-radius:12px;background:rgba(0,0,0,.15)}
.subcard-title{font-weight:700;margin-bottom:6px;opacity:.95}

/* dark inputs like Settings */
.vertical input, .vertical select, .vertical textarea{
  background:#0f2136;border:1px solid rgba(255,255,255,.14);color:#e7f0ff;height:42px;border-radius:10px;
}
.vertical textarea{min-height:84px}
.vertical label{color:#cfe0ff}

/* === P3 LOCATIONS V5 === */
/* Excel-like export icon */
.ic-excel{display:inline-block;width:18px;height:18px;vertical-align:-3px;border-radius:3px;background:#107c41;position:relative;box-shadow:0 0 0 1px rgba(0,0,0,.25) inset}
.ic-excel:before{content:"X";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-weight:800;font-size:12px;color:#eafff3;letter-spacing:.5px}

/* Drawer slide-in animation */
@keyframes dmp-slide-in-right { from{ transform:translateX(100%); opacity:.0 } to{ transform:translateX(0); opacity:1 } }
.drawer{ transform:translateX(100%); opacity:.0; transition:none }
.drawer.open{ animation:dmp-slide-in-right .28s ease forwards }

/* Main table look: full width + bordered cells */
.table.wide{ width:100%; table-layout:fixed }
.table.bordered{ border-collapse:collapse }
.table.bordered th, .table.bordered td{ border:1px solid rgba(255,255,255,.14) }
.table.bordered thead th{ background:rgba(255,255,255,.05) }

/* Inputs/time pickers: altezza uniforme (come Company Setup) */
.vertical input[type="time"]{ height:42px; background:#0f2136; border:1px solid rgba(255,255,255,.14); color:#e7f0ff; border-radius:10px; padding:0 .6rem }
.vertical label{ color:#cfe0ff }

/* Icon button minor tweaks */
.icon-btn{ gap:.25rem }

/* === P3 LOCATIONS FULLWIDTH === */
.card .table.full{ width:100%; display:table; table-layout:fixed; }
.card .table.full th, .card .table.full td{ border:1px solid rgba(255,255,255,.14); }
.card .table.full th{ background:rgba(255,255,255,.05); }
.card .table.full td, .card .table.full th{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* === DMP P3 LOCATIONS v2 (real <table>): hide 'Code' & font tune === */
/* 1) Nasconde la 3ª colonna (header + celle) nella tabella Locations */
#locations-list table.locations-table th:nth-child(3),
#locations-list table.locations-table td:nth-child(3) {
  display: none !important;
}

/* 2) Font leggermente più compatto, coerente con i form */
#locations-list table.locations-table th,
#locations-list table.locations-table td {
  font-size: 0.90rem !important;
  line-height: 1.25rem !important;
}
/* ================================================================== */

/* DMP_P3_LOCATIONS_CSS_ONLY_START
   Scope: pagina Locations
   Heuristics di selezione (senza cambiare HTML):
   - .content > .card (il box principale) con questa sequenza: .card-title + .muted + .actions-bar + .table-wrap > table.table.lined.bordered.wide.full
   - Prima colonna ha <td class="nowrap"> con <a class="icon-btn sm ...">
*/

/* 1) Azioni: rimuovi bordo, bg e box-shadow alle icon-btn "sm" in prima colonna */
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full tbody td.nowrap a.icon-btn.sm,
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full tbody td.nowrap a.icon-btn.sm.danger{
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  min-width: auto !important;
  height: auto !important;
  padding: 0 .25rem !important;
}

/* Mantieni le icone allineate orizzontalmente e senza “pill” */
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full tbody td.nowrap{
  white-space: nowrap !important;
}

/* 2) Tipografia celle: leggermente più compatta (in linea con Company Setup) */
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full th,
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full td{
  font-size:16px !important;
  line-height: 1.30 !important;
}

/* DMP_P3_LOCATIONS_CSS_ONLY_END */
/* DMP_P3_LOCATIONS_HIDE_CODE_START
   Locations page: hide "Code" (3rd column) in the main table,
   without touching other pages/tables. Scope via exact DOM chain. */
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full thead th:nth-child(3),
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full tbody td:nth-child(3){
  display:none !important;
}
/* opzionale: evita spazi vuoti residui */
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full{
  table-layout:auto !important;
}
/* DMP_P3_LOCATIONS_HIDE_CODE_END */

/* DMP P3 ROOMS UI */
.table-actions{white-space:nowrap}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;border-radius:8px;padding:0 .35rem;border:1px solid rgba(255,255,255,.14);background:transparent;color:#e7f0ff;text-decoration:none}
.icon-btn.sm{min-width:28px;height:28px;border-radius:7px;font-size:.95rem}
.icon-btn.danger{border-color:rgba(255,88,88,.35);color:#ffb3b3}
.icon-btn:hover{background:rgba(255,255,255,.08)}
.actions-bar{display:flex;gap:.5rem;margin-bottom:.75rem}

/* Drawer (maschera a scomparsa) */
.drawer-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);backdrop-filter:saturate(60%) blur(2px);opacity:0;pointer-events:none;transition:.18s}
.drawer{position:fixed;top:0;right:-480px;height:100vh;width:min(460px,92vw);background:#0b1220;border-left:1px solid rgba(255,255,255,.12);box-shadow:-4px 0 18px rgba(0,0,0,.35);transition:right .22s}
.drawer.open{right:0}
.drawer-overlay.open{opacity:1;pointer-events:auto}
.drawer .head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.12)}
.drawer .body{padding:16px}

/* === DMP P3 ROOMS: group row per Location === */
#rooms-list .group-row .td{
  font-weight:700;
  background:rgba(255,255,255,.06);
  border-top:1px solid rgba(255,255,255,.12);
  padding:8px 10px;
}

/* === DMP DRAWER BASE (Rooms/Locations) === */
.drawer-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:9998;
}
.drawer{
  position:fixed; top:0; bottom:0; right:-480px; width:420px;
  background:#0b1220; border-left:1px solid rgba(255,255,255,.12);
  box-shadow:-6px 0 20px rgba(0,0,0,.4); z-index:9999;
  transition:right .25s ease;
  display:flex; flex-direction:column;
}
.drawer.open{ right:0; }
.drawer.right{ right:-480px; }
.drawer-head{ padding:14px 16px; border-bottom:1px solid rgba(255,255,255,.1); display:flex; align-items:center; justify-content:space-between;}
.drawer-title{ font-weight:700; }
.drawer-close{ text-decoration:none; font-size:24px; line-height:1; color:#e2e8f0; }
.drawer-close:hover{ opacity:.85; }
.drawer-body{ padding:16px; overflow:auto; }

/* group row stile (già usato) */
#rooms-list .group-row .td{
  font-weight:700; background:rgba(255,255,255,.06);
  border-top:1px solid rgba(255,255,255,.12); padding:8px 10px;
}

/* --- Fix priorità: il drawer aperto deve vincere su .drawer.right --- */
.drawer.right.open{ right:0 !important; }

/* DMP DRAWER CSS */
.drawer{position:fixed;top:64px;right:-420px;width:400px;max-width:96vw;height:calc(100vh - 72px);background:#0b1220;border-left:1px solid rgba(255,255,255,.12);box-shadow:-8px 0 24px rgba(0,0,0,.35);transition:right .25s ease;padding:16px;z-index:50;overflow:auto;border-radius:12px 0 0 0}
.drawer.open{right:0}
.drawer-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.drawer .drawer-actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:12px}

/* DMP DRAWER CSS */
.drawer{position:fixed;top:64px;right:-420px;width:400px;max-width:96vw;height:calc(100vh - 72px);background:#0b1220;border-left:1px solid rgba(255,255,255,.12);box-shadow:-8px 0 24px rgba(0,0,0,.35);transition:right .25s ease;padding:16px;z-index:50;overflow:auto;border-radius:12px 0 0 0}
.drawer.open{right:0}
.drawer-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.drawer .drawer-actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:12px}

/* DMP P3 USERS UI v2 */
.drawer input[type=checkbox]{
  width:16px; height:16px; vertical-align:middle;
}
.icon-btn.sm{ min-width:30px; height:30px; border-radius:8px; }
.icon-btn.ghost{ background:transparent; border-color:transparent; }
/* DMP P3 USERS UI v2 */
.drawer input[type=checkbox]{ width:16px; height:16px; vertical-align:middle; }
.icon-btn.sm{ min-width:30px; height:30px; border-radius:8px; }
.icon-btn.ghost{ background:transparent; border-color:transparent; }
/* DMP P3 USERS ROOMS-STYLE */
.drawer input[type=checkbox]{ width:16px; height:16px; vertical-align:middle; }
.icon-btn.sm{ min-width:30px; height:30px; border-radius:8px; }

/* DMP P3 USERS ROOMS-MATCH */
.table .td-head{
  font-weight:600;
  opacity:.9;
  background:rgba(255,255,255,.05);
  padding:.55rem 1rem;
  border-radius:.35rem;
}
.icon-btn, .btn.icon, .icon-btn.sm{
  border:1px solid rgba(255,255,255,.18);
  border-radius:.45rem;
  padding:.25rem .45rem;
}
/* DMP P3 USERS FOLLOWUP */
#drawer-users .drawer-head a,
aside#drawer-users .drawer-head a{
  color:#fff !important;
  background:transparent !important;
  border:1px solid rgba(255,255,255,.28) !important;
  padding:.15rem .35rem !important;
  border-radius:.4rem !important;
  font-size:16px !important;
  line-height:1 !important;
}
#drawer-users .drawer-head a:hover{ background:rgba(255,255,255,.06)!important; }

/* ===========================================================
 * P4_USERS_ROWHEIGHT_CSS — aumenta altezza righe in Users per allinearle a Rooms
 * Target mirato: solo la tabella sotto .users-table-wrap
 * =========================================================== */
.users-table-wrap > table.table.lined.bordered.wide.full thead th,
.users-table-wrap > table.table.lined.bordered.wide.full tbody td{
  padding: 0.60rem 0.75rem;   /* come Rooms */
  line-height: 1.35;
}
/* Mantieni dimensioni dei bottoni azione coerenti */
.users-table-wrap a.icon-btn.sm{
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
}

/* P4_USERS_ROWHEIGHT_CSS */

/* ======================== P4_ROOMS_GROUP_FULLWIDTH_V6 =========================
 * Rooms: i browser spostano <div class="tr"> fuori dal <table>.
 * Agganciamo quindi il wrapper #rooms-list per forzare la riga di gruppo
 * ad 1 colonna e farle occupare 100% della larghezza.
 * ============================================================================ */
#rooms-list .tr.group-row{
  display: grid !important;
  grid-template-columns: 1fr !important;   /* 1 sola colonna */
}
#rooms-list .tr.group-row .td{
  grid-column: 1 / -1 !important;          /* occupa tutta la griglia */
  width: 100% !important;
  max-width: 100% !important;
}
/* Opzionale: applica l'aspetto "header" all'intera riga e neutralizza la pill */
#rooms-list .tr.group-row{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 8px !important;
}
#rooms-list .tr.group-row .td.td-head{
  background: transparent !important;
  border: 0 !important;
  padding: 6px 8px !important;
}
/* ====================== /P4_ROOMS_GROUP_FULLWIDTH_V6 ====================== */

/* ======================== P4_USERS_MATCH_ROOMS_STYLE_V1 =======================
 * Allinea la vista Users allo stile Rooms
 * Target: solo la tabella Users usando il wrapper .users-table-wrap
 * ============================================================================ */

.users-table-wrap > table.table.lined.bordered.wide.full thead th{
  text-align: left !important;              /* (2) label a sinistra */
  background: rgba(255,255,255,.06);        /* (1) evidenziatore thead */
  border-top: 1px solid rgba(255,255,255,.12);
  border-bottom: 1px solid rgba(255,255,255,.10);
  /* niente verticali sul thead */
  border-left: 0 !important;
  border-right: 0 !important;
  padding: .55rem .6rem;
}

/* Solo bordi orizzontali su tutta la tabella (3) */
.users-table-wrap > table.table.lined.bordered.wide.full tbody td{
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
  border-left: 0 !important;
  border-right: 0 !important;
}

/* Raggruppamenti con angoli arrotondati (4) */
.users-table-wrap td.td-head{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 6px 8px;
}

/* Bottoni dell'header (actions bar) stessa misura di Rooms (5) */
.users-table-wrap ~ .nothing{} /* no-op anchor */
.card > .actions-bar a.icon-btn{
  min-width: 38px; height: 38px; border-radius: 10px;
  padding: 0 .4rem;
}

/* Excel: se il tema non colora già la X, forziamo il verde Rooms */
.card > .actions-bar .ic-excel{
  position: relative; display: inline-block;
}
.card > .actions-bar .ic-excel:before{
  content: "X"; font-weight: 700;
  /* verde Rooms */
  color: #22c55e;
}

/* ====================== /P4_USERS_MATCH_ROOMS_STYLE_V1 ====================== */

/* ==================== P4_USERS_HEADERBG_EXCEL_V2_FIX ====================
 * Users thead = Rooms: trasparente, solo bordo basso, label a sinistra.
 * Rende robusto vs eventuali ombre/background di tema.
 * Excel 'X' verde nella actions-bar.
 * ======================================================================= */

.users-table-wrap > table.table.lined.bordered.wide.full thead th{
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  text-align: left !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  padding: .55rem .6rem;
}

/* Togli bordi verticali residui nel body */
.users-table-wrap > table.table.lined.bordered.wide.full tbody td{
  border-left: 0 !important;
  border-right: 0 !important;
}

/* Excel verde in actions-bar (fallback se non definito altrove) */
.card > .actions-bar .ic-excel{
  position: relative; display:inline-block; line-height:1;
}
.card > .actions-bar .ic-excel:before{
  content: "X"; font-weight: 700; color: #22c55e;
}
/* ================= /P4_USERS_HEADERBG_EXCEL_V2_FIX ===================== */

/* ================= P4_LOCATIONS_MATCH_ROOMS_STYLE_V2_SAFE ===================
 * Scopo: fare Locations come Rooms senza toccare markup oltre all'id wrapper.
 * Target: solo dentro #locations-list
 * ========================================================================== */

/* (1) THEAD: label a sx, bg trasparente, solo bordo orizzontale basso */
#locations-list table.locations-table thead th{
  text-align: left !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  padding: .55rem .6rem;
  vertical-align: middle;
}

/* (3) Altezza riga: padding uniforme come Rooms */
#locations-list table.locations-table tbody td{
  padding: .55rem .6rem;
  vertical-align: middle;
}

/* (4) Solo bordi orizzontali (niente verticali) */
#locations-list table.locations-table,
#locations-list table.locations-table tbody td{
  border-left: 0 !important;
  border-right: 0 !important;
}

/* (2) Icone azioni con contorno come Rooms anche se mancano le classi .icon-btn
   Applica stile “pill” ai <a> nella prima colonna */
#locations-list table.locations-table tbody td:first-child a{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:30px;height:30px;border-radius:8px;
  padding:0 .35rem;border:1px solid rgba(255,255,255,.14);
  background:transparent;color:#e7f0ff;text-decoration:none;
  margin-right:.22rem;
}
#locations-list table.locations-table tbody td:first-child a:hover{
  background:rgba(255,255,255,.08);
}
/* Variante delete (se il link contiene ?a=delete…) */
#locations-list table.locations-table tbody td:first-child a[href*="?a=delete"]{
  border-color:rgba(255,88,88,.35);color:#ffb3b3;
}

/* ========================================================================== */
/* ================= /P4_LOCATIONS_MATCH_ROOMS_STYLE_V2_SAFE ================ */

/* ================= P4_LOCATIONS_ROW_ICONS_OUTLINE_V1 =======================
 * Applica il contorno stile Rooms alle icone azione nelle righe di Locations.
 * Selettori robusti + !important per vincere su regole esistenti.
 * ========================================================================== */
#locations-list table.locations-table tbody td:first-child a,
.locations-table-wrap > table.locations-table tbody td:first-child a,
.card .table.locations-table tbody td:first-child a{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 30px !important;
  height: 30px !important;
  border-radius: 8px !important;
  padding: 0 .35rem !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: transparent !important;
  color: #e7f0ff !important;
  text-decoration: none !important;
  margin-right: .22rem !important;
}
#locations-list table.locations-table tbody td:first-child a:hover,
.locations-table-wrap > table.locations-table tbody td:first-child a:hover,
.card .table.locations-table tbody td:first-child a:hover{
  background: rgba(255,255,255,.08) !important;
}
/* Variante 'Delete' con bordo rosso tenue */
#locations-list table.locations-table tbody td:first-child a[href*="?a=delete"],
.locations-table-wrap > table.locations-table tbody td:first-child a[href*="?a=delete"],
.card .table.locations-table tbody td:first-child a[href*="?a=delete"]{
  border-color: rgba(255,88,88,.35) !important;
  color: #ffb3b3 !important;
}
/* ========================================================================== */
/* ================= /P4_LOCATIONS_ROW_ICONS_OUTLINE_V1 ===================== */

/* ================= P4_COMPANY_FULLWIDTH_LABELS_V3 ==========================
 * Company Setup: card full-width + label bianche (target #company-setup)
 * ========================================================================== */
#company-setup{
  width: 100% !important;
  max-width: none !important;
  grid-column: 1 / -1 !important;     /* se il contenitore è grid, occupa tutta la riga */
}
#company-setup .card-content,
#company-setup form{ width: 100% !important; }

/* Label bianche (copertura ampia) */
#company-setup label,
#company-setup .field > label,
#company-setup .form label,
#company-setup .control label,
#company-setup .grid-2 label,
#company-setup .grid-3 label{
  color: #e7f0ff !important;
}
/* ================= /P4_COMPANY_FULLWIDTH_LABELS_V3 ======================== */

/* ============ P4_COMPANY_FULLWIDTH_LABELS_FORCE_V1 ==========================
   Company Setup: card a piena larghezza + label bianche (target #company-setup)
   ========================================================================== */
#company-setup{
  width: 100% !important;
  max-width: none !important;            /* override dell'inline max-width:860px */
  grid-column: 1 / -1 !important;        /* nel caso il contenitore sia grid */
}
#company-setup .card-content,
#company-setup form{ width:100% !important; }

/* Label bianche (coerenza con dark UI) */
#company-setup label,
#company-setup .field > label,
#company-setup .form label,
#company-setup .control label,
#company-setup .grid-2 label,
#company-setup .grid-3 label{
  color:#e7f0ff !important;
}
/* ========================================================================== */
/* ==================== P4_PAYMENTMODES_ROOMS_STYLE_V1 ======================
 * Allinea "Payment Modes" allo stile Rooms:
 * - header descrizione + actions bar già in controller
 * - tabella con header left, solo bordi orizzontali
 * - icone azioni in prima colonna con stile icon-btn (senza toccare il controller)
 * ======================================================================== */

#payment-modes-list .actions-bar { gap:.5rem; }

/* Header left + distanza */
#payment-modes-list table.payments-table thead th{
  text-align:left;
  padding-top:.6rem; padding-bottom:.6rem;
}

/* Solo bordi orizzontali */
#payment-modes-list table.payments-table thead th,
#payment-modes-list table.payments-table tbody td{
  border-top: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Altezza righe coerente con Rooms */
#payment-modes-list table.payments-table tbody td{
  padding-top:.55rem; padding-bottom:.55rem;
}

/* Prima colonna (Actions) un po' più larga e nowrap */
#payment-modes-list table.payments-table thead th:first-child{
  width: 150px; min-width: 150px;
}
#payment-modes-list table.payments-table tbody td:first-child{
  white-space: nowrap;
}

/* Stile "icon-btn" applicato ai link della colonna azioni anche se
 * il controller non aggiunge la classe: li forziamo via scope CSS */
#payment-modes-list table.payments-table tbody td:first-child a{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:30px; height:30px; padding:0 .35rem;
  border-radius:8px; text-decoration:none;
  border:1px solid rgba(255,255,255,.14);
  background:transparent; color:#e7f0ff; margin-right:.25rem;
}
#payment-modes-list table.payments-table tbody td:first-child a:hover{
  background:rgba(255,255,255,.08);
}

/* Variante "danger" se il link contiene delete */
#payment-modes-list table.payments-table tbody td:first-child a[href*="delete"]{
  border-color: rgba(255,88,88,.35);
  color: #ffb3b3;
}

/* Pulsanti Add/CSV già usano .icon-btn; qui solo un piccolo riallineamento */
#payment-modes-list .actions-bar .icon-btn{ min-width:34px; height:34px; }

/* ===================================================================== */
/* ============== P4_PAYMENTMODES_ACTIONS_DRAWER_V2 =========================
   Hardening: se qualche vista legacy stampa una riga "+ New"
   nella colonna Actions, la nascondiamo.
   ============================================ */
#payment-modes-list table.payments-table tbody tr td:first-child a,
#payment-modes-list table.payments-table tbody tr td:first-child button{
  /* lo stile icon-btn è già definito in fogli precedenti */
}
#payment-modes-list table.payments-table tbody tr td:first-child a:has(> span:contains("+ New")),
#payment-modes-list table.payments-table tbody tr td:first-child a:contains("+ New"){
  display:none !important;
}
/* P4_IC_EXCEL_MIN */
.ic-excel{display:inline-block;vertical-align:middle;width:1.1em;height:1.1em;position:relative}
.ic-excel::before{content:"";position:absolute;inset:0;border-radius:2px;background:#166534}
.ic-excel::after{content:"X";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-weight:700;font-size:.75em;color:#fff}
/* /P4_IC_EXCEL_MIN */

/* ===================== P4_TEACHERS_UI_CURRENCY_V2 ===================== */
.input-prefix{ position:relative; display:flex; align-items:center; }
.input-prefix .prefix{ position:absolute; left:10px; pointer-events:none; opacity:.85; font-weight:600; }
.input-prefix input{ padding-left:34px !important; }
/* =================== /P4_TEACHERS_UI_CURRENCY_V2 ===================== */

/* ============ P4_TEACHERS_DRAWER_CSS_SINGLECOL_V1 ============ */
/* Forza la maschera dei Teachers a singola colonna anche se il markup avesse .grid-2/3 */
#teachers-list ~ .drawer .grid-3,
#teachers-list ~ .drawer .grid-2 { grid-template-columns: 1fr !important; gap: 8px !important; }
#teachers-list ~ .drawer .grid-3 > div,
#teachers-list ~ .drawer .grid-2 > div { width: 100% !important; }

/* Niente pulsante Cancel */
#teachers-list ~ .drawer .form-actions a.btn { display: none !important; }

/* Un minimo di ergonomia per l'input costo orario */
#teachers-list ~ .drawer input[name="costo_orario"] { min-width: 140px; }
/* ========== /P4_TEACHERS_DRAWER_CSS_SINGLECOL_V1 ========== */

/* ============== P4_TEACHERS_HOURLY_ICON_V1 ============== */
.input-prefix{display:flex;align-items:center;gap:.5rem}
.input-prefix .cur-icon{
  width:22px;height:22px;border-radius:9999px;
  display:inline-block;line-height:22px;text-align:center;
  font-weight:700;border:1px solid rgba(255,255,255,.18);
  background:#1f2937; /* slate-800 */
}
.input-prefix .cur-icon::before{content:'?';display:inline-block}

/* simboli per valute comuni */
.input-prefix .ic-eur::before{content:'€'}
.input-prefix .ic-usd::before{content:'$'}
.input-prefix .ic-gbp::before{content:'£'}
.input-prefix .ic-jpy::before{content:'¥'}
.input-prefix .ic-chf::before{content:'Fr'}
.input-prefix .ic-generic::before{content:'¤'}
/* ================================== */

/* ============== P4_TEACHERS_HOURLY_ICON_V3 ============== */
.input-prefix{display:flex;align-items:center;gap:.5rem}
.input-prefix .cur-icon{
  width:22px;height:22px;border-radius:9999px;
  display:inline-block;line-height:22px;text-align:center;
  font-weight:700;border:1px solid rgba(255,255,255,.18);
  background:#1f2937;color:#fff;
}
.input-prefix .cur-icon::before{content:'¤'}
.input-prefix .ic-eur::before{content:'€'}
.input-prefix .ic-usd::before{content:'$'}
.input-prefix .ic-gbp::before{content:'£'}
.input-prefix .ic-jpy::before{content:'¥'}
.input-prefix .ic-chf::before{content:'Fr'}
/* ================================== */

/* === P4_EXCEL_ICON_OVERLAP_FIX ===
   Scopo: evitare doppia "X" sovrapposta dell'icona Excel.
   Neutralizziamo la vecchia regola :before (P3) e lasciamo attiva solo la X su ::after (P4). */
.ic-excel:before,
.ic-excel::before{
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  transform: none !important;
  left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
  border-radius: 2px !important;
  /* colore base del riquadro (verde) */
  background: #166534 !important;
}

/* Assicuriamo che la X viva solo su ::after, centrata e leggibile */
.ic-excel:after,
.ic-excel::after{
  content: "X" !important;
  position: absolute !important;
  left: 50% !important; top: 50% !important;
  transform: translate(-50%,-50%) !important;
  font-weight: 700 !important;
  font-size: .75em !important;
  color: #fff !important;
}

/* Dimensioni/inline fix coerenti nei pulsanti */
.ic-excel{
  display: inline-block !important;
  vertical-align: middle !important;
  width: 1.1em !important;
  height: 1.1em !important;
  position: relative !important;
}

/* === P4_USERS_EXCEL_SCOPE_FIX ===
   Forza resa coerente dell'icona export anche nella toolbar di Users */
.page-title .actions .ic-excel,
.card-title .actions .ic-excel {
  display:inline-block; vertical-align:middle; width:1.1em; height:1.1em; position:relative;
}

/* === P4_USERS_HEADER_AND_LAYOUT_V2 ===
   Allinea la pagina Users a Locations/Rooms:
   - Titolo e sottotitolo coerenti
   - Spazio uniforme tra descrizione e actions
   - Rimuove rientri a destra della tabella e dei gruppi
*/
.users-page .card-title,
.users-page .page-title{
  display:flex; align-items:flex-start; justify-content:space-between; gap:1rem;
}
.users-page .card-title h2,
.users-page .page-title h2{
  font-size:1.25rem !important;
  line-height:1.25 !important;
  letter-spacing:.2px !important;
  margin:0 !important;
}
.users-page .card-title .subtitle,
.users-page .page-title p.muted{
  display:block !important;
  margin-top:.25rem !important;
  margin-bottom:.75rem !important; /* stesso respiro delle altre pagine */
  opacity:.85 !important;
  font-size:16px !important;
}
.users-page .card-title .actions,
.users-page .page-title .actions{
  margin-top:.25rem !important;
  display:flex; align-items:center; gap:.5rem;
}

/* Tabella allineata a sinistra come Locations/Rooms */
.users-page .table-wrap,
.users-page .table-responsive,
.users-page .table-container{
  margin-left:0 !important; padding-left:0 !important;
}
.users-page table{ width:100% !important; }

/* Righe di gruppo (Admin/Teacher/Staff) senza rientro extra */
.users-page .groupbar,
.users-page .group-row,
.users-page .table .group-header{
  margin-left:0 !important; padding-left:0 !important;
}

/* === P4_USERS_LAYOUT_FINAL_FIX ===
   - Allinea Users a Locations/Rooms
   - Neutralizza override troppo aggressivi sulla tabella Users
   - Uniforma spacing titolo/descrizione/actions
*/

/* Titolo/descrizione/actions come baseline globale */
.content .card .card-title{ font-weight:700; margin-bottom:.5rem; }
.content .card .muted{ opacity:.85; }
.content .card > .actions-bar{ display:flex; gap:.5rem; margin-bottom:.75rem; }

/* Portiamo Users alle stesse regole, ignorando precedenti override */
.users-table-wrap{ margin-left:0 !important; padding-left:0 !important; }
.users-table-wrap > table.table.lined.bordered.wide.full{ width:100% !important; table-layout:fixed !important; }

/* Prima colonna (Actions) coerente: 150px reali */
.users-table-wrap > table.table.lined.bordered.wide.full thead th:first-child{
  width:150px !important; min-width:150px !important; max-width:150px !important;
  white-space:nowrap !important;
}

/* Header di gruppo allineato a sinistra e senza rientri strani */
.users-table-wrap td.td-head{
  padding-left:.75rem !important;
  text-align:left !important;
}

/* Resetta eventuali padding/margini che spingono la tabella a destra */
.users-table-wrap > table.table.lined.bordered.wide.full thead th,
.users-table-wrap > table.table.lined.bordered.wide.full tbody td{
  padding-left:.75rem !important;
  padding-right:.75rem !important;
}

/* === P4_USERS_DRAWER_STICKY_V3 === */
aside#drawer-users .drawer-head{
  position: sticky; top: 0;
  display:flex; align-items:center; justify-content:space-between;
  padding:16px;
  background:#0f1a2a;
  border-bottom:1px solid rgba(255,255,255,.08);
  z-index:3;
}
aside#drawer-users .drawer-head strong{ font-size:1rem; font-weight:700; line-height:1.2; white-space:nowrap; }
aside#drawer-users .drawer-close{ display:inline-block; padding:4px 6px; font-size:18px; opacity:.9; text-decoration:none; }
aside#drawer-users .drawer-close:hover{ opacity:1; }
aside#drawer-users .drawer-body{ padding:16px; }

/* === P4_USERS_DRAWER_STICKY_MIN === */
aside#drawer-users .drawer-head{
  position: sticky; top: 0;
  display:flex; align-items:center; justify-content:space-between;
  padding:16px;
  background:#0f1a2a;
  border-bottom:1px solid rgba(255,255,255,.08);
  z-index:3;
}
aside#drawer-users .drawer-body{ padding:16px; }

/* === P4_USERS_DRAWER_STICKY_FINAL === */
aside#drawer-users .drawer-head{
  position: sticky; top: 0;
  display:flex; align-items:center; justify-content:space-between;
  padding:16px;
  background:#0f1a2a;
  border-bottom:1px solid rgba(255,255,255,.08);
  z-index:3;
}
aside#drawer-users .drawer-body{ padding:16px; }

/* === P4_USERS_ROW_ICONS_OUTLINE_V1 === */
.users-table-wrap td.nowrap a.icon-btn.sm{
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.04);
  margin-right:6px;
}
.users-table-wrap td.nowrap a.icon-btn.sm:hover{
  background:rgba(255,255,255,.08);
}
.users-table-wrap td.nowrap a.icon-btn.sm.danger{
  border-color: rgba(255,99,99,.45);
}

/* === P4_USERS_ROW_ICONS_OUTLINE_V3 (match stile Locations) === */
.content .card .table-wrap.users-table-wrap > table.table.lined.bordered.wide.full
  tbody td.nowrap a.icon-btn.sm{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:28px !important; height:28px !important;
  min-width:28px !important;
  border-radius:8px !important;
  border:1px solid rgba(255,255,255,.22) !important;
  background:rgba(255,255,255,.04) !important;
  margin-right:6px !important;
  text-decoration:none !important;
}
.content .card .table-wrap.users-table-wrap > table.table.lined.bordered.wide.full
  tbody td.nowrap a.icon-btn.sm:hover{
  background:rgba(255,255,255,.08) !important;
}
.content .card .table-wrap.users-table-wrap > table.table.lined.bordered.wide.full
  tbody td.nowrap a.icon-btn.sm.danger{
  border-color:rgba(255,99,99,.45) !important;
}

/* P4_USERS_CLONE_LOC_OUTLINE
   Riusa lo stile delle icone riga di Locations anche su Users.
   Funziona perché aggiungiamo 'locations-table' anche alla tabella Users. */
.card .table.locations-table tbody td:first-child a {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  width:34px;
  height:34px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.04);
  margin-right:6px;
  text-decoration:none;
}
.card .table.locations-table tbody td:first-child a.danger{
  border-color:rgba(255,99,99,.45);
}

/* Assicurati che la colonna 'Last name' sia visibile su Users */
.users-table-wrap > table.table.lined.bordered.wide.full th:nth-child(3),
.users-table-wrap > table.table.lined.bordered.wide.full td:nth-child(3){
  display:table-cell;
}

/* P4_USERS_OUTLINE_FORCE_VFINAL */
.users-table-wrap > table.table.lined.bordered.wide.full tbody tr > td:first-child a.icon-btn.sm,
.users-table-wrap > table.table.lined.bordered.wide.full tbody tr > td:first-child a.icon-btn.sm.users-outline {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:34px !important;
  height:34px !important;
  min-width:34px !important;
  border-radius:8px !important;
  border:1px solid rgba(255,255,255,.22) !important;
  background:rgba(255,255,255,.04) !important;
  margin-right:6px !important;
  text-decoration:none !important;
  box-sizing:border-box !important;
}
.users-table-wrap > table.table.lined.bordered.wide.full tbody tr > td:first-child a.icon-btn.sm.danger {
  border-color:rgba(255,99,99,.45) !important;
}

/* Garantisci che la colonna "Last name" (3ª) sia sempre visibile */
.users-table-wrap > table.table.lined.bordered.wide.full thead th:nth-child(3),
.users-table-wrap > table.table.lined.bordered.wide.full tbody td:nth-child(3){
  display:table-cell !important;
  visibility:visible !important;
}
/* P4_USERS_OUTLINE_INLINE_FALLBACK */
.users-table-wrap > table.table.lined.bordered.wide.full tbody tr > td:first-child a.icon-btn.sm{
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;min-width:34px;border-radius:8px;
  border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.04);
  margin-right:6px;box-sizing:border-box;
}
.users-table-wrap > table.table.lined.bordered.wide.full tbody tr > td:first-child a.icon-btn.sm.danger{
  border-color:rgba(255,99,99,.45);
}
/* P4_TEACHERS_ROOMS_LOOK */
.table.teachers-table thead th{
  text-align:left;
  background:transparent !important;
  font-weight:600;
}
.table.teachers-table td,
.table.teachers-table th{
  border-left:none !important;
  border-right:none !important;
}
.table.teachers-table tbody tr td{
  padding:10px 12px;
  font-size:14px;
  line-height:1.2;
}
.table.teachers-table .td-head{
  background:transparent;
  font-weight:600;
  opacity:.9;
}
/* Icone azioni con contorno */
.table.teachers-table td .icon-btn.sm{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;height:28px;min-width:28px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.04);
  margin-right:6px;
  box-sizing:border-box;
}
.table.teachers-table td .icon-btn.sm.danger{
  border-color:rgba(255, 99, 99, .45);
}
/* P4_TEACHERS_ROOMS_LOOK_V2 */
.table.teachers-table{ font-size:14px; }
.table.teachers-table thead th{
  text-align:left;
  background:transparent !important;
  border:0 !important;
  padding-top:.5rem; padding-bottom:.5rem;
}
.table.teachers-table th:first-child,
.table.teachers-table td:first-child{
  /* larghezza simile a Rooms per vedere bene entrambe le icone */
  width:100px; min-width:100px;
}
.table.teachers-table td, .table.teachers-table th{
  /* niente bordi verticali */
  border-right:0 !important;
}
.table.teachers-table .td-head{
  /* barra di gruppo (Teacher/Staff) stile Rooms */
  background:rgba(255,255,255,.06);
  color:#d9e4f2;
  font-weight:600;
  border-radius:10px;
  padding:.35rem .6rem;
}
/* Icone con contorno come Rooms */
.table.teachers-table .icon-btn.sm{
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; min-width:28px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.04);
  margin-right:6px;
  box-sizing:border-box;
}
.table.teachers-table .icon-btn.sm.danger{ border-color:rgba(255,99,99,.45); }
/* righe un filo più alte */
.table.teachers-table tbody td{ padding:.55rem .6rem; }
/* ===== P4_TEACHERS_ACTIONS200_GROUPHEIGHT_FIX ===== */
#teachers-list table.teachers-table thead th:first-child,
.table.teachers-table thead th:first-child{
  width:200px !important;
  min-width:200px !important;
  max-width:200px !important;
  white-space:nowrap !important;
}

/* Thead “pulito” come Rooms */
#teachers-list table.teachers-table thead th,
.table.teachers-table thead th{
  text-align:left !important;
  background:transparent !important;
  border:0 !important;
  padding:.55rem .6rem !important;
}

/* Niente bordi verticali */
#teachers-list table.teachers-table td,
#teachers-list table.teachers-table th,
.table.teachers-table td,
.table.teachers-table th{
  border-left:0 !important;
  border-right:0 !important;
}

/* Righe di raggruppamento stile Rooms (altezza via padding 8px 10px) */
#teachers-list .td-head,
.table.teachers-table .td-head{
  background:rgba(255,255,255,.06) !important;
  color:#d9e4f2 !important;
  font-weight:600 !important;
  border-radius:10px !important;
  padding:8px 10px !important; /* come Rooms */
}

/* Icone con contorno coerenti */
#teachers-list table.teachers-table td .icon-btn.sm,
.table.teachers-table td .icon-btn.sm{
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; min-width:28px;
  border-radius:8px; box-sizing:border-box;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.04);
  margin-right:6px;
}
#teachers-list table.teachers-table td .icon-btn.sm.danger,
.table.teachers-table td .icon-btn.sm.danger{
  border-color:rgba(255,99,99,.45);
}
/* ===== /P4_TEACHERS_ACTIONS200_GROUPHEIGHT_FIX ===== */
/* P5_COURSES_ROOMS_STYLE */
#courses-list table.courses-table thead th{
  text-align:left !important;
  background:transparent !important;
  border-top:0 !important; border-left:0 !important; border-right:0 !important;
  border-bottom:1px solid rgba(255,255,255,.08) !important;
  padding:.55rem .6rem !important;
}
#courses-list table.courses-table td,
#courses-list table.courses-table th{
  border-left:0 !important; border-right:0 !important;
  font-size:14px; line-height:1.3;
}
#courses-list table.courses-table thead th:first-child{
  width:200px !important; min-width:200px !important; max-width:200px !important;
}
#courses-list table.courses-table tbody td.nowrap a.icon-btn.sm{
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; min-width:28px;
  border-radius:8px; border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.04); margin-right:6px; box-sizing:border-box;
}
#courses-list table.courses-table tbody td.nowrap a.icon-btn.sm.danger{
  border-color:rgba(255,99,99,.45);
}
/* group row stile Rooms */
#courses-list .td-head{
  background:rgba(255,255,255,.06);
  color:#d9e4f2; font-weight:600;
  border-radius:10px; padding:.40rem .65rem;
}
/* P5_COURSES_ROOMS_STYLE */

/* P5_COURSES_UI */
#courses-list .table thead th:first-child{ width:150px; min-width:150px; }
#courses-list .chipset .chip{
  display:inline-flex; align-items:center; gap:.35rem;
  border:1px solid rgba(255,255,255,.18); border-radius:999px;
  padding:.25rem .55rem; background:rgba(255,255,255,.04); cursor:pointer;
}
#courses-list .chip input{ display:none }
#courses-list .chip input:checked + span{ font-weight:700; }
#courses-list .price-row .prefix{ position:absolute; left:10px; opacity:.85; }

/* P5_COURSES_PILLS_CHIPS_V1 */
/* Chip (Teachers) */
.chips-wrap{ margin-top:.6rem; }
.chips-title{ font-weight:700; margin:.35rem 0 .25rem; }
.chipset{ display:flex; flex-wrap:wrap; gap:.35rem; }
.chip{ display:inline-flex; align-items:center; }
.chip input{ display:none; }
.chip span{
  display:inline-flex; align-items:center; padding:.35rem .65rem;
  border:1px solid rgba(255,255,255,.18); border-radius:9999px;
  background:transparent; color:#e7f0ff; font-size:16px;
}
.chip span.on{ background:rgba(30,158,255,.15); border-color:#1e9eff; }

/* Pills (Available payments) */
.pills-wrap{ margin-top:.6rem; }
.pills-title{ font-weight:700; margin:.35rem 0 .25rem; }
.pillset{ display:flex; flex-wrap:wrap; gap:.35rem; }
.pill{ display:inline-flex; align-items:center; gap:.45rem;
  border:1px solid rgba(255,255,255,.18); border-radius:9999px;
  padding:.35rem .6rem; cursor:pointer; user-select:none;
  background:rgba(255,255,255,.02);
}
.pill input{ width:16px; height:16px; margin:0; }
.pill input:checked + span{ font-weight:700; }
.pill:hover{ background:rgba(255,255,255,.06); }

/* Prezzi in grid, simile AppSheet spacing */
.price-grid{ display:grid; grid-template-columns:1fr; gap:.45rem; margin-top:.6rem; }
.price-row label{ font-weight:700; margin:.2rem 0 .15rem; display:block; }
.price-row input{
  width:100%; min-height:40px; border-radius:8px;
  background:#0f2437; color:#fff; border:1px solid rgba(255,255,255,.12);
  padding:.45rem .6rem;
}

/* Cascading select: disabilitato = stile spento */
#course-room:disabled{ opacity:.6; }

/* Drawer head coerente con Rooms (se non già impostato) */
#drawer-courses .drawer-head{ position:sticky; top:0; background:#0f1a2a; z-index:2; }

/* prima colonna (actions) */
#courses-list table.table thead th:first-child{ width:150px; min-width:150px; }

/* Pills/Chips: font e raggi coerenti con tema */
.pill span, .chip span{ line-height:1; }

/* /P5_COURSES_PILLS_CHIPS_V1 */

/* P5_COURSES_LIST_ROOMS_STYLE */
#courses-list table tbody tr.group-row td.td-head{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 700;
  color: #e7f0ff;
}
#courses-list table thead th,
#courses-list table tbody td{
  border-left: 0 !important;
  border-right: 0 !important;
}
/* Badge N/A */
.badge-na{
  display:inline-block; padding:.14rem .45rem;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px; opacity:.85;
  font-size:.85em;
}
/* P5_TABLE_TH_NORMALIZE */
.table .th,
.table .thead .td,
.table thead th {
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}
.locations-table .th,
.table.locations-table .thead .td,
.table.locations-table thead th {
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}
.table.locations-table .th { line-height: 1.3; }
/* P5_LOCATIONS_ROW_SPACING */
.table.locations-table .tr { min-height: 44px; align-items: center; }
.table.locations-table .td, .table.locations-table .th { padding: 10px 12px; }

/* P5_HEADER_GLOBAL_16 */
.table .th,
.table .thead .td,
.table thead th {
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.3;
  text-align: left !important;
}

/* P5_TABLES_HEADERS_FORCE16_GLOBAL */
/* 1) Base di tutte le tabelle a 16px (ereditata da body cells, utile se header usa em/rem) */
html body .table { font-size: 16px !important; }

/* 2) Header cells: qualunque markup (.th / .thead .td / thead th) */
html body .table .th,
html body .table .thead .td,
html body .table thead th {
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-align: left !important;
}

/* 3) Fallback “brutale”: se l’header è la prima riga disegnata con .td normali */
html body .table .tr:first-child > .td,
html body .table .tr:first-child > .th,
html body .table .tr:first-child > div {
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-align: left !important;
}

/* 4) Spaziature uniformi stile Rooms */
html body .table .tr { min-height: 44px; align-items: center; }
html body .table .td, 
html body .table .th { padding: 10px 12px; }


/* 1) Tipografia uniforme delle label header (vale per tutti i markup che abbiamo visto in DMP) */
html body .table .th,
html body .table .thead .td,
html body .table thead th,
html body .table .tr:first-child > .td,
html body .table .tr:first-child > div {
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-align: left !important;
}

/* 2) NIENTE evidenziatore sulla riga header (bg, bordi, ombre). 
      Copre .thead, thead, eventuali header-row custom e il fallback "prima riga". */
html body .table .thead,
html body .table thead,
html body .table .tr.header,
html body .table .tr.table-header,
html body .table .tr:first-child {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* 3) Spaziature/altezza riga stile Rooms per coerenza visiva */
html body .table .tr { min-height: 44px; align-items: center; }
html body .table .td, 
html body .table .th { padding: 10px 12px; }

/* P5_TABLES_UNIFORM_ALL_V2 */
/* 1) Tipografia header uniforme (copre div-based e thead/th) */
html body .table .th,
html body .table .thead .td,
html body .table thead th,
html body .table thead tr th,
html body .table .tr.header > .td,
html body .table .tr.table-header > .td,
html body .table .tr:first-child > .td,
html body .table .tr:first-child > div {
  font-size:16px !important;
  font-weight:600 !important;
  line-height:1.3 !important;
  text-align:left !important;
}

/* 2) Niente evidenziatore sugli header (bg/bordi/ombre ovunque) */
html body .table .thead,
html body .table thead,
html body .table thead tr,
html body .table thead th,
html body .table .tr.header,
html body .table .tr.table-header,
html body .table .tr:first-child {
  background:transparent !important;
  background-color:transparent !important;
  background-image:none !important;
  border:0 !important;
  box-shadow:none !important;
}

/* 3) Rimuovi bordini solo sugli header */
html body .table thead th,
html body .table .thead .td,
html body .table .tr.header > .td,
html body .table .tr.table-header > .td,
html body .table .tr:first-child > .td,
html body .table .tr:first-child > div {
  border:0 !important;
}

/* 4) Spaziature e altezza riga uniformi (stile Rooms) */
html body .table .tr { min-height:44px; align-items:center; }
html body .table .td, html body .table .th { padding:10px 12px; }

/* 5) Safety: alcune pagine impostano font-size più piccolo sulla tabella:
      qui riportiamo la tabella all'unità base */
html body .table { font-size:16px !important; }
/* P5_TABLES_UNIFORM_ALL_V2 — global tables header + no chips */
:root{
  --dmp-th-size:16px;
  --dmp-th-weight:600;
  --dmp-th-line:1.3;
}

/* intestazioni ovunque */
.table .th,
.table .thead .td,
.table thead th{
  font-size:var(--dmp-th-size) !important;
  font-weight:var(--dmp-th-weight) !important;
  line-height:var(--dmp-th-line) !important;
  text-align:left !important;
  text-transform:none !important;
}

/* fallback: header reso come prima riga */
.table .tr:first-child > .td,
.table .tr:first-child > .th{
  font-size:var(--dmp-th-size) !important;
  font-weight:var(--dmp-th-weight) !important;
  line-height:var(--dmp-th-line) !important;
  text-align:left !important;
  text-transform:none !important;
}

/* spaziature uniformi stile Rooms */
.table .tr{ min-height:44px; align-items:center; }
.table .td, .table .th{ padding:10px 12px; }

/* annulla regole pagina-specifiche più piccole */
.locations-table .th,
.table.locations-table .thead .td{
  font-size:var(--dmp-th-size) !important;
}

/* righe di gruppo (Users/Teachers) */
.table .group-row,
.table .group-row .td{
  background:transparent !important;
  font-weight:var(--dmp-th-weight) !important;
  text-align:left !important;
}

/* rimuovi evidenziatori/badge/pill dentro alle tabelle (header + body) */
.table .chip,
.table .badge,
.table .pill,
.table .tag,
.table .label,
.table .status,
.table .muted,
.table .pill *,
.table .badge *,
.table .chip *{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:0 !important;
  color:inherit !important;
}

/* assicurati che “N/A”, “Yes”, ecc. siano testo semplice */
.table .td > span[class*="badge"],
.table .td > span[class*="pill"],
.table .td > span[class*="chip"]{ display:inline !important; }
/* fine P5_TABLES_UNIFORM_ALL_V2 */


/* === P5_UNIFORM_TABLES_V2_START === (TS 20250920_193321) */
/* Variabili */
:root{
  --dmp-th-size: 16px;
  --dmp-th-weight: 600;
  --dmp-th-lineheight: 1.3;
}

/* Header: forza 16px/bold/left su QUALSIASI tabella */
html body main.content .card .table thead th,
html body main.content .card .table .th,
html body .table thead th,
html body .table .th{
  font-size: var(--dmp-th-size) !important;
  font-weight: var(--dmp-th-weight) !important;
  line-height: var(--dmp-th-lineheight) !important;
  text-align: left !important;
}

/* Celle: allineamento a sinistra uniforme (senza toccare colonne numeric-only) */
html body .table .td{
  text-align: left !important;
}

/* Fallback header-disegnato-come-prima-riga */
html body .table .tr:first-child > .td,
html body .table .tr:first-child > div{
  font-size: var(--dmp-th-size) !important;
  font-weight: var(--dmp-th-weight) !important;
  line-height: var(--dmp-th-lineheight) !important;
  text-align: left !important;
}

/* Niente rientri a sinistra per i contenitori tabella su tutte le pagine */
html body .content .table-wrap,
html body .content .table-responsive,
html body .content .table-container,
html body .content .card .table-wrap,
html body .content .card .card-title + .actions-bar + .table-wrap,
html body .content .card .card-title + .muted + .actions-bar + .table-wrap{
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* Spaziature uniforme stile Rooms */
html body .table .tr{ min-height: 44px; align-items: center; }
html body .table .td,
html body .table .th{ padding: 10px 12px; }

/* Forza esplicita anche per Locations (se restano selettori molto specifici) */
html body .table.locations-table thead th,
html body .table.locations-table .th{
  font-size: var(--dmp-th-size) !important;
}
/* === P5_UNIFORM_TABLES_V2_END === */

/* P5_SUPER_FIX_LOC_USERS_TEACHERS_V4
   - Locations: header/celle a 16px, allineati a sinistra (batte regole locali)
   - Users/Teachers: rimuove rientri extra a sinistra (groupbar & wrapper) */

/*** LOCATIONS — forza 16px con alta specificità ***/
:root{ --p5-fz-16:16px; --p5-fw-600:600; --p5-lh-13:1.3; }

.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full thead th,
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full .th,
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full .thead .td{
  font-size: var(--p5-fz-16) !important;
  font-weight: var(--p5-fw-600) !important;
  line-height: var(--p5-lh-13) !important;
  text-align: left !important;
}

/*** USERS & TEACHERS — allineamento a sinistra ***/
.content .card .card-title + .muted + .actions-bar + .table-wrap,
.content .card .card-title + .muted + .actions-bar + .table-wrap > .table{
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* righe di gruppo: niente indent extra sulla prima cella */
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table .groupbar > .td:first-child,
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table .group-row > .td:first-child{
  padding-left: 12px !important; /* come le righe normali */
}

/* P5_LOC_FORCE16_FINAL */
:root{ --p5-fz16:16px; --p5-fw600:600; --p5-lh13:1.3; }
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full thead th,
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full .th,
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table.lined.bordered.wide.full .thead .td{
  font-size: var(--p5-fz16) !important;
  font-weight: var(--p5-fw600) !important;
  line-height: var(--p5-lh13) !important;
  text-align: left !important;
}

/* P5_USERS_TEACHERS_LEFT0 */
.content .card .card-title + .muted + .actions-bar + .table-wrap,
.content .card .card-title + .muted + .actions-bar + .table-wrap > .table{
  margin-left: 0 !important;
  padding-left: 0 !important;
}
/* groupbar e righe di gruppo senza indent extra */
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table .groupbar > .td:first-child,
.content .card .card-title + .muted + .actions-bar + .table-wrap
  > .table .group-row > .td:first-child{
  padding-left: 12px !important;
}
.table.locations-table .th { line-height: 1.3; }
/* P5_LOCATIONS_TH_FORCE16 */
.table.locations-table .th { font-size: 16px !important; font-weight: 600; line-height: 1.3; }
/* P5_LOCATIONS_ROW_SPACING */
.table.locations-table .tr { min-height: 44px; align-items: center; }
.table.locations-table .td, .table.locations-table .th { padding: 10px 12px; }
/* P5_LOCATIONS_FORCE16_GUARD */
.table.locations-table thead th,
.table.locations-table .th,
.table.locations-table .thead .td{
  font-size:16px !important;
  font-weight:600 !important;
  line-height:1.3 !important;
  text-align:left !important;
}
/* P5_USERS_TEACHERS_LEFT0_V3 */
.content .card .card-title + .muted + .actions-bar + .table-wrap,
.content .card .card-title + .muted + .table-wrap,
.content .card .table-wrap{
  margin-left:0 !important;
  padding-left:0 !important;
}
.content .card .table-wrap > .table{
  margin-left:0 !important;
  padding-left:0 !important;
}
/* P5_LOCATIONS_TABLE_FORCE16_V2 */
.table.locations-table { font-size: 16px !important; }
.table.locations-table .th,
.table.locations-table thead th,
.table.locations-table .thead .td {
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-align: left !important;
}
/* P5_LOC_DOMCHAIN_FORCE16 */
.content .card .card-title + .muted + .actions-bar + .table-wrap
> .table.lined.bordered.wide.full thead th,
.content .card .card-title + .muted + .actions-bar + .table-wrap
> .table.lined.bordered.wide.full .th,
.content .card .card-title + .muted + .actions-bar + .table-wrap
> .table.lined.bordered.wide.full .thead .td{
  font-size:16px !important;
  font-weight:600 !important;
  line-height:1.3 !important;
  text-align:left !important;
}
/* P5_USERS_TEACHERS_LEFT_STRICT_V2 */
main.content .card .card-title + .muted + .actions-bar + .table-wrap,
main.content .card .page-title  + .muted + .actions-bar + .table-wrap,
main.content .card .card-title + .muted + .table-wrap,
main.content .card .page-title  + .muted + .table-wrap{
  margin-left:0 !important; padding-left:0 !important;
}
main.content .card .table-wrap > .table{
  margin-left:0 !important; padding-left:0 !important;
}
/* gruppi (Admin/Teacher/Staff) */
main.content .groupbar, main.content .group-row{
  margin-left:0 !important; padding-left:0 !important;
}
/* P5_GLOBAL_TABLEHEAD_16_V1 */
main.content .table thead th,
main.content .table .thead .td,
main.content .table .th{
  font-size:16px !important;
  font-weight:600 !important;
  line-height:1.3 !important;
  text-align:left !important;
}
/* P5_USERS_TEACHERS_LEFT0_V4 */
.users-page .table-wrap,
.users-page .table-responsive,
.users-page .table-container,
.teachers-page .table-wrap,
.teachers-page .table-responsive,
.teachers-page .table-container{
  margin-left:0 !important;
  padding-left:0 !important;
}
/* anche le combinazioni con actions-bar immediatamente prima della tabella */
.users-page .card .card-title + .muted + .actions-bar + .table-wrap,
.users-page .card .page-title  + .muted + .actions-bar + .table-wrap,
.teachers-page .card .card-title + .muted + .actions-bar + .table-wrap,
.teachers-page .card .page-title  + .muted + .actions-bar + .table-wrap{
  margin-left:0 !important;
  padding-left:0 !important;
}
/* P5_SUPER_HEAD16_V2 — forza 16px sui table header anche se esistono altri !important */
main.content .table.table.table .th,
main.content .table.table.table .thead .td,
main.content .table.table.table thead th,
main.content .table.locations-table.locations-table .th,
main.content .table.locations-table.locations-table .thead .td,
main.content .table.locations-table.locations-table thead th,
.content .card .table.locations-table.locations-table .th,
.content .card .table.locations-table.locations-table .thead .td,
.content .card .table.locations-table.locations-table thead th{
  font-size:16px !important;
  font-weight:600 !important;
  line-height:1.30 !important;
  text-align:left !important;
}

/* P5_SUPER_USERS_TEACHERS_LEFT0_V2 — azzera rientro sinistro Users/Teachers */
.users-page .table-wrap,
.users-page .table-responsive,
.users-page .table-container,
.teachers-page .table-wrap,
.teachers-page .table-responsive,
.teachers-page .table-container,
.users-page .card .card-title + .muted + .actions-bar + .table-wrap,
.teachers-page .card .card-title + .muted + .actions-bar + .table-wrap{
  margin-left:0 !important;
  padding-left:0 !important;
}
/* P5_LOC_HEAD16_AND_LEFTFINAL_V2 */

/* === LOCATIONS: forza 16px anche su tutti i DISCENDENTI degli header === */
.content .card .card-title + .muted + .actions-bar + .table-wrap > .table.locations-table thead th,
.content .card .card-title + .muted + .actions-bar + .table-wrap > .table.locations-table thead th * ,
.content .card .card-title + .muted + .actions-bar + .table-wrap > .table.locations-table .thead .td,
.content .card .card-title + .muted + .actions-bar + .table-wrap > .table.locations-table .thead .td * ,
.content .card .card-title + .muted + .actions-bar + .table-wrap > .table.locations-table .th,
.content .card .card-title + .muted + .actions-bar + .table-wrap > .table.locations-table .th *{
  font-size:16px !important;
  font-weight:600 !important;
  line-height:1.30 !important;
  text-align:left !important;
}

/* ridondanza extra per battere qualunque selettore generico rimasto */
main.content .table.locations-table thead th,
main.content .table.locations-table thead th *{ font-size:16px !important; }

/* === USERS / TEACHERS: rientro sinistro a zero === */
.users-page .card .table-wrap,
.users-page .card .table-responsive,
.users-page .card .table-container,
.teachers-page .card .table-wrap,
.teachers-page .card .table-responsive,
.teachers-page .card .table-container{ margin-left:0 !important; padding-left:0 !important; }

/* fallback se le classi di pagina non ci sono: non rompe le altre viste */
main.content .card .table-wrap{ margin-left:0 !important; }
/* P5_LOC_HEAD16_AND_LEFT_FINAL */
/* === LOCATIONS: forza 16px sugli HEADER (specificità > della regola a 0.9rem) === */
#locations-list table.locations-table thead th,
#locations-list table.locations-table thead th *,
#locations-list table.locations-table .thead .td,
#locations-list table.locations-table .thead .td *,
#locations-list table.locations-table .th,
#locations-list table.locations-table .th *{
  font-size:16px !important;
  font-weight:600 !important;
  line-height:1.30 !important;
  text-align:left !important;
}

/* === USERS / TEACHERS: rientro sinistro a zero === */
#users-list.table-wrap,
#teachers-list.table-wrap,
.users-page .table-wrap,
.teachers-page .table-wrap{
  margin-left:0 !important; padding-left:0 !important;
}
/* P5_LEFT_ALIGN_TABLES_V1
   Allinea il bordo sinistro della tabella con l’icona + su Locations, Users, Teachers.
   Non tocca Rooms / Payment Modes / Courses che sono già corretti. */
#locations-list.table-wrap,
#users-list.table-wrap,
#teachers-list.table-wrap,
/* fallback a struttura comune (card-title -> muted -> actions-bar -> table-wrap)
   utile se gli id non esistono in alcune pagine */
.content .card .card-title + .muted + .actions-bar + .table-wrap{
  margin-left: 0 !important;
  padding-left: 0 !important;
}
/* sicurezza: niente padding sinistro “nascosto” su container alternativi */
.users-page .table-wrap,
.teachers-page .table-wrap{
  margin-left: 0 !important;
  padding-left: 0 !important;
}
/* === P5_USERS_TEACHERS_CARD_DEDUPE_V4 (2025-09-09) ========================= */
/* Nascondi qualsiasi .page-title (già fatto, lo ribadiamo) */
.users-page .page-title,
.teachers-page .page-title { display:none !important; }

/* Se, per qualsiasi motivo, compaiono più .card con tabella,
   lascia SOLO la prima e nascondi tutte le successive */
.users-page main.content > .card:has(.table):not(:first-of-type),
.teachers-page main.content > .card:has(.table):not(:first-of-type) {
  display:none !important;
}

/* Allineamento sinistro coerente con Rooms/Payments/Courses */
.users-page .card .actions-bar,
.teachers-page .card .actions-bar { margin-left:0 !important; padding-left:0 !important; }

.users-page .card .table-wrap,
.users-page .card .table-responsive,
.users-page .card .table-container,
.teachers-page .card .table-wrap,
.teachers-page .card .table-responsive,
.teachers-page .card .table-container {
  margin-left:0 !important; padding-left:0 !important;
}
/* =========================================================================== */
/* === P5_USERS_TEACHERS_CARD_DEDUPE_NOHAS (2025-09-09) =======================
   Su Users/Teachers può capitare un rendering doppio della .card principale.
   Nascondi *tutte* le card successive alla prima, senza usare :has().       */
.users-page main.content > .card ~ .card,
.teachers-page main.content > .card ~ .card {
  display: none !important;
}

/* Allineamento coerente a sinistra (già OK, lo ribadiamo per sicurezza) */
.users-page .card .actions-bar,
.teachers-page .card .actions-bar { margin-left:0 !important; padding-left:0 !important; }

.users-page .card .table-wrap,
.users-page .card .table-responsive,
.users-page .card .table-container,
.teachers-page .card .table-wrap,
.teachers-page .card .table-responsive,
.teachers-page .card .table-container {
  margin-left:0 !important; padding-left:0 !important;
}
/* =========================================================================== */

/* P5_USERS_TEACHERS_LEFT_ALIGN_V5 */
.users-page .card .table-wrap,
.users-page .card .table-responsive,
.users-page .card .table-container,
.users-page .card table,
.teachers-page .card .table-wrap,
.teachers-page .card .table-responsive,
.teachers-page .card .table-container,
.teachers-page .card table{
  margin-left: 0 !important;
  padding-left: 0 !important;
}
/* end P5_USERS_TEACHERS_LEFT_ALIGN_V5 */

/* P5_DEDUPE_CARDS_CSS_V3
   - Nasconde ogni card successiva alla prima quando la pagina contiene
     una tabella con .group-header (Users/Teachers).
   - Fallback: su Users/Teachers nasconde dalla 2a card in poi.
   - Allinea a sinistra la tabella (margini/padding 0). */
main.content > .card:has(.table .group-header) ~ .card { display:none !important; }

.users-page main.content > .card:nth-of-type(n+2),
.teachers-page main.content > .card:nth-of-type(n+2) { display:none !important; }

main.content > .card:has(.table .group-header) .table-wrap,
main.content > .card:has(.table .group-header) .table-responsive,
main.content > .card:has(.table .group-header) .table-container,
main.content > .card:has(.table .group-header) table{
  margin-left:0 !important;
  padding-left:0 !important;
}
/* end P5_DEDUPE_CARDS_CSS_V3 */
/* P5_USERS_TEACHERS_DEDUPE_ALIGN_V3
   Regola semplice e robusta:
   - se nella pagina esiste il link del pulsante "+" (a[href="/users?a=new"] / a[href="/teachers?a=new"])
     allora tieni SOLO la prima .card, le altre vengono nascoste.
   - forza anche l’allineamento a sinistra della tabella.
*/
@supports selector(:has(*)) {
  /* Nascondi tutte le card successive alla prima */
  main.content:has(a[href="/users?a=new"])    > .card ~ .card,
  main.content:has(a[href="/teachers?a=new"]) > .card ~ .card{
    display: none !important;
  }

  /* Allineamento sinistro coerente con Rooms/Payment Modes/Courses */
  main.content:has(a[href="/users?a=new"]) .table-wrap,
  main.content:has(a[href="/users?a=new"]) .table-responsive,
  main.content:has(a[href="/users?a=new"]) .table-container,
  main.content:has(a[href="/users?a=new"]) table,
  main.content:has(a[href="/teachers?a=new"]) .table-wrap,
  main.content:has(a[href="/teachers?a=new"]) .table-responsive,
  main.content:has(a[href="/teachers?a=new"]) .table-container,
  main.content:has(a[href="/teachers?a=new"]) table{
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
}
/* end P5_USERS_TEACHERS_DEDUPE_ALIGN_V3 */

/* P5_USERS_TEACHERS_DEDUPE_ALIGN_V3 START
   - Users/Teachers a volte rendono due .card sovrapposte.
   - Manteniamo SOLO la prima card e nascondiamo le successive.
   - Allineiamo a sinistra actions-bar e tabella come Rooms/Payment Modes.
*/
.users-page  main.content > .card ~ .card,
.teachers-page main.content > .card ~ .card{
  display: none !important;
}

/* allineamento sinistro coerente con le altre sezioni */
.users-page  .card > .actions-bar,
.teachers-page .card > .actions-bar,
.users-page  .card > .table-wrap,
.teachers-page .card > .table-wrap{
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* sicurezza: larghezza piena della tabella */
.users-page  .card table,
.teachers-page .card table{
  width: 100% !important;
}
/* P5_USERS_TEACHERS_DEDUPE_ALIGN_V3 END */

/* === P6_FLUSH_LEFT_UNIFY_V1 ================================================ */
/* Allinea a filo sinistro (+) e tabella su: Locations, Users, Teachers.      */
/* Non tocca le altre pagine.                                                 */

/* A) Wrapper tabella senza rientri */
#locations-list.table-wrap,
#users-list.table-wrap,
#teachers-list.table-wrap,
.users-table-wrap {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* B) Anche la tabella interna non deve avere rientri aggiuntivi */
#locations-list .table,
#teachers-list .table,
.users-table-wrap > .table {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* C) Actions bar allineata al bordo sinistro della card */
.content .card .card-title + .muted + .actions-bar {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* D) Prima colonna a filo (Actions) */
#locations-list table.locations-table thead th:first-child,
#locations-list table.locations-table tbody td:first-child {
  padding-left: 0 !important;
  width: 80px !important;   /* coerente con controller */
}

.users-table-wrap > table.table.lined.bordered.wide.full thead th:first-child,
.users-table-wrap > table.table.lined.bordered.wide.full tbody td:first-child {
  padding-left: 0 !important;
  width: 150px !important;  /* coerente con UI */
}

/* Teachers: struttura div-based */
.table.teachers-table .th:first-child,
.table.teachers-table .td:first-child {
  padding-left: 0 !important;
  width: 150px !important;
}
/* ========================================================================== */


/* === P6_TEACHERS_FLUSH_LEFT_FINAL (2025-09-11) ======================= */
#teachers-list.table-wrap,
#teachers-list .table.teachers-table { margin-left:0 !important; padding-left:0 !important; }
.table.teachers-table thead th:first-child,
.table.teachers-table tbody td:first-child { padding-left:0 !important; width:150px; min-width:150px; }
#teachers-list .icon-btn.sm{ min-width:34px; height:34px; }
/* ===================================================================== */

/* === P6_TEACHERS_ACTIONS_FLUSH_V1 (2025-09-11) ===========================
   Allinea a sinistra la colonna "Actions" in /teachers
   - NB: in Teachers l'header è costruito con <div class="th">, non <th>.
   - Forziamo padding-left:0 sul primo header (.th:first-child) e sulle celle (.td:first-child).
   - Ribadiamo anche su eventuale <table><th>/<td> per massima compatibilità. */
.teachers-page #teachers-list .table > .tr:first-child > .th:first-child,
.teachers-page #teachers-list .table .tr > .td:first-child {
  padding-left: 0 !important;
}

/* Compatibilità se in futuro l'header diventasse <thead><th> */
#teachers-list table.teachers-table thead th:first-child,
#teachers-list table.teachers-table tbody td:first-child {
  padding-left: 0 !important;
}

/* Larghezza coerente con Users/Rooms per la colonna azioni */
.teachers-page .table.teachers-table .th:first-child,
.teachers-page .table.teachers-table .td:first-child {
  width: 150px !important;
  min-width: 150px !important;
}

/* Evita spazi interni extra sugli icon button della prima colonna */
#teachers-list .td:first-child .icon-btn.sm { margin-left: 0 !important; }
#teachers-list .td:first-child { border-left-width: 0 !important; }  /* solo per sicurezza */
/* ======================================================================= */

/* === P7_FLUSH_LEFT_UNIFY_V1 (2025-09-11) ====================================
   Baseline compatta e finale:
   - Header tabelle a 16px / 600 / left (qualsiasi markup table o div-based)
   - Azzera rientri sinistri dei contenitori tabella
   - Teachers: prima colonna (Actions) flush-left + larghezza coerente
   NOTE: Non rimuove le regole precedenti; questo blocco le sovrascrive in modo
         sicuro e centralizzato per evitare regressioni.                                    */
:root{ --p7-th:16px; --p7-fw:600; --p7-lh:1.3; }

/* Header tables (thead th o header "div-based") */
html body main.content .card .table thead th,
html body main.content .card .table .th,
html body main.content .card .table .thead .td{
  font-size:var(--p7-th) !important;
  font-weight:var(--p7-fw) !important;
  line-height:var(--p7-lh) !important;
  text-align:left !important;
}

/* Flush-left contenitori tabella (qualsiasi pagina) */
html body .content .table-wrap,
html body .content .table-responsive,
html body .content .table-container,
html body .content .card .table-wrap,
html body .content .card .card-title + .actions-bar + .table-wrap,
html body .content .card .card-title + .muted + .actions-bar + .table-wrap{
  margin-left:0 !important;
  padding-left:0 !important;
}

/* ID più usati per sicurezza */
#locations-list.table-wrap,
#users-list.table-wrap,
#teachers-list.table-wrap{
  margin-left:0 !important;
  padding-left:0 !important;
}

/* Teachers: colonna Actions completamente a sinistra e dimensionata */
#teachers-list .table .tr:first-child > .th:first-child,
#teachers-list .table .tr > .td:first-child{
  padding-left:0 !important;
  text-align:left !important;
  width:150px !important;
}
#teachers-list .table .tr > .td:first-child .icon-btn.sm{
  min-width:34px; height:34px;
}
/* ========================================================================== */

/* P6_PATCH_BUNDLE_START ****************************************************/
/* (8) Gruppi: titolo centrato orizzontalmente su tutte le pagine */
.table .group-row .td-head{
  text-align:center !important; justify-content:center !important;
}

/* (2) Rooms: nascondi il link Cancel nel drawer Add Room */
#rooms-list ~ .drawer .form-actions a.btn{ display:none !important; }

/* (3) Users: contorno icone Edit/Reset/Delete */
.users-page .table .icon-btn.sm{
  border:1px solid rgba(255,255,255,.25) !important;
  border-radius:6px !important; background:transparent !important;
}
.users-page .table .icon-btn.sm:hover{ border-color:rgba(255,255,255,.45)!important; }

/* (6)(7) stile prefisso valuta riusabile */
.input-prefix{ position:relative; display:flex; align-items:center; gap:.25rem; }
.input-prefix .cur-icon{ width:18px; min-width:18px; height:18px; display:inline-block; }
.input-prefix input{ padding-left:34px !important; }
.cur-icon.ic-eur::before{ content:"€"; font-weight:700; }
.cur-icon.ic-usd::before{ content:"$"; font-weight:700; }
.cur-icon.ic-gbp::before{ content:"£"; font-weight:700; }
.cur-icon.ic-jpy::before{ content:"¥"; font-weight:700; }
.cur-icon.ic-chf::before{ content:"Fr"; font-weight:700; }
/* P6_PATCH_BUNDLE_END ******************************************************/

/* P6_PATCH_BUNDLE_START */
.table .group-row .td-head{
  text-align:center !important;
  justify-content:center !important;
}
#rooms-list ~ .drawer .form-actions a.btn{ display:none !important; } /* Remove Cancel in Add Room */

.table .td a.icon-btn.sm{
  border:1px solid rgba(255,255,255,.25);
  border-radius:6px;
  padding:2px 6px;
}
.table .td a.icon-btn.sm.danger{
  border-color:rgba(255,99,99,.45);
}

/* Icona/Prefisso valuta per gli input */
.input-prefix{ position:relative; display:flex; align-items:center; }
.input-prefix > span{ position:absolute; left:10px; opacity:.9; font-weight:600; }
.input-prefix > input{ padding-left:28px !important; }
/* P6_PATCH_BUNDLE_END */
/* P6_PATCH_BUNDLE_V3 START */
/* Bordi alle icone azione piccole */
.users-page .table .td a.icon-btn.sm,
.teachers-page .table .td a.icon-btn.sm,
.rooms-page .table .td a.icon-btn.sm,
.courses-page .table .td a.icon-btn.sm{
  border:1px solid rgba(255,255,255,.25) !important;
  border-radius:8px !important;
  padding:2px 6px !important;
}
/* Centra le righe di raggruppamento (Rooms, Users, Teachers, Courses) */
.rooms-page .group-row .td,
.users-page .group-row .td,
.teachers-page .group-row .td,
.courses-page .group-row .td,
.rooms-page .groupbar .td,
.users-page .groupbar .td,
.teachers-page .groupbar .td,
.courses-page .groupbar .td{
  text-align:center !important;
}
/* Badge e prefix valuta */
.p6-currency-badge{
  display:inline-block;
  min-width:24px; text-align:center;
  border:1px solid rgba(255,255,255,.25);
  border-radius:6px; padding:0 6px; font-weight:600; opacity:.85;
}
/* già presente: .input-prefix input { padding-left:34px !important; } */
/* P6_PATCH_BUNDLE_V3 END */

/* === P7_TEACHERS_FINAL_FIXES (append-only) === */
/* Centra Teacher/Staff anche contro regole globali left !important */
#teachers-list .table.teachers-table .tr.group-row > .td.td-head,
#teachers-list .tr.group-row > .td.td-head,
#teachers-list .td.td-head{
  text-align:center !important;
}

/* Icône valuta GENERICA: vale sia in lista che nel form */
.cur-icon{ display:inline-block; min-width:1.15em; text-align:center; margin-right:.35rem; }
.cur-icon::before{ content:"¤"; }       /* fallback generico */

/* Mappatura simboli (coerente con TeachersController::t_currency_info) */
.cur-icon.ic-eur::before{ content:"€"; }
.cur-icon.ic-usd::before{ content:"$"; }
.cur-icon.ic-gbp::before{ content:"£"; }
.cur-icon.ic-jpy::before{ content:"¥"; }
.cur-icon.ic-chf::before{ content:"Fr"; }
.cur-icon.ic-generic::before{ content:"¤"; }

/* Layout del campo "Hourly cost" nel form (non invasivo) */
.input-prefix{ display:inline-flex; align-items:center; gap:.4rem; }
/* === P7_TEACHERS_V4 =============================================== */
/* Centra le etichette di gruppo Teacher/Staff */
#teachers-list .td-head{ text-align:center !important; }

/* Icona valuta riutilizzabile */
.cur-icon{ display:inline-block; min-width:1.1em; text-align:center; margin-right:.35rem; }
.cur-icon::before{ content:"¤"; }
.cur-icon.ic-eur::before{ content:"€"; }
.cur-icon.ic-usd::before{ content:"$"; }
.cur-icon.ic-gbp::before{ content:"£"; }
.cur-icon.ic-jpy::before{ content:"¥"; }
.cur-icon.ic-chf::before{ content:"Fr"; }
.cur-icon.ic-generic::before{ content:"¤"; }

/* Wrapper per input con prefisso valuta (drawer) */
.input-prefix{ display:inline-flex; align-items:center; gap:.4rem; }
/* === /P7_TEACHERS_V4 ============================================== */
/* === P7_TEACHERS_CURRENCY_FIX_V7 ===========================================
   Goal:
   1) Icona valuta in /teachers lista (colonna "Hourly rate") via ::before
      senza toccare il controller.
   2) Stile globale per <span class="cur-icon ..."> nel drawer.
   NOTE: simbolo fissato a "€" (come Courses). Se in futuro servirà dinamico,
         si porterà il simbolo dal controller come data-attr.
=============================================================================*/

/* Stile globale per la "pill" valuta usata nel drawer */
.cur-icon{
  display:inline-block; width:22px; height:22px; line-height:22px; text-align:center;
  font-weight:700; border-radius:9999px;
  border:1px solid rgba(255,255,255,.18); background:#1f2937; color:#fff;
  vertical-align:middle; margin-right:.35rem;
}
.cur-icon.ic-eur::before{content:"€"}
.cur-icon.ic-usd::before{content:"$"}
.cur-icon.ic-gbp::before{content:"£"}
.cur-icon.ic-jpy::before{content:"¥"}
.cur-icon.ic-chf::before{content:"Fr"}
.cur-icon.ic-generic::before{content:"¤"}

/* Lista Teachers: metti l'icona (Euro) davanti all'ULTIMA cella riga (rate) */
#teachers-list table.teachers-table tbody tr td:last-child:not(.td-head){
  position:relative; padding-left:32px;   /* spazio per la pill */
}
#teachers-list table.teachers-table tbody tr td:last-child:not(.td-head)::before{
  content:"€";
  position:absolute; left:8px; top:50%; transform:translateY(-50%);
  display:inline-block; width:22px; height:22px; line-height:22px; text-align:center;
  font-weight:700; border-radius:9999px;
  border:1px solid rgba(255,255,255,.18); background:#1f2937; color:#fff;
}

/* Centra sempre le righe di gruppo (Teacher/Staff) */
#teachers-list .td-head{ text-align:center !important; }

/* Rafforzo: prima colonna (actions) a filo sinistro */
.teachers-page #teachers-list .table > .tr:first-child > .th:first-child,
.teachers-page #teachers-list .table .tr > .td:first-child{ padding-left:0 !important; }
/* === /P7_TEACHERS_CURRENCY_FIX_V7 ========================================= */

/* P7_TEACHERS_CSS_MIN */
.input-prefix{display:flex;align-items:center;gap:.5rem}
.cur-icon{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:22px;height:22px;border-radius:9999px;
  border:1px solid rgba(255,255,255,.18);background:#1f2937;color:#fff;font-weight:700;line-height:22px
}
.ic-eur::before{content:"€"} .ic-usd::before{content:"$"} .ic-gbp::before{content:"£"}
.ic-jpy::before{content:"¥"} .ic-chf::before{content:"Fr"} .ic-generic::before{content:"¤"}
/* /P7_TEACHERS_CSS_MIN */
/* P7_TEACHERS_CURRENCY_GLOBAL_V3 */
.drawer .input-prefix{display:flex;align-items:center;gap:.4rem}
.drawer .input-prefix .cur-icon{display:inline-block;line-height:1}
/* P7_COURSES_UI_V1 */
#courses-list .td-head{ text-align:center !important; }

/* Outline coerente per icone in prima colonna (edit/delete) */
#courses-list table.courses-table tbody td.nowrap a,
#courses-list table.courses-table tbody td:first-child a,
#courses-list .table tbody td.nowrap a,
#courses-list .table tbody td:first-child a{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:28px !important; height:28px !important; min-width:28px !important;
  border-radius:8px !important;
  border:1px solid rgba(255,255,255,.22) !important;
  background:rgba(255,255,255,.04) !important;
  margin-right:6px !important;
  box-sizing:border-box !important;
  text-decoration:none !important;
}
#courses-list table.courses-table tbody td:first-child a[href*="delete"],
#courses-list .table tbody td:first-child a[href*="delete"]{
  border-color:rgba(255,99,99,.45) !important;
}
/* /P7_COURSES_UI_V1 */
/* ===== P7c3 — Courses: righe come Rooms (override) ===== */
#courses-list table thead th,
#courses-list table tbody td{
  display: table-cell !important;
  padding: .55rem .6rem !important; /* come Rooms */
  vertical-align: middle !important;
}

/* Header di gruppo (Concorezzo, …) come Rooms */
#courses-list table tbody tr.group-row td.td-head{
  padding: 8px 10px !important;
}
/* ===== /P7c3 ===== */
/* ===== P7u1 — Users page tweaks ===== */
#users-list .td-head{ text-align:center !important; }

/* allinea lo stile dei bottoni azione a Rooms/Courses */
#users-list .table tbody td.nowrap a.icon-btn.sm,
#users-list .table tbody td.nowrap a.icon-btn.sm.users-outline{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; min-width:34px; border-radius:8px;
  border:1px solid rgba(255,255,255,.14); background:transparent;
  margin-right:.35rem; box-sizing:border-box;
}
#users-list .table tbody td.nowrap a.icon-btn.sm.danger{
  border-color: rgba(255,99,99,.45) !important;
}
/* ===== /P7u1 ===== */

/* ===== P7u2 — Users actions styled like Rooms/Courses ===== */
#users-list .td-head{ text-align:center !important; } /* già ok, lo ribadiamo */

#users-list td a[href*="/users?id="],
#users-list td a[href*="/users?a=reset"],
#users-list td a[href*="/users?a=delete"]{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; min-width:34px;
  border-radius:8px; box-sizing:border-box;
  margin-right:.35rem; text-decoration:none;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.28);
}

#users-list td a[href*="/users?a=delete"]{
  border-color:rgba(255,99,99,.55) !important;
  background:rgba(255,99,99,.06);
}
/* ===== /P7u2 ===== */

/* ===== P7_USERS_TS v1 — forza bordi bottoni /users ===== */
#users-list td a[href*="/users?id="],
#users-list td a[href*="/users?a=reset"],
#users-list td a[href*="/users?a=delete"]{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:34px !important; height:34px !important; min-width:34px !important;
  border-radius:8px !important; box-sizing:border-box !important;
  margin-right:.35rem !important; text-decoration:none !important;
  background:rgba(255,255,255,.06) !important;
  border:1px solid rgba(255,255,255,.28) !important;
}
#users-list td a[href*="/users?a=delete"]{
  border-color:rgba(255,99,99,.55) !important;
  background:rgba(255,99,99,.06) !important;
}
/* “gruppi” centrati (idempotente) */
#users-list .td-head{ text-align:center !important; }
/* ===== /P7_USERS_TS ===== */

/* ===== P7_USERS_VIS_COL3 v1 — forza visibilità 3ª colonna (Last name) ===== */
#users-list table thead th:nth-child(3),
#users-list table tbody td:nth-child(3){
  display: table-cell !important;
  visibility: visible !important;
  width: 200px !important;
  min-width: 150px !important;
  padding-left: .75rem !important;
  padding-right: .75rem !important;
  white-space: nowrap !important;
}
/* ===== /P7_USERS_VIS_COL3 ===== */
