/* ===== TOTOSCORE — base framework (sostituisce Bootstrap) ==================
   Grid + utilities + componenti, valori coerenti con Bootstrap 5 ma con
   l'identità TOTOSCORE. Caricato PRIMA di app.css. Nessuna dipendenza esterna.
   ========================================================================= */
:root {
    --tm-green-950: #04231a; --tm-green-900: #062a20; --tm-green-800: #0a3a2c;
    --tm-green-700: #0e4d39; --tm-green-600: #12805a; --tm-mint: #46e0a0;
    --tm-ink: #0b1f18; --tm-muted: #5b6f66; --tm-card-border: #cfded5;
    --tm-danger: #c5362f; --tm-warning: #e0a008; --tm-info: #2b8a9e;
    --tm-secondary: #6c7a72;
}

*, *::before, *::after { box-sizing: border-box; }

/* L'attributo hidden deve vincere sempre: senza questa regola un elemento con
   display impostato da una classe (es. .btn { display: inline-flex }) resta visibile. */
[hidden] { display: none !important; }

/* ── Container ────────────────────────────────────────────────────────── */
.container { width: 100%; padding-right: .75rem; padding-left: .75rem; margin-right: auto; margin-left: auto; }
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

/* ── Grid ────────────────────────────────────────────────────────────── */
.row { --tm-gx: 1.5rem; --tm-gy: 0rem; display: flex; flex-wrap: wrap;
    margin-top: calc(-1 * var(--tm-gy)); margin-right: calc(-.5 * var(--tm-gx)); margin-left: calc(-.5 * var(--tm-gx)); }
.row > * { flex-shrink: 0; width: 100%; max-width: 100%;
    padding-right: calc(var(--tm-gx) * .5); padding-left: calc(var(--tm-gx) * .5); margin-top: var(--tm-gy); }
.g-0 { --tm-gx: 0; --tm-gy: 0; }
.g-1 { --tm-gx: .25rem; --tm-gy: .25rem; }
.g-2 { --tm-gx: .5rem; --tm-gy: .5rem; }
.g-3 { --tm-gx: 1rem; --tm-gy: 1rem; }
.g-4 { --tm-gx: 1.5rem; --tm-gy: 1.5rem; }
.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { width: 8.3333%; } .col-2 { width: 16.6667%; } .col-3 { width: 25%; }
.col-4 { width: 33.3333%; } .col-5 { width: 41.6667%; } .col-6 { width: 50%; }
.col-7 { width: 58.3333%; } .col-8 { width: 66.6667%; } .col-9 { width: 75%; }
.col-10 { width: 83.3333%; } .col-11 { width: 91.6667%; } .col-12 { width: 100%; }
@media (min-width: 576px) {
    .col-sm { flex: 1 0 0%; } .col-sm-auto { flex: 0 0 auto; width: auto; }
    .col-sm-3 { width: 25%; } .col-sm-4 { width: 33.3333%; } .col-sm-6 { width: 50%; }
    .col-sm-12 { width: 100%; }
}
@media (min-width: 768px) {
    .col-md { flex: 1 0 0%; } .col-md-auto { flex: 0 0 auto; width: auto; }
    .col-md-1 { width: 8.3333%; } .col-md-2 { width: 16.6667%; } .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.3333%; } .col-md-5 { width: 41.6667%; } .col-md-6 { width: 50%; }
    .col-md-7 { width: 58.3333%; } .col-md-8 { width: 66.6667%; } .col-md-9 { width: 75%; }
    .col-md-10 { width: 83.3333%; } .col-md-11 { width: 91.6667%; } .col-md-12 { width: 100%; }
}
@media (min-width: 992px) {
    .col-lg { flex: 1 0 0%; } .col-lg-auto { flex: 0 0 auto; width: auto; }
    .col-lg-1 { width: 8.3333%; } .col-lg-2 { width: 16.6667%; } .col-lg-3 { width: 25%; }
    .col-lg-4 { width: 33.3333%; } .col-lg-5 { width: 41.6667%; } .col-lg-6 { width: 50%; }
    .col-lg-7 { width: 58.3333%; } .col-lg-8 { width: 66.6667%; } .col-lg-9 { width: 75%; }
    .col-lg-10 { width: 83.3333%; } .col-lg-11 { width: 91.6667%; } .col-lg-12 { width: 100%; }
}

/* ── Display ─────────────────────────────────────────────────────────── */
.d-none { display: none !important; } .d-block { display: block !important; }
.d-inline { display: inline !important; } .d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; } .d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }
@media (min-width: 576px) {
    .d-sm-none { display: none !important; } .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; } .d-sm-inline-flex { display: inline-flex !important; }
    .d-sm-table-cell { display: table-cell !important; }
}
@media (min-width: 768px) {
    .d-md-none { display: none !important; } .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; } .d-md-table-cell { display: table-cell !important; }
}
@media (min-width: 992px) {
    .d-lg-none { display: none !important; } .d-lg-block { display: block !important; } .d-lg-flex { display: flex !important; }
}

/* ── Flex ────────────────────────────────────────────────────────────── */
.flex-row { flex-direction: row !important; } .flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; } .flex-nowrap { flex-wrap: nowrap !important; }
.flex-fill { flex: 1 1 auto !important; } .flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-stretch { align-items: stretch !important; }
.align-self-center { align-self: center !important; }
.gap-0 { gap: 0 !important; } .gap-1 { gap: .25rem !important; } .gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; } .gap-4 { gap: 1.5rem !important; }

/* ── Spacing (0=0,1=.25,2=.5,3=1,4=1.5,5=3rem) ───────────────────────── */
.m-0{margin:0!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-3{margin:1rem!important}.m-4{margin:1.5rem!important}.m-5{margin:3rem!important}.m-auto{margin:auto!important}
.mt-0{margin-top:0!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-3{margin-top:1rem!important}.mt-4{margin-top:1.5rem!important}.mt-5{margin-top:3rem!important}.mt-auto{margin-top:auto!important}
.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mb-5{margin-bottom:3rem!important}.mb-auto{margin-bottom:auto!important}
.ms-0{margin-left:0!important}.ms-1{margin-left:.25rem!important}.ms-2{margin-left:.5rem!important}.ms-3{margin-left:1rem!important}.ms-auto{margin-left:auto!important}
.me-0{margin-right:0!important}.me-1{margin-right:.25rem!important}.me-2{margin-right:.5rem!important}.me-3{margin-right:1rem!important}.me-auto{margin-right:auto!important}
.mx-auto{margin-left:auto!important;margin-right:auto!important}.mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-2{margin-left:.5rem!important;margin-right:.5rem!important}
.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}
.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.p-3{padding:1rem!important}.p-4{padding:1.5rem!important}
.pt-0{padding-top:0!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-3{padding-top:1rem!important}
.pb-0{padding-bottom:0!important}.pb-1{padding-bottom:.25rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:1rem!important}
.ps-0{padding-left:0!important}.ps-1{padding-left:.25rem!important}.ps-2{padding-left:.5rem!important}.ps-3{padding-left:1rem!important}
.pe-0{padding-right:0!important}.pe-1{padding-right:.25rem!important}.pe-2{padding-right:.5rem!important}.pe-3{padding-right:1rem!important}
.px-0{padding-left:0!important;padding-right:0!important}.px-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-3{padding-left:1rem!important;padding-right:1rem!important}
.py-0{padding-top:0!important;padding-bottom:0!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important}

/* ── Text ────────────────────────────────────────────────────────────── */
.text-start { text-align: left !important; } .text-center { text-align: center !important; } .text-end { text-align: right !important; }
@media (min-width: 768px) { .text-md-end { text-align: right !important; } }
.text-nowrap { white-space: nowrap !important; } .text-wrap { white-space: normal !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-uppercase { text-transform: uppercase !important; }
.text-decoration-none { text-decoration: none !important; }
.fw-light { font-weight: 300 !important; } .fw-normal { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; } .fw-bold { font-weight: 700 !important; }
.fst-italic { font-style: italic !important; }
.font-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; }
.lh-1 { line-height: 1 !important; }
.small { font-size: .875em; }
.fs-1 { font-size: 2.5rem !important; } .fs-2 { font-size: 2rem !important; } .fs-3 { font-size: 1.75rem !important; }
.fs-4 { font-size: 1.5rem !important; } .fs-5 { font-size: 1.25rem !important; } .fs-6 { font-size: 1rem !important; }
.text-muted { color: var(--tm-muted) !important; }
.text-dark { color: var(--tm-ink) !important; } .text-white { color: #fff !important; }
.text-primary { color: var(--tm-t-600) !important; } .text-success { color: var(--tm-t-600) !important; }
.text-danger { color: var(--tm-danger) !important; } .text-warning { color: var(--tm-warning) !important; }
.text-info { color: var(--tm-info) !important; } .text-secondary { color: var(--tm-secondary) !important; }

/* ── Sizing ──────────────────────────────────────────────────────────── */
.w-100 { width: 100% !important; } .w-auto { width: auto !important; } .h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; } .min-vh-100 { min-height: 100vh !important; }

/* ── Borders / rounded ───────────────────────────────────────────────── */
.border { border: 1px solid var(--tm-card-border) !important; }
.border-bottom { border-bottom: 1px solid var(--tm-card-border) !important; }
.border-top { border-top: 1px solid var(--tm-card-border) !important; }
.border-primary { border-color: var(--tm-green-600) !important; }
.border-success { border-color: var(--tm-green-600) !important; }
.rounded { border-radius: .5rem !important; } .rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: 999px !important; }

/* ── Backgrounds ─────────────────────────────────────────────────────── */
.bg-primary { background-color: var(--tm-green-700) !important; color: #fff; }
.bg-success { background-color: var(--tm-green-600) !important; color: #fff; }
.bg-secondary { background-color: var(--tm-secondary) !important; color: #fff; }
.bg-warning { background-color: var(--tm-warning) !important; color: var(--tm-ink); }
.bg-danger { background-color: var(--tm-danger) !important; color: #fff; }
.bg-info { background-color: #d3edf2 !important; color: #0c5460; }
.bg-light { background-color: var(--tm-chip-tenue) !important; }
.bg-dark { background-color: var(--tm-green-900) !important; color: #fff; }
.bg-white { background-color: var(--tm-surface) !important; }

/* ── Position ────────────────────────────────────────────────────────── */
.position-relative { position: relative !important; } .position-absolute { position: absolute !important; } .position-fixed { position: fixed !important; }
.top-0 { top: 0 !important; } .bottom-0 { bottom: 0 !important; } .start-0 { left: 0 !important; } .end-0 { right: 0 !important; }
.start-100 { left: 100% !important; }
.translate-middle { transform: translate(-50%, -50%) !important; }

/* ── Headings ────────────────────────────────────────────────────────── */
.h1, .h2, .h3, .h4, .h5, .h6 { margin-bottom: .5rem; font-weight: 600; line-height: 1.2; }
.h1 { font-size: 2.25rem; } .h2 { font-size: 1.85rem; } .h3 { font-size: 1.6rem; }
.h4 { font-size: 1.35rem; } .h5 { font-size: 1.15rem; } .h6 { font-size: 1rem; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .5rem 1rem; font-size: .95rem; font-weight: 600; line-height: 1.5;
    border: 1.5px solid transparent; border-radius: 999px; cursor: pointer;
    text-decoration: none; background: transparent; color: var(--tm-ink);
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s;
    user-select: none; white-space: nowrap; vertical-align: middle;
}
.btn:focus, .btn:focus-visible { outline: 0; box-shadow: 0 0 0 .2rem rgba(18,128,90,.22); }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1.05rem; }
.btn-primary { background: var(--tm-green-700); border-color: var(--tm-green-700); color: #fff; }
.btn-primary:hover, .btn-primary:active { background: var(--tm-green-600); border-color: var(--tm-green-600); color: #fff; }
.btn-success { background: var(--tm-green-600); border-color: var(--tm-green-600); color: #fff; }
.btn-success:hover, .btn-success:active { background: var(--tm-green-700); border-color: var(--tm-green-700); color: #fff; }
.btn-warning { background: var(--tm-warning); border-color: var(--tm-warning); color: #2a2102; }
.btn-warning:hover, .btn-warning:active { filter: brightness(.95); color: #2a2102; }
.btn-link { border: 0; background: transparent; color: var(--tm-t-600); text-decoration: none; padding: .25rem .4rem; }
.btn-link:hover { text-decoration: underline; }
.btn-outline-primary { color: var(--tm-t-700); border-color: var(--tm-green-700); }
.btn-outline-primary:hover, .btn-outline-primary:active { background: var(--tm-green-700); color: #fff; }
.btn-outline-secondary { color: var(--tm-secondary); border-color: #c2cdc6; }
.btn-outline-secondary:hover, .btn-outline-secondary:active { background: var(--tm-secondary); border-color: var(--tm-secondary); color: #fff; }
.btn-outline-danger { color: var(--tm-danger); border-color: #e3a9a5; }
.btn-outline-danger:hover, .btn-outline-danger:active { background: var(--tm-danger); border-color: var(--tm-danger); color: #fff; }
.btn-outline-warning { color: #9a6f04; border-color: #e7cf8f; }
.btn-outline-warning:hover, .btn-outline-warning:active { background: var(--tm-warning); border-color: var(--tm-warning); color: #2a2102; }
.btn-outline-success { color: var(--tm-t-600); border-color: #9fd3bd; }
.btn-outline-success:hover, .btn-outline-success:active { background: var(--tm-green-600); border-color: var(--tm-green-600); color: #fff; }
/* btn-group */
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.btn-group > .btn:last-child { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.btn-group > .btn:not(:first-child) { margin-left: -1.5px; }
/* btn-check (radio nascosti) */
.btn-check { position: absolute; clip: rect(0,0,0,0); pointer-events: none; }
.btn-check:checked + .btn { background: var(--tm-green-700); border-color: var(--tm-green-700); color: #fff; }
/* close button (toast) */
.btn-close { width: 1em; height: 1em; padding: .25em; border: 0; border-radius: 6px; background: transparent; cursor: pointer; opacity: .6;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: center; background-size: .8em; }
.btn-close:hover { opacity: 1; }

/* ── Card ────────────────────────────────────────────────────────────── */
.card { position: relative; display: flex; flex-direction: column; min-width: 0;
    background: var(--tm-surface); border: 1px solid var(--tm-card-border); border-radius: 14px; box-shadow: 0 4px 14px -6px rgba(8,40,28,.12); }
.card-body { flex: 1 1 auto; padding: 1rem 1.1rem; }
.card-title { margin-bottom: .5rem; font-weight: 600; }
.card-header { padding: .7rem 1.1rem; background: var(--tm-surface); border-bottom: 1px solid var(--tm-card-border); font-weight: 600; border-radius: 14px 14px 0 0; }
.card-footer { padding: .7rem 1.1rem; background: var(--tm-surface); border-top: 1px solid var(--tm-card-border); border-radius: 0 0 14px 14px; }
.shadow-sm { box-shadow: 0 12px 32px -16px rgba(8,40,28,.32) !important; }

/* ── Table ───────────────────────────────────────────────────────────── */
.table { width: 100%; margin-bottom: 1rem; color: var(--tm-ink); border-collapse: collapse; vertical-align: top; }
.table > thead { background: var(--tm-chip-tenue); }
.table th, .table td { padding: .55rem .6rem; border-bottom: 1px solid var(--tm-card-border); text-align: left; }
.table > thead th { color: var(--tm-muted); font-weight: 600; }
.table-sm th, .table-sm td { padding: .3rem .45rem; }
.table-bordered, .table-bordered th, .table-bordered td { border: 1px solid var(--tm-card-border); }
.table-hover > tbody > tr:hover { background: var(--tm-chip-tenue); }
.table-light { background: var(--tm-chip-tenue); }
.table-primary, tr.table-primary > * { background: rgba(70,224,160,.16) !important; }
.align-middle, .align-middle th, .align-middle td { vertical-align: middle !important; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Tabella a filo card: l'ultima riga deve seguire gli angoli arrotondati,
   altrimenti una riga con sfondo (es. .table-primary per l'utente corrente)
   sborda con gli spigoli vivi e taglia la card. */
.card > .table:last-child > tbody > tr:last-child > td { border-bottom: 0; }
.card > .table:last-child > tbody > tr:last-child > td:first-child { border-bottom-left-radius: 13px; }
.card > .table:last-child > tbody > tr:last-child > td:last-child { border-bottom-right-radius: 13px; }

/* ── Badge ───────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .35em .6em; font-size: .75em; font-weight: 600; line-height: 1;
    text-align: center; vertical-align: baseline; border-radius: 999px; color: #fff; }
.badge.bg-light { color: var(--tm-ink); }
.badge.bg-warning { color: #2a2102; }

/* ── Alert ───────────────────────────────────────────────────────────── */
.alert { padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 12px; }
.alert-success { background: #e8f6ee; border-color: #bfe6cf; color: #0c5c3c; }
.alert-danger { background: #fdecea; border-color: #f3c7c4; color: #8f241f; }
.alert-info { background: #e7f4ee; border-color: #c9e7d8; color: #0c5c3c; }
.alert-warning { background: #fdf4e3; border-color: #f3e2b8; color: #7a5a06; }

/* ── Progress ────────────────────────────────────────────────────────── */
.progress { display: flex; height: 1rem; overflow: hidden; background: #e7efe9; border-radius: 999px; }
.progress-bar { display: flex; align-items: center; justify-content: center; color: #fff; font-size: .72rem; background: var(--tm-green-600); transition: width .4s ease; }
.progress-bar.bg-warning { color: #2a2102; }

/* ── List group ──────────────────────────────────────────────────────── */
.list-group { display: flex; flex-direction: column; border-radius: 12px; }
.list-group-item { position: relative; padding: .7rem 1rem; background: var(--tm-surface); border: 1px solid var(--tm-card-border); }
.list-group-item + .list-group-item { border-top-width: 0; }
.list-group-item:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.list-group-item:last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.list-group-flush > .list-group-item { border-right: 0; border-left: 0; border-radius: 0; }
.list-group-flush > .list-group-item:first-child { border-top: 0; }
/* senza questo l'ultimo elemento lascia un divisore sospeso sul fondo della card */
.list-group-flush > .list-group-item:last-child { border-bottom: 0; }
.list-group-item-action { cursor: pointer; color: inherit; text-decoration: none; display: block; }
.list-group-item-action:hover { background: var(--tm-chip-tenue); }
.list-group-item.active, .list-group-item-action.active { background: var(--tm-green-700); border-color: var(--tm-green-700); color: #fff; }
.list-group-item-primary { background: rgba(70,224,160,.16); }
/* liste flush dentro una card: arrotonda il primo/ultimo item ai bordi della card (es. Archivio) */
.card > .list-group:last-child > .list-group-item:last-child { border-bottom-left-radius: 13px; border-bottom-right-radius: 13px; }
.card > .list-group:first-child > .list-group-item:first-child { border-top-left-radius: 13px; border-top-right-radius: 13px; }
.list-unstyled { padding-left: 0; list-style: none; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.form-label { display: inline-block; margin-bottom: .4rem; font-weight: 500; }
.form-text { margin-top: .25rem; font-size: .85em; color: var(--tm-muted); }
.form-control, .form-select { display: block; width: 100%; padding: .55rem .8rem; font-size: .95rem; font-family: inherit;
    line-height: 1.5; color: var(--tm-ink); background: var(--tm-surface); border: 1.5px solid var(--tm-card-border); border-radius: 10px;
    transition: border-color .15s, box-shadow .15s; }
.form-control-sm { padding: .3rem .55rem; font-size: .85rem; border-radius: 8px; }
.form-control:focus, .form-select:focus { outline: 0; border-color: var(--tm-green-600); box-shadow: 0 0 0 .22rem rgba(18,128,90,.15); }
.form-control::placeholder { color: var(--tm-placeholder); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235b6f66' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right .7rem center; background-size: 14px; padding-right: 2rem; }
/* input file: il controllo nativo stonava (bottone squadrato dentro un campo
   arrotondato); qui il bottone segue lo stile degli altri controlli */
.form-control[type="file"] { padding: .35rem .5rem; line-height: 1.9; }
.form-control[type="file"]::file-selector-button {
    margin-right: .7rem; padding: .35rem .8rem; border: 0; border-radius: 999px;
    background: var(--tm-green-700); color: #fff; font-family: inherit; font-size: .85rem;
    font-weight: 600; cursor: pointer; transition: background .15s;
}
.form-control[type="file"]::file-selector-button:hover { background: var(--tm-green-600); }

/* color picker: pastiglia/swatch che mostra bene il colore scelto */
.form-control-color { width: 3.2rem; height: 2.6rem; padding: .25rem; cursor: pointer; }
.form-control-color::-webkit-color-swatch-wrapper { padding: 0; }
.form-control-color::-webkit-color-swatch { border: 0; border-radius: 7px; }
.form-control-color::-moz-color-swatch { border: 0; border-radius: 7px; }
/* campo password con toggle mostra/nascondi (stesse classi delle pagine auth) */
.password-field { position: relative; }
.password-field > .form-control { padding-right: 46px; }
.password-toggle { position: absolute; top: 0; right: 0; height: 100%; width: 46px;
    display: flex; align-items: center; justify-content: center; background: none; border: none;
    padding: 0; cursor: pointer; color: var(--tm-muted); border-radius: 0 10px 10px 0; transition: color .15s; }
.password-toggle:hover { color: var(--tm-t-700); }
.password-toggle:focus-visible { outline: 2px solid var(--tm-green-600); outline-offset: -2px; }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }

.form-check { display: block; min-height: 1.4rem; padding-left: 1.6rem; }
.form-check-input { float: left; margin-left: -1.6rem; width: 1.1em; height: 1.1em; margin-top: .2em; vertical-align: top;
    background: var(--tm-surface); border: 1.5px solid var(--tm-card-border); border-radius: .25em; cursor: pointer; appearance: none; }
.form-check-input[type=checkbox] { border-radius: .25em; }
.form-check-input[type=radio] { border-radius: 50%; }
.form-check-input:checked { background: var(--tm-green-600); border-color: var(--tm-green-600);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-width='2.5' d='M3.5 8.5l3 3 6-7'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: center; background-size: 70%; }
.form-check-input:focus { outline: 0; border-color: var(--tm-green-600); box-shadow: 0 0 0 .22rem rgba(18,128,90,.15); }
.form-check-label { cursor: pointer; }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > .form-control { flex: 1 1 auto; width: 1%; }
/* angoli interni squadrati e bordi agganciati (i .btn sono a pillola in app.css) */
.input-group > :not(:first-child) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ── Nav / tabs / pills ──────────────────────────────────────────────── */
.nav { display: flex; flex-wrap: wrap; padding-left: 0; margin-bottom: 0; list-style: none; }
.nav-link { display: block; padding: .5rem .9rem; color: var(--tm-t-700); text-decoration: none; cursor: pointer; background: none; border: 0; }
.nav-item { display: block; }
.nav-tabs { border-bottom: 1px solid var(--tm-card-border); gap: .2rem; }
.nav-tabs .nav-link { border: 1px solid transparent; border-top-left-radius: 8px; border-top-right-radius: 8px; color: var(--tm-muted); margin-bottom: -1px; }
.nav-tabs .nav-link.active { color: var(--tm-t-700); background: var(--tm-surface); border-color: var(--tm-card-border) var(--tm-card-border) #fff; font-weight: 600; }
.nav-pills { gap: .35rem .3rem; }
.nav-pills .nav-link { border-radius: 999px; }
.nav-pills .nav-link.active { background: var(--tm-green-700); color: #fff; }
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }

/* ── Navbar (struttura; lo skin TOTOSCORE è in app.css) ──────────────── */
.navbar { display: flex; flex-wrap: wrap; align-items: center; padding: .5rem 0; }
.navbar > .container { display: flex; flex-wrap: inherit; align-items: center; justify-content: space-between; }
.navbar-brand { padding: .3rem 0; margin-right: 1rem; font-size: 1.25rem; text-decoration: none; white-space: nowrap; }
.navbar-nav { display: flex; flex-direction: column; padding-left: 0; margin: 0; list-style: none; }
@media (min-width: 576px) {
    .navbar-expand-sm { flex-wrap: nowrap; }
    .navbar-expand-sm .navbar-nav { flex-direction: row; align-items: center; }
    .navbar-expand-sm .navbar-collapse { display: flex !important; flex-basis: auto; }
}
.navbar-collapse { flex-basis: 100%; flex-grow: 1; align-items: center; }

/* ── Dropdown ────────────────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-toggle::after { display: inline-block; margin-left: .4em; vertical-align: .15em; content: "";
    border-top: .3em solid; border-right: .3em solid transparent; border-left: .3em solid transparent; }
.dropdown-menu { position: absolute; z-index: 1000; display: none; min-width: 11rem; padding: .4rem; margin-top: .35rem;
    list-style: none; background: var(--tm-surface); border: 1px solid var(--tm-card-border); border-radius: 12px; box-shadow: 0 18px 44px -18px rgba(0,0,0,.35); }
.dropdown-menu.show { display: block; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-item { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .5rem .7rem; clear: both;
    font-weight: 500; color: var(--tm-ink); text-align: inherit; text-decoration: none; white-space: nowrap; background: 0; border: 0; border-radius: 8px; cursor: pointer; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--tm-chip-tenue); }
.dropdown-item.active { background: var(--tm-green-700); color: #fff; }
.dropdown-header { display: block; padding: .4rem .7rem; font-size: .82rem; color: var(--tm-muted); }
.dropdown-item-text { display: block; padding: .4rem .7rem; }
.dropdown-divider { height: 0; margin: .4rem .2rem; border-top: 1px solid var(--tm-card-border); overflow: hidden; }

/* ── Accordion / collapse ────────────────────────────────────────────── */
.collapse:not(.show) { display: none; }
.accordion { border-radius: 12px; }
.accordion-item { background: var(--tm-surface); border: 1px solid var(--tm-card-border); }
.accordion-item:first-of-type { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.accordion-item:last-of-type { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.accordion-item:not(:first-of-type) { border-top: 0; }
.accordion-header { margin: 0; }
.accordion-button { display: flex; align-items: center; width: 100%; padding: .85rem 1rem; font-size: 1rem; font-weight: 500;
    color: var(--tm-ink); text-align: left; background: var(--tm-surface); border: 0; border-radius: 0; cursor: pointer; }
.accordion-button:not(.collapsed) { background: rgba(70,224,160,.14); color: var(--tm-t-900); }
.accordion-button::after { flex-shrink: 0; width: 1.1rem; height: 1.1rem; margin-left: auto; content: "";
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230b1f18' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-size: 1.1rem; transition: transform .25s ease; }
.accordion-button:not(.collapsed)::after { transform: rotate(180deg); }
.accordion-body { padding: 1rem; }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast-container { position: fixed; z-index: 1090; padding: 1rem; }
.toast { display: flex; max-width: 350px; margin-bottom: .6rem; background: var(--tm-surface); border: 1px solid var(--tm-card-border);
    border-radius: 12px; box-shadow: 0 18px 44px -18px rgba(0,0,0,.4); overflow: hidden;
    opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: none; }
.toast-body { padding: .8rem 1rem; flex: 1 1 auto; font-size: .9rem; }
