/* ============================================================
   AREA RISERVATA — SHELL (topbar + sidebar + dashboard)

   Struttura: la stessa dell'Area Partner / AdminPanel
   (barra in alto sticky + sidebar a sinistra + main).
   Colori: quelli della homepage pubblica e del login
   (Porcelain #F8F7F4 + Signal Blue #0057FF).
   Superfici: neumorfismo MORBIDO — doppia ombra (luce in alto a
   sinistra, ombra in basso a destra) sul Porcelain, mai incisa.

   Tutto prefissato .ars- / --ars- per non collidere con .ar-*
   (le 140 view interne) ne' con Bootstrap.

   MOBILE: la sidebar diventa un drawer off-canvas vero (transform
   + scrim + blocco scroll + ESC), la barra in alto resta, la
   ricerca si apre a tutto schermo. Nessun controllo sotto i 16px,
   nessun doppio-tap-zoom: niente zoom automatico da nessuna parte.
   ============================================================ */

:root {
    --ars-nav-h: 60px;
    --ars-side-w: 268px;
    --ars-safe-top: env(safe-area-inset-top, 0px);
    --ars-safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Neumorfismo: la luce viene da in alto a sinistra */
    --ars-up: 5px 5px 12px rgba(12,20,32,.06), -5px -5px 12px rgba(255,255,255,.85);
    --ars-up-sm: 3px 3px 7px rgba(12,20,32,.05), -3px -3px 7px rgba(255,255,255,.8);
    --ars-up-lg: 10px 10px 26px rgba(12,20,32,.08), -8px -8px 20px rgba(255,255,255,.9);
    --ars-in: inset 3px 3px 7px rgba(12,20,32,.07), inset -3px -3px 7px rgba(255,255,255,.9);
    --ars-in-sm: inset 2px 2px 5px rgba(12,20,32,.06), inset -2px -2px 5px rgba(255,255,255,.85);

    --ars-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "SF Mono", Menlo, Consolas, monospace;
    --ars-ease: cubic-bezier(.22,.8,.28,1);
}

.ars-body {
    background: var(--hg-porcelain);
    color: var(--hg-ink);
}

/* salto al contenuto: invisibile finche' non lo si raggiunge da tastiera */
.ars-skip {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--hg-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform .18s var(--ars-ease);
}

.ars-skip:focus { transform: translateY(0); color: #fff; }

/* niente zoom automatico: campi >= 16px, doppio tap disattivato */
.ars-topbar input,
.ars-drawer-search input { font-size: 16px; }

.ars-topbar a, .ars-topbar button, .ars-topbar input,
.ars-sidebar a, .ars-sidebar button, .ars-sidebar input,
.ars-results a, .ars-cat button, .ars-sub { touch-action: manipulation; }

/* ============================================================
   1. BARRA IN ALTO
   ============================================================ */
.ars-topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    height: calc(var(--ars-nav-h) + var(--ars-safe-top));
    padding-top: var(--ars-safe-top);
    /* Fondo PIENO, niente backdrop-filter: un filtro qui dentro creerebbe
       un containing block e la ricerca a schermo intero (position:fixed)
       resterebbe intrappolata dentro la barra invece di coprire la pagina.
       Su porcellana la barra piena e' comunque indistinguibile dal vetro. */
    background: var(--hg-porcelain);
    border-bottom: 1px solid var(--hg-rule);
}

.ars-topbar-in {
    height: var(--ars-nav-h);
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- burger (solo mobile/tablet) --- */
.ars-burger {
    display: none;
    width: 42px;
    height: 42px;
    flex: none;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--hg-ink);
    cursor: pointer;
    transition: box-shadow .16s var(--ars-ease);
}

.ars-burger:active { box-shadow: var(--ars-in-sm); }
.ars-burger svg { width: 19px; height: 19px; }

/* --- logo --- */
.ars-logo {
    display: block;
    width: 132px;
    aspect-ratio: 2592/583;
    flex: none;
}

.ars-logo img { width: 100%; height: 100%; display: block; }

.ars-tag {
    flex: none;
    font-family: var(--ars-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--hg-mute);
    border: 1px solid var(--hg-rule);
    border-radius: 4px;
    padding: 3px 6px;
    line-height: 1;
}

/* ============================================================
   2. RICERCA
   ============================================================ */
.ars-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 560px;
    margin: 0 auto;
}

.ars-search-field {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 11px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-in);
    transition: box-shadow .18s var(--ars-ease);
}

.ars-search-field:focus-within {
    box-shadow: var(--ars-in), 0 0 0 2px var(--hg-blue);
}

.ars-search-field > svg {
    position: absolute;
    left: 13px;
    width: 16px;
    height: 16px;
    color: var(--hg-mute);
    pointer-events: none;
}

.ars-search input {
    width: 100%;
    height: 42px;
    padding: 0 74px 0 38px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--hg-ink);
    font-family: inherit;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

.ars-search input::placeholder { color: var(--hg-mute); }
.ars-search input:focus { outline: none; }
.ars-search input::-webkit-search-cancel-button { display: none; }

.ars-kbd {
    position: absolute;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--ars-mono);
    font-size: 10.5px;
    color: var(--hg-mute);
    border: 1px solid var(--hg-rule);
    border-radius: 4px;
    padding: 2px 6px;
    line-height: 1.4;
    pointer-events: none;
    transition: opacity .14s ease;
}

.ars-search-field:focus-within .ars-kbd { opacity: 0; }

.ars-spin {
    position: absolute;
    right: 12px;
    width: 15px;
    height: 15px;
    border: 2px solid var(--hg-rule);
    border-top-color: var(--hg-blue);
    border-radius: 50%;
    animation: ars-spin .65s linear infinite;
    display: none;
}

.ars-search.is-loading .ars-spin { display: block; }
.ars-search.is-loading .ars-kbd { display: none; }

@keyframes ars-spin { to { transform: rotate(360deg); } }

/* --- tendina risultati --- */
.ars-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: min(66vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--hg-paper);
    border: 1px solid var(--hg-rule);
    border-radius: 12px;
    box-shadow: 0 20px 50px -22px rgba(12,20,32,.45);
    padding: 6px;
    z-index: 1200;
    display: none;
}

.ars-results.open { display: block; }

.ars-res-grp {
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--hg-mute);
    padding: 12px 12px 5px;
}

.ars-res-grp:first-child { padding-top: 6px; }

.ars-res {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 8px 11px;
    border-radius: 8px;
    color: var(--hg-ink);
    text-decoration: none;
}

.ars-res:hover, .ars-res.active { background: var(--hg-blue-soft); }

.ars-res-ico {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-mist);
    color: var(--hg-slate);
}

.ars-res.active .ars-res-ico,
.ars-res:hover .ars-res-ico { background: rgba(0,87,255,.12); color: var(--hg-blue); }

.ars-res-ico svg { width: 15px; height: 15px; }
.ars-res-ico i { font-size: 13px; }

.ars-res-body { flex: 1; min-width: 0; }

.ars-res-t {
    display: block;
    font-size: 14px;
    font-weight: 550;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ars-res-t b {
    font-weight: 700;
    color: var(--hg-blue);
    background: rgba(0,87,255,.10);
    border-radius: 3px;
    padding: 0 1px;
}

.ars-res-s {
    display: block;
    font-size: 12px;
    color: var(--hg-mute);
    line-height: 1.35;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ars-res-go { flex: none; color: var(--hg-rule); }
.ars-res.active .ars-res-go, .ars-res:hover .ars-res-go { color: var(--hg-blue); }

.ars-res-msg {
    padding: 20px 12px;
    text-align: center;
    color: var(--hg-mute);
    font-size: 13px;
}

.ars-res-msg strong { display: block; color: var(--hg-slate); font-size: 14px; margin-bottom: 3px; }

/* ============================================================
   3. LATO DESTRO DELLA BARRA
   ============================================================ */
.ars-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }

.ars-icobtn {
    width: 42px;
    height: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--hg-ink);
    cursor: pointer;
}

.ars-icobtn:active { box-shadow: var(--ars-in-sm); }
.ars-icobtn svg { width: 18px; height: 18px; }

/* selettore filiale + profilo */
.ars-branch, .ars-profile { position: relative; flex: none; }

.ars-av {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,87,255,.12);
    color: var(--hg-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    /* qualunque cosa arrivi qui dentro resta nel cerchio */
    overflow: hidden;
    white-space: nowrap;
}

.ars-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 42px;
    max-width: 190px;
    padding: 0 13px;
    border: 0;
    border-radius: 11px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--hg-slate);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 550;
    cursor: pointer;
    transition: box-shadow .16s var(--ars-ease), color .16s ease;
}

.ars-pill:hover { color: var(--hg-ink); }
.ars-pill[aria-expanded="true"] { box-shadow: var(--ars-in-sm); color: var(--hg-blue); }
.ars-pill svg { flex: none; width: 15px; height: 15px; }
.ars-pill .ars-pill-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ars-pill .ars-chev { width: 11px; height: 11px; color: var(--hg-mute); transition: transform .18s var(--ars-ease); }
.ars-pill[aria-expanded="true"] .ars-chev { transform: rotate(180deg); }

/* menu a discesa condiviso (filiale + profilo) */
.ars-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 264px;
    background: var(--hg-paper);
    border: 1px solid var(--hg-rule);
    border-radius: 12px;
    box-shadow: 0 20px 50px -22px rgba(12,20,32,.45);
    padding: 6px;
    z-index: 1200;
    display: none;
}

.ars-menu.open { display: block; }

.ars-menu-head { padding: 11px 12px 9px; }
.ars-menu-head strong { display: block; font-size: 14px; color: var(--hg-ink); overflow-wrap: anywhere; }
.ars-menu-head span { font-size: 12px; color: var(--hg-mute); }

.ars-menu-lab {
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--hg-mute);
    padding: 10px 12px 5px;
}

.ars-menu-sep { height: 1px; background: var(--hg-rule); margin: 5px 8px; }

.ars-menu a, .ars-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--hg-slate);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.ars-menu a:hover, .ars-menu button:hover { background: var(--hg-mist); color: var(--hg-ink); }
.ars-menu a.active, .ars-menu button.active { background: var(--hg-blue-soft); color: var(--hg-blue); font-weight: 600; }
.ars-menu button.active i { color: var(--success); }
.ars-menu a.danger, .ars-menu button.danger { color: var(--danger); }
.ars-menu svg { flex: none; width: 16px; height: 16px; }
.ars-menu .ars-mi-body { flex: 1; min-width: 0; }
.ars-menu .ars-mi-body small { display: block; font-size: 11.5px; color: var(--hg-mute); }

/* ============================================================
   3b. CENTRO NOTIFICHE
   Gli stessi avvisi che sulla home si aprono come finestra sono
   qui elencati come notifiche, su OGNI pagina dell'area.
   ============================================================ */
.ars-notif { position: relative; flex: none; }

.ars-bell {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--hg-ink);
    cursor: pointer;
    transition: box-shadow .16s var(--ars-ease), color .16s ease;
}

.ars-bell:hover { color: var(--hg-blue); }
.ars-bell[aria-expanded="true"] { box-shadow: var(--ars-in-sm); color: var(--hg-blue); }
.ars-bell svg { width: 18px; height: 18px; }

.ars-bell-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--hg-porcelain);
    display: none;
}

.ars-notif.has-items .ars-bell-dot { display: block; }

/* la campanella "respira" una volta sola quando arrivano notifiche */
.ars-notif.has-items .ars-bell svg { animation: ars-ring .9s var(--ars-ease) 1; transform-origin: 50% 15%; }

@keyframes ars-ring {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(13deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(6deg); }
    80% { transform: rotate(-3deg); }
}

.ars-notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(380px, calc(100vw - 24px));
    max-height: min(70vh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--hg-paper);
    border: 1px solid var(--hg-rule);
    border-radius: 12px;
    box-shadow: 0 20px 50px -22px rgba(12,20,32,.45);
    padding: 6px;
    z-index: 1200;
    display: none;
}

.ars-notif-panel.open { display: block; }

.ars-notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px 9px;
}

.ars-notif-head strong { font-size: 14px; color: var(--hg-ink); }

.ars-notif-head .ars-notif-n {
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--hg-mute);
}

.ars-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .14s ease;
}

.ars-notif-item:hover { background: var(--hg-mist); }

.ars-notif-ico {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-mist);
    color: var(--c, var(--hg-blue));
    font-size: 13px;
}

.ars-notif-item[data-tone="warn"] { --c: #B07400; }
.ars-notif-item[data-tone="danger"] { --c: var(--danger); }
.ars-notif-item[data-tone="info"] { --c: var(--hg-blue); }
.ars-notif-item[data-tone="ok"] { --c: var(--success); }
.ars-notif-item[data-tone] .ars-notif-ico { background: color-mix(in srgb, var(--c) 12%, transparent); }

.ars-notif-b { flex: 1; min-width: 0; }
.ars-notif-b strong { display: block; font-size: 13.5px; font-weight: 640; color: var(--hg-ink); line-height: 1.35; }
.ars-notif-b span { display: block; font-size: 12.5px; color: var(--hg-mute); line-height: 1.45; margin-top: 2px; }
.ars-notif-go { flex: none; margin-top: 8px; color: var(--hg-rule); }
.ars-notif-item:hover .ars-notif-go { color: var(--hg-blue); }

.ars-notif-empty { padding: 26px 14px; text-align: center; color: var(--hg-mute); font-size: 13px; }
.ars-notif-empty strong { display: block; color: var(--hg-slate); font-size: 14px; margin-bottom: 3px; }
.ars-notif-empty .ars-notif-tick { font-size: 22px; color: var(--success); margin-bottom: 8px; display: block; }

/* ============================================================
   4. SHELL + SIDEBAR
   ============================================================ */
/* body.ar-body e' flex-column (footer sempre in fondo): lo shell deve
   crescere per riempire lo spazio fra barra in alto e fondo pagina. */
.ars-shell { display: flex; align-items: flex-start; flex: 1 0 auto; }

.ars-sidebar {
    position: sticky;
    top: calc(var(--ars-nav-h) + var(--ars-safe-top));
    width: var(--ars-side-w);
    flex: none;
    height: calc(100vh - var(--ars-nav-h) - var(--ars-safe-top));
    height: calc(100dvh - var(--ars-nav-h) - var(--ars-safe-top));
    background: var(--hg-porcelain);
    border-right: 1px solid var(--hg-rule);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ars-side-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 10px 10px 16px;
}

.ars-side-scroll::-webkit-scrollbar { width: 8px; }
.ars-side-scroll::-webkit-scrollbar-thumb { background: var(--hg-rule); border-radius: 8px; }

/* --- voce singola (Dashboard, Temperature…) --- */
.ars-nav {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--hg-slate);
    font-size: 14px;
    font-weight: 550;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s var(--ars-ease);
}

.ars-nav .ars-n-ico {
    flex: none;
    width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hg-mute);
    font-size: 14px;
    transition: color .15s ease;
}

.ars-nav .ars-n-lab { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ars-nav:hover { color: var(--hg-ink); box-shadow: var(--ars-up-sm); }
.ars-nav:hover .ars-n-ico { color: var(--hg-slate); }

.ars-nav.active {
    color: var(--hg-blue);
    font-weight: 650;
    background: var(--hg-paper);
    box-shadow: var(--ars-up-sm);
}

.ars-nav.active .ars-n-ico { color: var(--hg-blue); }

.ars-nav.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--hg-blue);
}

/* --- gruppo apribile --- */
.ars-grp { margin-bottom: 2px; }

.ars-grp-btn {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--hg-slate);
    font-family: inherit;
    font-size: 14px;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s var(--ars-ease);
}

.ars-grp-btn:hover { color: var(--hg-ink); box-shadow: var(--ars-up-sm); }

.ars-grp-btn .ars-n-ico {
    flex: none;
    width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hg-mute);
    font-size: 14px;
}

.ars-grp-btn .ars-n-lab { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ars-grp-btn .ars-chev {
    flex: none;
    width: 12px;
    height: 12px;
    color: var(--hg-mute);
    transition: transform .24s var(--ars-ease);
}

.ars-grp-btn[aria-expanded="false"] .ars-chev { transform: rotate(-90deg); }

/* il gruppo che contiene la pagina corrente resta segnalato anche da chiuso */
.ars-grp.has-active > .ars-grp-btn { color: var(--hg-ink); font-weight: 650; }
.ars-grp.has-active > .ars-grp-btn .ars-n-ico { color: var(--hg-blue); }

/* apertura/chiusura fluida ad altezza automatica (niente max-height a occhio) */
.ars-grp-body {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows .26s var(--ars-ease), opacity .2s ease;
}

.ars-grp-body > div { overflow: hidden; min-height: 0; }
.ars-grp-btn[aria-expanded="false"] + .ars-grp-body { grid-template-rows: 0fr; opacity: 0; }

.ars-sub-nav {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    margin: 2px 0 2px 19px;
    padding: 7px 12px 7px 16px;
    border-left: 1px solid var(--hg-rule);
    border-radius: 0 9px 9px 0;
    color: var(--hg-mute);
    font-size: 13.5px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.ars-sub-nav:hover { color: var(--hg-ink); background: var(--hg-mist); }

.ars-sub-nav.active {
    color: var(--hg-blue);
    font-weight: 600;
    border-left-color: var(--hg-blue);
    background: var(--hg-blue-soft);
}

.ars-sub-nav .ars-n-lab { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* separatore/etichetta di sezione nella sidebar */
.ars-side-lab {
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--hg-mute);
    padding: 16px 12px 6px;
}

/* piede sidebar */
.ars-side-foot {
    flex: none;
    border-top: 1px solid var(--hg-rule);
    padding: 10px;
}

.ars-side-foot .ars-who {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    text-decoration: none;
}

.ars-who-av {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,87,255,.12);
    color: var(--hg-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
}

.ars-who-b { min-width: 0; flex: 1; }
.ars-who-b strong { display: block; font-size: 13px; color: var(--hg-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ars-who-b span { font-size: 11px; color: var(--hg-mute); }

/* testa del drawer: solo su mobile */
.ars-drawer-only { display: none; }

.ars-drawer-head {
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-bottom: 1px solid var(--hg-rule);
    padding-top: calc(12px + var(--ars-safe-top));
}

.ars-x {
    margin-left: auto;
    width: 42px;
    height: 42px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--hg-ink);
    cursor: pointer;
}

.ars-x:active { box-shadow: var(--ars-in-sm); }
.ars-x svg { width: 17px; height: 17px; }

.ars-scrim {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(12,20,32,.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity .26s ease, visibility 0s linear .26s;
}

.ars-scrim.open { opacity: 1; visibility: visible; transition: opacity .26s ease; }

/* ============================================================
   5. MAIN
   ============================================================ */
/* colonna: contenuto che cresce + footer sempre in coda */
.ars-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

/* Il contenitore storico delle view (.ar-main-container, usato da tutte e
   140 le pagine) prima era figlio del body a tutta larghezza; ora vive
   dentro la colonna accanto alla sidebar. Senza box-sizing esplicito i
   suoi 24px di padding uscivano dalla colonna e comparivano 48px di
   scroll orizzontale. Il cap a 1400px resta, ma non puo' piu' superare
   lo spazio disponibile. */
.ars-main > .ar-main-container {
    box-sizing: border-box;
    width: 100%;
    max-width: min(1400px, 100%);
    margin: 0 auto;
}

/* ============================================================
   6. DASHBOARD
   ============================================================ */
.ars-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ars-hero .ars-lab {
    font-family: var(--ars-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--hg-mute);
}

.ars-hero h1 {
    margin: 8px 0 0;
    font-size: clamp(1.5rem, 3.4vw, 2rem);
    font-weight: 640;
    letter-spacing: -.025em;
    line-height: 1.12;
    color: var(--hg-ink);
}

.ars-hero h1 b { color: var(--hg-blue); font-weight: inherit; }
.ars-hero p { margin: 6px 0 0; color: var(--hg-slate); font-size: .95rem; }

.ars-date {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border-radius: 11px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--hg-slate);
    font-size: 13px;
    font-weight: 550;
    text-transform: capitalize;
}

.ars-date svg { flex: none; width: 15px; height: 15px; color: var(--hg-mute); }

/* --- statistiche --- */
.ars-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.ars-stat {
    position: relative;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up);
    text-decoration: none;
    display: block;
    transition: box-shadow .18s var(--ars-ease), transform .18s var(--ars-ease);
}

a.ars-stat:hover { box-shadow: var(--ars-up-lg); transform: translateY(-2px); }

.ars-stat-l {
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--hg-mute);
}

.ars-stat-n {
    margin: 9px 0 0;
    font-size: 30px;
    font-weight: 680;
    line-height: 1;
    color: var(--hg-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.ars-stat-c { margin-top: 4px; font-size: 12px; color: var(--hg-mute); }
.ars-stat.is-accent .ars-stat-n { color: var(--hg-blue); }

/* --- intestazione di sezione --- */
.ars-sec-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}

.ars-sec-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 640;
    letter-spacing: -.015em;
    color: var(--hg-ink);
}

.ars-sec-head p { margin: 0; font-size: 13px; color: var(--hg-mute); }

/* --- schede categoria con tendina --- */
.ars-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 14px;
    align-items: start;
}

.ars-cat {
    border-radius: 16px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up);
    overflow: hidden;
    transition: box-shadow .2s var(--ars-ease);
}

.ars-cat:hover { box-shadow: var(--ars-up-lg); }

.ars-cat-head {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 16px 18px;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}

.ars-cat-ico {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--hg-blue);
    font-size: 16px;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s var(--ars-ease);
}

.ars-cat:hover .ars-cat-ico,
.ars-cat.open .ars-cat-ico { background: var(--hg-blue); color: #fff; box-shadow: 0 6px 16px -6px rgba(0,87,255,.7); }

.ars-cat-info { flex: 1; min-width: 0; }

.ars-cat-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 640;
    letter-spacing: -.015em;
    color: var(--hg-ink);
}

.ars-cat-info p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--hg-mute);
    line-height: 1.4;
}

.ars-cat-side { flex: none; display: flex; align-items: center; gap: 9px; }

.ars-count {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 6px;
    background: var(--hg-mist);
    color: var(--hg-slate);
    font-family: var(--ars-mono);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .18s ease, color .18s ease;
}

.ars-cat.open .ars-count { background: rgba(0,87,255,.12); color: var(--hg-blue); }

.ars-cat-head .ars-chev {
    width: 13px;
    height: 13px;
    color: var(--hg-mute);
    transition: transform .26s var(--ars-ease), color .18s ease;
}

.ars-cat.open .ars-chev { transform: rotate(180deg); color: var(--hg-blue); }

/* corpo a tendina: altezza automatica, transizione fluida */
.ars-cat-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s var(--ars-ease);
}

.ars-cat.open > .ars-cat-body { grid-template-rows: 1fr; }
.ars-cat-body > div { overflow: hidden; min-height: 0; }
.ars-cat-body .ars-cat-list { padding: 2px 12px 12px; }

.ars-sub {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 9px 12px;
    border-radius: 11px;
    color: var(--hg-slate);
    text-decoration: none;
    transition: background-color .15s ease, box-shadow .16s var(--ars-ease), color .15s ease;
}

.ars-sub:hover { background: var(--hg-paper); box-shadow: var(--ars-up-sm); color: var(--hg-ink); }

.ars-sub-ico {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-mist);
    color: var(--hg-slate);
    font-size: 13px;
    transition: background-color .15s ease, color .15s ease;
}

.ars-sub:hover .ars-sub-ico { background: rgba(0,87,255,.12); color: var(--hg-blue); }

.ars-sub-t { flex: 1; min-width: 0; }
.ars-sub-t strong { display: block; font-size: 14px; font-weight: 600; color: var(--hg-ink); line-height: 1.3; }
.ars-sub-t small { display: block; font-size: 12px; color: var(--hg-mute); line-height: 1.35; margin-top: 1px; }
.ars-sub-go { flex: none; color: var(--hg-rule); transition: color .15s ease, transform .15s var(--ars-ease); }
.ars-sub:hover .ars-sub-go { color: var(--hg-blue); transform: translateX(3px); }

/* scheda categoria che e' un link diretto (Temperature) */
.ars-cat--direct .ars-cat-head { padding-right: 18px; }
.ars-cat--direct:hover .ars-cat-side .ars-chev { color: var(--hg-blue); transform: translateX(3px); }

/* ============================================================
   6b. BANNER E PANNELLI DELLA DASHBOARD
   Un solo linguaggio: superficie porcellana in rilievo, una
   sottile barra di colore a sinistra per il tono. Niente
   gradienti multicolore.
   ============================================================ */
.ars-banner {
    position: relative;
    border-radius: 14px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up);
    padding: 18px 20px 18px 22px;
    margin-bottom: 16px;
    overflow: hidden;
}

.ars-banner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--c, var(--hg-blue));
}

.ars-banner--calm { --c: var(--hg-blue); }
.ars-banner--warn { --c: #B07400; }
.ars-banner--danger { --c: var(--danger); }

.ars-banner-head { display: flex; align-items: flex-start; gap: 13px; }

.ars-banner-ico {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--c, var(--hg-blue));
    font-size: 15px;
}

.ars-banner-t {
    font-size: 1rem;
    font-weight: 640;
    color: var(--hg-ink);
    letter-spacing: -.01em;
    line-height: 1.35;
}

.ars-banner-s { margin-top: 4px; font-size: 13.5px; color: var(--hg-slate); line-height: 1.5; }
.ars-banner-s a { color: var(--hg-blue); font-weight: 600; }
.ars-banner-s code { font-family: var(--ars-mono); font-size: 12.5px; color: var(--hg-ink); background: var(--hg-mist); border-radius: 4px; padding: 1px 5px; }

.ars-banner-note {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px dashed var(--hg-rule);
    font-size: 12.5px;
    color: var(--hg-mute);
}

.ars-chip {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 5px;
    background: var(--hg-mist);
    color: var(--hg-slate);
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* --- passi di attivazione --- */
.ars-steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ars-steps li { display: flex; align-items: flex-start; gap: 12px; opacity: .62; }
.ars-steps li.is-done, .ars-steps li.is-current { opacity: 1; }

.ars-step-n {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-mist);
    color: var(--hg-mute);
    font-family: var(--ars-mono);
    font-size: 12px;
    font-weight: 700;
}

.ars-steps li.is-current .ars-step-n { background: rgba(0,87,255,.12); color: var(--hg-blue); }
.ars-steps li.is-done .ars-step-n { background: rgba(26,127,85,.14); color: var(--success); }
.ars-steps strong { display: block; font-size: 14px; font-weight: 640; color: var(--hg-ink); }
.ars-steps small { display: block; font-size: 12.5px; color: var(--hg-slate); line-height: 1.5; margin-top: 2px; }
.ars-steps a { color: var(--hg-blue); font-weight: 600; }

.ars-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 9px;
    padding: 0 16px;
    border-radius: 8px;
    background: var(--hg-blue);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}

.ars-banner-cta:hover { background: var(--hg-blue-d); color: #fff; }

/* --- pannello (temperature da registrare) --- */
.ars-panel {
    position: relative;
    border-radius: 16px;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up);
    padding: 18px;
    margin-bottom: 24px;
    overflow: hidden;
}

.ars-panel::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--c, var(--hg-blue));
}

.ars-panel--alert { --c: #B07400; }

.ars-panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.ars-panel-ico {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--c, var(--hg-blue));
    font-size: 15px;
}

.ars-panel-t strong { display: block; font-size: 1rem; font-weight: 640; color: var(--hg-ink); letter-spacing: -.01em; }
.ars-panel-t small { display: block; font-size: 12.5px; color: var(--hg-mute); margin-top: 1px; }

.ars-temps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }

.ars-temp {
    border-radius: 12px;
    background: var(--hg-paper);
    border: 1px solid var(--hg-rule);
    padding: 13px 14px;
}

.ars-temp-name { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--hg-ink); }
.ars-temp-name i { color: var(--hg-mute); font-size: 13px; }
.ars-temp-name strong { font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ars-temp-last { margin-top: 3px; font-size: 12.5px; color: var(--hg-mute); }
.ars-temp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.ars-temp-actions form { margin: 0; }

.ars-tbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--hg-rule);
    border-radius: 9px;
    background: var(--hg-porcelain);
    color: var(--hg-slate);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.ars-tbtn:hover { border-color: var(--hg-blue); color: var(--hg-blue); }
.ars-tbtn--ok { background: var(--success); border-color: var(--success); color: #fff; }
.ars-tbtn--ok:hover { background: #156B47; border-color: #156B47; color: #fff; }
.ars-tbtn:disabled { opacity: .6; cursor: not-allowed; }

.ars-temp-form { margin-top: 10px; }
.ars-temp-row { display: flex; align-items: center; gap: 8px; }

.ars-temp-row input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--hg-rule);
    border-radius: 9px;
    background: var(--hg-porcelain);
    color: var(--hg-ink);
    font-family: inherit;
    font-size: 16px; /* mai sotto i 16px: niente zoom al focus */
}

.ars-temp-row input:focus { outline: none; border-color: var(--hg-blue); box-shadow: 0 0 0 3px rgba(0,87,255,.14); }
.ars-temp-unit { flex: none; font-size: 13px; color: var(--hg-mute); font-weight: 600; }
.ars-temp-row .ars-tbtn { padding: 0 12px; }

.ars-panel-more {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    margin-top: 12px;
    color: var(--hg-blue);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}

.ars-panel-more svg { transition: transform .16s var(--ars-ease); }
.ars-panel-more:hover svg { transform: translateX(3px); }

/* ============================================================
   6c. AVVISI DELLA HOME (i 5 promemoria giornalieri)
   Restano finestre Bootstrap (usiamo il suo JS per apertura,
   backdrop e chiusura) ma tutto il vestito e' nostro.
   Su telefono NON sono a tutto schermo: diventano un foglio che
   sale dal basso, alto quanto serve e mai piu' di ~86% dello
   schermo, con lo scroll interno solo sul corpo.
   ============================================================ */
.arsn-modal .modal-content {
    border: 1px solid var(--hg-rule);
    border-radius: 16px;
    background: var(--hg-porcelain);
    box-shadow: 0 30px 70px -28px rgba(12,20,32,.55);
    overflow: hidden;
}

.arsn-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--hg-rule);
    background: var(--hg-porcelain);
}

.arsn-head-ico {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hg-porcelain);
    box-shadow: var(--ars-up-sm);
    color: var(--c, var(--hg-blue));
    font-size: 15px;
}

.arsn-modal[data-tone="warn"] { --c: #B07400; }
.arsn-modal[data-tone="danger"] { --c: var(--danger); }
.arsn-modal[data-tone="ok"] { --c: var(--success); }
.arsn-modal[data-tone="info"] { --c: var(--hg-blue); }

.arsn-head-t { flex: 1; min-width: 0; }
.arsn-head-t strong { display: block; font-size: 1rem; font-weight: 640; letter-spacing: -.01em; color: var(--hg-ink); line-height: 1.3; }
.arsn-head-t small { display: block; font-size: 12.5px; color: var(--hg-mute); margin-top: 1px; }

.arsn-chip {
    flex: none;
    padding: 4px 9px;
    border-radius: 6px;
    background: var(--hg-mist);
    color: var(--hg-slate);
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
}

.arsn-body {
    padding: 16px 18px;
    max-height: 58vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--hg-porcelain);
}

/* riga informativa in cima al corpo */
.arsn-lead {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--hg-mist);
    color: var(--hg-slate);
    font-size: 13.5px;
    line-height: 1.45;
}

.arsn-lead strong { color: var(--hg-ink); font-weight: 640; }
.arsn-lead > span { flex: 1; min-width: 160px; }

/* voce di elenco dentro il corpo (tipo di pulizia, frigo, allegato…) */
.arsn-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 13px;
    margin-bottom: 9px;
    border-radius: 11px;
    background: var(--hg-paper);
    border: 1px solid var(--hg-rule);
}

.arsn-row:last-child { margin-bottom: 0; }
.arsn-row-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--hg-mist); color: var(--hg-slate); font-size: 13px; }
.arsn-row-b { display: block; flex: 1; min-width: 0; }
/* Solo i figli DIRETTI vanno a capo: uno <strong> annidato (es. "Ieri
   3.5°C. E la stessa?") deve restare in linea con il suo testo. */
.arsn-row-b > strong { display: block; font-size: 13.5px; font-weight: 640; color: var(--hg-ink); line-height: 1.3; }
.arsn-row-b > small { display: block; font-size: 12.5px; color: var(--hg-mute); line-height: 1.4; margin-top: 2px; }
.arsn-row.is-done { border-color: rgba(26,127,85,.35); background: rgba(26,127,85,.05); }
.arsn-row.is-done .arsn-row-ico { background: rgba(26,127,85,.14); color: var(--success); }

.arsn-badge {
    flex: none;
    align-self: center;
    padding: 4px 9px;
    border-radius: 6px;
    background: var(--hg-mist);
    color: var(--hg-mute);
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.arsn-badge.is-ok { background: rgba(26,127,85,.14); color: var(--success); }

.arsn-field { margin-top: 12px; }
.arsn-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 640; color: var(--hg-ink); }

.arsn-field input,
.arsn-field textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--hg-rule);
    border-radius: 9px;
    background: var(--hg-paper);
    color: var(--hg-ink);
    font-family: inherit;
    font-size: 16px; /* mai sotto i 16px: niente zoom al focus */
    -webkit-appearance: none;
    appearance: none;
}

.arsn-field textarea { min-height: 88px; resize: vertical; }
.arsn-field input:focus,
.arsn-field textarea:focus { outline: none; border-color: var(--hg-blue); box-shadow: 0 0 0 3px rgba(0,87,255,.14); }

.arsn-inline { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.arsn-inline input {
    flex: 1 1 110px;
    min-width: 0;
    max-width: 170px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--hg-rule);
    border-radius: 9px;
    background: var(--hg-paper);
    color: var(--hg-ink);
    font-family: inherit;
    font-size: 16px; /* mai sotto i 16px: niente zoom al focus */
    -webkit-appearance: none;
    appearance: none;
}

.arsn-inline input:focus { outline: none; border-color: var(--hg-blue); box-shadow: 0 0 0 3px rgba(0,87,255,.14); }
.arsn-unit { flex: none; font-size: 13px; font-weight: 600; color: var(--hg-mute); }

/* bottone compatto, usato dentro le righe */
.arsn-btn--sm { min-height: 40px; padding: 0 13px; font-size: 13px; }

/* riga di un punto temperatura: la domanda "e' la stessa di ieri?" */
.arsn-frigo .arsn-ask { display: block; margin-top: 7px; font-size: 12.5px; color: var(--hg-slate); }
.arsn-frigo .arsn-ask strong { color: var(--hg-ink); }
.arsn-frigo .frigo-actions { display: block; }

.arsn-foot {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--hg-rule);
    background: var(--hg-porcelain);
}

.arsn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 640;
    cursor: pointer;
    text-decoration: none;
    touch-action: manipulation;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}

.arsn-btn:active { transform: translateY(1px); }
.arsn-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.arsn-btn--ok { background: var(--success); color: #fff; }
.arsn-btn--ok:hover:not(:disabled) { background: #156B47; color: #fff; }
.arsn-btn--no { background: var(--hg-paper); border-color: var(--hg-rule); color: var(--danger); }
.arsn-btn--no:hover:not(:disabled) { border-color: var(--danger); background: rgba(192,40,28,.06); }
.arsn-btn--warn { background: #B07400; color: #fff; }
.arsn-btn--warn:hover:not(:disabled) { background: #8F5E00; color: #fff; }
.arsn-btn--primary { background: var(--hg-blue); color: #fff; }
.arsn-btn--primary:hover:not(:disabled) { background: var(--hg-blue-d); color: #fff; }
.arsn-btn--ghost { background: transparent; border-color: var(--hg-rule); color: var(--hg-slate); }
.arsn-btn--ghost:hover:not(:disabled) { border-color: var(--hg-ink); color: var(--hg-ink); }
/* "Ricordamelo dopo" va spinto a destra e resta il gesto secondario */
.arsn-btn--later { margin-left: auto; }

.arsn-spin {
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ars-spin .65s linear infinite;
}

.arsn-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; color: var(--hg-slate); font-size: 13.5px; }
.arsn-loading .arsn-spin { border-color: var(--hg-rule); border-top-color: var(--hg-blue); }

/* ---------- TOAST (conferme ed errori al volo) ---------- */
.ars-toasts {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: calc(var(--ars-safe-top) + 12px);
    z-index: 2100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(440px, calc(100vw - 24px));
    pointer-events: none;
}

.ars-toast {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid var(--hg-rule);
    border-left: 4px solid var(--c, var(--success));
    background: var(--hg-paper);
    box-shadow: 0 18px 40px -18px rgba(12,20,32,.45);
    color: var(--hg-ink);
    font-size: 13.5px;
    line-height: 1.45;
    pointer-events: auto;
    animation: ars-toast-in .26s var(--ars-ease) both;
}

.ars-toast.is-out { animation: ars-toast-out .22s var(--ars-ease) both; }
.ars-toast[data-tone="ok"] { --c: var(--success); }
.ars-toast[data-tone="danger"] { --c: var(--danger); }
.ars-toast[data-tone="warn"] { --c: #B07400; }
.ars-toast[data-tone="info"] { --c: var(--hg-blue); }
.ars-toast i { flex: none; color: var(--c); font-size: 15px; margin-top: 1px; }
.ars-toast-b { flex: 1; min-width: 0; }
.ars-toast-b strong { font-weight: 640; }

.ars-toast-x {
    flex: none;
    width: 30px;
    height: 30px;
    margin: -4px -6px -4px 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--hg-mute);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.ars-toast-x:hover { background: var(--hg-mist); color: var(--hg-ink); }

@keyframes ars-toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes ars-toast-out { to { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 575.98px) {
    /* su telefono sale dal basso: non copre il contenuto in alto */
    .ars-toasts {
        top: auto;
        bottom: calc(var(--ars-safe-bottom) + 10px);
        width: calc(100vw - 20px);
    }
    @keyframes ars-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
    @keyframes ars-toast-out { to { opacity: 0; transform: translateY(8px); } }
}

/* ---------- TELEFONO: foglio dal basso, non a tutto schermo ---------- */
@media (max-width: 575.98px) {
    .arsn-modal .modal-dialog.arsn-dialog {
        margin: 0;
        max-width: none;
        min-height: 0;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        display: block;
    }

    .arsn-modal .modal-dialog.arsn-dialog .modal-content {
        min-height: 0;
        max-height: 86dvh;
        border-radius: 18px 18px 0 0;
        border-bottom: 0;
        display: flex;
        flex-direction: column;
        padding-bottom: var(--ars-safe-bottom);
    }

    /* entra scorrendo dal basso invece di comparire al centro */
    .arsn-modal.fade .modal-dialog.arsn-dialog { transform: translateY(24px); transition: transform .26s var(--ars-ease); }
    .arsn-modal.show .modal-dialog.arsn-dialog { transform: none; }

    .arsn-head { padding: 14px 16px; }
    .arsn-body { padding: 14px 16px; max-height: none; flex: 1; min-height: 0; }
    .arsn-foot { padding: 12px 16px; gap: 8px; }

    /* i bottoni principali occupano la riga, "dopo" resta sotto e discreto */
    .arsn-foot .arsn-btn { flex: 1 1 auto; }
    .arsn-foot .arsn-btn--later { flex: 1 0 100%; margin-left: 0; order: 2; min-height: 44px; }

    /* maniglia del foglio */
    .arsn-head::before {
        content: '';
        position: absolute;
        top: 7px;
        left: 50%;
        transform: translateX(-50%);
        width: 38px;
        height: 4px;
        border-radius: 4px;
        background: var(--hg-rule);
    }
    .arsn-head { position: relative; padding-top: 20px; }
}

/* ============================================================
   7. RESPONSIVE
   ============================================================ */
/* <= 1199px: la sidebar diventa un drawer */
@media (max-width: 1199.98px) {
    .ars-burger { display: inline-flex; }
    .ars-drawer-only { display: flex; }

    .ars-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1100;
        width: 296px;
        max-width: 86vw;
        height: 100vh;
        height: 100dvh;
        border-right: 1px solid var(--hg-rule);
        box-shadow: 0 24px 60px -20px rgba(12,20,32,.5);
        transform: translateX(-101%);
        visibility: hidden;
        transition: transform .28s var(--ars-ease), visibility 0s linear .28s;
    }

    .ars-sidebar.open {
        transform: translateX(0);
        visibility: visible;
        transition: transform .28s var(--ars-ease);
    }

    .ars-side-foot { padding-bottom: calc(10px + var(--ars-safe-bottom)); }
}

/* <= 991px: barra compatta, ricerca a tutto schermo */
@media (max-width: 991.98px) {
    .ars-topbar-in { padding: 0 12px; gap: 9px; }
    .ars-tag { display: none; }
    .ars-icobtn { display: inline-flex; }
    /* la filiale si sposta nel drawer: nella barra resterebbe stretta */
    .ars-branch { display: none !important; }
    /* il profilo si riduce alla sola iniziale */
    .ars-profile .ars-pill { padding: 0 8px; max-width: none; }
    .ars-profile .ars-pill .ars-pill-t,
    .ars-profile .ars-pill .ars-chev { display: none; }
    .ars-profile .ars-menu { width: min(280px, calc(100vw - 24px)); }

    /* la ricerca esce dal flusso e si apre a tutto schermo */
    .ars-search {
        position: fixed;
        inset: 0;
        z-index: 1150;
        max-width: none;
        margin: 0;
        padding: calc(10px + var(--ars-safe-top)) 12px 12px;
        background: var(--hg-porcelain);
        display: none;
        flex-direction: column;
        gap: 10px;
    }

    .ars-search.open { display: flex; }
    .ars-search-field { flex: none; }
    .ars-search input { height: 48px; padding-right: 60px; }
    .ars-kbd { display: none; }

    .ars-search-close {
        position: absolute;
        right: 20px;
        top: calc(10px + var(--ars-safe-top));
        height: 48px;
        display: inline-flex;
        align-items: center;
        padding: 0 6px;
        border: 0;
        background: transparent;
        color: var(--hg-blue);
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }

    .ars-results {
        position: static;
        flex: 1;
        min-height: 0;
        max-height: none;
        border: 0;
        box-shadow: none;
        background: transparent;
        padding: 0;
        display: none;
    }

    .ars-results.open { display: block; }
}

/* Su desktop la filiale sta nella barra: dentro il menu profilo sarebbe doppia */
@media (min-width: 992px) {
    .ars-search-close { display: none; }
    .ars-menu-branches { display: none !important; }
}

@media (max-width: 575.98px) {
    /* La campanella sta quasi sul bordo destro: un pannello largo 380px
       ancorato a lei uscirebbe dal lato sinistro. Su telefono lo
       ancoriamo alla finestra, non al bottone. */
    .ars-notif-panel {
        position: fixed;
        top: calc(var(--ars-nav-h) + var(--ars-safe-top) + 8px);
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100dvh - var(--ars-nav-h) - var(--ars-safe-top) - 20px);
    }

    .ars-logo { width: 112px; }
    .ars-cats { grid-template-columns: minmax(0, 1fr); }
    .ars-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ars-stat { padding: 14px; border-radius: 12px; }
    .ars-stat-n { font-size: 26px; }
    .ars-hero { margin-bottom: 16px; }
    .ars-date { width: 100%; justify-content: center; }
    .ars-cat-head { padding: 14px; gap: 11px; }
    .ars-cat-ico { width: 38px; height: 38px; border-radius: 11px; font-size: 15px; }
}

@media (max-width: 359.98px) {
    .ars-stats { grid-template-columns: minmax(0, 1fr); }
}

/* accessibilita' */
.ars-topbar :focus-visible,
.ars-sidebar :focus-visible,
.ars-results :focus-visible,
.ars-cat :focus-visible,
.ars-stat:focus-visible {
    outline: 2px solid var(--hg-blue);
    outline-offset: 2px;
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .ars-sidebar, .ars-scrim, .ars-cat-body, .ars-grp-body,
    .ars-cat, .ars-stat, .ars-chev { transition: none !important; }
}

/* ============================================================
   INTERRUTTORI (.form-switch) — VALE OVUNQUE NELL'AREA
   Prima erano un cerchietto blu identico acceso e spento: su
   telefono e tablet la regola dei "touch target" li schiacciava
   a 1.25em quadrati, perdendo la forma a levetta, e l'etichetta
   non era cliccabile perche' priva di `for`.

   Adesso: levetta larga, VERDE quando e' acceso e grigia quando
   e' spento, con l'etichetta accanto (e cliccabile: il legame
   label/input lo ripristina lo script della shell).
   ============================================================ */
.ars-body .form-check.form-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 34px;
    padding-left: 0;
}

.ars-body .form-check.form-switch .form-check-input {
    float: none;
    flex: none;
    width: 3em;
    height: 1.75em;
    margin: 0;
    border: 1px solid #C7D0DA;
    border-radius: 999px;
    background-color: #E4E9EF;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
    background-position: left center;
    background-size: contain;
    box-shadow: 0 1px 2px rgba(12, 20, 32, .12) inset;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, background-position .18s ease;
}

/* acceso: verde, senza ombra interna (sembra "pieno") */
.ars-body .form-check.form-switch .form-check-input:checked {
    background-color: #16A34A;
    border-color: #15803D;
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
    box-shadow: none;
}

.ars-body .form-check.form-switch .form-check-input:focus {
    border-color: #16A34A;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .20);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
}

.ars-body .form-check.form-switch .form-check-input:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.ars-body .form-check.form-switch .form-check-label {
    margin: 0;
    cursor: pointer;
    /* l'etichetta e' meta' del bersaglio: deve essere comoda da toccare */
    padding: 4px 0;
}

/* la nota sotto l'interruttore va a capo, non di fianco alla levetta */
.ars-body .form-check.form-switch > .form-text,
.ars-body .form-check.form-switch > small {
    flex: 1 1 100%;
    margin: -4px 0 0;
    padding-left: 0;
}

/* Parola di stato accanto alla levetta: "Attivo" / "Spento".
   La scrive lo script della shell, cosi' vale per ogni interruttore
   senza toccare le singole pagine. */
.ars-switch-state {
    flex: none;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--hg-mist);
    color: var(--hg-mute);
    font-family: var(--ars-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ars-switch-state.is-on { background: #E6F6EC; color: #15803D; }
