/* AD-RP: barra dei collegamenti rapidi sotto il benvenuto (utenti collegati). Template sid 1 header_welcomeblock_member*. */

#panel .lower .wrapper.adrp-barra {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
}
#panel .lower .adrp-barra ul.menu {
    display: flex; flex-wrap: wrap; gap: 8px; float: none; margin: 0; padding: 0; list-style: none; font-size: 14px;
}
#panel .lower .adrp-barra ul.menu li { margin: 0; padding: 0; display: block; }
#panel .lower .adrp-barra ul.menu li::before, #panel .lower .adrp-barra ul.menu li::after { display: none; content: none; }

#panel .lower .adrp-barra a.adrp-pill:link,
#panel .lower .adrp-barra a.adrp-pill:visited {
    --pc: var(--accent, #2e9bff);
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 14px 0 11px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); font-weight: 600; font-size: 13.5px; line-height: 1; white-space: nowrap; text-decoration: none;
    box-shadow: 0 1px 2px rgba(20, 30, 60, .05);
    transition: border-color .2s, box-shadow .2s, transform .15s, background-color .2s, color .2s;
}
#panel .lower .adrp-barra a.adrp-pill::before {
    content: ""; flex: none; width: 16px; height: 16px; background: var(--pc);
    -webkit-mask: var(--pi) center / 16px no-repeat; mask: var(--pi) center / 16px no-repeat;
}
#panel .lower .adrp-barra a.adrp-pill:hover,
#panel .lower .adrp-barra a.adrp-pill:focus-visible {
    border-color: var(--pc); color: var(--text); text-decoration: none; transform: translateY(-1px);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 18%, transparent), var(--shadow);
}
#panel .lower .adrp-barra a.adrp-pill:focus-visible { outline: none; }
#panel .lower .adrp-barra a.adrp-pill:active { transform: none; }

/* colori per ruolo */
#panel .lower .adrp-barra a.adrp-pill.modcp { --pc: #e8930c; }
#panel .lower .adrp-barra a.adrp-pill.admincp { --pc: #e5484d; }
#panel .lower .adrp-barra a.adrp-pill.modcp:link, #panel .lower .adrp-barra a.adrp-pill.modcp:visited { background: color-mix(in srgb, #e8930c 8%, var(--surface)); }
#panel .lower .adrp-barra a.adrp-pill.admincp:link, #panel .lower .adrp-barra a.adrp-pill.admincp:visited { background: color-mix(in srgb, #e5484d 8%, var(--surface)); }

/* icone (maschere SVG, prendono il colore --pc) */
#panel .adrp-barra a.usercp { --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
#panel .adrp-barra a.modcp { --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 4.5-3.4 8.3-8 9-4.6-.7-8-4.5-8-9V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); }
#panel .adrp-barra a.admincp { --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 0 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 0 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 0 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 0 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E"); }
#panel .adrp-barra a.buddy { --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Cpath d='M2 21a7 7 0 0 1 14 0'/%3E%3Cpath d='M19 8v6M16 11h6'/%3E%3C/svg%3E"); }
#panel .adrp-barra a.newposts { --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 4.6L19 8l-3.8 3.4L16.3 17 12 14.4 7.7 17l1.1-5.6L5 8l5.1-.4z'/%3E%3C/svg%3E"); }
#panel .adrp-barra a.todayposts { --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3Cpath d='M12 14v3l2 1'/%3E%3C/svg%3E"); }
#panel .adrp-barra a.pms { --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E"); }

/* contatore dei messaggi non letti */
#panel .adrp-barra .adrp-badge {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 999px;
    font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums;
    color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}
#panel .adrp-barra a.pms:not([data-n="0"]) { --pc: #e5484d; }
#panel .adrp-barra a.pms:not([data-n="0"]) .adrp-badge {
    color: #fff; background: #e5484d; border-color: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, .18);
    animation: adrp-badge-pulse 2s ease-in-out infinite;
}
@keyframes adrp-badge-pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); } }

/* tema scuro */
html[data-tema="scuro"] #panel .lower .adrp-barra a.adrp-pill:link,
html[data-tema="scuro"] #panel .lower .adrp-barra a.adrp-pill:visited { box-shadow: none; }

/* telefono: righe che scorrono di lato invece di andare a capo su piu' righe */
@media (max-width: 760px) {
    #panel .lower .wrapper.adrp-barra { flex-direction: column; align-items: stretch; gap: 8px; }
    #panel .lower .adrp-barra ul.menu {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
        margin: 0 -12px; padding: 2px 12px 4px;
    }
    #panel .lower .adrp-barra ul.menu::-webkit-scrollbar { display: none; }
    #panel .lower .adrp-barra a.adrp-pill:link, #panel .lower .adrp-barra a.adrp-pill:visited { height: 34px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    #panel .lower .adrp-barra a.adrp-pill { transition: none; }
    #panel .adrp-barra a.pms:not([data-n="0"]) .adrp-badge { animation: none; }
}

/* ------------------------------------------------------------------ benvenuto (avatar + saluto + ultimo accesso) */
#panel .upper .welcome.adrp-ben { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; font-size: 14.5px; min-width: 0; }
#panel .upper .adrp-ben-av { flex: none; display: block; width: 40px; height: 40px; padding: 2px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent, #2e9bff), var(--accent-2, #8b5cff)); box-shadow: 0 4px 14px rgba(46, 155, 255, .25); }
#panel .upper .adrp-ben-av img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface); border: 2px solid var(--surface); box-sizing: border-box; }
#panel .upper .adrp-ben-testo { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
#panel .upper .adrp-ben-ciao { font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .upper .adrp-ben-ciao a:link, #panel .upper .adrp-ben-ciao a:visited { font-weight: 800; }
#panel .upper .adrp-ben-ultimo { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .upper .adrp-ben-quando, #panel .upper .adrp-ben-quando * { display: inline; font-weight: 600; color: var(--text); }
#panel .upper .welcome.adrp-ben a.logout { flex: none; margin-left: 6px !important; }

@media (max-width: 760px) {
    #panel .upper .welcome.adrp-ben,
    #panel .upper .welcome.adrp-ben:has(a.logout) { display: flex; width: 100%; font-size: 14px; line-height: 1.25; }
    #panel .upper .welcome.adrp-ben:has(a.logout) a.logout { float: none; margin: 0 0 0 auto !important; padding: 7px 12px 7px 10px !important; font-size: 13px; }
    #panel .upper .adrp-ben-av { width: 36px; height: 36px; }
}

/* telefono: le pillole scorrono dentro la loro fascia senza allargare la pagina */
@media (max-width: 760px) {
    #panel .lower { overflow: hidden; }
    #panel .lower .wrapper.adrp-barra { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
    #panel .lower .adrp-barra ul.menu { width: auto; max-width: 100%; min-width: 0; margin: 0; padding: 2px 2px 4px; box-sizing: border-box; }
    #panel .lower .adrp-barra ul.menu li { flex: none; }
}

/* pulsante Tema da telefono: il testo e' nascosto, quindi deve vedersi l'icona (luna / sole) */
@media (max-width: 760px) {
    #header ul.menu.top_links li a.adrp-tema::before {
        display: block !important;
        content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E") center / 16px no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E") center / 16px no-repeat;
    }
    html[data-tema="scuro"] #header ul.menu.top_links li a.adrp-tema::before {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
    }
    #header ul.menu.top_links li a.adrp-tema { min-width: 38px; justify-content: center; }
}

/* telefono: pillole su piu' righe (cosi' Messaggi e il contatore si vedono sempre) */
@media (max-width: 760px) {
    #panel .lower .adrp-barra ul.menu { flex-wrap: wrap; overflow: visible; }
}
