/*
 *  RadioPanel by A.S.V. Studios APPS - CSS Style
 *  Powered by A.S.V. Studios APPS
 *
 *  Tema "Regia" - RadioPanel 3.0 (2026)
 *  Linea guida completa: STYLEGUIDE.md (radice del progetto).
 *
 *  Indice
 *    1. Font e token di design
 *    2. Base del pannello
 *    3. Layout: navbar, menu laterale, intestazione pagina, footer
 *    4. Componenti: box, pulsanti, campi, avvisi, etichette, tabelle, accordion, popup
 *    5. Moduli delle singole funzioni (richieste, centro messaggi, finestre, assistenza, regia...)
 *    6. Classi storiche (rp-auto-style-*): solo per le pagine esistenti, non usarle nelle nuove
 *    7. Pagine di accesso (login, recupero password)
 *    8. Responsive
 *
 *  Gli stili valgono dentro <body class="panelpage"> (pannello) e <body class="startpage"> (pagine di accesso):
 *  i componenti condivisi sono scritti con :where(.panelpage, .startpage), che non aumenta la specificità.
 */

/* ==========================================================================
   1. FONT E TOKEN DI DESIGN
   ========================================================================== */

/* Bootstrap è già incluso da bootstrap.min.css nelle pagine: niente @import duplicato */
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css");
/* Hanken Grotesk: testo del pannello. IBM Plex Mono: etichette tecniche e orari. */
@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,400..800;1,400..600&family=IBM+Plex+Mono:wght@400;500;600&family=Dancing+Script:wght@600&display=swap");

@font-face {
    font-family: "Daddy";
    src: url("fonts/daddy.ttf") format("truetype");
    font-display: swap;
}

:root {
    /* Palette del marchio, la stessa della pagina di login:
     * fondo #0f222d, riquadro #1b3e53, bordo crema #FFF5D0, testo crema #EBE7D9, spia rossa #f55139 */

    /* Superfici: dal fondo (più scuro) agli elementi in rilievo.
     * Il guscio (menu laterale, barra di stato) è un gradino più scuro del fondo e si stacca con il bordo crema del login;
     * i box restano scuri e smorzati,
     * appena sopra il fondo, perché il testo si legga bene */
    --rp-bg: #0f222d;
    --rp-sidebar: #0a1922;
    --rp-sidebar-hover: rgba(255, 245, 208, 0.08);
    --rp-sidebar-active: rgba(255, 245, 208, 0.13);
    --rp-surface: #132a37;
    --rp-surface-2: #183443;
    --rp-surface-3: #1f3f52;
    --rp-surface-4: #284b60;
    --rp-field: #0b1b24;

    /* Linee: il crema del bordo del login, trasparente */
    --rp-line: rgba(255, 245, 208, 0.14);
    --rp-line-strong: rgba(255, 245, 208, 0.26);
    --rp-line-soft: rgba(255, 245, 208, 0.07);
    /* Bordi del guscio (barra in alto, menu, barra di stato): come il bordo del riquadro di login */
    --rp-line-brand: rgba(255, 245, 208, 0.38);

    /* Testo: crema del marchio, poi grigi azzurrati */
    --rp-text: #f4f1e6;
    --rp-text-2: #bccad3;
    --rp-text-3: #8ea2af;
    --rp-white: #ffffff;
    --rp-cream: #ebe7d9;

    /* Documenti: la carta su cui si mostrano PDF e immagini e l'inchiostro delle firme (blu penna) */
    --rp-paper: #ffffff;
    --rp-ink: #1b2a6b;
    --rp-paper-text: #323232;

    /* Colore del marchio: la spia "ON AIR" (anche il pulsante premuto del login) */
    --rp-accent: #f55139;
    --rp-accent-hover: #ff6a50;
    --rp-accent-soft: rgba(245, 81, 57, 0.16);

    /* Stati: verde e rosso sono quelli dei messaggi del login */
    --rp-signal: #5ec8dc;
    --rp-signal-soft: rgba(94, 200, 220, 0.15);
    --rp-ok: #3fb950;
    --rp-ok-soft: rgba(63, 185, 80, 0.15);
    --rp-warn: #f0b03c;
    --rp-warn-soft: rgba(240, 176, 60, 0.15);
    --rp-danger: #f85149;
    --rp-danger-soft: rgba(248, 81, 73, 0.15);
    --rp-violet: #b494e8;
    --rp-violet-soft: rgba(180, 148, 232, 0.13);
    --rp-whatsapp: #3fb950;

    /* Tipografia */
    --rp-font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --rp-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Forme e misure */
    --rp-r-xs: 4px;
    --rp-r-sm: 6px;
    --rp-r: 10px;
    --rp-r-lg: 14px;
    --rp-control-h: 40px;
    --rp-nav-h: 52px;
    --rp-sidebar-w: 248px;
    --rp-rail-w: 64px;
    --rp-status-h: 28px;
    --rp-gutter: 32px;

    /* Ombre: solo per gli elementi che galleggiano (menu, popup, finestre) */
    --rp-shadow-pop: 0 18px 40px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.02);

    /* Movimento */
    --rp-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --rp-fast: 120ms;
    --rp-mid: 220ms;

    --timetable-menu-list-indicator: 90deg;
}

/* ==========================================================================
   2. BASE DEL PANNELLO
   ========================================================================== */

* {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

input,
textarea,
[contenteditable="true"],
.selectAllowed {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

:is(.panelpage, .startpage) {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--rp-bg);
    color: var(--rp-text);
    font-family: var(--rp-font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    color-scheme: dark;
    scrollbar-color: var(--rp-surface-4) transparent;
}

:is(.panelpage, .startpage) :where(button, input, select, textarea, optgroup) {
    font-family: inherit;
}

:is(.panelpage, .startpage) :where(h1, h2, h3, h4, h5, h6) {
    color: var(--rp-text);
    letter-spacing: -0.01em;
}

:is(.panelpage, .startpage) ::selection {
    background: rgba(245, 81, 57, 0.35);
    color: var(--rp-white);
}

:is(.panelpage, .startpage) :focus-visible {
    outline: 2px solid var(--rp-signal);
    outline-offset: 2px;
}

:where(.panelpage, .startpage) a {
    color: var(--rp-signal);
    text-underline-offset: 3px;
}

:where(.panelpage, .startpage) a:hover {
    color: #8ad7e0;
}

:where(.panelpage, .startpage) hr {
    margin: 1.25rem 0;
    border: 0;
    border-top: 1px solid var(--rp-line);
    opacity: 1;
}

:where(.panelpage, .startpage) .text-muted {
    color: var(--rp-text-3) !important;
}

:is(.panelpage, .startpage) .text-warning {
    color: var(--rp-warn) !important;
}

:is(.panelpage, .startpage) .text-danger {
    color: var(--rp-danger) !important;
}

:is(.panelpage, .startpage) .text-success {
    color: var(--rp-ok) !important;
}

:is(.panelpage, .startpage) code {
    padding: 1px 6px;
    border-radius: var(--rp-r-xs);
    background: var(--rp-surface-3);
    color: #f3a596;
    font-family: var(--rp-mono);
    font-size: 0.85em;
}

:is(.panelpage, .startpage) blockquote {
    margin: 0 0 1rem;
    padding: 2px 0 2px 14px;
    border-left: 2px solid var(--rp-line-strong);
    color: var(--rp-text-2);
}

.grassetto {
    font-weight: 650 !important;
}

.clickable {
    cursor: pointer;
}

dt {
    margin-bottom: 15px;
    font-weight: normal;
}

dd {
    margin-bottom: 15px;
    margin-inline-start: 13px;
}

ol,
ul {
    padding-left: 1.1rem !important;
}

ol>li {
    margin-bottom: 5px;
}

.regola-item>p {
    margin: 0;
}

/* Etichetta tecnica: maiuscoletto monospazio (intestazioni di tabelle, titoli del menu, sovratitoli) */
.rp-eyebrow {
    display: block;
    font-family: var(--rp-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rp-text-3);
}

/* Utility */
.noMargin {
    margin: 0;
}

.marginBottom10 {
    margin-bottom: 10px;
}

.noPadding {
    padding: 0;
}

.float-left {
    float: left;
    width: auto;
}

.float-right {
    float: right;
    width: auto;
}

/* Barra di azioni: i pulsanti partono da destra (il primo nel markup è il più a destra) */
.float-box {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.float-box>.float-left,
.float-box>.float-right,
.float-box>form>.float-right {
    float: none;
    margin: 0;
}

/* Elementi nascosti in app desktop (classe is-app aggiunta da panel.js) */
.is-app .hide-rpapp {
    display: none !important;
}

/* ==========================================================================
   3. LAYOUT
   ========================================================================== */

/* --- Guscio dell'app ---
 *  ┌ menu laterale ┬ barra in alto (percorso, Vai a…, profilo) ┐
 *  │ (a tutta      │ contenuto della pagina (scorre la pagina)  │
 *  │  altezza)     ├────────────────────────────────────────────┤
 *  └───────────────┴ barra di stato (connessione, ©, orologio)  ┘
 *  Menu ridotto a icone: html.rp-sidebar-collapsed (panel.js / shell.js) */
@media (min-width: 877px) {
    html.rp-sidebar-collapsed {
        --rp-sidebar-w: var(--rp-rail-w);
    }
}

html.is-app,
html.is-pwa {
    overscroll-behavior: none;
}

/* --- Barra in alto --- */
.rp-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    margin: 0;
    transition: left var(--rp-mid) var(--rp-ease);
}

/* Con il menu laterale (non nelle pagine senza menu, es. termini e condizioni) la barra parte dopo il menu */
body:has(> #menuPanel) .rp-navbar {
    left: var(--rp-sidebar-w);
}

.rp-navbar>.rp-nav {
    position: sticky;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--rp-nav-h);
    width: 100%;
    padding: 0 16px 0 var(--rp-gutter);
    background: rgba(15, 34, 45, 0.92);
    border-bottom: 1px solid var(--rp-line-brand);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    backdrop-filter: saturate(140%) blur(12px);
}

.rp-navbar>.rp-nav>.rp-navHeader {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* Nome della radio nella barra: solo nelle pagine senza menu e su smartphone */
body:has(> #menuPanel) .rp-navbar .title {
    display: none !important;
}

/* Percorso: categoria › pagina */
.rp-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.88rem;
    white-space: nowrap;
}

.rp-crumbs [hidden] {
    display: none !important;
}

.rp-crumb-cat {
    color: var(--rp-text-3);
}

.rp-crumb-sep {
    font-size: 0.65rem;
    color: var(--rp-text-3);
}

.rp-crumb-page {
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--rp-text);
    font-weight: 650;
}

/* Tasto (scorciatoia da tastiera) */
.rp-kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--rp-line-strong);
    border-bottom-width: 2px;
    border-radius: var(--rp-r-xs);
    background: var(--rp-surface-2);
    color: var(--rp-text-2);
    font-family: var(--rp-mono);
    font-size: 0.66rem;
    line-height: 1.5;
    white-space: nowrap;
}

/* Pulsante "Vai a…" (ricerca rapida, _js/shell.js): stessa forma del pulsante del profilo che gli sta accanto */
.rp-cmdk-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 38px;
    min-width: 220px;
    margin-right: 10px;
    padding: 0 6px 0 14px;
    border: 1px solid var(--rp-line);
    border-radius: 999px;
    background: var(--rp-surface);
    color: var(--rp-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: background-color var(--rp-fast) ease, border-color var(--rp-fast) ease;
}

.rp-cmdk-btn:hover {
    background: var(--rp-surface-2);
    border-color: var(--rp-line-strong);
}

.rp-cmdk-btn > .bi {
    color: var(--rp-text-3);
}

/* Tasto della scorciatoia arrotondato come il pulsante */
.rp-cmdk-btn .rp-kbd {
    padding: 2px 8px;
    border-radius: 999px;
}

.rp-cmdk-btn .rp-cmdk-label {
    flex: 1;
    text-align: left;
}

.rp-navbar>.rp-nav>.rp-navLinks {
    display: flex;
    align-items: center;
}

.rp-navbar>.rp-nav>.rp-navHeader>.menu,
.rp-navbar>.rp-nav>.rp-navHeader>.title {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.rp-navbar>.rp-nav>.rp-navHeader>.title {
    gap: 10px;
    min-width: 0;
    color: var(--rp-text);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.rp-navbar>.rp-nav>.rp-navHeader>.title>img {
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
    border-radius: 8px;
}

.rp-navbar>.rp-nav>.rp-navHeader>.menu {
    display: none;
    width: 40px;
    height: 40px;
    margin: 0 6px 0 -8px;
    justify-content: center;
    border-radius: var(--rp-r-sm);
    color: var(--rp-text-2) !important;
}

.rp-navbar>.rp-nav>.rp-navHeader>.menu:hover {
    background: var(--rp-surface-2);
    color: var(--rp-text) !important;
}

.rp-navbar>.rp-nav>.rp-navHeader>.menu svg {
    width: 22px;
    height: 22px;
}

.rp-radio-name-full,
.rp-radio-name-short {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-radio-name-full {
    display: inline-block;
    max-width: 380px;
}

.rp-radio-name-short {
    display: none;
    max-width: 200px;
}

.rp-navbar>.rp-nav>.rp-navLinks {
    position: relative;
    font-size: 0.92rem;
}

.rp-navbar>.rp-nav>.rp-navLinks>a {
    margin-left: 16px;
    color: var(--rp-text-2);
    text-decoration: none;
    transition: color var(--rp-fast) ease;
}

.rp-navbar>.rp-nav>.rp-navLinks>a:hover {
    color: var(--rp-text);
}

/* --- Menu del profilo e centro notifiche --- */
.rp-profile-dropdown {
    position: relative;
    display: inline-block;
}

.rp-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 38px;
    padding: 0 10px 0 5px;
    border: 1px solid var(--rp-line);
    border-radius: 999px;
    background: var(--rp-surface);
    color: var(--rp-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: background-color var(--rp-fast) ease, border-color var(--rp-fast) ease;
}

.rp-profile-btn:hover,
.rp-profile-dropdown.open .rp-profile-btn {
    background: var(--rp-surface-2);
    border-color: var(--rp-line-strong);
}

.rp-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--rp-surface-3);
}

.rp-profile-avatar-wrap {
    position: relative;
    display: inline-flex;
}

.rp-profile-arrow {
    font-size: 11px;
    color: var(--rp-text-3);
    transition: transform var(--rp-mid) var(--rp-ease);
}

.rp-profile-dropdown.open .rp-profile-arrow {
    transform: rotate(180deg);
}

/* Il menu resta nel layout e si apre/chiude in dissolvenza (visibility lo toglie anche dalla tastiera quando è chiuso) */
.rp-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 9999;
    min-width: 220px;
    padding: 6px;
    background: var(--rp-surface);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r-lg);
    box-shadow: var(--rp-shadow-pop);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
}

.rp-profile-dropdown.open .rp-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--rp-mid) var(--rp-ease), transform var(--rp-mid) var(--rp-ease), visibility 0s;
}

@keyframes rp-pop {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

.rp-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--rp-r-sm);
    color: var(--rp-text-2);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--rp-fast) ease, color var(--rp-fast) ease;
}

.rp-dropdown-item>i {
    width: 16px;
    color: var(--rp-text-3);
    text-align: center;
}

.rp-dropdown-item:hover {
    background: var(--rp-surface-2);
    color: var(--rp-text);
    text-decoration: none;
}

.rp-dropdown-item:hover>i {
    color: var(--rp-text);
}

.rp-dropdown-hint {
    display: block;
    font-size: 11px;
    color: var(--rp-text-3);
}

.rp-dropdown-item-danger:hover,
.rp-dropdown-item-danger:hover>i {
    background: var(--rp-danger-soft);
    color: var(--rp-danger);
}

.rp-dropdown-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--rp-line);
}

.rp-notif-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--rp-accent);
    color: var(--rp-white);
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--rp-bg);
}

.rp-notif-badge[hidden] {
    display: none;
}

#rpProfileMenu {
    width: 360px;
    max-width: calc(100vw - 24px);
}

.rp-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px 8px;
    color: var(--rp-text);
    font-size: 0.88rem;
    font-weight: 700;
}

.rp-notif-header .bi {
    color: var(--rp-text-3);
    margin-right: 4px;
}

.rp-notif-readall {
    background: none;
    border: 0;
    padding: 0;
    color: var(--rp-signal);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.rp-notif-readall:hover {
    text-decoration: underline;
}

.rp-notif-readall:disabled {
    color: var(--rp-text-3);
    cursor: default;
    text-decoration: none;
}

.rp-notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.rp-notif-item {
    display: flex;
    align-items: flex-start;
    position: relative;
    border-radius: var(--rp-r-sm);
    color: var(--rp-text-2);
    transition: background-color var(--rp-fast) ease;
}

.rp-notif-item:hover {
    background: var(--rp-surface-2);
}

.rp-notif-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 4px 9px 24px;
    color: inherit;
    text-decoration: none;
}

a.rp-notif-body:hover {
    color: var(--rp-text);
    text-decoration: none;
}

.rp-notif-delete {
    flex: none;
    margin: 6px 6px 0 0;
    padding: 3px 6px;
    background: none;
    border: 0;
    border-radius: var(--rp-r-xs);
    color: var(--rp-text-3);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--rp-fast) ease, color var(--rp-fast) ease, background-color var(--rp-fast) ease;
}

.rp-notif-item:hover .rp-notif-delete,
.rp-notif-delete:focus-visible {
    opacity: 1;
}

.rp-notif-delete:hover {
    color: var(--rp-danger);
    background: var(--rp-danger-soft);
}

/* Dispositivi touch: niente hover, la X resta sempre visibile */
@media (hover: none) {
    .rp-notif-delete {
        opacity: 1;
    }
}

.rp-notif-item.unread {
    color: var(--rp-text);
}

.rp-notif-item.unread::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rp-accent);
}

.rp-notif-title {
    font-size: 0.86rem;
    font-weight: 650;
}

.rp-notif-message {
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rp-notif-meta {
    font-family: var(--rp-mono);
    font-size: 0.68rem;
    color: var(--rp-text-3);
}

.rp-notif-empty {
    padding: 18px 16px;
    color: var(--rp-text-3);
    font-size: 0.85rem;
    text-align: center;
}

/* --- Menu laterale --- */
.rp-menuPanel {
    position: fixed;
    z-index: 21;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: var(--rp-sidebar-w);
    height: 100%;
    background: var(--rp-sidebar);
    border-right: 1px solid var(--rp-line-brand);
    transition: transform var(--rp-mid) var(--rp-ease), width var(--rp-mid) var(--rp-ease);
}

/* Intestazione del menu: logo e nome della radio */
.rp-sidebar-head {
    flex: 0 0 var(--rp-nav-h);
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid var(--rp-line-brand);
}

.rp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--rp-text);
}

.rp-brand>img {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.rp-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.rp-brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.rp-brand-sub {
    font-family: var(--rp-mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rp-text-3);
}

.rp-menuPanel>.rp-menuItems {
    flex: 1 1 auto;
    min-height: 0;
    padding: 6px 10px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.rp-menuPanel>.rp-menuItems::-webkit-scrollbar {
    width: 0;
}

/* Piede del menu: riduci/espandi */
.rp-sidebar-foot {
    flex: none;
    padding: 8px 10px;
    border-top: 1px solid var(--rp-line);
}

.rp-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: var(--rp-r-sm);
    background: transparent;
    color: var(--rp-text-3);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.rp-sidebar-toggle:hover {
    background: var(--rp-sidebar-hover);
    color: var(--rp-text);
}

.rp-sidebar-toggle>.bi {
    width: 18px;
    text-align: center;
}

.rp-menuPanel>.rp-menuItems>.rp-menuItem {
    padding: 20px 0 5px;
}

.rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuTitle {
    margin: 0 0 6px;
    padding: 0 10px;
    font-family: var(--rp-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rp-text-3);
}

.rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuLink {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1px;
    padding: 7px 10px;
    border-radius: var(--rp-r-sm);
    color: var(--rp-text-2);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--rp-fast) ease, color var(--rp-fast) ease;
}

.rp-menuLink>.bi {
    flex: none;
    width: 18px;
    font-size: 1rem;
    text-align: center;
    color: var(--rp-text-3);
    transition: color var(--rp-fast) ease;
}

.rp-menuLabel {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuLink:hover {
    background: var(--rp-sidebar-hover);
    color: var(--rp-text);
}

.rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuLink:hover>.bi {
    color: var(--rp-text-2);
}

/* Pagina aperta: icona accesa (rossa "on air") e tacca a sinistra */
.rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuLink.active {
    background: var(--rp-sidebar-active);
    color: var(--rp-text);
    font-weight: 650;
}

.rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuLink.active>.bi {
    color: #dfc6a6;
}

/* Menu ridotto a icone (solo computer): le etichette sfumano mentre il menu si stringe,
 * le icone restano ferme al centro della colonna (64px), i titoli delle categorie diventano separatori */
.rp-menuLabel,
.rp-brand-text {
    max-width: 190px;
    transition: opacity 160ms ease, max-width var(--rp-mid) var(--rp-ease);
}

.rp-brand,
.rp-sidebar-head,
.rp-sidebar-toggle,
.rp-menuPanel>.rp-menuItems,
.rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuLink {
    transition: padding var(--rp-mid) var(--rp-ease), gap var(--rp-mid) var(--rp-ease), background-color var(--rp-fast) ease, color var(--rp-fast) ease, box-shadow var(--rp-fast) ease;
}

.rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuTitle {
    transition: color var(--rp-mid) ease, background-color var(--rp-mid) ease;
}

@media (min-width: 877px) {

    .rp-sidebar-collapsed .rp-menuLabel,
    .rp-sidebar-collapsed .rp-brand-text {
        max-width: 0;
        opacity: 0;
        overflow: hidden;
    }

    .rp-sidebar-collapsed .rp-brand {
        gap: 0;
    }

    .rp-sidebar-collapsed .rp-sidebar-head {
        padding: 0 17px;
    }

    .rp-sidebar-collapsed .rp-menuPanel>.rp-menuItems {
        padding: 6px 8px 20px;
    }

    .rp-sidebar-collapsed .rp-menuPanel>.rp-menuItems>.rp-menuItem {
        padding: 6px 0 0;
    }

    .rp-sidebar-collapsed .rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuTitle {
        height: 1px;
        margin: 4px 6px 8px;
        padding: 0;
        overflow: hidden;
        background: var(--rp-line);
        color: transparent;
    }

    .rp-sidebar-collapsed .rp-menuPanel>.rp-menuItems>.rp-menuItem:first-child>.rp-menuTitle {
        display: none;
    }

    .rp-sidebar-collapsed .rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuLink,
    .rp-sidebar-collapsed .rp-sidebar-toggle {
        gap: 0;
        padding: 9px 15px;
    }

    .rp-sidebar-collapsed .rp-sidebar-toggle>.bi {
        transform: scaleX(-1);
    }

    .rp-sidebar-collapsed .rp-sidebar-foot {
        padding: 8px;
    }
}

.rp-sidebar-toggle {
    white-space: nowrap;
}

.rp-sidebar-toggle>.bi {
    transition: transform var(--rp-mid) var(--rp-ease);
}

/* Sfondo scuro dietro al menu aperto su smartphone (#muro, vedi layoutNav.php e panel.js) */
.rp-scrim {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(6, 16, 22, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--rp-mid) ease;
}

.muroActive {
    z-index: 15 !important;
    opacity: 1 !important;
    pointer-events: auto;
}

/* --- Contenuto e intestazione pagina --- */
.container {
    padding: 0;
    margin-bottom: 0;
}

.rp-content {
    flex: 1;
    margin: 0;
    padding: var(--rp-nav-h) 0 calc(var(--rp-status-h) + 24px) var(--rp-sidebar-w);
    transition: padding-left var(--rp-mid) var(--rp-ease);
}

/* Pagine senza menu laterale (termini e condizioni, account sospeso) */
body:not(:has(> #menuPanel)) .rp-content {
    padding-left: 0;
}

.rp-content>.welcome {
    position: relative;
    padding: 34px var(--rp-gutter) 26px;
    margin: 0 0 6px;
    text-align: left;
}

.rp-content>.welcome>h1 {
    margin: 0;
    font-size: clamp(1.55rem, 1.1rem + 1.1vw, 2.1rem);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--rp-text);
}

.rp-content>.welcome>h1 b {
    font-weight: inherit;
    color: var(--rp-accent);
}

.rp-content>.welcome>p {
    max-width: 70ch;
    margin: 6px 0 0;
    font-size: 1rem;
    color: var(--rp-text-2);
}

/* Firma grafica del pannello: la scala di sintonia sotto il titolo, con la lancetta "on air" */
.rp-content>.welcome::after {
    content: "";
    display: block;
    height: 10px;
    margin-top: 20px;
    background:
        linear-gradient(var(--rp-accent), var(--rp-accent)) 96px 0 / 2px 10px no-repeat,
        repeating-linear-gradient(90deg, var(--rp-text-3) 0 1px, transparent 1px 48px) 0 100% / 100% 8px no-repeat,
        repeating-linear-gradient(90deg, var(--rp-line-strong) 0 1px, transparent 1px 8px) 0 100% / 100% 4px no-repeat;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 100%);
    opacity: 0.8;
}

.container-full {
    padding: 0 var(--rp-gutter);
}

/* --- Barra di stato (#rpFooter, layoutFooter.php): fissa in fondo come nelle app desktop --- */
.rp-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 17;
    height: var(--rp-status-h);
    margin: 0;
    padding: 0;
    background: var(--rp-sidebar);
    border-top: 1px solid var(--rp-line-brand);
    transition: left var(--rp-mid) var(--rp-ease);
}

body:has(> #menuPanel) .rp-footer {
    left: var(--rp-sidebar-w);
}

.rp-footerContent {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    margin: 0;
    padding: 0 14px;
}

.rp-footerBox {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: var(--rp-text-3);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pagine con il footer storico su due righe (termini, account sospeso) */
.rp-footerBox br {
    display: none;
}

.rp-footerBox a {
    color: var(--rp-text-2);
    text-decoration: none;
}

.rp-footerBox a:hover {
    color: var(--rp-text);
    text-decoration: underline;
}

.rp-status-net {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rp-text-2);
    font-size: 0.72rem;
}

.rp-status-net>i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rp-ok);
    box-shadow: 0 0 0 3px var(--rp-ok-soft);
}

.rp-status-net[data-state="offline"] {
    color: var(--rp-danger);
}

.rp-status-net[data-state="offline"]>i {
    background: var(--rp-danger);
    box-shadow: 0 0 0 3px var(--rp-danger-soft);
}

.rp-status-clock {
    flex: none;
    color: var(--rp-text-2);
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

/* --- Ricerca rapida "Vai a…" (Ctrl+K, _js/shell.js) --- */
.rp-cmdk {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 16px;
    background: rgba(6, 16, 22, 0.6);
}

.rp-cmdk[hidden] {
    display: none;
}

.rp-cmdk-panel {
    display: flex;
    flex-direction: column;
    width: min(620px, 100%);
    max-height: 70vh;
    overflow: hidden;
    background: var(--rp-surface);
    border: 1px solid var(--rp-line-strong);
    border-radius: var(--rp-r-lg);
    box-shadow: var(--rp-shadow-pop);
    animation: rp-pop var(--rp-mid) var(--rp-ease);
}

.rp-cmdk-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border-bottom: 1px solid var(--rp-line);
}

.rp-cmdk-search>.bi {
    color: var(--rp-text-3);
}

.rp-cmdk-search>input {
    flex: 1;
    min-width: 0;
    height: 52px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--rp-text);
    font-size: 1rem;
}

.rp-cmdk-search>input::placeholder {
    color: var(--rp-text-3);
}

.rp-cmdk-search>input:focus-visible {
    outline: none;
}

.rp-cmdk-list {
    flex: 1 1 auto;
    margin: 0;
    padding: 6px !important;
    overflow-y: auto;
    list-style: none;
}

.rp-cmdk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 9px 12px;
    border-radius: var(--rp-r-sm);
    color: var(--rp-text-2);
    cursor: pointer;
}

.rp-cmdk-item>.bi {
    width: 18px;
    color: var(--rp-text-3);
    text-align: center;
}

.rp-cmdk-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rp-cmdk-group {
    flex: none;
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.rp-cmdk-item[aria-selected="true"] {
    background: var(--rp-sidebar-active);
    color: var(--rp-text);
}

.rp-cmdk-item[aria-selected="true"]>.bi {
    color: var(--rp-accent);
}

.rp-cmdk-empty {
    padding: 22px 12px;
    color: var(--rp-text-3);
    text-align: center;
}

.rp-cmdk-foot {
    display: flex;
    gap: 18px;
    padding: 8px 14px;
    border-top: 1px solid var(--rp-line);
    color: var(--rp-text-3);
    font-size: 0.74rem;
}

.rp-cmdk-foot .rp-kbd {
    margin-right: 3px;
}

/* --- Barra del titolo integrata (PWA installata, "Window Controls Overlay") ---
 * La barra in alto prende il posto della barra del titolo del sistema: si trascina per spostare la finestra
 * e lascia libero lo spazio dei pulsanti della finestra (a destra su Windows, a sinistra su macOS). */
@media (display-mode: window-controls-overlay) {

    .rp-navbar,
    .rp-sidebar-head {
        -webkit-app-region: drag;
        app-region: drag;
    }

    .rp-navbar :is(a, button, input, select, [role="button"], .clickable, .rp-dropdown-menu),
    .rp-sidebar-head .rp-brand {
        -webkit-app-region: no-drag;
        app-region: no-drag;
    }

    .rp-navbar>.rp-nav {
        padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 12px);
    }

    .rp-sidebar-head {
        padding-left: max(14px, calc(env(titlebar-area-x, 0px) + 8px));
    }
}

/* Navigazione AJAX (_js/navigation.js) */
#rp-page {
    display: contents;
}

#rp-page[aria-busy="true"] {
    cursor: progress;
}

.rp-nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    width: 0;
    height: 2px;
    background: var(--rp-accent);
    box-shadow: 0 0 10px rgba(245, 81, 57, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: width 0.4s ease, opacity 0.3s ease;
}

.rp-nav-progress.active {
    width: 70%;
    opacity: 1;
    transition: width 8s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 0.1s ease;
}

.rp-nav-progress.done {
    width: 100%;
    opacity: 0;
}

.rp-nav-loader {
    position: fixed;
    top: var(--rp-nav-h);
    right: 0;
    bottom: 0;
    left: var(--rp-sidebar-w);
    z-index: 18;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(15, 34, 45, 0.62);
    color: var(--rp-text-2);
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.rp-nav-loader.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

.rp-nav-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--rp-surface-4);
    border-top-color: var(--rp-accent);
    border-radius: 50%;
    animation: rp-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   4. COMPONENTI
   ========================================================================== */

/* --- Box (card) --- */
.rp-pageContent,
.rp-box {
    margin: 0 0 16px;
    padding: 20px;
    background: var(--rp-surface);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r-lg);
}

.rp-box>p:last-child,
.rp-pageContent>p:last-child {
    margin-bottom: 0;
}

/* Box dentro un box: un gradino di superficie più in alto */
.rp-box .rp-box {
    background: var(--rp-surface-2);
    border-color: var(--rp-line-soft);
    border-radius: var(--rp-r);
    padding: 14px 16px;
}

.rp-pageContent>h1,
.rp-box>h2 {
    margin: 0 0 16px;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: left;
    color: var(--rp-text);
}

.rp-box>h3,
.rp-box h3.m-0,
.rp-box h3.mb-0 {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--rp-text);
}

.rp-box>h3 {
    margin: 0 0 12px;
    padding: 0;
    text-align: left;
}

.rp-box>h4,
.rp-box h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.rp-box>p,
.rp-pageContent>p {
    color: var(--rp-text-2);
}

/* Riquadro dei numeri (contatori in home) */
.rp-box>p.counter {
    margin: 0;
    font-family: var(--rp-mono);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--rp-text);
    text-align: left;
}

/* Elemento di un elenco dentro un box (richieste, notizie, voci) */
.boxrequest,
.rp-articleBox {
    width: 100%;
    margin: 0 0 8px;
    padding: 14px 16px;
    background: var(--rp-surface-2);
    border: 1px solid var(--rp-line-soft);
    border-radius: var(--rp-r);
    transition: border-color var(--rp-fast) ease, background-color var(--rp-fast) ease;
}

.boxrequest:last-child,
.rp-articleBox:last-child,
.rp-articleBox:last-of-type {
    margin-bottom: 0 !important;
}

.boxrequest.clickable:hover {
    border-color: var(--rp-line-strong);
    background: var(--rp-surface-3);
}

.boxrequest>table {
    width: 100%;
}

.boxrequest>table td {
    padding-right: 14px;
    vertical-align: top;
}

.boxrequest>table td:last-child {
    padding-right: 0;
}

.boxrequest>.noRequestTitle,
.boxrequest>p.noRequestSubtitle,
.boxrequest>table>tbody>tr>td>p {
    margin: 0;
    padding: 0;
}

/* Etichetta del campo (prima riga) e valore (seconda riga) */
.boxrequest>table>tbody>tr>td>p:first-child:not(.grassetto) {
    font-family: var(--rp-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rp-text-3);
    margin-bottom: 2px;
}

/* Stato vuoto */
.boxrequest:has(> .noRequestTitle) {
    padding: 30px 16px;
    background: transparent;
    border: 1px dashed var(--rp-line-strong);
}

.boxrequest>.noRequestTitle,
.boxrequest>p.noRequestSubtitle {
    text-align: center;
}

.boxrequest>.noRequestTitle {
    font-weight: 700;
    color: var(--rp-text);
}

.boxrequest>p.noRequestSubtitle {
    margin-top: 2px;
    font-size: 0.88rem;
    color: var(--rp-text-3);
}

.rp-article>h3 {
    position: relative;
    margin: 0 0 8px;
    padding: 0;
    font-size: 1.08rem;
    font-weight: 700;
    text-align: left;
    color: var(--rp-text);
}

.rp-article>p {
    margin: 0 0 10px;
    color: var(--rp-text-2);
}

.rp-article>p:last-child {
    margin: 0;
}

/* Notizia valida per tutte le radio */
.rp-articleBox.is-global {
    border-color: rgba(94, 200, 220, 0.28);
    background: linear-gradient(180deg, var(--rp-signal-soft), transparent 70%), var(--rp-surface-2);
}

.rp-news-image {
    width: 100%;
    height: 100%;
    min-height: 140px;
    border-radius: var(--rp-r-sm);
    background-size: cover;
    background-position: center;
}

/* Intestazione di un box con titolo a sinistra e azioni a destra */
.rp-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.rp-box-head>h2,
.rp-box-head>h3 {
    margin: 0;
    font-weight: 700;
    color: var(--rp-text);
}

.rp-box-head>h2 {
    font-size: 1.25rem;
}

.rp-box-head>h3 {
    font-size: 1.02rem;
}

/* --- Pulsanti ---
 * .rp-button              pulsante neutro
 * submit / .rp-button-fullcolor   azione principale (rosso "on air")
 * .button-red             azione distruttiva     .button-green   conferma
 * .rp-btn-sm              versione compatta
 */
:where(.panelpage, .startpage) .rp-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45em;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--rp-line-strong);
    border-radius: var(--rp-r-sm);
    background: var(--rp-surface-3);
    color: var(--rp-text);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--rp-fast) ease, border-color var(--rp-fast) ease, color var(--rp-fast) ease, transform var(--rp-fast) ease;
}

:where(.panelpage, .startpage) .rp-button:hover {
    background: var(--rp-surface-4);
    border-color: rgba(255, 245, 208, 0.36);
    color: var(--rp-white);
    text-decoration: none;
}

:where(.panelpage, .startpage) .rp-button:active {
    transform: translateY(1px);
}

:where(.panelpage, .startpage) .rp-button:disabled,
:where(.panelpage, .startpage) .rp-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Azione principale */
:where(.panelpage, .startpage) .rp-button:where([type=submit], .rp-button-fullcolor) {
    background: var(--rp-accent);
    border-color: var(--rp-accent);
    color: var(--rp-white);
}

:where(.panelpage, .startpage) .rp-button:where([type=submit], .rp-button-fullcolor):hover {
    background: var(--rp-accent-hover);
    border-color: var(--rp-accent-hover);
}

/* Varianti esplicite: vincono sull'azione principale */
:where(.panelpage, .startpage) .rp-button.button-red,
:where(.panelpage, .startpage) .rp-button.rp-mc-danger {
    background: var(--rp-danger-soft);
    border-color: rgba(248, 81, 73, 0.35);
    color: #ff8a83;
}

:where(.panelpage, .startpage) .rp-button.button-red:hover,
:where(.panelpage, .startpage) .rp-button.rp-mc-danger:hover {
    background: var(--rp-danger);
    border-color: var(--rp-danger);
    color: var(--rp-white);
}

:where(.panelpage, .startpage) .rp-button.button-green {
    background: var(--rp-ok);
    border-color: var(--rp-ok);
    color: #06210f;
}

:where(.panelpage, .startpage) .rp-button.button-green:hover {
    background: #56d364;
    border-color: #56d364;
}

:where(.panelpage, .startpage) .rp-button.button-blue,
:where(.panelpage, .startpage) .rp-button.rp-ticket-btn-secondary {
    background: transparent;
    border-color: var(--rp-line-strong);
    color: var(--rp-text-2);
}

:where(.panelpage, .startpage) .rp-button.button-blue:hover,
:where(.panelpage, .startpage) .rp-button.rp-ticket-btn-secondary:hover {
    background: var(--rp-surface-3);
    color: var(--rp-text);
}

.rp-btn-sm,
:where(.panelpage, .startpage) .rp-button.rp-btn-sm {
    min-height: 30px;
    padding: 0 11px;
    font-size: 0.8rem;
    text-decoration: none;
}

.rp-icon-btn {
    margin-right: 8px;
    text-decoration: none;
}

/* Pulsante-icona dentro un form (es. cestino che invia il form) senza aspetto da pulsante */
.rp-icon-btn-plain {
    margin-right: 0;
    padding: 0;
    border: 0;
    background: none;
}

.rp-icon-img {
    width: 16px;
    height: 16px;
}

/* Utente in una riga di tabella (Gestione Utenti): nome, username e email uno sotto l'altro */
.rp-user-name {
    color: var(--rp-text);
    font-size: 0.95rem;
    font-weight: 700;
}

.rp-user-handle {
    color: var(--rp-signal);
    font-size: 0.9rem;
    font-weight: 600;
}

.rp-user-mail {
    margin-top: 1px;
    color: var(--rp-text-3);
    font-size: 0.78rem;
}

/* Palinsesto: slot libero ("Prenota") */
.rp-slot>a.rp-slot-free {
    color: var(--rp-warn);
}

/* Miniatura di un'immagine in una riga di tabella (es. immagine di una news) */
.rp-table-thumb {
    max-width: 50px;
    max-height: 28px;
    border-radius: 3px;
    object-fit: cover;
}

.rp-table-thumb-lg {
    max-width: 60px;
    max-height: 40px;
}

/* Icona d'azione non disponibile (es. cestino del proprio account) */
.rp-icon-disabled {
    opacity: 0.4;
    filter: grayscale(100%);
    cursor: not-allowed;
}

/* Cella delle azioni di una riga (frecce, matita, cestino): sempre su una riga */
.rp-table td.rp-row-actions {
    padding: 8px 0;
    white-space: nowrap;
}

/* Icone d'azione distanziate allo stesso modo, che siano link o pulsanti */
.rp-row-actions .rp-icon-btn {
    margin-right: 8px;
    vertical-align: middle;
}

/* Cestino in fondo alle azioni di una riga ($core->deleteButton) */
.rp-row-delete {
    display: inline-block;
    margin: 0 0 0 10px;
    vertical-align: middle;
}

.rp-row-delete .rp-icon-img {
    vertical-align: middle;
}

/* Icone d'azione nelle tabelle (matita, cestino) */
.rp-table img[src*="pencil"],
.rp-table img[src*="trash"],
.rp-icon-img {
    opacity: 0.75;
    transition: opacity var(--rp-fast) ease;
}

.rp-table a:hover>img,
.rp-table button:hover>img,
.rp-icon-btn:hover>img {
    opacity: 1;
}

.rp-action-link {
    color: var(--rp-warn);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* --- Campi dei moduli --- */
:where(.panelpage, .startpage) .form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--rp-text-2);
    font-size: 0.84rem;
    font-weight: 600;
}

:where(.panelpage, .startpage) .form-text {
    margin-top: 5px !important;
    margin-left: 0 !important;
    color: var(--rp-text-3) !important;
    font-size: 0.8rem;
}

:where(.panelpage, .startpage) :is(input.rp-form:not([type=checkbox], [type=radio], [type=file], [type=submit], [type=button]), textarea.rp-form, select.rp-form, .rp-select),
:where(.panelpage, .startpage) .form-control {
    display: block;
    width: 100%;
    min-height: var(--rp-control-h);
    margin: 0 0 4px;
    padding: 8px 12px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r-sm);
    background-color: var(--rp-field);
    color: var(--rp-text);
    font-size: 0.92rem;
    line-height: 1.4;
    text-align: left;
    outline: none;
    box-shadow: none;
    transition: border-color var(--rp-fast) ease, box-shadow var(--rp-fast) ease, background-color var(--rp-fast) ease;
}

:where(.panelpage, .startpage) textarea.rp-form {
    min-height: 110px;
    resize: vertical;
}

:where(.panelpage, .startpage) :is(.rp-form, .rp-select, .form-control)::placeholder {
    color: var(--rp-text-3);
    opacity: 1;
}

:where(.panelpage, .startpage) :is(.rp-form, .rp-select, .form-control):hover {
    border-color: var(--rp-line-strong);
}

:where(.panelpage, .startpage) :is(.rp-form, .rp-select, .form-control):focus {
    border-color: var(--rp-accent);
    background-color: var(--rp-field);
    color: var(--rp-text);
    box-shadow: 0 0 0 3px var(--rp-accent-soft);
    outline: none;
}

:where(.panelpage, .startpage) :is(.rp-form, .rp-select, .form-control):disabled,
:where(.panelpage, .startpage) input.rp-form:read-only {
    color: var(--rp-text-2) !important;
    background-color: var(--rp-surface-2);
}

:where(.panelpage, .startpage) :is(.rp-form, .rp-select, .form-control):disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

:where(.panelpage, .startpage) :is(select.rp-form, .rp-select) {
    padding-right: 36px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23bccad3' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

:where(.panelpage, .startpage) :is(select.rp-form, .rp-select)[multiple] {
    padding-right: 12px;
    background-image: none;
}

:where(.panelpage, .startpage) :is(select.rp-form, .rp-select) option {
    background: var(--rp-surface-2);
    color: var(--rp-text);
}

:where(.panelpage, .startpage) input[type=file].rp-form,
:where(.panelpage, .startpage) input[type=file].form-control {
    padding: 6px;
    font-size: 0.85rem;
}

:where(.panelpage, .startpage) input[type=file]::file-selector-button {
    margin-right: 10px;
    padding: 5px 12px;
    border: 1px solid var(--rp-line-strong);
    border-radius: var(--rp-r-xs);
    background: var(--rp-surface-3);
    color: var(--rp-text);
    font-weight: 600;
    cursor: pointer;
}

input[type=submit].right {
    display: block;
    width: auto;
    margin: 15px 0 0 auto;
}

/* Spunte e interruttori (Bootstrap form-check) */
:is(.panelpage, .startpage) .form-check-input {
    background-color: var(--rp-field);
    border: 1px solid var(--rp-line-strong);
    cursor: pointer;
}

:is(.panelpage, .startpage) .form-check-input:checked {
    background-color: var(--rp-accent);
    border-color: var(--rp-accent);
}

:is(.panelpage, .startpage) .form-check-input:focus {
    border-color: var(--rp-accent);
    box-shadow: 0 0 0 3px var(--rp-accent-soft);
}

:is(.panelpage, .startpage) .form-switch .form-check-input:not(:checked) {
    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='%238ea2af'/%3e%3c/svg%3e");
}

:is(.panelpage, .startpage) .form-check-label {
    color: var(--rp-text-2);
    cursor: pointer;
}

:is(.panelpage, .startpage) input[type=checkbox],
:is(.panelpage, .startpage) input[type=radio] {
    accent-color: var(--rp-accent);
}

.rp-formCheckControl {
    margin-bottom: 6px;
}

.rp-formCheckControl>input[type=checkbox] {
    margin-right: 6px;
}

.rp-formCheckControl>label {
    color: var(--rp-text-2);
    font-weight: 500;
}

/* Elenco di spunte che scorre (destinatari, membri, radio) */
.rp-checklist {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px 14px;
    background: var(--rp-field);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r-sm);
}

/* Separatore con testo ("oppure") */
.rp-divider-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.rp-divider-label::before,
.rp-divider-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rp-line);
}

/* Zona di caricamento file */
.rp-dropzone {
    padding: 18px;
    border: 1px dashed var(--rp-line-strong);
    border-radius: var(--rp-r);
    background: var(--rp-field);
    text-align: center;
    transition: border-color var(--rp-fast) ease, background-color var(--rp-fast) ease;
}

/* Campo e pulsanti sulla stessa riga: stessa altezza, bordi inferiori allineati */
.rp-field-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.rp-field-actions>.rp-field-actions-input {
    flex: 1 1 220px;
    min-width: 0;
}

:where(.panelpage, .startpage) .rp-field-actions :is(.rp-form, .rp-select) {
    margin-bottom: 0;
}

:where(.panelpage, .startpage) .rp-field-actions .rp-button {
    min-height: var(--rp-control-h);
}

.rp-dropzone:hover,
.rp-dropzone.is-dragover {
    border-color: var(--rp-signal);
    background: var(--rp-signal-soft);
}

.rp-dropzone.is-ready {
    border-style: solid;
    border-color: rgba(63, 185, 80, 0.5);
}

/* --- Avvisi (Core::alert) --- */
:where(.panelpage, .startpage) :is(.rp-alertSUCCESSO, .rp-alertERRORE, .rp-boxNotify, .alert) {
    position: relative;
    margin: 0 0 16px !important;
    padding: 11px 14px 11px 16px;
    border: 1px solid;
    border-radius: var(--rp-r);
    color: var(--rp-text);
    font-size: 0.9rem;
    text-align: left;
}

:where(.panelpage, .startpage) :is(.rp-alertSUCCESSO, .rp-alertERRORE, .alert)::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: currentColor;
}

:where(.panelpage, .startpage) .rp-alertSUCCESSO,
:where(.panelpage, .startpage) .alert-success {
    background: var(--rp-ok-soft);
    border-color: rgba(63, 185, 80, 0.3);
    color: #bdeccd;
}

:where(.panelpage, .startpage) .rp-alertERRORE,
:where(.panelpage, .startpage) .alert-danger {
    background: var(--rp-danger-soft);
    border-color: rgba(248, 81, 73, 0.3);
    color: #ffc9c5;
}

:where(.panelpage, .startpage) .alert-warning {
    background: var(--rp-warn-soft);
    border-color: rgba(240, 176, 60, 0.3);
    color: #f6dba8;
}

:where(.panelpage, .startpage) .alert-info,
:where(.panelpage, .startpage) .rp-boxNotify {
    background: var(--rp-signal-soft);
    border-color: rgba(94, 200, 220, 0.3);
    color: #c6eef2;
}

:where(.panelpage, .startpage) .rp-boxNotify>p {
    margin: 0;
    padding: 4px 0;
    font-weight: 500;
}

/* Avviso a tutta larghezza (es. dentro i popup), vedi Core::alert() */
.rp-alert-full {
    width: 100%;
}

/* Gli avvisi dentro una barra di azioni occupano tutta la riga */
.float-box>.rp-alertSUCCESSO,
.float-box>.rp-alertERRORE {
    flex: 1 0 100%;
    margin: 0 !important;
}

/* --- Etichette (chip) e badge ---
 * .rp-chip + .rp-chip--ok / --warn / --danger / --info / --violet / --neutral
 * I .badge di Bootstrap usati nelle pagine prendono lo stesso aspetto. */
.rp-chip,
:is(.panelpage, .startpage) .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: 0.01em;
    white-space: nowrap;
    vertical-align: middle;
}

.rp-chip,
.rp-chip--neutral,
:is(.panelpage, .startpage) .badge.bg-secondary,
:is(.panelpage, .startpage) .badge.bg-dark,
:is(.panelpage, .startpage) .badge:not([class*="bg-"]) {
    background: var(--rp-surface-3) !important;
    border-color: var(--rp-line-strong);
    color: var(--rp-text-2) !important;
}

.rp-chip--ok,
:is(.panelpage, .startpage) .badge.bg-success {
    background: var(--rp-ok-soft) !important;
    border-color: rgba(63, 185, 80, 0.32);
    color: var(--rp-ok) !important;
}

.rp-chip--warn,
:is(.panelpage, .startpage) .badge.bg-warning {
    background: var(--rp-warn-soft) !important;
    border-color: rgba(240, 176, 60, 0.32);
    color: var(--rp-warn) !important;
}

.rp-chip--danger,
:is(.panelpage, .startpage) .badge.bg-danger {
    background: var(--rp-danger-soft) !important;
    border-color: rgba(248, 81, 73, 0.32);
    color: var(--rp-danger) !important;
}

.rp-chip--info,
:is(.panelpage, .startpage) .badge.bg-info,
:is(.panelpage, .startpage) .badge.bg-primary {
    background: var(--rp-signal-soft) !important;
    border-color: rgba(94, 200, 220, 0.32);
    color: var(--rp-signal) !important;
}

.rp-chip--violet {
    background: var(--rp-violet-soft) !important;
    border-color: rgba(180, 148, 232, 0.32);
    color: var(--rp-violet) !important;
}

.rp-chip--accent {
    background: var(--rp-accent-soft) !important;
    border-color: rgba(245, 81, 57, 0.35);
    color: #ff8a76 !important;
}

/* --- Tabelle dati ---
 * Uso: <div class="rp-table-wrap"><table class="rp-table">...</table></div>
 * Padding e bordi sono forzati (!important) per neutralizzare gli stili inline
 * ancora presenti nelle celle generate dalle pagine. */
.rp-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
    background: var(--rp-surface);
    -webkit-overflow-scrolling: touch;
}

.rp-table-wrap+.rp-table-wrap {
    margin-top: 16px;
}

.rp-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--rp-text);
    font-size: 0.88rem;
}

/* Tabelle con molte colonne: scroll orizzontale invece di schiacciare le celle */
.rp-table-wide {
    min-width: 640px;
}

.rp-table>thead>tr>td,
.rp-table>thead>tr>th {
    padding: 10px 14px !important;
    background: var(--rp-surface-2);
    border-bottom: 1px solid var(--rp-line) !important;
    color: var(--rp-text-3) !important;
    font-family: var(--rp-mono);
    font-size: 0.68rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

.rp-table>thead strong {
    font-weight: inherit;
}

.rp-table>tbody>tr>td,
.rp-table>tbody>tr>th {
    padding: 11px 14px !important;
    border-bottom: 1px solid var(--rp-line-soft) !important;
    color: inherit;
    vertical-align: middle;
}

.rp-table>tbody>tr:last-child>td,
.rp-table>tbody>tr:last-child>th {
    border-bottom: none !important;
}

.rp-table>tbody>tr {
    transition: background-color var(--rp-fast) ease;
}

.rp-table>tbody>tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.rp-table code {
    font-size: 0.8rem;
}

.rp-table>tbody>tr>td.rp-table-empty,
.rp-table-empty {
    padding: 30px 14px !important;
    color: var(--rp-text-3);
    text-align: center;
}

.rp-table>tbody>tr:hover:has(> .rp-table-empty) {
    background: transparent;
}

.rp-status-waiting,
.rp-status-approved,
.rp-status-rejected {
    font-weight: 650;
}

.rp-status-waiting {
    color: var(--rp-warn);
}

.rp-status-approved {
    color: var(--rp-ok);
}

.rp-status-rejected {
    color: var(--rp-danger);
}

.rp-status-icon {
    width: 15px;
    margin: -3px 3px 0 0;
}

/* --- Accordion (palinsesto) --- */
.accordion {
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accordion-item {
    margin: 0;
    background: var(--rp-surface-2);
    border: 1px solid var(--rp-line-soft);
    border-radius: var(--rp-r) !important;
    color: var(--rp-text);
    overflow: hidden;
}

.accordion-header {
    position: relative;
    padding: 13px 48px 13px 18px;
    background: transparent;
    color: var(--rp-text);
    font-size: 0.98rem;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--rp-fast) ease;
}

.accordion-header:hover {
    background: var(--rp-surface-3);
}

.accordion-header::before {
    content: "\F282";
    font-family: "bootstrap-icons" !important;
    position: absolute;
    right: 18px;
    top: 50%;
    font-size: 0.85rem;
    line-height: 1;
    color: var(--rp-text-3);
    transform: translateY(-50%);
    transition: transform var(--rp-mid) var(--rp-ease);
}

.accordion-item.active {
    border-color: var(--rp-line-strong);
}

.accordion-item.active .accordion-header::before {
    transform: translateY(-50%) rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 18px;
    transition: max-height 0.4s var(--rp-ease), opacity 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 3000px;
    opacity: 1;
    padding: 4px 18px 18px;
    overflow: auto;
}

/* Palinsesto: griglia delle 24 ore */
.rp-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
}

.rp-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 10px;
    border-radius: var(--rp-r-sm);
    background: var(--rp-surface);
    border: 1px solid var(--rp-line-soft);
}

.rp-slot-time {
    flex: none;
    font-family: var(--rp-mono);
    font-size: 0.78rem;
    color: var(--rp-text-3);
}

.rp-slot>a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
}

.rp-slot>a:hover {
    text-decoration: underline !important;
}

.rp-slot.is-now {
    border-color: rgba(245, 81, 57, 0.45);
    box-shadow: inset 2px 0 0 var(--rp-accent);
}

.rp-slot.is-now .rp-slot-time {
    color: var(--rp-accent);
}

/* Palinsesto: popup per scegliere quale programma prenotare (chi ne conduce più di uno) */
.rp-show-picker-text {
    margin: 0 0 16px;
    color: var(--rp-text-2);
}

.rp-show-picker {
    display: grid;
    gap: 8px;
}

:where(.panelpage) .rp-show-picker .rp-button {
    justify-content: flex-start;
    width: 100%;
    min-height: 44px;
    white-space: normal;
    text-align: left;
}

/* --- Schede (filtri) --- */
.rp-tabs,
.rp-ticket-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 16px;
    padding: 4px;
    width: fit-content;
    max-width: 100%;
    background: var(--rp-surface);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
}

/* Schede: hover e scheda aperta come le voci del menu laterale (.rp-menuLink).
 * Link per i filtri che cambiano pagina, <button> per le schede che cambiano solo il contenuto sotto (es. pagina di firma) */
.rp-tabs>button {
    border: 0;
    background: transparent;
    font-family: inherit;
}

.rp-tabs a,
.rp-tabs>button,
.rp-ticket-tabs a {
    padding: 6px 14px;
    border-radius: var(--rp-r-sm);
    color: var(--rp-text-2);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--rp-fast) ease, color var(--rp-fast) ease;
}

.rp-tabs a:hover,
.rp-tabs>button:hover,
.rp-ticket-tabs a:hover {
    background: var(--rp-sidebar-hover);
    color: var(--rp-text);
}

.rp-tabs a.active,
.rp-tabs>button.active,
.rp-ticket-tabs a.active {
    background: var(--rp-sidebar-active);
    color: var(--rp-text);
    font-weight: 650;
}

.rp-tabs a span,
.rp-ticket-tabs a span {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--rp-field);
    font-family: var(--rp-mono);
    font-size: 0.7rem;
    text-align: center;
}

/* --- Popup (remodal) --- */
:is(.panelpage, .startpage) .remodal-overlay {
    background: rgba(6, 16, 22, 0.72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

:is(.panelpage, .startpage) .remodal-bg.remodal-is-opening,
:is(.panelpage, .startpage) .remodal-bg.remodal-is-opened {
    filter: none;
}

:is(.panelpage, .startpage) .remodal {
    padding: 26px 26px 24px;
    background: var(--rp-surface);
    border: 1px solid var(--rp-line-strong);
    border-radius: 16px;
    box-shadow: var(--rp-shadow-pop) !important;
    color: var(--rp-text);
    text-align: left;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

:is(.panelpage, .startpage) .remodal>h2,
:is(.panelpage, .startpage) .remodal>h3 {
    margin: 0 36px 16px 0;
    font-size: 1.2rem;
    font-weight: 700;
}

:is(.panelpage, .startpage) .remodal-close {
    top: 14px;
    right: 14px;
    left: auto;
    width: 32px;
    height: 32px;
    border-radius: var(--rp-r-sm);
    color: var(--rp-text-3);
}

:is(.panelpage, .startpage) .remodal-close:hover,
:is(.panelpage, .startpage) .remodal-close:focus {
    background: var(--rp-surface-3);
    color: var(--rp-text);
}

:is(.panelpage, .startpage) .remodal-close::before {
    width: 32px;
    font-size: 22px;
    line-height: 32px;
}

/* --- Editor TinyMCE --- */
.tox-tinymce {
    border: 1px solid var(--rp-line) !important;
    border-radius: var(--rp-r-sm) !important;
}

/* ==========================================================================
   4 bis. MOVIMENTO
   Animazioni brevi (120–450ms), sempre con --rp-ease, solo opacità e spostamenti di pochi pixel.
   Con "riduci movimento" del sistema si spengono tutte (sezione 8).
   ========================================================================== */

@keyframes rp-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

@keyframes rp-fade {
    from {
        opacity: 0;
    }
}

/* La lancetta "on air" si sintonizza: parte da sinistra e si ferma sulla sua tacca */
@keyframes rp-tune {
    from {
        background-position: 0 0, 0 100%, 0 100%;
    }
}

@keyframes rp-tune-top {
    from {
        background-position: 0 0, 0 0, 0 0;
    }
}

@keyframes rp-badge-pop {
    0% {
        transform: scale(0.4);
        opacity: 0;
    }

    60% {
        transform: scale(1.15);
    }
}

/* Entrata della pagina (anche a ogni navigazione AJAX: i contenuti nuovi partono da qui).
 * Intestazione, poi le colonne una dopo l'altra. */
.rp-content>.welcome {
    animation: rp-fade 320ms var(--rp-ease) backwards;
}

.rp-content>.welcome::after {
    animation: rp-tune 900ms cubic-bezier(0.22, 1, 0.36, 1) 120ms backwards;
}

.container-full>*,
.container-full>.row>* {
    animation: rp-rise 420ms var(--rp-ease) backwards;
}

.container-full>.row {
    animation: none;
}

.container-full>*:nth-child(2),
.container-full>.row>*:nth-child(2) {
    animation-delay: 50ms;
}

.container-full>*:nth-child(3),
.container-full>.row>*:nth-child(3) {
    animation-delay: 100ms;
}

.container-full>*:nth-child(4),
.container-full>.row>*:nth-child(4) {
    animation-delay: 150ms;
}

.container-full>*:nth-child(n+5),
.container-full>.row>*:nth-child(n+5) {
    animation-delay: 200ms;
}

/* Righe degli elenchi: entrano una dopo l'altra */
.boxrequest,
.rp-articleBox,
.rp-ticket-item {
    animation: rp-rise 360ms var(--rp-ease) backwards;
}

.boxrequest:nth-child(2),
.rp-articleBox:nth-child(2),
.rp-ticket-item:nth-child(2) {
    animation-delay: 60ms;
}

.boxrequest:nth-child(3),
.rp-articleBox:nth-child(3),
.rp-ticket-item:nth-child(3) {
    animation-delay: 110ms;
}

.boxrequest:nth-child(4),
.rp-articleBox:nth-child(4),
.rp-ticket-item:nth-child(4) {
    animation-delay: 150ms;
}

.boxrequest:nth-child(n+5),
.rp-articleBox:nth-child(n+5),
.rp-ticket-item:nth-child(n+5) {
    animation-delay: 180ms;
}

/* Cambio pagina in corso (navigation.js mette aria-busy): il contenuto vecchio si attenua */
.rp-content {
    transition: padding-left var(--rp-mid) var(--rp-ease), opacity 200ms ease;
}

#rp-page[aria-busy="true"]>.rp-content {
    opacity: 0.45;
}

/* Avvisi, popup e ricerca rapida */
:where(.panelpage, .startpage) :is(.rp-alertSUCCESSO, .rp-alertERRORE, .alert) {
    animation: rp-rise 320ms var(--rp-ease) backwards;
}

.rp-cmdk:not([hidden]) {
    animation: rp-fade 160ms ease;
}

.rp-notif-badge:not([hidden]) {
    animation: rp-badge-pop 420ms var(--rp-ease);
}

.panelpage .remodal.remodal-is-opening,
.panelpage .remodal.remodal-is-closing,
.panelpage .remodal-overlay.remodal-is-opening,
.panelpage .remodal-overlay.remodal-is-closing {
    animation-duration: 220ms;
    animation-timing-function: var(--rp-ease);
}

/* Micro-interazioni: ciò che si clicca risponde */
.boxrequest.clickable,
.rp-ticket-item,
.rp-group-member,
.rp-ticket-stat {
    transition: transform var(--rp-fast) ease, background-color var(--rp-fast) ease, border-color var(--rp-fast) ease, box-shadow var(--rp-fast) ease;
}

.boxrequest.clickable:hover,
.rp-ticket-item:hover,
.rp-group-member:hover,
.rp-ticket-stat:hover {
    transform: translateY(-1px);
}

.boxrequest.clickable:active,
.rp-ticket-item:active,
.rp-group-member:active {
    transform: translateY(0) scale(0.995);
}

:where(.panelpage, .startpage) .rp-button:active,
.rp-request-delete:active,
.rp-request-visual:active,
.rp-audio-play:active,
.rp-mc-send:active,
.rp-cmdk-btn:active,
.rp-profile-btn:active {
    transform: scale(0.97);
}

.rp-request-delete,
.rp-request-visual,
.rp-audio-play,
.rp-mc-send,
.rp-cmdk-btn,
.rp-profile-btn {
    transition-property: background-color, border-color, color, opacity, transform;
    transition-duration: var(--rp-fast);
}

/* Icona della voce di menu: piccolo scatto al passaggio del mouse */
.rp-menuLink>.bi {
    transition: color var(--rp-fast) ease, transform var(--rp-mid) var(--rp-ease);
}

.rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuLink:hover>.bi {
    transform: translateX(2px);
}

.rp-sidebar-collapsed .rp-menuPanel>.rp-menuItems>.rp-menuItem>.rp-menuLink:hover>.bi {
    transform: scale(1.12);
}

/* Freccia dell'accordion e righe del palinsesto */
.accordion-item.active .rp-slot {
    animation: rp-fade 300ms ease backwards;
}

/* ==========================================================================
   5. MODULI DELLE FUNZIONI
   ========================================================================== */

/* --- Termini & condizioni --- */
.firma {
    text-align: center;
}

.firma>form {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.firma>form>input.rp-button {
    min-width: 120px;
}

:where(.panelpage, .startpage) .firma>form>input.rp-button[value=Rifiuta] {
    background: var(--rp-danger-soft);
    border-color: rgba(248, 81, 73, 0.35);
    color: #ff8a83;
}

:where(.panelpage, .startpage) .firma>form>input.rp-button[value=Rifiuta]:hover {
    background: var(--rp-danger);
    color: var(--rp-white);
}

:where(.panelpage, .startpage) .firma>form>input.rp-button[value=Accetta] {
    background: var(--rp-ok);
    border-color: var(--rp-ok);
    color: #06210f;
}

/* --- Radio show --- */
.rp-header-border {
    border-bottom: 1px solid var(--rp-line);
    padding: 0 0 12px;
    margin-bottom: 12px;
}

.rp-header-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.rp-box-dark {
    background: var(--rp-field);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
}

.rp-scroll-150 {
    max-height: 150px;
    overflow-y: auto;
}

.rp-cohost-label {
    color: var(--rp-text-2);
    font-size: 0.88rem;
}

.rp-show-img {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    object-fit: cover;
    border-radius: var(--rp-r);
    border: 1px solid var(--rp-line);
}

.rp-show-title {
    margin-bottom: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rp-text);
}

.rp-show-subname {
    margin-bottom: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rp-text-2);
}

.rp-show-hosts {
    font-size: 0.78rem;
    color: var(--rp-text-3);
}

.rp-show-badge {
    margin-right: 4px;
    font-size: 0.75rem;
    font-style: italic;
}

/* --- Organigramma --- */
.rp-person {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.rp-person-avatar {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--rp-surface-3);
    border: 1px solid var(--rp-line);
}

.rp-person-name {
    font-size: 1.05rem;
    font-weight: 700;
}

/* --- Immagine profilo (Avatar::html): foto oppure iniziali del nome --- */
.rp-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--rp-text);
    font-family: var(--rp-mono);
    font-weight: 600;
    line-height: 1;
    user-select: none;
}

.rp-profile-avatar.rp-avatar-initials {
    font-size: 0.68rem;
}

.rp-person-avatar.rp-avatar-initials {
    font-size: 1rem;
}

.rp-avatar-lg {
    flex: none;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--rp-surface-3);
    border: 1px solid var(--rp-line);
}

.rp-avatar-lg.rp-avatar-initials {
    font-size: 1.9rem;
}

/* Modifica Profilo: immagine a sinistra centrata sulla zona di caricamento, pulsanti sotto */
.rp-avatar-edit {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rp-avatar-edit-body {
    flex: 1;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .rp-avatar-edit {
        flex-direction: column;
        align-items: stretch;
    }

    .rp-avatar-edit>.rp-avatar-lg {
        align-self: center;
    }
}

.rp-person-meta {
    font-size: 0.85rem;
}

/* Contatti social: icone Bootstrap, mai emoji */
.rp-person-socials,
.rp-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.rp-person-socials a,
.rp-contacts span {
    color: var(--rp-text-2);
    text-decoration: none;
}

.rp-person-socials a {
    font-size: 1.05rem;
}

.rp-person-socials a:hover {
    color: var(--rp-text);
}

.rp-contacts span {
    font-size: 0.8rem;
    white-space: nowrap;
}

.rp-contacts .bi {
    margin-right: 4px;
    color: var(--rp-text-3);
}

/* --- Modifica profilo: app di autenticazione (MFA) --- */
.rp-totp-setup ol {
    padding-left: 1.2rem;
    font-size: 0.9rem;
}

.rp-totp-qr {
    width: 220px;
    max-width: 100%;
    margin: 15px auto;
    padding: 8px;
    background: #ffffff;
    /* fondo chiaro: le app non leggono i QR in negativo */
    border-radius: var(--rp-r);
}

.rp-totp-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.rp-totp-key {
    text-align: center;
    font-size: 0.85rem;
    color: var(--rp-text-3);
}

.rp-totp-key code {
    display: inline-block;
    margin-top: 4px;
    font-size: 1rem;
    letter-spacing: 1px;
    color: var(--rp-text);
    word-break: break-all;
}

.rp-field-note {
    margin: 4px 0 0;
    color: var(--rp-text-3);
    font-size: 0.8rem;
}

/* --- Richieste: player dei vocali (WhatsApp) --- */
.rp-audio {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    margin-top: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--rp-field);
    border: 1px solid var(--rp-line);
    border-radius: 999px;
}

.rp-audio-play {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--rp-surface-3);
    color: var(--rp-text);
    font-size: 1.1rem;
    transition: background-color var(--rp-fast) ease;
}

.rp-audio-play:hover {
    background: var(--rp-surface-4);
}

.rp-audio.is-playing .rp-audio-play {
    background: var(--rp-accent);
    color: var(--rp-white);
}

.rp-audio-bar {
    flex: 1 1 auto;
    height: 4px;
    background: var(--rp-surface-4);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.rp-audio-progress {
    width: 0;
    height: 100%;
    background: var(--rp-text);
    border-radius: 4px;
}

.rp-audio-time {
    flex: 0 0 auto;
    min-width: 34px;
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    color: var(--rp-text-2);
    text-align: right;
}

.rp-audio.is-error .rp-audio-time {
    color: var(--rp-danger);
}

/* --- Richieste: pulsanti tondi della riga (elimina, manda in visual) --- */
.rp-request-delete,
.rp-request-visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--rp-line-strong);
    border-radius: var(--rp-r-sm);
    background: var(--rp-surface-3);
    color: var(--rp-text-2);
    font-size: 0.92rem;
    transition: background-color var(--rp-fast) ease, color var(--rp-fast) ease, border-color var(--rp-fast) ease, opacity var(--rp-fast) ease;
}

.rp-request-visual {
    margin-right: 6px;
}

.rp-request-delete:hover {
    background: var(--rp-danger);
    border-color: var(--rp-danger);
    color: var(--rp-white);
}

.rp-request-visual:hover {
    background: var(--rp-surface-4);
    color: var(--rp-text);
}

.rp-request-visual.is-flagged {
    color: var(--rp-warn);
}

.rp-request-visual.is-sent {
    background: var(--rp-ok-soft);
    border-color: rgba(63, 185, 80, 0.4);
    color: var(--rp-ok);
}

.rp-request-delete:disabled,
.rp-request-visual:disabled {
    opacity: 0.5;
    cursor: wait;
}

.is-visual-autoplay .rp-request-visual {
    display: none;
}

:where(.panelpage, .startpage) .rp-button.rp-visual-autoplay.is-on {
    background: var(--rp-ok-soft);
    border-color: rgba(63, 185, 80, 0.4);
    color: var(--rp-ok);
}

.rp-visual-help {
    margin-top: 8px;
    font-size: 0.84rem;
    color: var(--rp-text-3);
}

/* Riga di una richiesta: autore, testo, data, azioni */
.rp-request {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(0, 2.2fr) minmax(130px, 0.9fr) auto;
    gap: 16px;
    align-items: start;
}

.rp-request-label {
    display: block;
    margin-bottom: 2px;
    font-family: var(--rp-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rp-text-3);
}

.rp-request-value {
    margin: 0;
    font-weight: 650;
    color: var(--rp-text);
    overflow-wrap: anywhere;
}

.rp-request-sub {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--rp-text-2);
}

.rp-request-date {
    font-family: var(--rp-mono);
    font-size: 0.82rem;
    font-weight: 500;
}

.rp-request-actions {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Home: "in onda" */
.rp-box>p.rp-onair-title,
.rp-onair-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 650;
    color: var(--rp-text);
}

.rp-onair-time {
    margin: 2px 0 0;
    font-family: var(--rp-mono);
    font-size: 0.8rem;
    color: var(--rp-text-3);
}

.rp-onair-now {
    border-color: rgba(245, 81, 57, 0.35);
    background: linear-gradient(135deg, rgba(245, 81, 57, 0.09), transparent 55%), var(--rp-surface);
}

.rp-onair-now>h3::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 8px 1px 0;
    border-radius: 50%;
    background: var(--rp-accent);
    box-shadow: 0 0 0 4px var(--rp-accent-soft);
    animation: rp-onair 2.4s ease-in-out infinite;
}

@keyframes rp-onair {
    50% {
        box-shadow: 0 0 0 7px rgba(245, 81, 57, 0);
    }
}

/* --- Centro messaggi WhatsApp (radioManager/centroMessaggi) --- */
.rp-mc {
    display: flex;
    height: calc(100vh - 280px);
    min-height: 480px;
    padding: 0;
    overflow: hidden;
}

.rp-mc [hidden] {
    display: none !important;
}

.rp-mc-sidebar {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid var(--rp-line);
}

.rp-mc-account {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--rp-line);
}

.rp-mc-account>.bi-whatsapp {
    font-size: 1.5rem;
    color: var(--rp-whatsapp);
}

.rp-mc-account-name {
    font-weight: 700;
    line-height: 1.2;
}

.rp-mc-account-phone {
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    color: var(--rp-text-3);
}

.rp-mc-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--rp-text-2);
    white-space: nowrap;
}

.rp-mc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rp-text-3);
}

.rp-mc-status[data-kind="ok"] .rp-mc-dot {
    background: var(--rp-ok);
}

.rp-mc-status[data-kind="warn"] .rp-mc-dot {
    background: var(--rp-warn);
}

.rp-mc-status[data-kind="ko"] .rp-mc-dot {
    background: var(--rp-danger);
}

.rp-mc-search {
    position: relative;
    padding: 10px 14px;
}

.rp-mc-search>i {
    position: absolute;
    left: 27px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rp-text-3);
    font-size: 13px;
}

.rp-mc-search>input {
    width: 100%;
    height: 36px;
    padding: 6px 12px 6px 34px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r-sm);
    background: var(--rp-field);
    color: var(--rp-text);
    outline: none;
}

.rp-mc-search>input:focus {
    border-color: var(--rp-accent);
    box-shadow: 0 0 0 3px var(--rp-accent-soft);
}

.rp-mc-chats {
    flex: 1 1 auto;
    overflow-y: auto;
}

.rp-mc-chat {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid var(--rp-line-soft);
    background: transparent;
    color: inherit;
    text-align: left;
    transition: background-color var(--rp-fast) ease;
}

.rp-mc-chat:hover {
    background: var(--rp-sidebar-hover);
}

.rp-mc-chat.active {
    background: var(--rp-sidebar-active);
}

.rp-mc-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--rp-surface-4);
    color: var(--rp-text);
    font-size: 14px;
    font-weight: 700;
}

.rp-mc-chat-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rp-mc-chat-top,
.rp-mc-chat-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rp-mc-chat-name,
.rp-mc-chat-last {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rp-mc-chat-name {
    font-weight: 600;
}

.rp-mc-chat-time {
    flex: 0 0 auto;
    font-family: var(--rp-mono);
    font-size: 0.68rem;
    color: var(--rp-text-3);
}

.rp-mc-chat-last {
    font-size: 0.82rem;
    color: var(--rp-text-2);
}

.rp-mc-chat.unread .rp-mc-chat-name,
.rp-mc-chat.unread .rp-mc-chat-last {
    color: var(--rp-text);
    font-weight: 700;
}

.rp-mc-chat.unread .rp-mc-chat-time {
    color: var(--rp-whatsapp);
}

.rp-mc-badge {
    flex: 0 0 auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--rp-whatsapp);
    color: #06210f;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.rp-mc-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px 16px;
    color: var(--rp-text-3);
    font-size: 0.88rem;
    text-align: center;
}

.rp-mc-empty-error {
    color: var(--rp-danger);
}

.rp-mc-thread {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--rp-field);
}

.rp-mc-placeholder {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    color: var(--rp-text-3);
    text-align: center;
}

.rp-mc-placeholder>i {
    font-size: 2.6rem;
}

.rp-mc-thread-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--rp-line);
    background: var(--rp-surface);
}

.rp-mc-back {
    display: none;
    padding: 0 4px;
    border: none;
    background: transparent;
    color: var(--rp-text);
    font-size: 1.3rem;
}

.rp-mc-thread-title {
    min-width: 0;
}

.rp-mc-thread-name {
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rp-mc-thread-phone {
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    color: var(--rp-text-3);
}

.rp-mc-messages {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    overflow-y: auto;
}

.rp-mc-day {
    margin: 10px 0 6px;
    text-align: center;
}

.rp-mc-day>span {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--rp-surface-2);
    color: var(--rp-text-2);
    font-family: var(--rp-mono);
    font-size: 0.68rem;
}

.rp-mc-msg {
    display: flex;
}

.rp-mc-msg.out {
    justify-content: flex-end;
}

.rp-mc-bubble {
    max-width: min(75%, 560px);
    padding: 7px 11px 5px;
    border-radius: 12px;
    background: var(--rp-surface-3);
    overflow-wrap: anywhere;
}

.rp-mc-msg.in .rp-mc-bubble {
    border-top-left-radius: 3px;
}

.rp-mc-msg.out .rp-mc-bubble {
    border-top-right-radius: 3px;
    background: #1e5a45;
}

.rp-mc-text a {
    color: #8ad7e0;
}

.rp-mc-muted {
    color: var(--rp-text-2);
    font-style: italic;
}

.rp-mc-quote {
    margin-bottom: 4px;
    padding: 4px 8px;
    border-left: 3px solid var(--rp-whatsapp);
    border-radius: var(--rp-r-xs);
    background: rgba(0, 0, 0, 0.2);
    color: var(--rp-text-2);
    font-size: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.rp-mc-meta {
    margin-top: 2px;
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.66rem;
    text-align: right;
    white-space: nowrap;
}

.rp-mc-meta .rp-mc-read {
    color: #53bdeb;
}

.rp-mc-meta .rp-mc-failed {
    color: var(--rp-danger);
}

.rp-mc-image {
    display: block;
    margin: 2px 0 4px;
}

.rp-mc-image>img {
    display: block;
    max-width: 100%;
    max-height: 320px;
    border-radius: var(--rp-r-sm);
}

.rp-mc-image.is-sticker>img {
    max-width: 140px;
    max-height: 140px;
}

.rp-mc-missing {
    display: none;
    color: var(--rp-text-2);
    font-style: italic;
}

.rp-mc-image.is-missing>img {
    display: none;
}

.rp-mc-image.is-missing>.rp-mc-missing {
    display: inline;
}

.rp-mc-audio {
    min-width: 240px;
    margin: 2px 0 4px;
}

.rp-mc-video {
    display: block;
    max-width: 100%;
    max-height: 320px;
    margin: 2px 0 4px;
    border-radius: var(--rp-r-sm);
}

.rp-mc-document {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0 4px;
    padding: 6px 10px;
    border-radius: var(--rp-r-sm);
    background: rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.rp-mc-composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--rp-line);
    background: var(--rp-surface);
}

.rp-mc-composer>textarea {
    flex: 1 1 auto;
    max-height: 160px;
    padding: 9px 14px;
    border: 1px solid var(--rp-line);
    border-radius: 20px;
    background: var(--rp-field);
    color: var(--rp-text);
    line-height: 1.4;
    resize: none;
    outline: none;
}

.rp-mc-composer>textarea:focus {
    border-color: var(--rp-accent);
    box-shadow: 0 0 0 3px var(--rp-accent-soft);
}

.rp-mc-send {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--rp-whatsapp);
    color: var(--rp-white);
    transition: background-color var(--rp-fast) ease, opacity var(--rp-fast) ease;
}

.rp-mc-send:hover {
    background: #2ea043;
}

.rp-mc-send:disabled {
    opacity: 0.5;
    cursor: wait;
}

.rp-mc-error {
    padding: 8px 14px;
    background: var(--rp-danger-soft);
    color: #ffc9c5;
    font-size: 0.82rem;
}

.rp-mc-footnote {
    margin-top: -8px;
    color: var(--rp-text-3);
    font-size: 0.78rem;
}

/* Collegamento di WhatsApp (Editore e Direttore, _js/centroMessaggiSetup.js) */
.rp-mc-setup [hidden],
.rp-mc-manage [hidden] {
    display: none !important;
}

.rp-mc-setup {
    max-width: 720px;
    margin: 0 auto;
}

.rp-mc-setup-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.rp-mc-setup-head>.bi-whatsapp {
    font-size: 2.2rem;
    line-height: 1;
    color: var(--rp-whatsapp);
}

.rp-mc-setup-head h3 {
    margin: 0 0 4px;
}

.rp-mc-setup-head p {
    margin: 0;
    color: var(--rp-text-2);
}

.rp-mc-step {
    padding: 16px 0;
    border-top: 1px solid var(--rp-line);
}

.rp-mc-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 700;
}

.rp-mc-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--rp-line-strong);
    background: var(--rp-surface-3);
    color: var(--rp-text);
    font-family: var(--rp-mono);
    font-size: 0.75rem;
}

.rp-mc-number {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rp-mc-number>input {
    flex: 1 1 220px;
    min-width: 0;
}

.rp-mc-hint {
    margin: 6px 0 0;
    color: var(--rp-text-3);
    font-size: 0.8rem;
}

.rp-mc-modes {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 3px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
    background: var(--rp-field);
}

.rp-mc-mode {
    padding: 5px 14px;
    border: none;
    border-radius: var(--rp-r-sm);
    background: transparent;
    color: var(--rp-text-2);
    font-size: 0.82rem;
    font-weight: 600;
}

.rp-mc-mode.active {
    background: var(--rp-surface-3);
    color: var(--rp-text);
}

.rp-mc-howto {
    margin: 0 0 12px;
    padding-left: 20px;
    font-size: 0.9rem;
}

.rp-mc-howto li {
    margin-bottom: 3px;
}

.rp-mc-link-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
    background: var(--rp-field);
    text-align: center;
}

.rp-mc-code {
    font-family: var(--rp-mono);
    font-size: 2.1rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--rp-text);
}

.rp-mc-qr img {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
    padding: 10px;
    border-radius: var(--rp-r);
    background: #ffffff;
}

.rp-mc-link-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--rp-text-2);
}

.rp-mc-link-status .rp-nav-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.rp-mc-setup .rp-mc-error,
.rp-mc-manage .rp-mc-error {
    margin-top: 12px;
    border-radius: var(--rp-r-sm);
}

.rp-mc-setup-foot {
    margin-top: 14px;
}

.rp-mc-manage {
    margin-top: 14px;
}

.rp-mc-manage>summary {
    cursor: pointer;
    font-weight: 700;
}

.rp-mc-manage-body {
    padding-top: 12px;
}

.rp-mc-manage-body p {
    margin: 0 0 10px;
}

.rp-mc-manage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

/* --- App desktop: finestre interne (vedi _js/desktop.js) --- */

/* Pagina dentro una finestra: niente spazio per navbar e menu (non presenti) */
.rp-embed .rp-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Area delle finestre: lo spazio di #rp-page, tra navbar, menu e barra delle finestre */
.rp-desktop {
    position: fixed;
    top: var(--rp-nav-h);
    left: var(--rp-sidebar-w);
    right: 0;
    bottom: 40px;
    z-index: 12;
    pointer-events: none;
    overflow: hidden;
}

.rp-desktop[hidden] {
    display: none;
}

/* Modalità finestre: il contenuto della pagina principale resta nascosto dietro le finestre */
.rp-windows-mode #rp-page,
.rp-windows-mode #rpFooter {
    display: none !important;
}

/* Voci di menu solo per l'app desktop e la PWA (es. cambio modalità nel menu del profilo) */
html:not(.is-app):not(.is-pwa) .rp-app-only,
html:not(.is-app) .rp-desktop-only {
    display: none !important;
}

.rp-view-to-classic,
.rp-windows-mode .rp-view-to-windows {
    display: none;
}

.rp-windows-mode .rp-view-to-classic {
    display: inline;
}

.rp-desktop-interacting {
    -webkit-user-select: none;
    user-select: none;
}

.rp-desktop-interacting .rp-win-body iframe {
    pointer-events: none;
}

.rp-win {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--rp-bg);
    border: 1px solid var(--rp-line-strong);
    border-radius: var(--rp-r);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.rp-win.active {
    border-color: rgba(255, 245, 208, 0.45);
    box-shadow: var(--rp-shadow-pop);
}

.rp-win.minimized {
    display: none;
}

.rp-win.maximized {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
}

.rp-win.maximized .rp-win-header,
.rp-win.maximized .rp-win-body {
    border-radius: 0;
}

.rp-win.maximized .rp-win-resize {
    display: none;
}

.rp-win-header {
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 6px 0 14px;
    background: var(--rp-surface-2);
    border-bottom: 1px solid var(--rp-line);
    border-radius: 9px 9px 0 0;
    cursor: move;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

.rp-win:not(.active) .rp-win-header {
    background: var(--rp-surface);
    color: var(--rp-text-3);
}

.rp-win-title {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-win-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.rp-win-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: var(--rp-r-xs);
    background: transparent;
    color: var(--rp-text-2);
    cursor: pointer;
}

.rp-win-btn:hover {
    background: var(--rp-surface-4);
    color: var(--rp-text);
}

.rp-win-btn.rp-win-close:hover {
    background: #c42b1c;
    color: var(--rp-white);
}

.rp-win-body {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: 0 0 9px 9px;
    background: var(--rp-bg);
}

.rp-win-body iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.rp-win-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid var(--rp-surface-4);
    border-top-color: var(--rp-accent);
    border-radius: 50%;
    animation: rp-spin 0.8s linear infinite;
}

.rp-win.loading .rp-win-spinner {
    display: block;
}

/* Maniglie di ridimensionamento (bordi e angoli) */
.rp-win-resize {
    position: absolute;
    z-index: 1;
    touch-action: none;
}

.rp-win-resize-n,
.rp-win-resize-s {
    left: 10px;
    right: 10px;
    height: 8px;
    cursor: ns-resize;
}

.rp-win-resize-n {
    top: -4px;
}

.rp-win-resize-s {
    bottom: -4px;
}

.rp-win-resize-e,
.rp-win-resize-w {
    top: 10px;
    bottom: 10px;
    width: 8px;
    cursor: ew-resize;
}

.rp-win-resize-e {
    right: -4px;
}

.rp-win-resize-w {
    left: -4px;
}

.rp-win-resize-ne,
.rp-win-resize-nw,
.rp-win-resize-se,
.rp-win-resize-sw {
    width: 14px;
    height: 14px;
}

.rp-win-resize-ne {
    top: -4px;
    right: -4px;
    cursor: nesw-resize;
}

.rp-win-resize-nw {
    top: -4px;
    left: -4px;
    cursor: nwse-resize;
}

.rp-win-resize-se {
    bottom: -4px;
    right: -4px;
    cursor: nwse-resize;
}

.rp-win-resize-sw {
    bottom: -4px;
    left: -4px;
    cursor: nesw-resize;
}

/* Barra delle finestre */
.rp-taskbar {
    position: fixed;
    left: var(--rp-sidebar-w);
    right: 0;
    bottom: 0;
    z-index: 13;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 8px;
    background: var(--rp-sidebar);
    border-top: 1px solid var(--rp-line);
    overflow-x: auto;
    scrollbar-width: none;
}

.rp-taskbar[hidden] {
    display: none;
}

.rp-taskbar-item {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 60px;
    max-width: 200px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r-sm);
    background: var(--rp-surface);
    color: var(--rp-text-2);
    font-size: 0.82rem;
    cursor: pointer;
}

.rp-taskbar-item svg {
    flex-shrink: 0;
}

.rp-taskbar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* La home è sempre la prima della barra */
.rp-taskbar-item.rp-taskbar-home {
    flex-shrink: 0;
}

.rp-taskbar-item:hover {
    color: var(--rp-text);
}

.rp-taskbar-item.active {
    background: var(--rp-sidebar-active);
    border-color: var(--rp-line-strong);
    color: var(--rp-text);
}

.rp-taskbar-item.minimized {
    opacity: 0.6;
}

/* --- Assistenza tecnica (richiediAssistenza, gestioneAssistenza) --- */
.rp-ticket-back {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--rp-text-2);
    font-weight: 600;
    text-decoration: none;
}

.rp-ticket-back:hover {
    color: var(--rp-text);
}

.rp-ticket-box-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.rp-ticket-box-head>h3 {
    margin: 0;
    font-size: 1.1rem !important;
    font-weight: 700;
    color: var(--rp-text);
}

.rp-ticket-btn-block {
    display: flex !important;
    width: 100%;
}

/* Riquadri riepilogativi (gestione) */
.rp-ticket-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.rp-ticket-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    color: var(--rp-text);
    text-decoration: none;
    transition: border-color var(--rp-fast) ease;
}

.rp-ticket-stat::before {
    content: "";
    position: absolute;
    left: 22px;
    top: 0;
    width: 28px;
    height: 2px;
    background: transparent;
}

.rp-ticket-stat:hover {
    border-color: var(--rp-line-strong);
    color: var(--rp-text);
}

.rp-ticket-stat-value {
    font-family: var(--rp-mono);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.1;
}

.rp-ticket-stat-label {
    color: var(--rp-text-2);
    font-weight: 600;
}

.rp-ticket-stat-open::before {
    background: var(--rp-warn);
}

.rp-ticket-stat-answered::before {
    background: var(--rp-signal);
}

.rp-ticket-stat-closed::before {
    background: var(--rp-text-3);
}

/* Elenco ticket */
.rp-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rp-ticket-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    border: 1px solid var(--rp-line-soft);
    border-left: 3px solid transparent;
    border-radius: var(--rp-r);
    background: var(--rp-surface-2);
    color: var(--rp-text);
    text-decoration: none;
    transition: background-color var(--rp-fast) ease, border-color var(--rp-fast) ease;
}

.rp-ticket-item:hover {
    background: var(--rp-surface-3);
    color: var(--rp-text);
}

.rp-ticket-item-open {
    border-left-color: var(--rp-warn);
}

.rp-ticket-item-answered {
    border-left-color: var(--rp-signal);
}

.rp-ticket-item-closed {
    opacity: 0.7;
}

.rp-ticket-item-main {
    flex: 1;
    min-width: 0;
}

.rp-ticket-item-title {
    font-size: 1rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rp-ticket-id {
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-weight: 500;
}

.rp-ticket-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 16px;
    margin-top: 3px;
    color: var(--rp-text-2);
    font-size: 0.8rem;
}

.rp-ticket-item-meta i {
    margin-right: 3px;
}

.rp-ticket-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.rp-ticket-badges {
    display: flex;
    gap: 6px;
}

.rp-ticket-item-date {
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    white-space: nowrap;
}

.rp-ticket-none {
    margin: 10px 0 4px;
    color: var(--rp-text-3);
    text-align: center;
}

.rp-ticket-empty {
    padding: 30px 10px;
    text-align: center;
}

.rp-ticket-empty>i {
    display: block;
    margin-bottom: 8px;
    color: var(--rp-text-3);
    font-size: 2.6rem;
}

.rp-ticket-empty>h4 {
    font-weight: 700;
}

.rp-ticket-empty>p {
    color: var(--rp-text-2);
}

/* Etichette di stato e priorità */
.rp-ticket-status,
.rp-ticket-priority {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 650;
    white-space: nowrap;
}

.rp-ticket-priority i {
    font-size: 10px;
}

.rp-ticket-status-open {
    background: var(--rp-warn-soft);
    color: var(--rp-warn);
}

.rp-ticket-status-answered {
    background: var(--rp-signal-soft);
    color: var(--rp-signal);
}

.rp-ticket-status-closed {
    background: var(--rp-surface-3);
    color: var(--rp-text-2);
}

.rp-ticket-priority-0 {
    background: var(--rp-surface-3);
    color: var(--rp-text-2);
}

.rp-ticket-priority-1 {
    background: rgba(120, 160, 255, 0.14);
    color: #9db8ff;
}

.rp-ticket-priority-2 {
    background: var(--rp-danger-soft);
    color: var(--rp-danger);
}

/* Conversazione */
.rp-ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rp-ticket-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 88%;
}

.rp-ticket-msg.own {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.rp-ticket-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--rp-surface-4);
    color: var(--rp-text);
    font-size: 13px;
    font-weight: 800;
}

.rp-ticket-msg.staff .rp-ticket-avatar {
    background: var(--rp-signal);
    color: var(--rp-bg);
}

.rp-ticket-bubble {
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--rp-line-soft);
    border-radius: 4px 12px 12px 12px;
    background: var(--rp-surface-2);
}

.rp-ticket-msg.own .rp-ticket-bubble {
    border-radius: 12px 4px 12px 12px;
    background: var(--rp-surface-3);
}

.rp-ticket-msg.staff .rp-ticket-bubble {
    border-color: rgba(94, 200, 220, 0.2);
    background: var(--rp-signal-soft);
}

.rp-ticket-msg-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-bottom: 4px;
    font-size: 0.88rem;
}

.rp-ticket-role {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--rp-signal);
    color: var(--rp-bg);
    font-size: 0.68rem;
    font-weight: 700;
}

.rp-ticket-date {
    margin-left: auto;
    padding-left: 10px;
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.7rem;
}

.rp-ticket-msg-body {
    overflow-wrap: anywhere;
}

.rp-ticket-msg-body,
.rp-ticket-msg-body * {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

.rp-ticket-msg-body p:last-child {
    margin-bottom: 0;
}

.rp-ticket-msg-body img {
    display: block;
    max-width: 100%;
    max-height: 420px;
    height: auto;
    margin: 6px 0;
    border-radius: var(--rp-r-sm);
    cursor: zoom-in;
}

.rp-ticket-msg-body table td,
.rp-ticket-msg-body table th {
    padding: 4px 6px;
    border: 1px solid var(--rp-line-strong);
}

.rp-ticket-msg-body pre {
    padding: 8px;
    border-radius: var(--rp-r-sm);
    background: var(--rp-field);
    white-space: pre-wrap;
}

/* Dettagli e azioni */
.rp-ticket-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 9px 14px;
    align-items: center;
    margin: 0 0 15px;
}

.rp-ticket-details dt {
    margin: 0;
    color: var(--rp-text-3);
    font-size: 0.85rem;
    font-weight: 600;
}

.rp-ticket-details dd {
    margin: 0;
    margin-inline-start: 0;
}

.rp-ticket-break {
    overflow-wrap: anywhere;
}

.rp-ticket-muted,
.rp-ticket-hint {
    color: var(--rp-text-3);
}

.rp-ticket-priority-form {
    margin-bottom: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--rp-line);
}

.rp-ticket-inline {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.rp-ticket-inline .rp-select {
    margin: 0;
}

.rp-ticket-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.rp-ticket-notice {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rp-ticket-notice>i {
    color: var(--rp-text-3);
    font-size: 1.6rem;
}

.rp-ticket-steps,
.rp-ticket-tips {
    margin: 0;
    padding-left: 20px;
}

.rp-ticket-steps li,
.rp-ticket-tips li {
    margin-bottom: 8px;
}

.rp-ticket-steps li:last-child,
.rp-ticket-tips li:last-child {
    margin-bottom: 0;
}

/* --- Gestione regia (radioManager/gestioneRegia) --- */
.rp-regia-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rp-regia-tabs .bi {
    margin-right: 2px;
}

.rp-regia-badge {
    display: inline-block;
    padding: 3px 9px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 650;
    white-space: nowrap;
}

.rp-regia-badge.is-in {
    background: var(--rp-ok-soft);
    border-color: rgba(63, 185, 80, 0.35);
    color: var(--rp-ok);
}

.rp-regia-badge.is-out {
    background: var(--rp-danger-soft);
    border-color: rgba(248, 81, 73, 0.35);
    color: var(--rp-danger);
}

.rp-regia-custom {
    color: var(--rp-signal);
}

.rp-regia-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
    font-size: 12px;
}

.rp-regia-note>summary {
    cursor: pointer;
    font-size: 0.82rem;
    white-space: nowrap;
}

.rp-regia-note>div {
    min-width: 200px;
    margin-top: 6px;
    padding: 8px;
    border-radius: var(--rp-r-sm);
    background: var(--rp-field);
    font-size: 0.82rem;
}

.rp-regia-group {
    height: 100%;
    padding: 14px 16px;
    border: 1px solid var(--rp-line-soft);
    border-radius: var(--rp-r);
    background: var(--rp-surface-2);
}

.rp-regia-group h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.rp-regia-group ul {
    margin: 0;
    padding-left: 18px;
}

.rp-regia-link {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rp-regia-link>input {
    flex: 1 1 280px;
    min-width: 0;
    font-family: var(--rp-mono) !important;
    font-size: 0.8rem !important;
}

/* --- Pagina pubblica di presa visione (public/rpigroup/presaVisione.php) ---
 * Fuori dal pannello (niente menu): stessa intestazione e stessi box, contenuto centrato. */
.rp-public .rp-content {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 0 8px;
}

.rp-content>.welcome>.rp-eyebrow {
    margin-bottom: 8px;
    color: var(--rp-accent);
}

.rp-doc-frame {
    display: block;
    width: 100%;
    height: 72vh;
    min-height: 460px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
    background: var(--rp-paper);
    /* i documenti (PDF, immagini) sono pensati su fondo chiaro */
}

.rp-doc-empty {
    padding: 36px 20px;
    border: 1px dashed var(--rp-line-strong);
    border-radius: var(--rp-r);
    text-align: center;
}

.rp-doc-empty>.bi {
    display: block;
    margin-bottom: 10px;
    font-size: 2.4rem;
    color: var(--rp-text-3);
}

.rp-doc-empty>p {
    margin: 0 auto 16px;
    max-width: 46ch;
    color: var(--rp-text-2);
}

/* Conferma della presa visione: frase a sinistra, pulsante a destra */
.rp-ack {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px 20px;
}

/* Finché non si conferma, la barra resta ancorata in fondo alla finestra: il pulsante è sempre a portata */
.rp-ack:not(.is-done) {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    border-color: var(--rp-line-brand);
    box-shadow: var(--rp-shadow-pop);
}

.rp-box.rp-ack>p {
    margin: 0;
    color: var(--rp-text);
    font-weight: 600;
}

.rp-ack.is-done {
    justify-content: flex-start;
    border-color: rgba(63, 185, 80, 0.35);
    background: linear-gradient(135deg, var(--rp-ok-soft), transparent 60%), var(--rp-surface);
}

.rp-ack.is-done>.bi {
    font-size: 1.5rem;
    color: var(--rp-ok);
}

.rp-box.rp-ack.is-done>p {
    font-weight: 500;
}

.rp-public-foot {
    margin: 0;
    padding: 18px 16px 24px;
    color: var(--rp-text-3);
    font-size: 0.78rem;
    text-align: center;
}

/* Rifiuto registrato (pagina di firma): stessa barra dell'esito, in rosso */
.rp-ack.is-done.is-rejected {
    border-color: rgba(248, 81, 73, 0.35);
    background: linear-gradient(135deg, var(--rp-danger-soft), transparent 60%), var(--rp-surface);
}

.rp-ack.is-rejected>.bi {
    color: var(--rp-danger);
}

/* --- Firme dei documenti (radioManager/gestioneFirme, public/rpigroup/firma.php, _js/firmaPdf.js) ---
 * Pagine del PDF disegnate da pdf.js su "carta" (--rp-paper), con sopra il livello dei riquadri della firma.
 * Posizione e misure dei riquadri sono percentuali calcolate dal JS (stile inline ammesso, vedi STYLEGUIDE §10). */
.rp-pdf-pages {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rp-pdf.is-editable .rp-pdf-pages {
    max-height: 78vh;
    overflow-y: auto;
    padding-right: 4px;
}

.rp-pdf-page {
    position: relative;
    width: 100%;
    background: var(--rp-paper);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r-xs);
}

.rp-pdf-page>canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.rp-pdf-layer {
    position: absolute;
    inset: 0;
}

/* Editor dei riquadri: si disegna trascinando; in verticale il dito scorre ancora la pagina */
.rp-pdf.is-editable .rp-pdf-layer {
    cursor: crosshair;
    touch-action: pan-y pinch-zoom;
}

.rp-pdf-num {
    margin: 0 0 12px;
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

/* Riquadro della firma: colore del firmatario (rp-sign-c0…c3) per bordo, fondo tenue ed etichetta */
.rp-sign-field {
    position: absolute;
    border: 2px dashed currentColor;
    border-radius: var(--rp-r-xs);
    background: var(--rp-sign-soft);
}

.rp-pdf.is-editable .rp-sign-field {
    cursor: move;
    touch-action: none;
}

.rp-sign-field-name {
    position: absolute;
    top: 0;
    left: 0;
    max-width: calc(100% - 26px);
    padding: 0 6px;
    border-radius: 0 0 var(--rp-r-xs) 0;
    background: var(--rp-sidebar);
    color: currentColor;
    font-family: var(--rp-mono);
    font-size: 0.66rem;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.rp-sign-field-del {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid var(--rp-line-strong);
    border-radius: 50%;
    background: var(--rp-surface-3);
    color: var(--rp-text);
    font-size: 0.7rem;
    cursor: pointer;
}

.rp-sign-field-del:hover {
    background: var(--rp-danger);
    border-color: var(--rp-danger);
}

.rp-sign-field-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border-radius: 2px 0 0 0;
    background: currentColor;
    cursor: nwse-resize;
}

/* Editor: etichetta sopra il timbro e X sull'angolo, fuori dall'anteprima per non coprirla */
.rp-pdf.is-editable .rp-sign-field-name {
    top: auto;
    bottom: 100%;
    max-width: 100%;
    border-radius: var(--rp-r-xs) var(--rp-r-xs) 0 0;
}

.rp-pdf.is-editable .rp-sign-field-del {
    top: -10px;
    right: -10px;
    z-index: 1;
}

/* Anteprima del timbro nell'editor, con le stesse proporzioni del PDF firmato (Firma::drawSignature):
 * firma a sinistra (Firma::STAMP_SIGNATURE_WIDTH) sul logo in filigrana, a destra 4 righe che crescono con il timbro.
 * --rp-pt (pixel per punto del PDF) arriva dalla pagina (_js/firmaPdf.js). */
.rp-sign-stamp {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

.rp-sign-stamp-sig {
    position: relative;
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    container-type: size;
}

.rp-sign-stamp-logo {
    position: absolute;
    inset: 0;
    width: min(90cqw, 90cqh);
    height: min(90cqw, 90cqh);
    margin: auto;
    opacity: 0.1;
}

.rp-sign-stamp-sample {
    position: relative;
    max-width: 100%;
    color: var(--rp-ink);
    font-family: "Dancing Script", cursive;
    font-size: min(36cqh, 17cqw);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-sign-stamp-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: calc(3 * var(--rp-pt, 1px));
    container-type: size;
    color: var(--rp-paper-text);
    font-family: "DejaVu Sans", Verdana, sans-serif;
    font-size: calc(min(25cqh, 11cqw) * 0.78);
    line-height: min(25cqh, 11cqw);
}

.rp-sign-stamp-text>span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Riquadri del firmatario nella pagina di firma: solo da vedere */
.rp-sign-field.is-mine {
    color: var(--rp-warn);
    --rp-sign-soft: var(--rp-warn-soft);
    pointer-events: none;
}

.rp-sign-c0 { color: var(--rp-signal); --rp-sign-soft: var(--rp-signal-soft); }
.rp-sign-c1 { color: var(--rp-violet); --rp-sign-soft: var(--rp-violet-soft); }
.rp-sign-c2 { color: var(--rp-ok); --rp-sign-soft: var(--rp-ok-soft); }
.rp-sign-c3 { color: var(--rp-warn); --rp-sign-soft: var(--rp-warn-soft); }

/* Scelta del firmatario a cui vanno i nuovi riquadri */
.rp-sign-who {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
}

.rp-sign-who-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 3px 10px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r-sm);
    background: var(--rp-surface-2);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--rp-fast) ease, border-color var(--rp-fast) ease;
}

.rp-sign-who-item:hover {
    border-color: currentColor;
}

.rp-sign-who-item.is-active {
    border-color: currentColor;
    background: var(--rp-sign-soft);
    box-shadow: inset 0 0 0 1px currentColor;
}

.rp-sign-who-item>span {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--rp-field);
    color: var(--rp-text-2);
    font-family: var(--rp-mono);
    font-size: 0.7rem;
    text-align: center;
}

/* Spazio della firma: un foglio bianco su cui si firma con l'inchiostro blu */
.rp-sign-pad {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 1;
    background: var(--rp-paper);
    border: 1px solid var(--rp-line-strong);
    border-radius: var(--rp-r);
}

.rp-sign-pad.is-drawing {
    cursor: crosshair;
    touch-action: none;
}

.rp-sign-pad-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.rp-sign-pad-bar>.rp-field-note {
    margin: 0;
}

.rp-sign-confirm {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--rp-line-soft);
}

/* Impronta del documento: lunga, in monospazio, selezionabile per copiarla */
.rp-sign-hash {
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    word-break: break-all;
    user-select: text;
}

/* Firmatari di una richiesta nel registro: nome, esito ed eventuale motivo del rifiuto */
.rp-sign-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rp-sign-list>li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.rp-sign-list-name {
    font-weight: 600;
}

.rp-sign-list-note {
    flex-basis: 100%;
    color: var(--rp-text-3);
    font-size: 0.8rem;
}

/* --- Knowledge base (utility/knowledge, gestisciKnowledge, articoliKnowledge) --- */
/* Elenco delle categorie nella colonna laterale */
/* Categorie: stesso aspetto delle voci del menu laterale (.rp-menuLink) */
.rp-kb-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.rp-kb-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 10px;
    border-radius: var(--rp-r-sm);
    color: var(--rp-text-2);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    transition: background-color var(--rp-fast) ease, color var(--rp-fast) ease;
}

.rp-kb-nav a:hover {
    background: var(--rp-sidebar-hover);
    color: var(--rp-text);
}

.rp-kb-nav a.active {
    background: var(--rp-sidebar-active);
    color: var(--rp-text);
    font-weight: 650;
}

.rp-kb-nav a span {
    flex: none;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--rp-field);
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.7rem;
    text-align: center;
}

/* Articolo in un elenco (link su .boxrequest.clickable) */
.rp-kb-item,
.rp-kb-item:hover {
    display: block;
    color: var(--rp-text-2);
    text-decoration: none;
}

.rp-kb-item-title {
    display: block;
    color: var(--rp-text);
    font-weight: 700;
}

.rp-kb-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    margin-top: 2px;
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.72rem;
}

.rp-kb-item-excerpt {
    display: block;
    margin-top: 6px;
    font-size: 0.9rem;
}

.rp-kb-description {
    margin: -6px 0 14px;
    color: var(--rp-text-2);
}

/* Data e autore dell'ultima modifica */
.rp-kb-meta,
.rp-kb-date {
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.75rem;
}

.rp-kb-meta {
    margin: -6px 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rp-line-soft);
}

.rp-kb-date {
    white-space: nowrap;
}

/* Testo dell'articolo (HTML dell'editor) */
.rp-kb-content {
    color: var(--rp-text-2);
    overflow-wrap: anywhere;
}

.rp-kb-content :is(h1, h2, h3, h4, h5, h6) {
    margin: 1.2em 0 0.5em;
    color: var(--rp-text);
    font-weight: 700;
}

.rp-kb-content h1 { font-size: 1.3rem; }
.rp-kb-content h2 { font-size: 1.18rem; }
.rp-kb-content h3 { font-size: 1.06rem; }
.rp-kb-content :is(h4, h5, h6) { font-size: 0.98rem; }

.rp-kb-content> :first-child {
    margin-top: 0;
}

.rp-kb-content> :last-child {
    margin-bottom: 0;
}

.rp-kb-content a {
    color: var(--rp-signal);
}

.rp-kb-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border: 1px solid var(--rp-line-soft);
    border-radius: var(--rp-r-sm);
    cursor: zoom-in;
}

.rp-kb-content blockquote {
    margin: 12px 0;
    padding: 4px 0 4px 14px;
    border-left: 2px solid var(--rp-line-strong);
    color: var(--rp-text-3);
}

.rp-kb-content :is(pre, code) {
    border-radius: var(--rp-r-xs);
    background: var(--rp-field);
    font-family: var(--rp-mono);
    font-size: 0.85em;
}

.rp-kb-content code {
    padding: 1px 5px;
}

.rp-kb-content pre {
    padding: 10px 12px;
    white-space: pre-wrap;
}

.rp-kb-content pre code {
    padding: 0;
    background: none;
}

.rp-kb-content table {
    max-width: 100%;
    margin: 12px 0;
    border-collapse: collapse;
}

.rp-kb-content :is(td, th) {
    padding: 6px 10px;
    border: 1px solid var(--rp-line);
}

.rp-kb-content th {
    background: var(--rp-surface-2);
    color: var(--rp-text);
}

.rp-kb-content hr {
    border-color: var(--rp-line);
}

/* Visore delle immagini (_js/knowledge.js): adattata allo schermo, poi ingrandita con rotellina, clic o barra.
   La larghezza dell'immagine ingrandita è calcolata dallo script (style.width, §10).
   App desktop e PWA con la barra del titolo integrata: in alto ci sono i pulsanti della finestra (a destra su Windows,
   a sinistra su macOS), quindi i comandi stanno in basso, l'immagine parte sotto la barra del titolo e il visore
   non trascina la finestra (no-drag, altrimenti i clic sopra .rp-navbar sposterebbero la finestra). */
.rp-zoom {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    overflow: auto;
    padding: max(16px, calc(env(titlebar-area-height, 0px) + 12px)) 16px 72px;
    -webkit-app-region: no-drag;
    app-region: no-drag;
    background: rgba(6, 16, 22, 0.88);
    cursor: zoom-out;
    overscroll-behavior: contain;
    animation: rp-fade 160ms ease;
}

.rp-zoom[hidden] {
    display: none;
}

.rp-zoom-img {
    flex: none;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    object-fit: contain;
    border-radius: var(--rp-r-sm);
    box-shadow: var(--rp-shadow-pop);
    cursor: zoom-in;
    user-select: none;
    animation: rp-pop var(--rp-mid) var(--rp-ease);
}

.rp-zoom.is-zoomed .rp-zoom-img {
    max-width: none;
    max-height: none;
    cursor: grab;
}

.rp-zoom.is-max .rp-zoom-img {
    cursor: zoom-out;
}

.rp-zoom.is-dragging .rp-zoom-img {
    cursor: grabbing;
}

/* Barra dei comandi, fissa in basso al centro */
.rp-zoom-bar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--rp-line-strong);
    border-radius: var(--rp-r);
    background: var(--rp-surface);
    box-shadow: var(--rp-shadow-pop);
    cursor: default;
}

.rp-zoom-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--rp-r-sm);
    background: transparent;
    color: var(--rp-text-2);
    cursor: pointer;
    transition: background-color var(--rp-fast) ease, color var(--rp-fast) ease;
}

.rp-zoom-btn:hover,
.rp-zoom-btn:focus-visible {
    background: var(--rp-surface-3);
    color: var(--rp-text);
}

.rp-zoom-btn[data-zoom="close"] {
    margin-left: 4px;
}

.rp-zoom-level {
    min-width: 48px;
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

/* Azioni di una riga o di una categoria (pulsanti compatti affiancati) */
.rp-kb-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.rp-kb-actions>form {
    margin: 0;
}

.rp-table th.rp-kb-col-actions {
    text-align: right;
}

/* Pulsanti in fondo a un modulo: allineati a destra, l'azione principale per ultima */
.rp-kb-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* --- Visualizza log --- */
.rp-log-console {
    max-height: 400px;
    overflow-y: auto;
    padding: 14px 16px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
    background: #0a1820;
    color: #b8c4cb;
    font-family: var(--rp-mono);
    font-size: 0.78rem;
    line-height: 1.6;
}

/* ==========================================================================
   6. CLASSI STORICHE (rp-auto-style-*)
   Estratte in passato dagli stili inline: restano per le pagine esistenti,
   ma ora usano i token. Nelle pagine nuove usare i componenti della sezione 4.
   ========================================================================== */

.rp-auto-style-2 {
    display: none;
}

.rp-auto-style-21 {
    margin-bottom: 25px;
}

.rp-auto-style-22 {
    margin: 5px 0 15px;
}

.rp-auto-style-23 {
    margin: 15px 0 10px;
}

.rp-auto-style-24 {
    margin: 10px 0 5px;
}

/* Logo della navbar */
.rp-auto-style-25 {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 8px;
}

/* Voce "Torna al tuo profilo" del menu profilo */
.rp-auto-style-26 {
    background: var(--rp-warn-soft);
    color: var(--rp-warn) !important;
    font-weight: 600;
}

/* Box a tutta altezza della colonna (home) */
.rp-auto-style-60 {
    height: calc(100% - 16px);
    overflow: hidden;
}

.rp-auto-style-61 {
    width: 150px;
}

.rp-auto-style-64 {
    margin-bottom: 2px;
}

.rp-auto-style-66 {
    color: var(--rp-ok);
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    font-weight: 600;
}

.rp-auto-style-67 {
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    font-weight: 600;
}

.rp-auto-style-69 {
    text-align: justify;
}

/* Novità e aggiornamenti (home/changelog): una scheda apribile per versione, letta dal CHANGELOG.md */
.rp-changelog-installed {
    margin: 0 0 16px;
}

.rp-changelog-version>summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    list-style: none;
    cursor: pointer;
}

.rp-changelog-version>summary::-webkit-details-marker {
    display: none;
}

/* Freccia che ruota quando la versione è aperta */
.rp-changelog-version>summary::before {
    content: "\F285";
    font-family: "bootstrap-icons";
    color: var(--rp-text-3);
    transition: transform var(--rp-fast) ease;
}

.rp-changelog-version[open]>summary::before {
    transform: rotate(90deg);
}

.rp-changelog-version>summary>h3 {
    margin: 0;
}

.rp-changelog-version[open]>summary {
    margin-bottom: 6px;
}

.rp-changelog-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 8px;
    color: var(--rp-text-2);
    font-family: var(--rp-mono);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.rp-changelog-list {
    margin: 0;
    padding-left: 20px;
}

.rp-changelog-list>li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.rp-changelog-list>li:last-child {
    margin-bottom: 0;
}

/* Testo delle pagine di blocco (_blocked.php: account sospeso, termini rifiutati): paragrafi ravvicinati */
.rp-blocked-text>p {
    margin: 0;
}

.rp-blocked-text>p:not(:last-child) {
    margin-bottom: 5px;
}

/* Descrizione di un programma nella tabella dei Radio Show: niente spazio attorno ai paragrafi dell'editor */
.rp-show-descr>p {
    margin: 0;
}

/* Console dei log */
.rp-auto-style-70 {
    max-height: 400px;
    overflow-y: auto;
    padding: 14px 16px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
    background: #0a1820;
    color: #b8c4cb;
    font-family: var(--rp-mono);
    font-size: 0.78rem;
    line-height: 1.6;
}

.rp-auto-style-71 {
    padding: 3px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.rp-auto-style-74,
.rp-auto-style-114,
.rp-auto-style-120,
.rp-auto-style-121,
.rp-auto-style-122,
.rp-auto-style-123,
.rp-auto-style-124,
.rp-auto-style-127,
.rp-auto-style-128,
.rp-auto-style-129,
.rp-auto-style-140,
.rp-auto-style-141,
.rp-auto-style-143 {
    padding: 8px 0;
    font-weight: 650;
}

.rp-auto-style-75 {
    width: 120px;
    padding: 8px 0;
    font-weight: 650;
    text-align: center;
}

.rp-auto-style-76,
.rp-auto-style-84 {
    border-bottom: 1px solid var(--rp-line-soft);
}

.rp-auto-style-77 {
    padding: 8px 0;
}

.rp-auto-style-78 {
    padding: 8px 0;
    color: var(--rp-text-2);
}

.rp-auto-style-79 {
    padding: 8px 0;
    color: var(--rp-text-3);
}

.rp-auto-style-80 {
    padding: 8px 0;
    text-align: center;
}

.rp-auto-style-83 {
    padding: 8px 6px;
    color: var(--rp-text-3);
    font-family: var(--rp-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.rp-auto-style-85 {
    padding: 6px;
    vertical-align: middle;
}

.rp-auto-style-86 {
    display: inline-block;
    text-decoration: none;
}

/* Box dell'elenco richieste */
.rp-auto-style-89 {
    padding: 14px;
}

/* Larghezza di un popup */
.rp-auto-style-94 {
    max-width: 500px;
}

.rp-auto-style-95 {
    font-weight: 700;
}

/* Box dell'accordion del palinsesto */
.rp-auto-style-97 {
    padding: 14px;
}

.rp-auto-style-98 {
    overflow: auto;
}

.rp-auto-style-99 {
    padding: 16px;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
    background: var(--rp-field);
}

.rp-auto-style-100 {
    color: var(--rp-text);
    font-weight: 600;
}

.rp-auto-style-101 {
    margin: 10px 0;
    border-color: var(--rp-line);
}

.rp-auto-style-102 {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rp-line);
}

.rp-auto-style-103 {
    min-height: 30px !important;
    padding: 0 12px !important;
    font-size: 0.82rem !important;
    text-decoration: none;
}

.rp-auto-style-111 {
    width: 100%;
    text-decoration: none;
}

.rp-auto-style-112 {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rp-line);
}

/* Contatore "N Utenti" accanto al titolo del ruolo */
.rp-auto-style-113 {
    font-family: var(--rp-mono);
    font-size: 0.72rem !important;
    font-weight: 500 !important;
}

.rp-auto-style-115 {
    width: 80px;
    padding: 8px 6px;
    font-weight: 650;
    text-align: right;
}

.rp-auto-style-116 {
    padding: 8px 6px;
    vertical-align: middle;
    line-height: 1.5;
}

.rp-auto-style-117 {
    padding: 8px 6px;
    text-align: right;
    vertical-align: middle;
}

.rp-auto-style-119 {
    color: var(--rp-signal);
}

.rp-auto-style-125 {
    color: var(--rp-ok);
    font-weight: 600;
}

.rp-auto-style-126 {
    color: var(--rp-danger);
    font-weight: 600;
}

.rp-auto-style-130 {
    color: var(--rp-text);
}

.rp-auto-style-131 {
    font-size: 0.8rem;
}

.rp-auto-style-133,
.rp-auto-style-142 {
    width: 200px;
}

.rp-auto-style-136 {
    width: 220px;
}

.rp-auto-style-137 {
    width: 260px;
}

.rp-auto-style-139 {
    width: 270px;
}

.rp-auto-style-141 {
    width: 450px;
}

.rp-auto-style-120 {
    width: 250px;
}

.rp-auto-style-121 {
    width: 300px;
}

.rp-auto-style-123 {
    width: 100px;
}

.rp-auto-style-124 {
    width: 104px;
}

.rp-auto-style-127 {
    width: 140px;
}

.rp-auto-style-128 {
    width: 180px;
}

.rp-auto-style-129 {
    width: 90px;
}

.rp-auto-style-143 {
    width: 60px;
}

/* Etichette colorate storiche: stesso aspetto delle .rp-chip */
.rp-auto-style-144,
.rp-auto-style-145,
.rp-auto-style-147,
.rp-auto-style-148,
.rp-auto-style-149,
.rp-auto-style-150,
.rp-auto-style-151,
.rp-auto-style-152,
.rp-auto-style-153 {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 650;
    line-height: 1.4;
    white-space: nowrap;
}

.rp-auto-style-145 {
    margin: 0 3px 2px 0;
}

.rp-auto-style-147 {
    margin-left: 6px;
    font-size: 0.68rem;
}

.rp-auto-style-144,
.rp-auto-style-149 {
    background: var(--rp-ok-soft);
    border-color: rgba(63, 185, 80, 0.32);
    color: var(--rp-ok);
}

.rp-auto-style-145,
.rp-auto-style-147 {
    background: var(--rp-signal-soft);
    border-color: rgba(94, 200, 220, 0.32);
    color: var(--rp-signal);
}

.rp-auto-style-148 {
    background: var(--rp-surface-3);
    border-color: var(--rp-line-strong);
    color: var(--rp-text-2);
}

.rp-auto-style-150 {
    background: rgba(255, 152, 0, 0.13);
    border-color: rgba(255, 152, 0, 0.32);
    color: #ffa53d;
}

.rp-auto-style-151 {
    background: var(--rp-danger-soft);
    border-color: rgba(248, 81, 73, 0.32);
    color: var(--rp-danger);
}

.rp-auto-style-152 {
    background: var(--rp-warn-soft);
    border-color: rgba(240, 176, 60, 0.32);
    color: var(--rp-warn);
}

.rp-auto-style-153 {
    background: var(--rp-violet-soft);
    border-color: rgba(180, 148, 232, 0.32);
    color: var(--rp-violet);
}

.rp-auto-style-146 {
    color: var(--rp-text-3);
    font-size: 0.8rem;
}

/* Intestazione di un box con titolo e contatore */
.rp-auto-style-154 {
    padding: 0 0 12px;
    border-bottom: 1px solid var(--rp-line);
}

.rp-auto-style-155 {
    font-size: 1.1rem !important;
    font-weight: 700;
}

.rp-auto-style-156 {
    color: var(--rp-text);
    text-decoration: none;
}

.rp-auto-style-157 {
    width: 100%;
    margin-bottom: 7px;
    border-radius: var(--rp-r);
}

/* ==========================================================================
   7. PAGINE DI ACCESSO (login, recupero password: <body class="startpage">)
   Stessi token e componenti del pannello: la scheda d'accesso è un box del pannello,
   con il bordo crema del guscio e la scala di sintonia in cima.
   ========================================================================== */

.startpage {
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 32px 16px !important;
}

.boxLogin {
    position: relative;
    width: min(420px, 100%);
    padding: 40px 30px 28px;
    background: var(--rp-surface);
    border: 1px solid var(--rp-line-brand);
    border-radius: 16px;
    box-shadow: var(--rp-shadow-pop);
    color: var(--rp-text);
    text-align: left;
}

/* Scala di sintonia con la lancetta "on air": la stessa firma dei titoli del pannello */
.boxLogin::before {
    content: "";
    position: absolute;
    top: 0;
    left: 30px;
    right: 30px;
    height: 10px;
    background:
        linear-gradient(var(--rp-accent), var(--rp-accent)) 64px 0 / 2px 10px no-repeat,
        repeating-linear-gradient(90deg, var(--rp-text-3) 0 1px, transparent 1px 48px) 0 0 / 100% 7px no-repeat,
        repeating-linear-gradient(90deg, var(--rp-line-strong) 0 1px, transparent 1px 8px) 0 0 / 100% 4px no-repeat;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 50%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 50%, transparent 100%);
}

/* Entrata: la scheda sale in dissolvenza e la lancetta si sintonizza (keyframes nella sezione 4 bis) */
.boxLogin {
    animation: rp-rise 480ms var(--rp-ease) backwards;
}

.boxLogin::before {
    animation: rp-tune-top 1000ms cubic-bezier(0.22, 1, 0.36, 1) 200ms backwards;
}

.footerLogin {
    animation: rp-fade 600ms ease 250ms backwards;
}

/* Logo e nome del pannello in cima alla scheda */
.rp-login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.rp-login-brand>img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.rp-login-brand>span {
    font-family: var(--rp-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rp-text-3);
}

.boxLogin>h1,
.boxLogin>h2 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.boxLogin>p {
    margin: 0 0 20px;
    color: var(--rp-text-2);
    font-size: 0.95rem;
}

.boxLogin>form {
    margin: 0;
}

/* Campi: niente etichette (solo segnaposto), quindi un po' più alti e distanziati */
.boxLogin .rp-form {
    min-height: 44px !important;
    margin-bottom: 10px !important;
}

/* Codice MFA: cifre centrate e spaziate (stile della pagina, più specifico dei campi del pannello) */
.boxLogin input.rp-form.mfa-code-input {
    text-align: center;
    font-family: var(--rp-mono);
}

/* Azione principale a tutta larghezza */
:where(.startpage) .rp-button.loginpage {
    display: flex;
    width: 100%;
    min-height: 44px;
    margin-top: 6px;
    background: var(--rp-accent);
    border-color: var(--rp-accent);
    color: var(--rp-white);
    font-size: 0.95rem;
}

:where(.startpage) .rp-button.loginpage:hover {
    background: var(--rp-accent-hover);
    border-color: var(--rp-accent-hover);
}

/* Link secondari ("Password dimenticata?", "Torna al login") */
.boxLogin>a.resetpassword {
    display: block;
    margin-top: 16px;
    color: var(--rp-text-2);
    font-size: 0.85rem;
    text-align: center;
    text-decoration: none;
}

.boxLogin>a.resetpassword:hover {
    color: var(--rp-text);
    text-decoration: underline;
}

.boxLogin>p#resetMessage {
    margin: 6px 0 0;
    font-size: 0.85rem;
}

.footerLogin {
    max-width: 420px;
    color: var(--rp-text-3);
    font-size: 0.74rem;
    text-align: center;
}

/* Il copyright inizia con un a capo quando manca il nome della radio */
.footerLogin br {
    display: none;
}

.footerLogin a {
    color: var(--rp-text-2);
}

/* Login: passaggi credenziali e codice MFA (uno visibile alla volta), captcha centrato */
.cf-turnstile-container {
    margin-bottom: 15px;
    text-align: center;
}

.cf-turnstile {
    display: inline-block;
}

@keyframes rp-step-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-credentials,
.step-mfa {
    display: none;
}

.step-credentials.visible,
.step-mfa.visible {
    display: block;
    animation: rp-step-in 0.35s var(--rp-ease) forwards;
}

.mfa-code-input {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 6px;
    text-align: center;
    text-transform: uppercase;
}

/* Scadenza del codice MFA e del link di recupero password: rossa quando sta per scadere */
.mfa-timer,
.reset-timer {
    margin-top: 6px;
    color: var(--rp-text-3);
    font-size: 12px;
    text-align: center;
}

.reset-timer {
    margin: 4px 0 16px;
}

.mfa-timer.expiring,
.reset-timer.expiring {
    color: var(--rp-danger);
    font-weight: 700;
}

/* Link ai Termini e Condizioni sotto la scheda di accesso */
.rp-login-links {
    margin: 0;
    font-size: 0.8rem;
    text-align: center;
}

.rp-login-links a {
    color: var(--rp-text-2);
    text-decoration: none;
}

.rp-login-links a:hover {
    color: var(--rp-text);
    text-decoration: underline;
}

/* Pagina pubblica di Termini e Condizioni (termini-condizioni.php): testo lungo, più largo della scheda di accesso */
.rp-legal {
    width: min(880px, 100%);
    animation: rp-rise 480ms var(--rp-ease) backwards;
}

.rp-legal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.rp-legal-head .rp-login-brand {
    margin-bottom: 0;
}

.rp-legal>h1 {
    margin: 0 0 18px;
    font-size: 1.6rem;
}

.rp-legal .rp-box+.rp-box {
    margin-top: 18px;
}

/* Login: scelta dell'account di un account di gruppo */
.rp-group-members {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    /* con molti membri scorre solo l'elenco */
    overflow-y: auto;
}

.rp-group-member {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 11px 14px;
    background: var(--rp-surface-2);
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-r);
    color: var(--rp-text);
    text-align: left;
    cursor: pointer;
    transition: background-color var(--rp-fast) ease, border-color var(--rp-fast) ease;
}

.rp-group-member:hover,
.rp-group-member:focus-visible {
    background: var(--rp-surface-3);
    border-color: var(--rp-line-strong);
    box-shadow: inset 2px 0 0 var(--rp-accent);
}

.rp-group-member-name {
    font-weight: 700;
}

.rp-group-member-role {
    font-size: 0.8rem;
    color: var(--rp-text-3);
}

.rp-group-exit {
    padding: 0;
    border: 0;
    background: none;
    color: var(--rp-text-2);
    font-size: 0.82rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.rp-group-exit:hover {
    color: var(--rp-text);
}

/* Classi storiche usate solo dalle pagine di accesso */
.rp-auto-style-27 {
    display: none;
    margin-top: 6px;
    font-size: 0.82rem;
}

.rp-auto-style-28 {
    margin: 0 0 16px;
    color: var(--rp-text-2);
    font-size: 0.9rem;
}

.rp-auto-style-29 {
    width: 100%;
}

.rp-auto-style-30,
.rp-auto-style-35 {
    margin-bottom: 12px;
    font-size: 0.85rem;
    text-align: center;
}

.rp-auto-style-35 {
    display: none;
}

.rp-auto-style-31,
.rp-auto-style-36 {
    margin-top: 14px;
    text-align: center;
}

.rp-auto-style-32,
.rp-auto-style-37,
.rp-auto-style-42 {
    color: var(--rp-text-2);
    font-size: 0.85rem;
    text-decoration: none;
}

.rp-auto-style-32:hover,
.rp-auto-style-37:hover,
.rp-auto-style-42:hover {
    color: var(--rp-text);
    text-decoration: underline;
}

.rp-auto-style-37 {
    display: block;
    margin-top: 14px;
    text-align: center;
}

.rp-auto-style-33,
.rp-auto-style-39 {
    margin: 4px 0 20px;
    color: var(--rp-text-2);
    font-size: 0.9rem;
}

.rp-auto-style-34 {
    width: 100%;
}

.rp-auto-style-38 {
    margin-top: 16px;
}

.rp-auto-style-40 {
    margin-top: 20px;
}

.rp-auto-style-41 {
    margin-bottom: 14px;
    text-decoration: none;
}

.rp-auto-style-42 {
    display: block;
    text-align: center;
}

.rp-auto-style-43 {
    margin: 4px 0 2px;
    color: var(--rp-text-2);
    font-size: 0.9rem;
}

.rp-auto-style-44 {
    margin-bottom: 12px;
    font-family: var(--rp-mono);
    font-size: 0.95rem;
    font-weight: 600;
}

@media (max-width: 480px) {
    .boxLogin {
        padding: 36px 20px 22px;
    }

    .boxLogin::before {
        left: 20px;
        right: 20px;
    }
}

/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
    :root {
        --rp-gutter: 24px;
    }
}

@media (max-width: 876px) {
    :root {
        --rp-gutter: 16px;
    }

    .hide-876 {
        display: none;
    }

    /* Menu laterale a scomparsa, sopra alla barra in alto */
    .rp-menuPanel {
        z-index: 21;
        width: min(300px, 86vw);
        transform: translateX(-100%);
        box-shadow: none;
    }

    .rp-menuPanel.activeMenu {
        transform: translateX(0);
        box-shadow: var(--rp-shadow-pop);
    }

    .rp-sidebar-foot {
        display: none;
    }

    body:has(> #menuPanel) .rp-navbar {
        left: 0;
    }

    .rp-navbar>.rp-nav {
        padding: 0 12px;
    }

    .rp-navbar>.rp-nav>.rp-navHeader>.menu {
        display: flex;
    }

    /* Su smartphone la barra mostra il nome della radio al posto del percorso */
    body:has(> #menuPanel) .rp-navbar .title {
        display: flex !important;
    }

    .rp-crumbs {
        display: none;
    }

    .rp-cmdk-btn {
        justify-content: center;
        width: 38px;
        min-width: 0;
        height: 38px;
        margin-right: 6px;
        padding: 0;
    }

    .rp-cmdk-btn :is(.rp-cmdk-label, .rp-kbd) {
        display: none;
    }

    .rp-cmdk {
        padding-top: 10px;
    }

    .rp-cmdk-foot {
        display: none;
    }

    .rp-content {
        padding-left: 0;
        padding-bottom: 8px;
    }

    /* La barra di stato torna un footer a fine pagina */
    .rp-footer,
    body:has(> #menuPanel) .rp-footer {
        position: static;
        height: auto;
        margin-top: 16px;
        background: transparent;
    }

    .rp-footerContent {
        flex-wrap: wrap;
        gap: 6px 12px;
        padding: 14px var(--rp-gutter) 18px;
    }

    .rp-footerBox {
        flex-basis: 100%;
        order: 2;
        white-space: normal;
    }

    .rp-footerBox br {
        display: inline;
    }

    .rp-status-clock {
        display: none;
    }

    .rp-content>.welcome {
        padding-top: 24px;
        padding-bottom: 20px;
    }

    .rp-content>.welcome>p {
        font-size: 0.95rem;
    }

    .rp-pageContent,
    .rp-box {
        padding: 16px;
    }

    .rp-radio-name-full {
        display: none !important;
    }

    .rp-radio-name-short {
        display: inline-block !important;
    }

    .rp-nav-loader,
    .rp-desktop,
    .rp-taskbar {
        left: 0;
    }

    .rp-request {
        grid-template-columns: 1fr auto;
        gap: 10px 14px;
    }

    .rp-request>.rp-request-text {
        grid-column: 1 / -1;
        order: 3;
    }

    .rp-request>.rp-request-date-col {
        order: 4;
        grid-column: 1 / -1;
    }

    /* Centro messaggi: elenco chat o conversazione, una alla volta */
    .rp-mc {
        height: calc(100vh - 200px);
    }

    .rp-mc-sidebar {
        flex: 1 1 auto;
        border-right: none;
    }

    .rp-mc-thread {
        display: none;
    }

    .rp-mc.show-thread .rp-mc-sidebar {
        display: none;
    }

    .rp-mc.show-thread .rp-mc-thread {
        display: flex;
    }

    .rp-mc-back {
        display: inline-block;
    }

    .rp-mc-bubble {
        max-width: 88%;
    }

    /* Assistenza */
    .rp-ticket-stats {
        gap: 8px;
    }

    .rp-ticket-stat-value {
        font-size: 1.5rem;
    }

    .rp-ticket-stat-label {
        font-size: 0.8rem;
    }

    .rp-ticket-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .rp-ticket-item-title {
        white-space: normal;
    }

    .rp-ticket-item-side {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .rp-ticket-msg {
        max-width: 100%;
    }

    .rp-ticket-avatar {
        display: none;
    }
}

@media (max-width: 768px) {

    /* Pulsanti a tutta larghezza su smartphone: più facili da toccare (non quelli compatti) */
    :where(.panelpage, .startpage) .rp-button:not(.rp-btn-sm, .rp-auto-style-103) {
        width: 100%;
    }

    .float-left,
    .float-right {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .float-box>form,
    .rp-ack>form {
        width: 100%;
    }

    .rp-tabs,
    .rp-ticket-tabs {
        width: 100%;
    }

    /* Le tabelle-layout di una richiesta (pagine storiche) vanno a capo */
    .boxrequest>table,
    .boxrequest>table>tbody,
    .boxrequest>table>tbody>tr {
        display: block;
    }

    .boxrequest>table>tbody>tr>td {
        display: block;
        width: auto !important;
        padding: 0 0 10px;
        text-align: left !important;
    }

    .boxrequest>table>tbody>tr>td:last-child {
        padding-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    :is(.panelpage, .startpage) *,
    :is(.panelpage, .startpage) *::before,
    :is(.panelpage, .startpage) *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .rp-nav-spinner,
    .rp-win-spinner {
        animation-duration: 2.4s !important;
        animation-iteration-count: infinite !important;
    }
}