:root {
    --bs-primary:           #5bc4f1;
    --bs-primary-rgb:       91, 196, 241;
    --bs-primary-bg-subtle: #daf2fc;
    --bs-link-color:        #5bc4f1;
    --bs-link-hover-color:  #2daede;

    --bs-info:           #5bc4f1;
    --bs-info-rgb:       91, 196, 241;
    --bs-info-bg-subtle: #daf2fc;
}

/* btn-primary solid */
.btn-primary {
    --bs-btn-color:              #fff;
    --bs-btn-bg:                 #5bc4f1;
    --bs-btn-border-color:       #5bc4f1;
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           #2daede;
    --bs-btn-hover-border-color: #2daede;
    --bs-btn-active-bg:          #1f9dc8;
    --bs-btn-active-border-color:#1f9dc8;
    --bs-btn-focus-shadow-rgb:   91, 196, 241;
    --bs-btn-disabled-bg:        #5bc4f1;
    --bs-btn-disabled-border-color: #5bc4f1;
}

/* btn-outline-primary */
.btn-outline-primary {
    --bs-btn-color:              #5bc4f1;
    --bs-btn-border-color:       #5bc4f1;
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           #5bc4f1;
    --bs-btn-hover-border-color: #5bc4f1;
    --bs-btn-active-bg:          #2daede;
    --bs-btn-active-border-color:#2daede;
    --bs-btn-focus-shadow-rgb:   91, 196, 241;
}

/* btn-info solid */
.btn-info {
    --bs-btn-color:              #fff;
    --bs-btn-bg:                 #5bc4f1;
    --bs-btn-border-color:       #5bc4f1;
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           #2daede;
    --bs-btn-hover-border-color: #2daede;
    --bs-btn-active-bg:          #1f9dc8;
    --bs-btn-active-border-color:#1f9dc8;
    --bs-btn-focus-shadow-rgb:   91, 196, 241;
}

/* btn-outline-info */
.btn-outline-info {
    --bs-btn-color:              #5bc4f1;
    --bs-btn-border-color:       #5bc4f1;
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           #5bc4f1;
    --bs-btn-hover-border-color: #5bc4f1;
    --bs-btn-active-bg:          #2daede;
    --bs-btn-active-border-color:#2daede;
    --bs-btn-focus-shadow-rgb:   91, 196, 241;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Home carousel */
.carousel-home {
    height: 300px;
}
@media (min-width: 576px) {
    .carousel-home { height: 420px; }
}
@media (min-width: 992px) {
    .carousel-home { height: 600px; }
}

.carousel-home .carousel-item,
.carousel-home .carousel-item img {
    height: 100%;
}
.carousel-home .carousel-item img {
    width: 100%;
    object-fit: cover;
    object-position: center;
}

/* Navbar logo — same height public + admin */
.navbar-logo {
    height: 60px;
    width: auto;
}

/* Navbar user badge */
.navbar-user-badge {
    font-size: .82rem;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

/* Footer: il tema usa margin-top:50px su .footer-copyright che collassa
   in un flex container — sostituiamo con padding sul .page-footer */
.page-footer {
    margin-top: auto;
}
.page-footer .footer-copyright {
    margin-top: 0;
    padding-top: 12px;
    padding-bottom: 12px;
}

/* ── Admin layout ─────────────────────────────────── */
body.admin-body {
    background-color: #f4f6f9;
}


/* Dashboard action cards */
.admin-action-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
}
.admin-action-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,.14);
    transform: translateY(-2px);
}
.admin-action-card .card-body {
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.admin-action-card .icon-wrap {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0;
}
.admin-action-card .card-title {
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 0;
}

/* Live counter badges */
.live-counter {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Section panels inside admin */
.admin-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.admin-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid #e9ecef;
}

/* jqGrid pager icons — replace invisible sprite icons with text glyphs */
.ui-jqgrid .ui-pg-button .ui-icon {
    background-image: none !important;
    text-indent: 0 !important;
    overflow: visible !important;
    font-size: .8rem;
    color: #495057;
    font-family: "FontAwesome";
}
.ui-jqgrid .ui-pg-button .ui-icon::before { content: ''; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-seek-first::before  { content: '\f049'; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-seek-prev::before   { content: '\f048'; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-seek-next::before   { content: '\f051'; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-seek-end::before    { content: '\f050'; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-refresh::before     { content: '\f021'; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-plus::before        { content: '\f067'; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-trash::before       { content: '\f1f8'; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-pencil::before      { content: '\f040'; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-search::before      { content: '\f002'; }
.ui-jqgrid .ui-pg-button .ui-icon.ui-icon-disk::before        { content: '\f0c7'; }

/* jqGrid tweaks */
.ui-jqgrid-view,
.ui-jqgrid .ui-jqgrid-bdiv,
.ui-jqgrid .ui-jqgrid-hdiv {
    width: 100% !important;
}
/* Su desktop nasconde la scrollbar orizzontale (la tabella si adatta);
   su mobile lascia scorrere orizzontalmente se le colonne non ci stanno */
.jqgrid-wrap {
    overflow-x: auto;
}
@media (min-width: 992px) {
    .jqgrid-wrap .ui-jqgrid,
    .jqgrid-wrap .ui-jqgrid-bdiv {
        overflow-x: hidden !important;
    }
}
.ui-jqgrid .ui-jqgrid-htable,
.ui-jqgrid .ui-jqgrid-btable {
    width: 100% !important;
}
.ui-jqgrid .ui-jqgrid-htable th {
    background: #343a40 !important;
    color: #fff !important;
    font-size: .75rem;
    letter-spacing: .02em;
    padding: 6px 4px !important;
}
.ui-jqgrid .ui-jqgrid-btable td {
    font-size: .78rem;
    padding: 5px 4px !important;
    vertical-align: middle !important;
}
.ui-jqgrid tr.jqgrow:hover td {
    background: #f0f4ff !important;
}
.ui-jqgrid tr.jqgrow:nth-child(even) td {
    background: #f8f9fa;
}
.ui-jqgrid tr.jqgrow:nth-child(even):hover td {
    background: #f0f4ff !important;
}
.ui-jqgrid .ui-pg-table {
    font-size: .82rem;
}

/* ── Select2 — colori primary del sito ───────────────────────────────── */
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #5bc4f1;
    box-shadow: 0 0 0 .25rem rgba(91, 196, 241, .25);
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--highlighted {
    background-color: #5bc4f1;
    color: #fff;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected,
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) {
    background-color: #2daede;
    color: #fff;
}

/* Badge stato tessera */
.badge-tessera {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-tessera-ok {
    background: #d1fae5;
    color: #065f46;
}
.badge-tessera-ko {
    background: #fef3c7;
    color: #92400e;
}

/* Colonna 1/5 per le action card */
@media (min-width: 1200px) {
    .col-xl-5th {
        flex: 0 0 auto;
        width: 20%;
    }
}

.btn i {
    margin-right: 0 !important;
    vertical-align: middle;
    line-height: 1;
}
