:root {
    --app-bg: #101317;
    --app-bg-soft: #151a20;
    --app-border: rgba(117, 183, 152, 0.22);
    --app-green: #198754;
    --app-green-soft: #75b798;
    --app-text: #f8f9fa;
    --app-muted: #adb5bd;
}

/* BASE */
html {
    min-height: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--app-bg);
    color: var(--app-text);
}

img {
    max-width: 100%;
}

/* HEADER E NAVBAR */
.site-header {
    background: rgba(8, 10, 12, 0.97);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1030;
}

    .site-header .navbar {
        min-height: 68px;
        padding-block: 0.65rem;
        background: transparent;
    }

.site-logo {
    display: block;
    width: auto;
    height: 44px;
    max-width: 190px;
    object-fit: contain;
}

.navbar-toggler {
    padding: 0.45rem 0.55rem;
    border-color: rgba(117, 183, 152, 0.4);
    box-shadow: none;
}

    .navbar-toggler:focus {
        border-color: var(--app-green-soft);
        box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.2);
    }

.navbar .nav-link {
    color: rgba(248, 249, 250, 0.78);
    border-radius: 0.6rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

    .navbar .nav-link:hover,
    .navbar .nav-link:focus {
        color: var(--app-green-soft);
        background: rgba(117, 183, 152, 0.08);
    }

/* Pulsante utente */
.user-menu-button {
    display: flex;
    align-items: center;
    max-width: 260px;
    min-height: 38px;
}

.user-menu-name {
    display: inline-block;
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Menu utente */
.site-header .dropdown-menu {
    min-width: 240px;
    padding: 0.5rem;
    background: #151a20;
    border: 1px solid var(--app-border);
    border-radius: 0.8rem;
}

.site-header .dropdown-item {
    padding: 0.65rem 0.75rem;
    color: rgba(248, 249, 250, 0.85);
    border-radius: 0.5rem;
}

    .site-header .dropdown-item:hover,
    .site-header .dropdown-item:focus {
        color: #fff;
        background: rgba(117, 183, 152, 0.1);
    }

    .site-header .dropdown-item.text-danger:hover,
    .site-header .dropdown-item.text-danger:focus {
        background: rgba(220, 53, 69, 0.12);
    }

.site-header .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

/* TABLET E SMARTPHONE */
@media (max-width: 991.98px) {
    html {
        scroll-padding-top: 85px;
    }

    .site-header .navbar {
        min-height: 64px;
    }

    .site-logo {
        height: 40px;
        max-width: 150px;
    }

    .site-header .navbar-collapse {
        margin-top: 0.7rem;
        padding: 0.7rem;
        background: rgba(15, 18, 22, 0.98);
        border: 1px solid var(--app-border);
        border-radius: 0.9rem;
        box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.35);
    }

    .site-header .navbar-nav {
        gap: 0.25rem;
        padding-bottom: 0;
    }

    .site-header .nav-link {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 0.75rem 0.85rem;
    }

    .site-header .nav-item {
        width: 100%;
    }

        .site-header .nav-item > .btn {
            width: 100%;
        }

    .site-header .user-menu-button {
        width: 100%;
        max-width: none;
        justify-content: flex-start;
        margin-top: 0.35rem;
        padding: 0.75rem 0.85rem;
    }

    .site-header .user-menu-name {
        max-width: calc(100vw - 155px);
    }

    .site-header .dropdown-item {
        white-space: normal;
    }

        .site-header .dropdown-item form,
        .site-header .dropdown-item button {
            width: 100%;
        }
}

.mobile-user-panel {
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--app-border);
    border-radius: 0.8rem;
}

    .mobile-user-panel form {
        width: 100%;
    }

/* SMARTPHONE */
@media (max-width: 575.98px) {
    html {
        scroll-padding-top: 80px;
    }

    .site-header .navbar {
        min-height: 60px;
        padding-block: 0.45rem;
    }

    .site-logo {
        height: 35px;
        max-width: 130px;
    }

    .navbar-toggler {
        padding: 0.35rem 0.45rem;
    }

    .site-header .navbar-collapse {
        margin-top: 0.5rem;
        padding: 0.55rem;
        border-radius: 0.75rem;
    }

    .site-header .nav-link {
        padding: 0.7rem 0.75rem;
    }

    .site-header .user-menu-button {
        padding: 0.7rem 0.75rem;
    }

    .site-header .user-menu-name {
        max-width: calc(100vw - 140px);
    }

    .site-header .dropdown-menu {
        padding: 0.4rem;
    }
}

/* SMARTPHONE MOLTO PICCOLI */
@media (max-width: 380px) {
    .site-logo {
        height: 32px;
        max-width: 115px;
    }

    .site-header .navbar-collapse {
        padding: 0.45rem;
    }

    .site-header .user-menu-name {
        max-width: 170px;
    }
}

/* FOOTER */
.site-footer {
    background: #080a0c;
    border-top: 1px solid var(--app-border);
}

    .site-footer a {
        color: var(--app-muted);
    }

        .site-footer a:hover {
            color: var(--app-green-soft);
        }

/* SEZIONI */
.app-main {
    background: radial-gradient( circle at 15% 10%, rgba(25, 135, 84, 0.2), transparent 28% ), linear-gradient(180deg, #101317, #0d1013);
}

.section-soft {
    background: var(--app-bg-soft);
}

.section-dark {
    background: #0d1013;
}

/* CARD */
.app-card {
    background: var(--app-bg-soft);
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

    .app-card:hover {
        transform: translateY(-3px);
        border-color: rgba(117, 183, 152, 0.45);
    }

/* FORM */
.form-control,
.form-select,
textarea {
    background: #10151a;
    color: var(--app-text);
    border-color: #343a40;
}

    .form-control:focus,
    .form-select:focus,
    textarea:focus {
        background: #111820;
        color: #fff;
        border-color: var(--app-green-soft);
        box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.2);
    }

    .form-control::placeholder,
    textarea::placeholder {
        color: #8f98a3;
    }

/* ELEMENTI COMUNI */
.text-secondary,
.text-muted {
    color: var(--app-muted) !important;
}

.link-success {
    color: var(--app-green-soft) !important;
}

    .link-success:hover {
        color: #a3cfbb !important;
    }

.field-validation-error {
    color: #ff6b6b;
}

/* LISTA PAESI */
.zone-list {
    display: grid;
    gap: 0.75rem;
}

.zone-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    background: rgba(16, 21, 26, 0.75);
    border: 1px solid rgba(117, 183, 152, 0.28);
    border-radius: 0.9rem;
}

.zone-card-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    color: var(--app-green-soft);
    background: rgba(25, 135, 84, 0.14);
    border-radius: 50%;
}

.zone-card-content {
    display: flex;
    flex-direction: column;
}

.zone-card-name {
    font-weight: 600;
}

.zone-card-content small {
    color: var(--app-muted);
}

/* SMARTPHONE: PAESI COMPATTI AFFIANCATI */
@media (max-width: 575.98px) {
    .zone-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .zone-card {
        display: inline-flex;
        width: auto;
        gap: 0.4rem;
        padding: 0.45rem 0.65rem;
        border-radius: 999px;
    }

    .zone-card-icon {
        width: auto;
        height: auto;
        background: transparent;
        font-size: 0.8rem;
    }

    .zone-card-content {
        display: block;
    }

    .zone-card-name {
        font-size: 0.85rem;
        line-height: 1;
        white-space: nowrap;
    }

    .zone-card-content small {
        display: none;
    }
}

/* FLATPICKER */
#dateSelect {
    background-color: #212529;
    color: #f8f9fa;
    border-color: #6c757d;
}

    #dateSelect:focus {
        background-color: #212529;
        color: #fff;
        border-color: #ffc107;
        box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
    }

    #dateSelect::placeholder {
        color: #adb5bd;
    }