/* The new Hub's look on every section (loaded by main.js after styles.css, 28 Oct 2026):
   colours, corners, shadows and spacing, the left menu on computers and the bottom bar on phones. No page logic. */
:root{
  --bg:#F4F6F3; --surface:#FFFFFF; --surface-2:#F0F4F1; --line:#E3E9E5; --ink:#1C2621; --muted:#66756E;
  --bar:#FFFFFF; --bar-ink:#1C2621; --bar-muted:#66756E; --bar-line:#E3E9E5; --bar-hi:#E3F4EA;
  --accent:#1F6B4A; --accent-ink:#FFFFFF; --accent-soft:#E3F4EA; --accent-text:#17734A;
  --shadow:0 1px 2px rgba(20,40,30,.04),0 8px 24px rgba(20,40,30,.07);
  --r-card:18px; --r-ctl:12px;
}

/* top bar: white, logo red, tabs as soft pills */
.top{box-shadow:0 1px 0 var(--line),0 4px 16px rgba(20,40,30,.04)}
.top-in{min-height:62px}
.logo{color:var(--brand-red)}
.brand-sub{color:var(--muted);border-left-color:var(--line)}
.tab{border-radius:999px;padding:8px 14px}
.tab[aria-current]{background:var(--accent-soft);color:var(--accent-text)}
.who>button{border-color:var(--line)}
.avatar{background:#DDF3E8;color:#17734A}
.hub-btn,.hr-back{color:var(--ink)}
.hub-btn:hover,.hr-back:hover{background:var(--surface-2);color:var(--ink)}
.menu{border:0;border-radius:16px;box-shadow:0 12px 40px rgba(0,0,0,.16);padding:8px}

/* page titles */
.page-head{margin-bottom:20px}
.page-head h1,.hub-hello h1{font-size:30px;letter-spacing:-.01em}
.label{letter-spacing:.12em}
.subnav{border-bottom:0;gap:6px;margin-bottom:22px}
.subnav>a{border:0;border-radius:999px;padding:8px 14px;background:var(--surface);box-shadow:var(--shadow);margin:0}
.subnav>a[aria-current="page"]{background:var(--accent);color:#fff}

/* cards: no borders, soft shadow, rounder */
.panel,.app-tile,.req-type,.req-card,.admin-tile,.q-stat,.q-card,.m-step{border-color:transparent;border-radius:var(--r-card);box-shadow:var(--shadow)}
.panel{padding:20px}
.m-row,.q-card{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;box-shadow:var(--shadow);border-radius:16px}
.empty{border:0;background:var(--surface);border-radius:var(--r-card);box-shadow:var(--shadow)}
.notice{border-radius:14px;background:var(--accent-soft);color:var(--accent-text)}
.banner{border-radius:14px}
a.app-tile:hover,.req-type:hover,.admin-tile:hover,.m-row:hover{border-color:transparent;box-shadow:0 2px 4px rgba(20,40,30,.05),0 14px 32px rgba(20,40,30,.1)}

/* section landing pages (HR, Academy…): coloured icon squares like the new Hub */
.app-grid{gap:14px}
.app-tile{padding:18px;gap:14px;align-items:center}
.app-icon{width:56px;height:56px;border-radius:16px}
.app-grid>.app-tile:nth-child(8n+1) .app-icon{background:#DDF3E8;color:#17734A}
.app-grid>.app-tile:nth-child(8n+2) .app-icon{background:#E0EAFB;color:#2B5BB0}
.app-grid>.app-tile:nth-child(8n+3) .app-icon{background:#E7E3FA;color:#4B3BA8}
.app-grid>.app-tile:nth-child(8n+4) .app-icon{background:#FBE1DD;color:#B23A2E}
.app-grid>.app-tile:nth-child(8n+5) .app-icon{background:#DCF1EF;color:#1E6F68}
.app-grid>.app-tile:nth-child(8n+6) .app-icon{background:#FCEFCF;color:#8A5A00}
.app-grid>.app-tile:nth-child(8n+7) .app-icon{background:#FDE6D3;color:#A3500F}
.app-grid>.app-tile:nth-child(8n+8) .app-icon{background:#FBE0EC;color:#A2325F}
.app-icon.ghost{background:var(--surface-2)!important;color:var(--muted)!important}
.app-text b{font-size:18px}
.app-stat{border-top:0;padding-top:0}
.app-count{background:var(--brand-red)}

/* controls */
.btn{border-radius:var(--r-ctl);border-color:var(--line)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn.primary:hover{filter:brightness(1.12)}
.inp{border-radius:var(--r-ctl);border-color:var(--line)}
.inp:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.chip{border-radius:999px;border-color:var(--line)}
.chip[aria-pressed="true"]{background:#E8F3EC;border-color:#9FD3B4;color:#1F5E3D}
.seg{border-radius:999px;border-color:var(--line);padding:3px;gap:2px}
.seg button,.seg a{border-radius:999px;padding:6px 14px}
.seg button[aria-pressed="true"],.seg a[aria-pressed="true"]{background:#E8F3EC;color:#1F5E3D;box-shadow:inset 0 0 0 1px #9FD3B4}
.m-next{background:var(--accent-soft);color:var(--accent-text)}
.m-step.done span{background:var(--accent);color:#fff}

/* tables: lighter lines, row hover */
table.list th{border-bottom-color:var(--line);font-size:11px;letter-spacing:.08em}
table.list td{border-bottom-color:var(--surface-2)}
table.list tbody tr:hover td{background:#FAFCFA}

/* maintenance: closing a job is the obvious green button; another visit is one optional button */
.m-done-box{border-color:#BFE6CF;background:#F3FBF6}
.m-done-btn{width:100%;font-size:16px}
.m-next-btn{width:100%;background:var(--surface);border:1.5px dashed var(--line);color:var(--ink)}
.m-next-btn:hover{border-color:var(--accent);background:var(--accent-soft)}
.m-next-box{border-color:#F3DFA2;background:#FFFBEE}

/* Reports → Complaints: totals of each type of case */
.cr-dash{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;margin:14px 0 6px}
.cr-tile{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border-radius:14px;background:var(--surface-2)}
.cr-tile b{font:700 22px/1.1 var(--f-mono)}
.cr-tile span{font-size:12px;color:var(--muted);font-weight:600}
.cr-tile.cr-total{background:var(--accent);color:#fff}.cr-tile.cr-total span{color:rgba(255,255,255,.85)}
.cr-t-safety{background:#FDEAE6}.cr-t-safety b{color:#A1281A}
.cr-t-order{background:#FFF1D6}.cr-t-order b{color:#8A5A00}
.cr-t-quality{background:#E6EFFF}.cr-t-quality b{color:#1D4F9A}
.cr-t-timing{background:#EFE6FB}.cr-t-timing b{color:#5B2F99}
.cr-t-comm{background:#E4F4EA}.cr-t-comm b{color:#1F6B44}
.cr-upset{background:#FDEAE6}.cr-upset b{color:#A1281A}

/* HR → Planner → management schedule */
.btn.mg-gen{background:var(--brand-red);border-color:var(--brand-red);color:#fff}
.btn.mg-gen:hover{filter:brightness(1.08);background:var(--brand-red)}
.mg-grid{font-size:13px;min-width:1420px;table-layout:fixed}
.mg-grid th:nth-child(1){width:34px}.mg-grid th:nth-child(2){width:200px}.mg-grid th:nth-child(3){width:170px}.mg-grid th:nth-child(11){width:110px}.mg-grid th:nth-child(12){width:74px}
.mg-grid td{padding:2px 4px;height:32px}
.mg-grid th{white-space:nowrap}
.mg-in{width:100%;min-width:0;border:1px solid transparent;background:transparent;border-radius:6px;padding:4px 6px;font:inherit;color:inherit;text-align:inherit}
.mg-in:hover{border-color:rgba(0,0,0,.15)}.mg-in:focus{outline:none;border-color:var(--accent);background:#fff;color:var(--ink)}
.mg-name{font-weight:700;min-width:170px}
.mg-day{text-align:center;font-family:var(--f-mono);font-size:12px;font-weight:600}
.mg-day .mg-in{padding:4px 2px}
.mg-tools{white-space:nowrap}
.mg-print td,.mg-print th{padding:4px 6px;font-size:11px}

/* Events, Promos & Specials: clearer text (28 Oct 2026) */
.rc-kinds a{color:var(--ink);font-weight:700}
.rc-kinds a[aria-pressed="true"]{background:#E8F3EC;border-color:#9FD3B4;color:#1F5E3D}
.rc-kinds .rc-n{font-size:12px;font-weight:600;margin-left:4px;padding:1px 8px;border-radius:999px;background:var(--accent-soft);color:var(--accent-text)}
.rc-kinds a[aria-pressed="true"] .rc-n{background:#fff;color:#1F5E3D}
.promo h2{color:var(--ink)}
.promo .small,.promo p,.promo li{color:var(--ink);font-size:15px;line-height:1.5}
.promo .small{font-size:14px}
.promo-say{background:#FFF6E0}
.promo-say p{color:var(--ink);font-size:15px}
.h2-feature{background-color:#2B1B12;text-shadow:0 1px 3px rgba(0,0,0,.55)}
.h2-feature b{font-size:19px}

/* toasts and update bar */
.toast,.update-bar{border-radius:14px}

/* computer: fixed menu on the left on every page (theme2.js); the page opens in the centre */
.t2-side{display:none}
@media (min-width:821px){
  body.t2-side-on{--t2-side:224px}
  body.t2-side-on .t2-side{display:flex;flex-direction:column;gap:2px;position:fixed;z-index:25;left:0;top:62px;bottom:0;width:var(--t2-side);
    padding:16px 12px;overflow-y:auto;background:var(--bg);border-right:1px solid var(--line);scrollbar-width:none;-ms-overflow-style:none}
  .t2-side::-webkit-scrollbar{display:none}
  /* the Planner's schedule grid needs the whole width: no menu there */
  body.t2-side-on.t2-wide{--t2-side:0px}
  body.t2-side-on.t2-wide .t2-side{display:none}
  body.t2-side-on.t2-wide .hub-btn{display:inline-flex}
  .t2-side a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;color:var(--ink);text-decoration:none;font-weight:600;font-size:14px;white-space:nowrap}
  .t2-side a svg{width:20px;height:20px;flex:none;color:var(--muted)}
  .t2-side a:hover{background:var(--surface)}
  .t2-side a[aria-current]{background:var(--accent-soft);color:var(--accent-text)}
  .t2-side a[aria-current] svg{color:var(--accent-text)}
  .t2-sep{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);padding:14px 12px 4px}
  .t2-grow{flex:1;min-height:12px}
  /* the page in the centre of the space on the right of the menu */
  body.t2-side-on main{margin-left:var(--t2-side);margin-right:0;max-width:none;padding-left:max(24px,calc((100vw - var(--t2-side) - 1180px)/2));padding-right:max(24px,calc((100vw - var(--t2-side) - 1180px)/2))}
  body.t2-side-on .top-in{max-width:none;padding:0 24px}
  /* (1 Dec 2026) the Guests and Events tab bar lines up with the page */
  body.t2-side-on #gnav{margin-left:var(--t2-side);margin-right:0;max-width:none;padding-left:max(24px,calc((100vw - var(--t2-side) - 1180px)/2));padding-right:max(24px,calc((100vw - var(--t2-side) - 1180px)/2))}
  body.t2-side-on .hub-btn{display:none}
  /* the new Hub uses this menu too (its own one is hidden) */
  body.t2-side-on .h2-side{display:none}
  body.t2-side-on .h2-shell{grid-template-columns:minmax(0,1fr);max-width:1380px}
}
/* Planner and duty roster: the schedule grid as big as the screen, a little larger text, compact around it */
@media (min-width:821px){
  /* the page is exactly the screen: title, tools, then the grid takes all the height that is left */
  main.planner-view:has(>.pl-wrap){padding-top:12px;padding-bottom:10px;height:calc(100vh - 62px);display:flex;flex-direction:column}
  main.planner-view:has(>.pl-wrap)>*{flex:none;min-width:0}
  main.planner-view>.pl-wrap{flex:1 1 auto;min-height:320px;max-height:none}
  .planner-view .page-head{margin-bottom:8px;gap:8px;align-items:center}
  .planner-view .page-head h1{font-size:22px}
  .planner-view .notice{padding:8px 12px;margin-bottom:8px;font-size:14px}
  .planner-view .pl-tools{flex-direction:row;align-items:center;gap:10px;margin-bottom:8px}
  .planner-view .pl-pal{flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:thin;padding-bottom:4px;flex:1;min-width:0}
  .planner-view .pl-chip{padding:4px 8px;flex:none}
  .planner-view .pl-help{flex:none}
  .pl-wrap{border:0;border-radius:16px;box-shadow:var(--shadow)}
  .pl-grid{font-size:13px}
  .pl-grid th{padding:5px 7px;font-size:12px}
  .pl-grid td{height:28px;padding:3px 6px}
  .pl-grid td.pl-shift{font-size:12px}
  .roster-read{max-height:calc(100vh - 230px)}
  /* inside a week: the grid takes the whole width of the screen (no 1180px column), bigger text and cells that grow
     with the screen (Yassine, 28 Oct 2026: "lo voglio più grande") */
  body.t2-wide main.planner-view{padding-left:16px;padding-right:16px}
  body.t2-wide .pl-grid{min-width:100%;font-size:clamp(13px,.8vw,16px)}
  body.t2-wide .pl-grid th{font-size:clamp(12px,.72vw,14px);padding:7px 8px}
  body.t2-wide .pl-grid td{height:clamp(32px,2.1vw,42px);padding:4px 8px}
  body.t2-wide .pl-grid td.pl-shift{font-size:clamp(12px,.78vw,15.5px)}
  body.t2-wide .pl-chip{font-size:13px;padding:5px 10px}
}
/* Academy → Training calendar (views/trcal.js): one big card per day in a strip that scrolls sideways */
.tc-nav{display:flex;gap:6px;justify-content:flex-end;margin-bottom:8px}
.tc-strip{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(260px,calc((100% - 48px)/4));gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;padding:4px 4px 14px;scrollbar-width:thin}
.tc-card{scroll-snap-align:start;background:var(--surface);border-radius:18px;box-shadow:var(--shadow);padding:16px 18px;display:flex;flex-direction:column;gap:12px;border:2px solid transparent;min-width:0}
.tc-card.today{border-color:#1F6B4A}
.tc-card.past{opacity:.72}
.tc-card header{display:flex;flex-direction:column;gap:2px;position:relative}
.tc-card header b{font-size:20px;font-family:var(--f-display,Georgia,serif)}
.tc-wd{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.tc-today{position:absolute;right:0;top:0;background:#1F6B4A;color:#fff;font-size:12px;font-weight:700;padding:4px 10px;border-radius:999px}
.tc-train{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border-radius:14px;background:#EEF0FB}
.tc-train b{font-size:17px;line-height:1.3}
.tc-train.empty{background:var(--bg,#F4F7F5)}
.tc-lab{font-size:12px;color:var(--muted);font-weight:600}
.tc-line{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;background:var(--bg,#F4F7F5);color:var(--ink);text-decoration:none;border:0;font:inherit;text-align:left;cursor:pointer;width:100%}
.tc-line:hover{background:var(--accent-soft,#DDF3E8)}
.tc-line>span:nth-child(2){display:flex;flex-direction:column;flex:1;min-width:0}
.tc-line b{font-size:15px;line-height:1.3;overflow-wrap:anywhere}
.tc-ic{font-size:22px;flex:none}
.tc-open{display:inline-flex;align-items:center;gap:2px;font-size:12px;font-weight:700;color:var(--accent-text,#17734A);flex:none}
.tc-open svg{width:14px;height:14px}
.tc-editbtn{align-self:flex-start;margin-top:auto}
.tc-page{min-width:0;max-width:100%}
.tc-page .page-head{flex-wrap:wrap}
.tc-page .page-head>*{min-width:0}
@media (max-width:700px){.tc-strip{grid-auto-columns:86%}.tc-page .page-head h1{font-size:24px}}
.tc-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
.tc-h{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;padding:0 4px}
.tc-day{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-height:104px;padding:8px 9px;border-radius:12px;background:var(--surface);box-shadow:var(--shadow);border:1px solid transparent;text-align:left;font:inherit;color:var(--ink);min-width:0;cursor:default}
button.tc-day{cursor:pointer}button.tc-day:hover{border-color:var(--accent)}
.tc-day.out{background:none;box-shadow:none}
.tc-day.today{border-color:#1F6B4A;box-shadow:0 0 0 2px rgba(31,107,74,.25)}
.tc-day.sel{border-color:var(--brand-red)}
.tc-n{font:700 12px/1 var(--f-mono);color:var(--muted)}
.tc-tr{font-size:13px;line-height:1.25}
.tc-x{font-size:12px;color:var(--muted);line-height:1.25;overflow-wrap:anywhere}
.tc-edit{margin-bottom:14px}
@media (max-width:700px){.tc-grid{gap:4px}.tc-day{min-height:70px;padding:5px}.tc-tr{font-size:11px}.tc-x{display:none}}
/* "+ Add section" on every section title, and the line of a section with nobody yet */
.pl-grid .pl-gadd{width:auto;padding:0 8px;margin-left:6px;font-weight:700;color:var(--accent-text,#17734A);background:var(--accent-soft,#DDF3E8);border-radius:999px}
.pl-grid tr.pl-grp-empty th{background:#FFF7E6}
.pl-grid tr.pl-empty-sec td{height:auto;padding:8px 12px;background:#FFFCF5;cursor:default}
/* Clear, Colour, + Shift, + Section: always visible, outside the scrolling row of shift buttons */
.pl-fixed{display:flex;gap:6px;flex:none;flex-wrap:wrap;align-items:center}
/* Planner live: who else has the week open, and the cell each of them is on (30 Oct 2026) */
.pl-people{display:inline-flex;align-items:center;gap:4px;color:var(--muted)}
.pl-people:empty{display:none}
.pl-live-dot{width:8px;height:8px;border-radius:50%;background:#E07B00;box-shadow:0 0 0 3px rgba(224,123,0,.2);margin-right:2px}
.pl-who{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:#E07B00;color:#fff;font:700 11px/1 var(--f-body);border:2px solid var(--surface)}
.pl-grid td.pl-other{outline:2px dashed #E07B00;outline-offset:-2px}
.pl-grid td.pl-other::after{content:attr(data-who);position:absolute;top:0;right:0;font:700 9px/1.2 var(--f-body);background:#E07B00;color:#fff;padding:1px 3px;border-radius:0 0 0 4px;pointer-events:none}

/* narrower computers: only the icons */
@media (min-width:821px) and (max-width:1100px){
  body.t2-side-on:not(.t2-wide){--t2-side:72px}
  .t2-side a{justify-content:center;padding:10px}
  .t2-side a span,.t2-sep{display:none}
}

/* phones: bottom tab bar on every page (theme2.js), like the new Hub */
.t2-tabbar{display:none}
@media (max-width:820px){
  .t2-tabbar{display:grid;grid-template-columns:repeat(4,1fr);position:fixed;left:0;right:0;bottom:0;z-index:35;background:var(--surface);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
  .t2-tabbar a{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;color:var(--muted);text-decoration:none;font-weight:600}
  .t2-tabbar a svg{width:22px;height:22px}
  .t2-tabbar a[aria-current]{color:var(--brand-red)}
  body:has(.h2-view) .t2-tabbar,body:has(.login-wrap) .t2-tabbar{display:none}
  main{padding-bottom:96px}
  .page-head h1,.hub-hello h1{font-size:26px}
  .panel{padding:16px}
}
