/*
 * Pickup Portal UI Theme
 * Allineato con lo stile Coresuite Business
 */

:root {
    --ag-accent: #0b2f6b;
    --ag-accent-strong: #082451;
    --ag-accent-soft: rgba(11, 47, 107, 0.12);
    --ag-surface: #ffffff;
    --ag-surface-alt: #f4f6fb;
    --ag-border: rgba(11, 47, 107, 0.14);
    --ag-text: #1c2534;
    --ag-muted: #6c7d93;
    --bs-primary: #0b2f6b;
    --bs-primary-rgb: 11, 47, 107;
    --bs-warning: #0b2f6b;
    --bs-warning-rgb: 11, 47, 107;
    --portal-sidebar-width: 260px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    background-color: var(--ag-surface-alt);
    color: var(--ag-text);
    font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
    margin: 0;
    min-height: 100vh;
}

body.sidebar-collapsed {
    --portal-sidebar-width: 88px;
}

a {
    color: var(--bs-primary);
    text-decoration: none;
}

a:hover {
    color: var(--ag-accent-strong);
}

/* =====================
   Login shell
   ===================== */
body.login-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 18%, rgba(11, 47, 107, 0.18), transparent 55%),
        radial-gradient(circle at 88% 88%, rgba(13, 60, 126, 0.14), transparent 60%),
        var(--ag-surface-alt);
    color: var(--ag-text);
}

.login-layout {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: row;
}

.login-hero {
    flex: 1.1;
    position: relative;
    color: #ffffff;
    background: linear-gradient(150deg, #10306d 0%, #124d9d 45%, #0d72c6 100%);
    padding: clamp(2.75rem, 5vw, 4rem) clamp(3rem, 6vw, 4.75rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(2rem, 5vh, 3rem);
    overflow: hidden;
}

.login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 55%),
        radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.16), transparent 65%);
    opacity: 0.85;
    pointer-events: none;
}

.login-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 3vh, 2.5rem);
    max-width: 32rem;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-brand-label {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.7;
}

.login-brand-symbol {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.login-brand-title {
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 1rem;
    line-height: 1.1;
    opacity: 0.85;
}

.login-brand-title strong {
    display: block;
    font-size: clamp(2.1rem, 3vw, 2.6rem);
    letter-spacing: 0.02em;
    line-height: 1.1;
    opacity: 1;
}

.login-hero-lead {
    font-size: 1.05rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.92);
}

.login-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: stretch;
}

.login-highlights li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1.1rem 1.25rem;
    min-height: 6.25rem;
}

.login-highlight-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
}

.login-highlights li span:last-child {
    flex: 1 1 auto;
}

.login-hero-footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: auto;
}

.login-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    width: fit-content;
}

.login-hero-cta:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
}

.login-panel {
    flex: 0.9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(3rem, 6vw, 4.25rem) clamp(2.75rem, 5vw, 4rem);
    background: linear-gradient(180deg, #ffffff 0%, rgba(247, 249, 254, 0.96) 100%);
    overflow: hidden;
}

.login-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(11, 47, 107, 0.12), transparent 60%),
        radial-gradient(circle at bottom left, rgba(13, 60, 126, 0.1), transparent 60%);
    opacity: 0.6;
    pointer-events: none;
}

.login-panel-inner {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.login-panel-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.login-pill {
    align-self: flex-start;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(11, 47, 107, 0.1);
    color: var(--bs-primary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-panel-header h2 {
    margin: 0;
    font-size: clamp(2rem, 2.3vw, 2.35rem);
    font-weight: 600;
    color: var(--ag-text);
    letter-spacing: -0.015em;
}

.login-panel-header p {
    color: var(--ag-muted);
    font-size: 0.98rem;
    margin: 0;
}

.login-progress {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
}

.login-progress-divider {
    flex: 0 0 1.8rem;
    height: 1px;
    background: var(--ag-border);
    opacity: 0.7;
}

.login-progress-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 1rem;
    background: rgba(11, 47, 107, 0.06);
    color: var(--ag-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.login-progress-step.active {
    background: #ffffff;
    color: var(--ag-text);
    border-color: rgba(11, 47, 107, 0.2);
    box-shadow: 0 12px 26px rgba(8, 28, 60, 0.12);
    font-weight: 600;
}

.login-progress-index {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.45);
    color: #0b2f6b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.login-progress-step.active .login-progress-index {
    background: rgba(11, 47, 107, 0.12);
}

.login-progress-step i {
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.login-field:not(:last-child) {
    margin-bottom: 0.25rem;
}

.login-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ag-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.35rem;
}

.login-field .form-control {
    border-radius: 0.9rem;
    border: 1px solid rgba(11, 47, 107, 0.24);
    padding: 0.85rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #ffffff;
}

.login-field .form-control:focus {
    border-color: rgba(11, 47, 107, 0.65);
    box-shadow: 0 0 0 0.2rem rgba(11, 47, 107, 0.15);
}

.login-field .form-text {
    color: var(--ag-muted);
    font-size: 0.82rem;
}

.login-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

.login-step {
    display: none;
    animation: fadeInLogin 0.25s ease;
}

.login-step.active {
    display: block;
}

.login-step-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.login-step-subtitle {
    font-size: 0.95rem;
    color: var(--ag-muted);
    margin-bottom: 1.25rem;
}

.login-hint {
    font-size: 0.82rem;
    color: var(--ag-muted);
    margin-bottom: 0;
}

.login-otp-form {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    width: 100%;
}

.login-otp-input {
    letter-spacing: 0.35em;
    text-align: center;
    font-weight: 600;
    font-size: 1.15rem;
    text-transform: uppercase;
    padding: 0.75rem;
}

.login-submit button {
    padding: 0.95rem 1.2rem;
    border-radius: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    justify-content: center;
    box-shadow: 0 18px 36px rgba(11, 47, 107, 0.18);
    font-size: 1rem;
}

.login-submit button i {
    font-size: 1.1rem;
}

.login-submit .btn-outline-primary {
    border-width: 1px;
}

.login-submit .btn-outline-primary:hover {
    background: rgba(11, 47, 107, 0.08);
}

.login-resend {
    font-weight: 600;
    border-radius: 0.9rem;
    padding: 0.75rem;
    font-size: 0.92rem;
}

.login-privacy {
    font-size: 0.82rem;
    color: var(--ag-muted);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.login-privacy a {
    color: var(--bs-primary);
}

.login-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.92rem;
    color: var(--ag-muted);
}

.login-loading .spinner-border {
    width: 1.4rem;
    height: 1.4rem;
    border-width: 0.16rem;
}

.login-help {
    font-size: 0.85rem;
    color: var(--ag-muted);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.login-countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--ag-muted);
}

.login-alert {
    border-radius: 1rem;
    padding: 0.95rem 1.1rem;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-alert i {
    font-size: 1rem;
    color: inherit;
}

.login-step + .login-step {
    margin-top: 2.25rem;
}

@keyframes fadeInLogin {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-help a {
    color: var(--bs-primary);
}

.login-help a:hover {
    color: var(--ag-accent-strong);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.28em;
    color: var(--ag-muted);
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ag-border);
}

@media (max-width: 1199.98px) {
    .login-hero {
        padding: clamp(2.25rem, 5vw, 3.25rem) clamp(2.5rem, 5vw, 3.5rem);
    }

    .login-panel {
        padding: clamp(2.5rem, 5vw, 3.5rem) clamp(2.25rem, 5vw, 3.25rem);
    }
}

@media (max-width: 991.98px) {
    body.login-body {
        min-height: 0;
    }

    .login-layout {
        flex-direction: column;
        min-height: 0;
    }

    .login-hero,
    .login-panel {
        padding: clamp(2.2rem, 6vw, 2.75rem) clamp(1.8rem, 6vw, 2.4rem);
    }

    .login-panel-inner {
        width: min(480px, 100%);
        margin-inline: auto;
        gap: 1.75rem;
    }
}

@media (max-width: 767.98px) {
    .login-hero,
    .login-panel {
        padding: 2rem 1.75rem;
    }

    .login-hero-content {
        align-items: center;
        text-align: center;
    }

    .login-brand {
        justify-content: center;
    }

    .login-highlights {
        gap: 0.85rem;
    }

    .login-highlights li {
        justify-content: center;
        text-align: left;
    }

    .login-progress {
        flex-direction: column;
        gap: 0.75rem;
    }

    .login-progress-divider {
        display: none;
    }

    .login-progress-step {
        width: 100%;
        justify-content: center;
    }

    .login-field-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .login-privacy {
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .login-hero,
    .login-panel {
        padding: 1.8rem 1.4rem;
    }

    .login-hero-content {
        gap: 1.8rem;
    }

    .login-brand-title strong {
        font-size: 2rem;
    }

    .login-hero-lead {
        font-size: 0.98rem;
    }
}

/* =====================
   Layout shell
   ===================== */
#portal-app {
    min-height: 100vh;
    width: 100%;
    background-color: var(--ag-surface-alt);
    display: grid !important;
    grid-template-columns: var(--portal-sidebar-width) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "alerts alerts"
        "sidebar main"
        "sidebar footer";
    align-items: stretch;
    transition: grid-template-columns 0.3s ease;
}

#global-alert-container {
    grid-area: alerts;
    padding-inline: 1.75rem;
}

.portal-main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    background: var(--ag-surface-alt);
    min-height: 0;
    min-width: 0;
    position: relative;
    z-index: 101;
}

.portal-content {
    flex: 1;
    padding: 1.75rem 1.75rem 6.5rem;
    background: var(--ag-surface-alt);
    width: 100%;
    max-width: none;
}

.portal-footer {
    grid-area: footer;
    background: #ffffff;
    border-top: 1px solid var(--ag-border);
    box-shadow: 0 -12px 32px rgba(8, 28, 60, 0.05);
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 900;
}

.portal-footer__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.85rem;
}

.portal-footer__left,
.portal-footer__right {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.portal-footer__brand {
    font-size: 0.95rem;
    white-space: nowrap;
}

.portal-footer__link {
    color: var(--ag-muted);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.portal-footer__link:hover {
    color: var(--bs-primary);
}

.portal-footer__secure {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .portal-footer__bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .portal-footer__left,
    .portal-footer__right {
        gap: 0.75rem;
    }
}

@media (max-width: 991.98px) {
    #portal-app {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr auto;
        grid-template-areas:
            "alerts"
            "main"
            "footer";
    }

    #global-alert-container {
        padding-inline: 1.5rem;
    }

    .portal-main {
        width: 100%;
    }

    .sidebar {
        grid-area: auto;
    }

    .portal-content {
        padding: 1.5rem 1.5rem 6rem;
    }
}

/* =====================
   Sidebar (stile business)
   ===================== */
.sidebar {
    grid-area: sidebar;
    width: var(--portal-sidebar-width);
    min-height: 100vh;
    transition: width 0.3s ease;
    background-color: #0b2f6b !important;
    color: #f8f9ff;
    box-shadow: 0 0 24px rgba(8, 28, 60, 0.28);
    position: sticky;
    top: 0;
    align-self: start;
    height: calc(100vh - var(--footer-height, 0px));
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 900;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.sidebar-brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    width: 100%;
    color: inherit;
    text-decoration: none;
    padding: 0.2rem 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.sidebar-brand-title {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffffff;
}

.sidebar-brand-subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar {
    grid-area: sidebar;
    width: var(--portal-sidebar-width);
    min-height: 100vh;
    transition: width 0.3s ease;
    background-color: #0b2f6b !important;
    color: #f8f9ff;
    box-shadow: 0 0 24px rgba(8, 28, 60, 0.28);
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 900;
}

.sidebar .nav-icon,
.sidebar .nav-subicon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    color: inherit;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar .nav-link:hover .nav-icon,
.sidebar .nav-link.active .nav-icon,
.sidebar .nav-link:hover .nav-subicon,
.sidebar .nav-link.active .nav-subicon {
    transform: translateX(2px);
}

.sidebar .nav-icon[data-color="amber"],
.sidebar .nav-subicon[data-color="amber"] {
    color: #ffd166;
}

.sidebar .nav-icon[data-color="emerald"],
.sidebar .nav-subicon[data-color="emerald"] {
    color: #8ce99a;
}

.sidebar .nav-icon[data-color="sky"],
.sidebar .nav-subicon[data-color="sky"] {
    color: #74c0fc;
}

.sidebar .nav-link {
    color: #ffffff;
}

.sidebar .nav-link .nav-label,
.sidebar .sidebar-section-label,
.sidebar .badge,
.sidebar .sidebar-footer {
    color: inherit;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus,
.sidebar .nav-link.active {
    color: #ffffff;
}

.sidebar .nav-link.text-danger,
.sidebar .nav-link.text-danger .nav-label {
    color: #ff6b6b !important;
}

.sidebar .nav-icon[data-color="violet"],
.sidebar .nav-subicon[data-color="violet"] {
    color: #b197fc;
}

.sidebar .nav-icon[data-color="crimson"],
.sidebar .nav-subicon[data-color="crimson"] {
    color: #ff8787;
}

.sidebar .nav-icon[data-color="teal"],
.sidebar .nav-subicon[data-color="teal"] {
    color: #63e6be;
}

.sidebar .nav-icon[data-color="orange"],
.sidebar .nav-subicon[data-color="orange"] {
    color: #ffa94d;
}

.sidebar .nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100%;
    padding-bottom: 2rem;
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-footer {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.sidebar.collapsed {
    width: 88px;
}

.sidebar.collapsed .sidebar-inner {
    padding: 1.5rem 0.75rem 2rem;
    gap: 1rem;
}

.sidebar.collapsed .sidebar-brand-link {
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-caret,
.sidebar.collapsed .nav-link-toggle::after,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-quick-info,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .nav-link .badge,
.sidebar.collapsed .nav-link .ms-auto {
    display: none !important;
}

.sidebar.collapsed .nav,
.sidebar.collapsed .sidebar-section {
    align-items: center;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding-inline: 0.5rem;
    gap: 0;
}

.sidebar.collapsed .nav-link + .nav-link {
    margin-top: 0.25rem;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-section {
    border-top-color: rgba(255, 255, 255, 0.1);
    padding-top: 1rem !important;
}

.sidebar.collapsed .sidebar-section .nav {
    width: 100%;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -260px;
        width: 240px;
        transition: transform 0.3s ease, left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 0 24px 48px rgba(8, 28, 60, 0.24);
    }

    body.offcanvas-active {
        overflow: hidden;
    }

    body.offcanvas-active::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(12, 23, 52, 0.45);
        z-index: 1020;
        animation: fadeInOverlay 0.2s ease;
    }
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* =====================
   Topbar
   ===================== */
.topbar {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.92);
    padding: 0.75rem 1.5rem;
    z-index: 1020;
    border-bottom: 1px solid var(--ag-border);
}

.topbar-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}

.topbar-left,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.topbar-actions {
    margin-left: auto;
    justify-content: flex-end;
}

.topbar-brand-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ag-accent);
}

.topbar-brand-subtitle {
    font-size: 0.72rem;
    color: var(--ag-muted);
    letter-spacing: 0.05em;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(11, 47, 107, 0.14);
    background-color: #ffffff;
    color: var(--ag-accent);
    padding: 0.55rem 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.topbar-btn:hover,
.topbar-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(11, 47, 107, 0.14);
}

.topbar-btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    justify-content: center;
    border-radius: 0.75rem;
    padding: 0;
}

.topbar-btn-icon i {
    font-size: 1rem;
}

.topbar-btn-user {
    background: var(--ag-accent);
    color: #fff;
    border-color: transparent;
    padding: 0.55rem 1rem;
}

.topbar-btn-user .topbar-btn-label {
    font-weight: 600;
}

.topbar-dropdown {
    min-width: 220px;
    font-size: 0.9rem;
}

@media (max-width: 991.98px) {
    .topbar {
        position: sticky;
        top: 0;
    }
}

/* =====================
   Cards & utilities
   ===================== */
.card {
    border: none;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(8, 28, 60, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(8, 28, 60, 0.16);
}

.card-header {
    border-bottom: 1px solid rgba(8, 28, 60, 0.08);
    background: rgba(248, 250, 255, 0.9);
    border-radius: 1rem 1rem 0 0 !important;
}

.badge {
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.5rem 0.8rem;
}

.alert {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 12px 24px rgba(8, 28, 60, 0.12);
}

.portal-stat-card {
    border: 1px solid rgba(8, 28, 60, 0.06);
    border-radius: 1.25rem;
    padding: 1.4rem 1.6rem;
    background: linear-gradient(135deg, rgba(11, 47, 107, 0.08), rgba(11, 47, 107, 0));
    position: relative;
    overflow: hidden;
}

.portal-stat-card::after {
    content: "";
    position: absolute;
    inset: 1.2rem;
    border-radius: 1.1rem;
    border: 1px dashed rgba(11, 47, 107, 0.12);
    pointer-events: none;
}

.portal-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: rgba(11, 47, 107, 0.12);
    color: var(--ag-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.portal-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ag-muted);
    text-transform: uppercase;
}

.portal-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--ag-muted);
}

.portal-empty-state i {
    font-size: 2.5rem;
    color: rgba(11, 47, 107, 0.25);
    margin-bottom: 1rem;
}

/* Dashboard layout */
.portal-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    width: 100%;
}

.portal-dashboard > * {
    width: 100%;
}

.dashboard-card {
    border: 1px solid rgba(11, 47, 107, 0.08);
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(8, 28, 60, 0.08);
    overflow: hidden;
}

.dashboard-card {
    width: 100%;
    border: 1px solid var(--ag-border);
}

.dashboard-card .card-header {
    background: transparent;
    border: none;
    padding: clamp(1.4rem, 2.6vw, 2rem) clamp(1.6rem, 3vw, 2.3rem) 0;
}

.dashboard-card .card-body {
    padding: clamp(1.6rem, 2.6vw, 2.2rem) clamp(1.6rem, 3vw, 2.3rem);
}

.portal-hero {
    border: none;
    background: linear-gradient(135deg, #0b2f6b 0%, #1c4d95 45%, #2f6bcf 100%);
    color: #ffffff;
    position: relative;
}

.portal-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 55%),
        radial-gradient(circle at bottom left, rgba(15, 76, 182, 0.4), transparent 58%);
    opacity: 0.7;
    pointer-events: none;
}

.portal-hero .card-body {
    position: relative;
    z-index: 1;
    padding: clamp(2rem, 4vw, 2.8rem);
}

.dashboard-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.dashboard-title {
    margin: 1rem 0 0.5rem;
    font-size: clamp(2rem, 4vw, 2.7rem);
    font-weight: 600;
    line-height: 1.1;
}

.dashboard-subtitle {
    margin: 0 0 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.dashboard-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dashboard-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 0.9rem;
    padding: 0.65rem 1.2rem;
    font-weight: 600;
    box-shadow: none;
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.dashboard-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 1.1rem;
    padding: 1.15rem 1.25rem;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.dashboard-stat-label {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.dashboard-stat-value {
    font-size: 1.9rem;
    font-weight: 600;
}

.dashboard-stat-hint {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.68);
}

.dashboard-action {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.4rem 1.6rem;
    border-radius: 1.15rem;
    border: 1px solid var(--ag-border);
    background: var(--ag-surface-alt);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.dashboard-action:hover {
    transform: translateY(-4px);
    border-color: rgba(11, 47, 107, 0.24);
    background-color: #ffffff;
    box-shadow: 0 20px 42px rgba(8, 28, 60, 0.12);
}

.dashboard-action-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--ag-accent-strong);
    flex-shrink: 0;
}

.dashboard-action-icon[data-variant="primary"] {
    background: rgba(11, 47, 107, 0.14);
}

.dashboard-action-icon[data-variant="success"] {
    background: rgba(47, 158, 68, 0.14);
    color: #2f9e44;
}

.dashboard-action-icon[data-variant="warning"] {
    background: rgba(240, 140, 0, 0.16);
    color: #d9480f;
}

.dashboard-action-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dashboard-action-title {
    font-weight: 600;
    color: var(--ag-text);
}

.dashboard-action-text {
    font-size: 0.92rem;
    color: var(--ag-muted);
    margin: 0;
}

.dashboard-action-chevron {
    font-size: 1rem;
    color: var(--ag-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.dashboard-action-chevron {
    margin-left: auto;
}

.dashboard-action:hover .dashboard-action-chevron {
    transform: translateX(4px);
    color: var(--ag-accent);
}

.dashboard-metric {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 1.6rem 1.7rem;
    border-radius: 1.15rem;
    border: 1px solid var(--ag-border);
    background: var(--ag-surface-alt);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-metric:hover {
    transform: translateY(-3px);
    border-color: rgba(11, 47, 107, 0.24);
    box-shadow: 0 18px 36px rgba(8, 28, 60, 0.12);
}

.dashboard-metric-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(11, 47, 107, 0.12);
    color: var(--ag-accent-strong);
}

.dashboard-metric-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dashboard-metric-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ag-muted);
}

.dashboard-metric-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--ag-accent);
}

.dashboard-metric-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ag-muted);
}

.dashboard-main {
    align-items: stretch;
}

.dashboard-main > [class*="col-"] {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-main > [class*="col-"] > .dashboard-card {
    height: auto;
}

.dashboard-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.2rem;
}

.dashboard-panel-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ag-text);
}

.dashboard-panel-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--ag-muted);
}

.dashboard-empty-state {
    text-align: center;
    padding: 2.3rem 1.8rem;
    color: var(--ag-muted);
}

.dashboard-empty-state-compact {
    padding: 1.6rem 1.2rem;
}

.dashboard-empty-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: rgba(11, 47, 107, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--ag-accent);
    margin-bottom: 1rem;
}

.dashboard-empty-title {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ag-text);
}

.dashboard-empty-text {
    margin-bottom: 1.2rem;
    font-size: 0.92rem;
    color: var(--ag-muted);
}

.dashboard-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(11, 47, 107, 0.08);
    border-radius: 1rem;
    background: rgba(11, 47, 107, 0.02);
}

.dashboard-feed-compact {
    gap: 0.85rem;
}

.dashboard-feed-compact .dashboard-feed-item {
    padding: 0.9rem 1rem;
}

.dashboard-feed-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.9rem;
    background: rgba(11, 47, 107, 0.12);
    color: var(--ag-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.dashboard-feed-icon[data-status="reported"],
.dashboard-feed-icon[data-status="in_arrivo"],
.dashboard-feed-icon[data-status="warning"] {
    background: rgba(244, 170, 80, 0.16);
    color: #d9480f;
}

.dashboard-feed-icon[data-status="arrived"],
.dashboard-feed-icon[data-status="consegnato"] {
    background: rgba(116, 192, 252, 0.18);
    color: #1864ab;
}

.dashboard-feed-icon[data-status="ritirato"] {
    background: rgba(140, 233, 154, 0.2);
    color: #2f9e44;
}

.dashboard-feed-icon[data-status="in_giacenza"],
.dashboard-feed-icon[data-status="in_giacenza_scaduto"] {
    background: rgba(255, 146, 139, 0.22);
    color: #c92a2a;
}

.dashboard-feed-icon[data-status="notification"] {
    background: rgba(115, 164, 255, 0.2);
    color: #364fc7;
}

.dashboard-feed-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.dashboard-feed-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.dashboard-feed-title {
    font-weight: 600;
    color: var(--ag-text);
}

.dashboard-feed-status .badge {
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.dashboard-feed-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: var(--ag-muted);
}

.dashboard-feed-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dashboard-feed-meta i {
    color: rgba(11, 47, 107, 0.45);
}

.dashboard-feed-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ag-muted);
}

.dashboard-feed-time {
    font-size: 0.82rem;
    color: var(--ag-muted);
}

.dashboard-feed-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-support-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.dashboard-support-item {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.dashboard-support-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    background: rgba(11, 47, 107, 0.12);
    color: var(--ag-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.dashboard-support-item strong {
    display: block;
    font-weight: 600;
    color: var(--ag-text);
}

.dashboard-support-item a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--ag-accent);
    font-weight: 500;
    text-decoration: none;
}

.dashboard-support-item a:hover {
    text-decoration: underline;
}

.dashboard-support-item small {
    display: block;
    font-size: 0.8rem;
    color: var(--ag-muted);
}

@media (max-width: 1199.98px) {
    .dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .portal-dashboard {
        gap: 2rem;
    }

    .dashboard-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 767.98px) {
    .dashboard-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-action {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-action-meta {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .dashboard-card .card-body {
        padding: 1.35rem;
    }

    .dashboard-metric {
        padding: 1.35rem;
    }

    .dashboard-feed-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-feed-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Notifications */
.notification-dropdown {
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(8, 28, 60, 0.06);
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: rgba(11, 47, 107, 0.06);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-badge {
    font-size: 0.6rem;
    width: 1.3rem;
    height: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
}

/* Status badge */
.status-reported { background-color: #e59f1d !important; color: #fff; }
.status-confirmed { background-color: #0aa2c0 !important; color: #fff; }
.status-arrived { background-color: #198754 !important; color: #fff; }
.status-cancelled { background-color: #6c757d !important; color: #fff; }
.status-in_arrivo { background-color: #0b2f6b !important; color: #fff; }
.status-consegnato { background-color: #198754 !important; color: #fff; }
.status-ritirato { background-color: #1c2534 !important; color: #fff; }
.status-in_giacenza { background-color: #ffc107 !important; color: #1c2534; }
.status-in_giacenza_scaduto { background-color: #dc3545 !important; color: #fff; }

.quick-info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(8, 28, 60, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.9rem;
    padding: 1rem;
    color: #fff;
}

.quick-info .fw-bold {
    font-size: 1.05rem;
}

.text-muted-soft {
    color: rgba(108, 125, 147, 0.85) !important;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}



.portal-cookie-banner {
    position: fixed;
    inset-block-end: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    background: var(--ag-surface);
    border-top: 1px solid rgba(11, 47, 107, 0.1);
    box-shadow: 0 -12px 24px rgba(11, 47, 107, 0.12);
    z-index: 1085;
}

.portal-cookie-banner[hidden] {
    display: none !important;
}

.portal-cookie-banner__inner {
    margin: 0 auto;
    padding: 1.5rem 2rem;
    max-width: 1080px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.portal-cookie-banner__text {
    flex: 1 1 320px;
    color: var(--ag-muted);
}

.portal-cookie-banner__title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--ag-text);
}

.portal-cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.portal-cookie-banner__actions .btn-primary {
    white-space: nowrap;
}

.portal-cookie-banner__actions .btn-link {
    padding-inline: 0.25rem;
}

@media (max-width: 576px) {
    .portal-cookie-banner__inner {
        padding: 1.25rem 1.5rem;
    }

    .portal-cookie-banner__actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .portal-cookie-banner__actions .btn-primary {
        width: 100%;
    }
}

/* =====================
   BRT PUDO selector
   ===================== */
.portal-pudo-map {
    width: 100%;
    height: 420px;
    min-height: 320px;
    border-radius: 1rem;
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .portal-pudo-map {
        height: 360px;
        min-height: 280px;
    }
}

.portal-pudo-results {
    max-height: 420px;
    overflow-y: auto;
}

.portal-pudo-results .list-group-item {
    border: none;
    border-radius: 0;
    padding: 0.65rem 0.85rem;
}

.portal-pudo-results .list-group-item + .list-group-item {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}


