:root {
    --app-bg: #f4f7fb;
    --app-surface: #ffffff;
    --app-surface-alt: #ecf1f7;
    --app-border: rgba(15, 23, 42, 0.08);
    --app-text: #152033;
    --app-text-soft: #64748b;
    --app-primary: #2563eb;
    --app-sidebar: #25387B;
    --app-sidebar-text: #dbe5f4;
    --app-topbar-height: 58px;
}

[data-bs-theme="dark"] {
    --app-bg: #0b1220;
    --app-surface: #111a2d;
    --app-surface-alt: #162238;
    --app-border: rgba(148, 163, 184, 0.18);
    --app-text: #e2e8f0;
    --app-text-soft: #94a3b8;
    --app-primary: #60a5fa;
    --app-sidebar: #09111f;
    --app-sidebar-text: #d9e4f6;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.14), transparent 36%), var(--app-bg);
    color: var(--app-text);
    min-height: 100vh;
}

h1,
.h1 {
    font-size: 1.8rem;
}

h2,
.h2 {
    font-size: 1.35rem;
}

h3,
.h3 {
    font-size: 1.1rem;
}

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
    backdrop-filter: blur(18px);
}

.layout-auth .theme-toggle {
    top: 1.5rem;
    right: 1.5rem;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-primary) 14%, transparent);
    color: var(--app-primary);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-card,
.card,
.modal-content,
.metric-card {
    background: var(--app-surface);
    border-color: var(--app-border) !important;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    background-image:
        linear-gradient(135deg, rgba(11, 18, 32, 0.72), rgba(11, 18, 32, 0.4)),
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.3), transparent 35%),
        url('/assets/images/background-login.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.auth-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 45%),
        linear-gradient(315deg, rgba(14, 165, 233, 0.16), transparent 40%);
    pointer-events: none;
}

.auth-card {
    backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--app-surface) 86%, transparent);
}

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    align-items: start;
}

body.layout-app-shell {
    padding-top: var(--app-topbar-height);
}

.app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--app-topbar-height);
    z-index: 1035;
    background: linear-gradient(180deg, color-mix(in srgb, var(--app-sidebar) 94%, #000 6%), var(--app-sidebar));
    color: var(--app-sidebar-text);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.app-topbar-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    gap: 1rem;
}

.app-topbar-left {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.app-topbar-brand {
    display: inline-flex;
    align-items: center;
    color: var(--app-sidebar-text);
    font-size: 1rem;
    font-weight: 700;
}

.app-topbar-brand-logo {
    display: block;
    height: 34px;
    width: auto;
}

.app-topbar-brand-accent {
    color: #f59e0b;
    margin-left: 0.12rem;
}

.app-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.app-topbar-menu-toggle {
    color: var(--app-sidebar-text);
    border-color: rgba(219, 229, 244, 0.22);
}

.app-topbar-menu-toggle:hover,
.app-topbar-menu-toggle:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(219, 229, 244, 0.28);
}

.app-topbar-theme,
.app-topbar-user,
.app-topbar-bell {
    color: var(--app-sidebar-text);
    border-color: rgba(219, 229, 244, 0.22);
}

.app-topbar-theme:hover,
.app-topbar-theme:focus,
.app-topbar-bell:hover,
.app-topbar-bell:focus,
.app-topbar-bell.show,
.app-topbar-user:hover,
.app-topbar-user:focus,
.app-topbar-user.show {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(219, 229, 244, 0.28);
}

.app-topbar-bell-badge {
    position: absolute;
    top: -0.3rem;
    right: -0.35rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-topbar-notifications-menu {
    width: 360px;
    max-width: min(92vw, 360px);
}

.app-topbar-notification-item {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--app-border);
}

.app-topbar-notification-item:last-child {
    border-bottom: 0;
}

.app-topbar-notification-item.is-unread {
    background: color-mix(in srgb, var(--app-primary) 8%, var(--app-surface));
    border-left: 3px solid var(--app-primary);
}

.app-topbar-notification-title {
    font-weight: 600;
}

.app-topbar-notification-meta {
    color: var(--app-text-soft);
    font-size: 0.78rem;
}

.notification-read {
    opacity: 0.78;
}

.notification-unread {
    border-left: 4px solid var(--app-primary) !important;
    background: color-mix(in srgb, var(--app-primary) 6%, var(--app-surface));
}

.app-topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.app-topbar-user-avatar-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
}

.app-topbar-user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-preview-wrap {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    overflow: hidden;
    background: #e9ecef;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.profile-avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-cropper-wrap {
    position: relative;
    width: min(360px, 100%);
    height: min(360px, 70vw);
    min-height: 320px;
    margin: 0 auto;
    overflow: hidden;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
}

.profile-avatar-cropper-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.profile-avatar-cropper-canvas.is-dragging {
    cursor: grabbing;
}

.profile-avatar-cropper-mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.profile-avatar-cropper-mask::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.48);
    clip-path: circle(120px at 50% 50%);
    -webkit-mask: radial-gradient(circle 120px at center, transparent 99%, #000 100%);
            mask: radial-gradient(circle 120px at center, transparent 99%, #000 100%);
}

.profile-avatar-cropper-mask::after {
    content: '';
    position: absolute;
    width: 240px;
    height: 240px;
    border: 2px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 9999px rgba(17, 24, 39, 0.18);
}

.intro-video-layout {
    background: #000;
}

.intro-video-shell {
    position: fixed;
    inset: 0;
    background: #000;
    overflow: hidden;
}

.intro-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.intro-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.1) 35%, rgba(0, 0, 0, 0.45));
}

.intro-video-brand {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.intro-video-brand sup {
    color: var(--app-primary);
}

.intro-video-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 767.98px) {
    .intro-video-overlay {
        padding: 1rem;
    }

    .intro-video-actions {
        width: 100%;
    }

    .intro-video-actions .btn {
        flex: 1 1 auto;
    }
}

.app-topbar-user-menu {
    min-width: 12rem;
}

.app-impersonation-banner {
    position: fixed;
    top: var(--app-topbar-height);
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1.25rem;
    background: linear-gradient(90deg, rgba(180, 83, 9, 0.95), rgba(217, 119, 6, 0.92));
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

body.layout-app-shell .app-impersonation-banner + .app-shell,
body.layout-app-shell .app-impersonation-banner + main,
body.layout-app-shell.is-impersonating {
    margin-top: 3rem;
}

.sidebar {
    position: sticky;
    top: var(--app-topbar-height);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    height: calc(100vh - var(--app-topbar-height));
    overflow-y: auto;
    padding: 1.5rem;
    background: linear-gradient(180deg, color-mix(in srgb, var(--app-sidebar) 94%, #000 6%), var(--app-sidebar));
    color: var(--app-sidebar-text);
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    transition: width 0.2s ease, padding 0.2s ease;
}

.app-sidebar-mobile-backdrop {
    position: fixed;
    inset: var(--app-topbar-height) 0 0 0;
    background: rgba(2, 6, 23, 0.54);
    z-index: 1025;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.pipeline-opportunita-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 1fr);
    gap: 1.25rem;
    align-items: start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.25rem;
}

.pipeline-opportunita-column {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    min-height: 28rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.pipeline-opportunita-column-header {
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid var(--app-border);
}

.pipeline-opportunita-column-nuove .pipeline-opportunita-column-header {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.18), rgba(34, 197, 94, 0.06));
}

.pipeline-opportunita-column-progettazione .pipeline-opportunita-column-header {
    background: linear-gradient(135deg, rgba(161, 98, 7, 0.28), rgba(202, 138, 4, 0.12));
}

.pipeline-opportunita-column-offerta .pipeline-opportunita-column-header {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(96, 165, 250, 0.08));
}

.pipeline-opportunita-column-consegnata .pipeline-opportunita-column-header {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.18), rgba(148, 163, 184, 0.08));
}

.pipeline-opportunita-column-inviata .pipeline-opportunita-column-header {
    background: #ca8a04;
    color: #fff;
}

.pipeline-opportunita-column-accettata .pipeline-opportunita-column-header {
    background: #15803d;
    color: #fff;
}

.pipeline-opportunita-column-rifiutata .pipeline-opportunita-column-header {
    background: #dc2626;
    color: #fff;
}

.pipeline-opportunita-column-inviata .pipeline-opportunita-column-header .text-secondary,
.pipeline-opportunita-column-accettata .pipeline-opportunita-column-header .text-secondary,
.pipeline-opportunita-column-rifiutata .pipeline-opportunita-column-header .text-secondary {
    color: rgba(255, 255, 255, 0.85) !important;
}

.pipeline-opportunita-column-body {
    padding: 1rem;
    display: grid;
    gap: 0.9rem;
}

.coverage-check-layout {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 1.5rem;
}

.coverage-check-main-column {
    flex: 1 1 auto;
    min-width: 0;
}

.coverage-check-info-column {
    position: relative;
    flex: 0 0 320px;
    width: 320px;
    min-width: 320px;
    transition: width 0.2s ease, min-width 0.2s ease, flex-basis 0.2s ease;
}

.coverage-check-info-column.is-collapsed {
    flex-basis: 3.5rem;
    width: 3.5rem;
    min-width: 3.5rem;
}

.coverage-check-info-panel {
    display: block;
}

.coverage-check-info-column.is-collapsed .coverage-check-info-panel {
    display: none;
}

.coverage-check-info-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-soft);
    border-radius: 0.9rem 0.9rem 0.9rem 0.3rem;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    padding: 0.65rem 0.75rem;
    margin-bottom: 1rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.coverage-check-info-toggle:hover,
.coverage-check-info-toggle:focus {
    color: var(--app-primary);
    border-color: color-mix(in srgb, var(--app-primary) 45%, var(--app-border));
    background: color-mix(in srgb, var(--app-primary) 8%, var(--app-surface));
}

.coverage-check-info-column.is-collapsed .coverage-check-info-toggle {
    padding-inline: 0.8rem;
}

.coverage-check-info-column.is-collapsed .coverage-check-info-toggle-label {
    display: none;
}

@media (max-width: 1199.98px) {
    .coverage-check-layout {
        flex-wrap: wrap;
    }

    .coverage-check-main-column,
    .coverage-check-info-column,
    .coverage-check-info-column.is-collapsed {
        flex: 1 1 100%;
        width: 100%;
        min-width: 100%;
    }

    .coverage-check-info-column.is-collapsed .coverage-check-info-panel {
        display: none;
    }

    .coverage-check-info-column.is-collapsed .coverage-check-info-toggle-label {
        display: inline;
    }
}

.pipeline-opportunita-card {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--app-surface-alt) 58%, var(--app-surface));
    border: 1px solid var(--app-border);
    color: inherit;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.pipeline-opportunita-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
    border-color: color-mix(in srgb, var(--app-primary) 26%, var(--app-border));
}

.pipeline-opportunita-card-title {
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.pipeline-opportunita-card-meta {
    display: grid;
    gap: 0.2rem;
    color: var(--app-text-soft);
    font-size: 0.82rem;
}

.pipeline-opportunita-card-footer {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pipeline-opportunita-empty {
    color: var(--app-text-soft);
    font-size: 0.88rem;
    padding: 0.25rem 0.1rem;
}

.anagrafica-revenue-chart {
    display: grid;
    gap: 0.75rem;
}

.anagrafica-revenue-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 140px;
    gap: 0.9rem;
    align-items: center;
}

.anagrafica-revenue-year {
    font-weight: 600;
    color: var(--app-text-soft);
}

.anagrafica-revenue-bar-wrap {
    position: relative;
    height: 0.95rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-surface-alt) 78%, var(--app-surface));
    overflow: hidden;
}

.anagrafica-revenue-bar {
    height: 100%;
    min-width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.anagrafica-revenue-value {
    text-align: right;
    font-weight: 600;
}

@media (max-width: 1400px) {
    .pipeline-opportunita-board {
        grid-auto-columns: minmax(240px, 1fr);
    }
}

@media (max-width: 768px) {
    .anagrafica-revenue-row {
        grid-template-columns: 56px minmax(0, 1fr) 108px;
        gap: 0.6rem;
    }

    .anagrafica-revenue-value {
        font-size: 0.82rem;
    }
}

@media (max-width: 768px) {
    .pipeline-opportunita-board {
        grid-auto-columns: minmax(240px, 1fr);
    }
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0;
}

.sidebar-brand-accent {
    color: #f59e0b;
}

.sidebar-collapse-toggle {
    flex-shrink: 0;
}

.sidebar-section-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(219, 229, 244, 0.72);
    margin-bottom: 0.75rem;
}

.sidebar .nav-link {
    color: var(--app-sidebar-text);
    border-radius: 0.85rem;
    padding: 0.62rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.88rem;
}

.nav-link-icon {
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-link-label {
    white-space: nowrap;
}

.sidebar .nav-link-toggle {
    background: transparent;
    border: 0;
    width: 100%;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: rgba(96, 165, 250, 0.14);
    color: #fff;
}

.sidebar-submenu {
    display: grid;
    gap: 0.2rem;
    margin-left: 0.85rem;
    padding-left: 0.65rem;
    border-left: 1px solid rgba(219, 229, 244, 0.16);
}

html.sidebar-collapsed .app-shell {
    grid-template-columns: 74px 1fr;
}

html.sidebar-collapsed .sidebar {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

html.sidebar-collapsed .sidebar-brand,
html.sidebar-collapsed .sidebar-section-label,
html.sidebar-collapsed .nav-link-label,
html.sidebar-collapsed .sidebar-submenu {
    display: none;
}

html.sidebar-collapsed .sidebar .nav-link,
html.sidebar-collapsed .sidebar .nav-link-toggle {
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

html.sidebar-collapsed .sidebar-header {
    justify-content: center;
}

html.sidebar-collapsed .sidebar-collapse-toggle {
    width: 100%;
}

.sidebar-submenu .nav-link {
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
}

.sidebar-submenu-deep {
    margin-left: 0.75rem;
}

.sidebar .nav-link.disabled {
    opacity: 0.56;
}

.content-area {
    padding: 2rem;
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
        grid-template-columns: none;
    }

    .sidebar {
        position: fixed;
        top: var(--app-topbar-height);
        left: 0;
        width: min(84vw, 320px);
        height: calc(100vh - var(--app-topbar-height));
        z-index: 1031;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
    }

    html.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    html.sidebar-mobile-open .app-sidebar-mobile-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    html.sidebar-mobile-open body {
        overflow: hidden;
    }

    .content-area {
        padding: 1.15rem;
    }

    html.sidebar-collapsed .app-shell {
        grid-template-columns: 1fr;
    }

    html.sidebar-collapsed .sidebar {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    html.sidebar-collapsed .sidebar-brand,
    html.sidebar-collapsed .sidebar-section-label,
    html.sidebar-collapsed .nav-link-label,
    html.sidebar-collapsed .sidebar-submenu {
        display: initial;
    }

    html.sidebar-collapsed .sidebar .nav-link,
    html.sidebar-collapsed .sidebar .nav-link-toggle {
        justify-content: flex-start;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    html.sidebar-collapsed .sidebar-header {
        justify-content: space-between;
    }

    html.sidebar-collapsed .sidebar-collapse-toggle {
        width: auto;
    }
}

.table,
.form-control,
.form-select,
.btn,
.small,
.form-label,
.nav-link,
.dropdown-item {
    font-size: 0.89rem;
}

.sidebar .nav-link,
.sidebar-submenu .nav-link,
.app-topbar-brand,
.app-topbar-user,
.app-topbar-theme,
.app-topbar-user-menu .dropdown-item {
    font-size: inherit;
}

.content-header h1,
.auth-brand h1 {
    font-weight: 700;
}

.text-secondary {
    color: var(--app-text-soft) !important;
}

.metric-card {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    padding: 1rem;
    height: 100%;
}

.acl-page .nav-tabs {
    border-bottom-color: var(--app-border);
}

.acl-row {
    cursor: pointer;
}

.acl-row.table-active > * {
    background-color: color-mix(in srgb, var(--app-primary) 14%, var(--app-surface));
}

.opportunita-row {
    cursor: pointer;
}

.opportunita-row:hover > * {
    background-color: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
}

.acl-editor {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--app-surface-alt);
}

.acl-member-list {
    display: grid;
    gap: 0.5rem;
    max-height: 220px;
    overflow: auto;
}

.acl-member-item {
    border: 1px solid var(--app-border);
    border-radius: 0.75rem;
    padding: 0.65rem 0.8rem;
    background: var(--app-surface);
}

.acl-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.acl-status-badge {
    min-width: 82px;
    text-align: center;
}

.acl-sync-report {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--app-surface-alt);
}

.acl-sync-skipped {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.acl-sync-skipped .badge {
    font-weight: 500;
}

.modal-xl {
    max-width: 1140px;
}

#tabAnagraficheCommerciali .btn {
    white-space: nowrap;
}

.contact-badge {
    min-width: 2.5rem;
    font-weight: 600;
}

.opportunita-map {
    width: 100%;
    height: 320px;
    border-radius: 0.75rem;
    overflow: hidden;
}

.coverage-check-request-modal {
    max-height: calc(100vh - 2rem);
}

.coverage-check-request-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 2rem);
}

.coverage-check-request-modal .modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 11rem);
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.coverage-check-diary-entry {
    background: color-mix(in srgb, var(--app-surface) 92%, var(--app-surface-alt));
}

.coverage-check-diary-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.coverage-check-diary-content > :last-child {
    margin-bottom: 0;
}

.note-editor.note-frame.fullscreen {
    z-index: 2000;
    background: var(--app-surface);
}

.note-editor.note-frame.fullscreen .note-editing-area,
.note-editor.note-frame.fullscreen .note-editable,
.note-editor.note-frame.fullscreen .note-toolbar,
.note-editor.note-frame.fullscreen .note-statusbar {
    background: var(--app-surface);
}

.opportunita-dropzone {
    border: 2px dashed color-mix(in srgb, var(--app-primary) 45%, var(--app-border));
    border-radius: 0.85rem;
    min-height: 220px;
    padding: 1rem;
    background: linear-gradient(180deg, color-mix(in srgb, var(--app-primary) 10%, var(--app-surface-alt)), var(--app-surface-alt));
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.opportunita-dropzone-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    border-radius: 0.65rem;
    padding: 1.5rem;
    background: color-mix(in srgb, var(--app-surface) 65%, transparent);
}

.opportunita-dropzone.is-dragover {
    border-color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 18%, var(--app-surface-alt));
    transform: translateY(-1px);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--app-primary) 18%, transparent);
}

.opportunita-dropzone:hover {
    border-color: color-mix(in srgb, var(--app-primary) 70%, var(--app-border));
    background: color-mix(in srgb, var(--app-primary) 14%, var(--app-surface-alt));
}

.opportunita-dropzone-icon {
    font-size: 2.5rem;
    color: var(--app-primary);
}

.opportunita-dropzone-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-text);
}

.opportunita-dropzone-text {
    font-size: 0.88rem;
    color: var(--app-text-soft);
    max-width: 22rem;
}

.invalid-feedback {
    font-size: 0.82rem;
}

#ac-form-errors {
    font-size: 0.88rem;
}

.acl-permission-cell {
    min-width: 160px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background-color: var(--app-surface);
    color: var(--app-text);
    border: 1px solid var(--app-border);
    border-radius: 0.5rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--app-text-soft);
}

.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_length {
    display: none;
}

.dt-buttons {
    margin-bottom: 0.75rem;
}

.page-link {
    color: var(--app-text);
    background-color: var(--app-surface);
    border-color: var(--app-border);
}

.active > .page-link,
.page-link.active {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

.metric-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--app-text-soft);
    font-size: 0.85rem;
}

.dashboard-checklist li {
    padding: 0.65rem 0 0.65rem 1.6rem;
    position: relative;
    border-bottom: 1px solid var(--app-border);
}

.dashboard-checklist li:last-child {
    border-bottom: 0;
}

.dashboard-checklist li::before {
    content: '';
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--app-primary);
    position: absolute;
    left: 0;
    top: 1rem;
}

.select2-container--bootstrap-5 .select2-selection {
    background-color: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection__placeholder {
    color: var(--app-text) !important;
}

.select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

.select2-container--bootstrap-5 .select2-search input,
.select2-container--bootstrap-5 .select2-search textarea {
    background-color: var(--app-surface);
    color: var(--app-text);
    border-color: var(--app-border);
}

.select2-container--bootstrap-5 .select2-results__option {
    color: var(--app-text);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: color-mix(in srgb, var(--app-primary) 65%, transparent);
    color: #fff;
}

.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: var(--app-surface-alt);
}

.form-control,
.form-select,
.input-group-text,
.btn-outline-secondary,
.modal-content,
.nav-tabs {
    border-color: var(--app-border);
}

.form-control,
.form-select,
.input-group-text {
    background-color: var(--app-surface);
    color: var(--app-text);
}

.form-control:focus,
.form-select:focus {
    border-color: color-mix(in srgb, var(--app-primary) 55%, white 45%);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--app-primary) 18%, transparent);
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
        grid-template-columns: none;
    }

    .sidebar {
        position: fixed;
        top: var(--app-topbar-height);
        left: 0;
        width: min(84vw, 320px);
        height: calc(100vh - var(--app-topbar-height));
        max-height: calc(100vh - var(--app-topbar-height));
        overflow-y: auto;
        border-right: 1px solid rgba(148, 163, 184, 0.12);
        border-bottom: 0;
        z-index: 1031;
        transform: translateX(-100%);
    }

    .content-area {
        padding: 1.25rem;
    }

    .app-topbar-content {
        padding: 0 1rem;
    }

    html.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

}
