/* set the background color of many elements across the grid */
body {
    background-color: #d2d2d6 !important;
}

.navbar.bg-light {
    color: #d2d2d6 !important;
}

.offcanvas-body i {
    margin-right: 5px;
}

#download-template {
    font-size: xx-large;
}

#download-template label {
    font-size: medium;
}

img[src*="#thumbnail"] {
    width: 20px;
    height: 20px;
}

img[alt=Observed_table] {
    width: 80%;
}

/* =========================
   VARIABILI COMUNI
   ========================= */

:root {
    --shell-width: 80%;
    --shell-left: 10%;
    --bar-height: 86px;
    --footer-height: 58px;
    --bar-padding-x: 14px;
    --bar-gradient: linear-gradient(180deg, #6f8db4 0%, #5f7da5 45%, #4e6991 100%);
    --bar-border-strong: rgba(25, 53, 88, 0.35);
    --bar-highlight: rgba(255,255,255,0.08);
    --bar-highlight-soft: rgba(255,255,255,0.10);
    --bar-text: rgba(255,255,255,0.96);
    --bar-text-soft: rgba(255,255,255,0.95);
    --btn-gradient: linear-gradient(
        180deg,
        rgba(120, 149, 187, 0.55) 0%,
        rgba(85, 112, 146, 0.78) 100%
    );
}


/* wrapper principale app */
.app-shell {
    width: var(--shell-width);
    position: absolute;
    left: var(--shell-left);
    top: 0%;
    padding-bottom: 108px;
    box-sizing: border-box;
}


/* navbar confinata al wrapper 80% */
.custom-navbar {
    width: 100% !important;
    max-width: 100% !important;
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--bar-gradient);
    min-height: var(--bar-height);
    padding: 0 var(--bar-padding-x);
    overflow: visible !important;
    box-shadow: inset 0 -1px 0 var(--bar-highlight);
}

/* evita che il contenuto finisca sotto la navbar */
.page-shell {
    margin-top: 16px;
}

/* se vuoi più spazio sotto la navbar */
@media (min-width: 768px) {
    .page-shell {
        margin-top: 20px;
    }
}

/* layout interno navbar */
.custom-navbar .container,
.custom-navbar .container-fluid,
.custom-navbar .row {
    overflow: visible !important;
}

.minw-0 {
    min-width: 0 !important;
}

.app-title {
    color: #FDFAF9 !important;
    font-size: 40px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    margin: 0 !important;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    white-space: nowrap;
}

/* bottoni */
.nav-btn.btn {
    width: 42px;
    min-width: 42px;
    height: 36px;
    padding: 0 !important;
    border-radius: 6px !important;
    line-height: 1 !important;
    font-size: 16px !important;
    border: 1px solid var(--bar-border-strong) !important;
    color: var(--bar-text-soft) !important;
    background: var(--btn-gradient) !important;
    box-shadow:
        inset 0 1px 0 var(--bar-highlight-soft),
        0 1px 2px rgba(0,0,0,0.15) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.custom-navbar .row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-side {
    flex: 0 0 220px;
    max-width: 220px;
}

.nav-side-left {
    justify-content: flex-start;
}

.nav-side-right {
    justify-content: flex-end;
}

.nav-center {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* dropdown lang */
.lang-menu,
.lang-menu.dropdown,
.lang-menu.btn-group {
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    display: inline-block !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.lang-toggle.btn {
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    height: 36px !important;
    padding: 0 12px !important;
    border-radius: 6px !important;
    line-height: 1 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border: 1px solid var(--bar-border-strong) !important;
    color: var(--bar-text) !important;
    background: var(--btn-gradient) !important;
    box-shadow:
        inset 0 1px 0 var(--bar-highlight-soft),
        0 1px 2px rgba(0,0,0,0.15) !important;
}

.lang-menu .dropdown-menu {
    background: #55729a !important;
    border: 1px solid var(--bar-border-strong) !important;
    border-radius: 8px !important;
    overflow: hidden;
    margin-top: 6px !important;
    min-width: 88px !important;
}

.lang-menu .dropdown-item {
    color: #fff !important;
    background: #55729a !important;
}

.lang-menu .dropdown-item:hover,
.lang-menu .dropdown-item:focus {
    background: #6b88b0 !important;
    color: #fff !important;
}
/* =========================
   FOOTER FISSO CENTRALE
   VERSIONE PULITA
   ========================= */
.app-shell {
    padding-bottom: 82px;
}

.app-footer {
    position: fixed;
    bottom: 0;
    left: var(--shell-left);
    width: var(--shell-width);
    height: var(--footer-height);
    min-height: var(--footer-height);
    background: var(--bar-gradient);
    border-top: 1px solid var(--bar-border-strong);
    box-shadow: inset 0 1px 0 var(--bar-highlight);
    z-index: 1000;
}

.app-footer-inner {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    box-sizing: border-box;
    flex-wrap: nowrap;
    overflow: visible;
}

/* azioni footer tutte uguali */
.app-footer .footer-action,
.app-footer .footer-action:link,
.app-footer .footer-action:visited,
.app-footer .footer-action:active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 34px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--bar-border-strong);
    background: var(--btn-gradient);
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    box-shadow:
        inset 0 1px 0 var(--bar-highlight-soft),
        0 1px 2px rgba(0,0,0,0.15);
    transition:
        transform 0.16s ease,
        filter 0.16s ease,
        box-shadow 0.16s ease;
}

.app-footer .footer-action:hover,
.app-footer .footer-action:focus {
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.14),
        0 2px 4px rgba(0,0,0,0.18);
}

.app-footer .footer-action-icon,
.app-footer .footer-action-text,
.app-footer .footer-action i,
.app-footer .footer-action span {
    color: #ffffff !important;
    fill: #ffffff !important;
    opacity: 1 !important;
}

.footer-action-icon {
    font-size: 15px;
    line-height: 1;
}

.footer-action-text {
    line-height: 1;
    white-space: nowrap;
}

/* su mobile */
@media (max-width: 900px) {
    :root {
        --shell-width: 94%;
        --shell-left: 3%;
        --footer-height: 54px;
    }

    .app-shell {
        width: var(--shell-width);
        left: var(--shell-left);
        top: 8%;
        padding-bottom: 78px;
    }

    .app-footer {
        left: var(--shell-left);
        width: var(--shell-width);
    }

    .app-footer-inner {
        justify-content: center;
        gap: 8px;
        padding: 0 8px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .app-footer .footer-action {
        height: 32px;
        min-height: 32px;
        padding: 0 10px;
        font-size: 12px;
    }

    .footer-action-icon {
        font-size: 14px;
    }
}
