/* =====================================================
   ISTRUTTORI V7 - FRONTEND E ADMIN
===================================================== */

:root{
    --ins-primary:rgb(var(--theme-rgb-primary,91,42,134));
    --ins-primary-dark:rgb(var(--theme-rgb-secondary,90,23,47));
    --ins-navy:rgb(var(--theme-rgb-secondary,90,23,47));
    --ins-surface:#ffffff;
    --ins-bg:rgba(var(--theme-rgb-primary,91,42,134),.08);
    --ins-border:#dce6f2;
    --ins-text:rgb(var(--theme-rgb-secondary,90,23,47));
    --ins-muted:#66758c;
}

/* FRONTEND LISTA */
.federal-instructors-hero{
    padding:54px 0 62px;
    color:#fff;
    background:linear-gradient(115deg,rgb(var(--theme-rgb-secondary,90,23,47)) 0%,rgb(var(--theme-rgb-primary,91,42,134)) 100%);
}
.federal-instructors-breadcrumb{
    display:flex;align-items:center;gap:10px;margin-bottom:24px;
    color:rgba(255,255,255,.85);font-size:.9rem;font-weight:700;
}
.federal-instructors-breadcrumb a{color:inherit;text-decoration:none}
.federal-instructors-kicker,
.federal-instructors-section-kicker{
    display:block;color:color-mix(in srgb,rgb(var(--theme-rgb-primary)) 24%,#fff);font-size:.78rem;font-weight:900;
    letter-spacing:.12em;text-transform:uppercase;
}
.federal-instructors-hero h1{
    margin:8px 0 10px;font-size:clamp(2.4rem,5vw,4.5rem);font-weight:950;
}
.federal-instructors-hero p{max-width:720px;margin:0;font-size:1.08rem}
.federal-instructors-page{padding:42px 0 70px;background:var(--ins-bg)}
.instructors-unified-toolbar{
    padding:22px;background:#fff;border:1px solid var(--ins-border);
    border-radius:20px;box-shadow:0 16px 38px rgba(7,26,53,.08);
}
.instructors-results-head{
    display:flex;align-items:end;justify-content:space-between;gap:20px;margin:34px 0 20px;
}
.instructors-results-head h2{margin:5px 0 0;color:var(--ins-text);font-weight:900}
.instructors-results-head .federal-instructors-section-kicker{
    color:var(--ins-primary);
}
.instructors-results-head>strong{
    width:50px;height:50px;display:grid;place-items:center;color:#fff;
    background:var(--ins-primary);border-radius:50%;font-size:1.15rem;
}
.federal-instructors-grid{
    display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:22px;
}
.federal-instructor-card{
    overflow:hidden;display:flex;flex-direction:column;background:#fff;
    border:1px solid var(--ins-border);border-radius:22px;
    box-shadow:0 14px 34px rgba(7,26,53,.08);
    transition:transform .2s ease,box-shadow .2s ease;
}
.federal-instructor-card:hover{
    transform:translateY(-5px);box-shadow:0 22px 45px rgba(7,26,53,.13);
}
.federal-instructor-card__media{position:relative}
.federal-instructor-card__media img{width:100%;height:270px;object-fit:cover}
.instructor-card-badges{position:absolute;left:14px;bottom:14px;display:flex;gap:7px}
.instructor-card-badges span{
    padding:6px 10px;color:#fff;background:rgba(7,26,53,.9);
    border-radius:999px;font-size:.76rem;font-weight:900;
}
.federal-instructor-card__body{padding:20px}
.federal-instructor-card__body h3{margin:0;color:var(--ins-text);font-size:1.35rem;font-weight:900}
.federal-instructor-role{margin:6px 0 12px;color:var(--ins-primary);font-weight:800}
.federal-instructor-card__body p{display:flex;gap:7px;color:var(--ins-muted)}
.online-instructor-modalities,
.instructor-detail-modes{display:flex;flex-wrap:wrap;gap:8px}
.online-instructor-modalities span,
.instructor-detail-modes span{
    padding:7px 11px;color:var(--ins-primary);background:rgba(var(--theme-rgb-primary,91,42,134),.08);
    border-radius:999px;font-size:.82rem;font-weight:850;
}
.instructor-card-actions{margin-top:auto;padding:0 20px 20px}
.instructor-card-actions .btn{width:100%;border-radius:12px}
.federal-instructors-empty{
    padding:52px;text-align:center;background:#fff;border:1px solid var(--ins-border);
    border-radius:22px;
}

/* DETTAGLIO */
.instructor-detail-hero{
    padding:24px 0;color:#fff;background:linear-gradient(115deg,rgb(var(--theme-rgb-secondary,90,23,47)),rgb(var(--theme-rgb-primary,91,42,134)));
}
.instructor-detail-page{padding:40px 0 70px;background:var(--ins-bg)}
.instructor-detail-banner{
    display:grid;grid-template-columns:220px 1fr;gap:30px;align-items:center;
    margin-bottom:28px;padding:28px;color:#fff;
    background:
        radial-gradient(circle at 92% 12%,rgba(255,255,255,.14),transparent 34%),
        linear-gradient(120deg,rgb(var(--theme-rgb-primary,35,87,166)),color-mix(in srgb,rgb(var(--theme-rgb-primary,35,87,166)) 72%,rgb(var(--theme-rgb-secondary,9,31,61))));
    border:1px solid rgba(255,255,255,.14);border-radius:24px;
    box-shadow:0 20px 46px rgba(7,26,53,.17);
}
.instructor-detail-banner__photo img{
    width:220px;height:220px;object-fit:cover;border:5px solid rgba(255,255,255,.32);
    border-radius:24px;
}
.instructor-detail-eyebrow{font-size:.8rem;font-weight:900;letter-spacing:.12em}
.instructor-detail-banner h1{margin:8px 0;color:#fff;font-size:clamp(2.4rem,5vw,4.4rem);font-weight:950}
.instructor-detail-eyebrow,
.instructor-detail-role,
.instructor-detail-location,
.instructor-detail-banner i{color:#fff}
.instructor-detail-role{font-size:1.15rem}
.instructor-detail-location{display:flex;gap:7px;color:rgba(255,255,255,.82)}
.instructor-detail-banner .instructor-detail-modes span{
    color:#fff;background:rgba(255,255,255,.14)
}
.instructor-detail-layout{
    display:grid;grid-template-columns:minmax(0,1.8fr) minmax(300px,.9fr);gap:24px;
}
.instructor-detail-main,.instructor-detail-sidebar{display:flex;flex-direction:column;gap:22px}
.instructor-detail-card{
    padding:28px;background:#fff;border:1px solid var(--ins-border);
    border-radius:22px;box-shadow:0 12px 30px rgba(7,26,53,.06);
}
.instructor-detail-card__kicker{
    color:var(--ins-primary);font-size:.76rem;font-weight:900;
    letter-spacing:.12em;text-transform:uppercase;
}
.instructor-detail-card h2{margin:8px 0 18px;color:var(--ins-text);font-size:2rem;font-weight:950}
.instructor-detail-copy{color:#33445f;line-height:1.75}
.instructor-detail-sport-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.instructor-detail-sport-grid div,
.instructor-detail-summary__item{
    padding:18px;background:#f4f7fb;border-radius:16px;
}
.instructor-detail-sport-grid span,
.instructor-detail-summary__item span{
    display:block;margin-bottom:6px;color:var(--ins-muted);font-size:.86rem;
}
.instructor-detail-sport-grid strong,
.instructor-detail-summary__item strong{
    color:var(--ins-text);font-size:1.08rem;
}
.instructor-detail-modes--light span{background:rgba(var(--theme-rgb-primary,91,42,134),.08)}
.instructor-detail-summary{position:sticky;top:110px}
.instructor-detail-summary__item+.instructor-detail-summary__item{margin-top:12px}
.instructor-detail-booking{
    padding:28px;color:#fff;
    background:
        radial-gradient(circle at 100% 0,rgba(255,255,255,.13),transparent 42%),
        linear-gradient(145deg,rgb(var(--theme-rgb-primary,35,87,166)),color-mix(in srgb,rgb(var(--theme-rgb-primary,35,87,166)) 72%,rgb(var(--theme-rgb-secondary,9,31,61))));
    border:1px solid rgba(255,255,255,.14);
    border-radius:22px;box-shadow:0 18px 38px rgba(7,26,53,.16);
}
.instructor-detail-booking>i{color:#fff;font-size:1.5rem}
.instructor-detail-booking h2{margin:10px 0;color:#fff;font-weight:900}
.instructor-detail-booking p{color:rgba(255,255,255,.9)}
.instructor-detail-booking .btn{width:100%;font-weight:900;border-radius:12px}

/* ADMIN */
.instructors-admin-page{padding-bottom:24px}
.instructors-admin-hero{
    display:flex;align-items:center;justify-content:space-between;gap:24px;
    padding:28px;color:#fff;background:linear-gradient(115deg,rgb(var(--theme-rgb-secondary,90,23,47)),rgb(var(--theme-rgb-primary,91,42,134)));
    border-radius:22px;box-shadow:0 20px 44px rgba(7,26,53,.15);
}
.instructors-admin-kicker,.instructors-section-label{
    display:block;margin-bottom:6px;color:color-mix(in srgb,rgb(var(--theme-rgb-primary)) 24%,#fff);font-size:.75rem;
    font-weight:900;letter-spacing:.12em;
}
.instructors-admin-hero h1{margin:0;font-size:2.2rem;font-weight:950}
.instructors-admin-hero p{margin:8px 0 0;color:rgba(255,255,255,.8)}
.instructors-form-card{border-radius:22px!important}
.instructors-fixed-value{
    min-height:48px;display:flex;align-items:center;gap:10px;padding:12px 14px;
    color:var(--ins-primary);background:rgba(var(--theme-rgb-primary,91,42,134),.08);border:1px solid rgba(var(--theme-rgb-primary),.28);border-radius:12px;
}
.instructors-fixed-value i{font-size:1.1rem}
.admin-instructor-avatar{
    width:60px;height:60px;object-fit:cover;border-radius:14px;
    box-shadow:0 6px 16px rgba(7,26,53,.12);
}
.instructor-current-photo img{
    width:120px;height:120px;object-fit:cover;border-radius:16px;
}
.instructors-admin-page .form-control,
.instructors-admin-page .form-select,
.instructors-admin-page .input-group-text{
    min-height:48px;border-radius:12px;
}
.instructors-admin-page textarea.form-control{min-height:130px}
.instructors-admin-page .table{margin-bottom:0}
.instructors-admin-page .table thead th{
    color:#4a5d76;background:#f5f8fc;border-bottom:1px solid var(--ins-border);
}
.instructors-admin-page .table tbody tr:hover{background:rgba(var(--theme-rgb-primary,91,42,134),.08)}

@media(max-width:991.98px){
    .instructor-detail-layout{grid-template-columns:1fr}
    .instructor-detail-summary{position:static}
}
@media(max-width:767.98px){
    .instructor-detail-banner{grid-template-columns:1fr;text-align:center}
    .instructor-detail-banner__photo img{width:180px;height:180px}
    .instructor-detail-modes{justify-content:center}
    .instructor-detail-sport-grid{grid-template-columns:1fr}
    .instructors-admin-hero{align-items:flex-start;flex-direction:column}
}


/* =====================================================
   V8 - VERSIONE COMPATTA
===================================================== */

.instructors-btn-compact{
    min-height:36px!important;
    padding:.44rem .78rem!important;
    border-radius:10px!important;
    font-size:.84rem!important;
    font-weight:800!important;
    line-height:1.1!important;
}

.federal-instructors-hero{
    padding:34px 0 38px;
}

.federal-instructors-breadcrumb{
    margin-bottom:14px;
    font-size:.82rem;
}

.federal-instructors-hero h1{
    margin:5px 0 6px;
    font-size:clamp(2rem,4vw,3.35rem);
}

.federal-instructors-hero p{
    max-width:660px;
    font-size:.98rem;
}

.federal-instructors-page{
    padding:28px 0 48px;
}

.instructors-unified-toolbar{
    padding:16px;
    border-radius:16px;
}

.instructors-unified-toolbar .form-label{
    margin-bottom:5px;
    font-size:.8rem;
    font-weight:800;
}

.instructors-unified-toolbar .form-control,
.instructors-unified-toolbar .form-select{
    min-height:40px;
    padding:.45rem .7rem;
    border-radius:10px;
    font-size:.88rem;
}

.instructors-results-head{
    margin:24px 0 14px;
}

.instructors-results-head h2{
    font-size:1.45rem;
}

.instructors-results-head>strong{
    width:40px;
    height:40px;
    font-size:.95rem;
}

.federal-instructors-grid{
    grid-template-columns:repeat(auto-fit,minmax(225px,1fr));
    gap:16px;
}

.federal-instructor-card{
    border-radius:17px;
}

.federal-instructor-card__media img{
    height:205px;
}

.instructor-card-badges{
    left:10px;
    bottom:10px;
    gap:5px;
}

.instructor-card-badges span{
    padding:5px 8px;
    font-size:.7rem;
}

.federal-instructor-card__body{
    padding:15px;
}

.federal-instructor-card__body h3{
    font-size:1.12rem;
}

.federal-instructor-role{
    margin:4px 0 8px;
    font-size:.9rem;
}

.federal-instructor-card__body p{
    margin-bottom:7px;
    font-size:.84rem;
}

.online-instructor-modalities{
    gap:5px;
    margin-top:9px;
}

.online-instructor-modalities span{
    padding:5px 8px;
    font-size:.73rem;
}

.instructor-card-actions{
    padding:0 15px 15px;
}

.federal-instructors-empty{
    padding:34px 20px;
    border-radius:17px;
}

/* DETTAGLIO COMPATTO */
.instructor-detail-hero{
    padding:16px 0;
}

.instructor-detail-page{
    padding:26px 0 48px;
}

.instructor-detail-banner{
    grid-template-columns:150px 1fr;
    gap:22px;
    margin-bottom:20px;
    padding:20px;
    border-radius:18px;
}

.instructor-detail-banner__photo img{
    width:150px;
    height:150px;
    border-width:4px;
    border-radius:18px;
}

.instructor-detail-banner h1{
    margin:5px 0;
    font-size:clamp(2rem,4vw,3.2rem);
}

.instructor-detail-role{
    margin-bottom:8px;
    font-size:1rem;
}

.instructor-detail-location{
    margin-bottom:10px;
    font-size:.86rem;
}

.instructor-detail-layout{
    grid-template-columns:minmax(0,1.65fr) minmax(280px,.85fr);
    gap:18px;
}

.instructor-detail-main,
.instructor-detail-sidebar{
    gap:16px;
}

.instructor-detail-card{
    padding:20px;
    border-radius:17px;
}

.instructor-detail-card h2{
    margin:5px 0 12px;
    font-size:1.5rem;
}

.instructor-detail-card__kicker{
    font-size:.68rem;
}

.instructor-detail-copy{
    font-size:.92rem;
    line-height:1.6;
}

.instructor-detail-sport-grid{
    gap:10px;
}

.instructor-detail-sport-grid div,
.instructor-detail-summary__item{
    padding:14px;
    border-radius:12px;
}

.instructor-detail-sport-grid span,
.instructor-detail-summary__item span{
    margin-bottom:4px;
    font-size:.78rem;
}

.instructor-detail-sport-grid strong,
.instructor-detail-summary__item strong{
    font-size:.98rem;
}

.instructor-detail-booking{
    padding:20px;
    border-radius:17px;
}

.instructor-detail-booking h2{
    margin:7px 0;
    font-size:1.45rem;
}

.instructor-detail-booking p{
    margin-bottom:14px;
    font-size:.9rem;
}

/* ADMIN COMPATTO */
.instructors-admin-hero{
    padding:20px 22px;
    border-radius:17px;
}

.instructors-admin-hero h1{
    font-size:1.75rem;
}

.instructors-admin-hero p{
    margin-top:5px;
    font-size:.9rem;
}

.instructors-form-card{
    border-radius:17px!important;
}

.instructors-admin-page .form-label{
    margin-bottom:5px;
    font-size:.82rem;
    font-weight:800;
}

.instructors-admin-page .form-control,
.instructors-admin-page .form-select,
.instructors-admin-page .input-group-text{
    min-height:40px;
    padding:.45rem .7rem;
    border-radius:10px;
    font-size:.88rem;
}

.instructors-admin-page textarea.form-control{
    min-height:105px;
}

.instructors-fixed-value{
    min-height:40px;
    padding:9px 12px;
    border-radius:10px;
    font-size:.88rem;
}

.admin-instructor-avatar{
    width:48px;
    height:48px;
    border-radius:11px;
}

.instructor-current-photo img{
    width:90px;
    height:90px;
    border-radius:12px;
}

.instructors-admin-page .table{
    font-size:.86rem;
}

.instructors-admin-page .table>:not(caption)>*>*{
    padding:.62rem .7rem;
}

.instructors-admin-page .badge{
    font-size:.68rem;
    padding:.42em .62em;
}

.instructors-admin-page .btn-sm{
    min-height:32px;
    padding:.35rem .6rem;
    border-radius:8px;
    font-size:.76rem;
}

@media(max-width:991.98px){
    .instructor-detail-layout{
        grid-template-columns:1fr;
    }
}

@media(max-width:767.98px){
    .federal-instructors-hero{
        padding:28px 0 30px;
    }

    .instructor-detail-banner{
        grid-template-columns:1fr;
        text-align:center;
    }

    .instructor-detail-banner__photo img{
        width:135px;
        height:135px;
    }

    .instructor-detail-modes{
        justify-content:center;
    }

    .instructors-admin-hero{
        padding:18px;
    }
}


/* =====================================================
   V9 FIX - BUTTON PROFILO E ADMIN
===================================================== */

/* Il pulsante Profilo non deve occupare tutta la card */
.instructor-card-actions{
    display:flex;
    justify-content:flex-start;
    padding:0 15px 15px;
}

.instructor-card-actions .btn,
.instructor-profile-button{
    width:auto!important;
    min-width:112px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

/* Rimuove qualsiasi spazio residuo del vecchio hero Admin */
.instructors-admin-page > .instructors-form-card:first-child{
    margin-top:0!important;
}

/* Titolo form Admin più compatto */
.instructors-form-card > .d-flex{
    margin-bottom:18px!important;
}

.instructors-form-card .instructors-section-label{
    color:rgb(var(--theme-rgb-primary));
}

@media(max-width:575.98px){
    .instructor-card-actions{
        justify-content:stretch;
    }

    .instructor-card-actions .btn,
    .instructor-profile-button{
        width:100%!important;
    }
}


/* =====================================================
   V10 - MODAL CONFERMA ADMIN
===================================================== */

.instructor-confirm-modal{
    overflow:hidden;
    border:0;
    border-radius:18px;
    box-shadow:0 24px 70px rgba(7,26,53,.24);
}

.instructor-confirm-modal .modal-header{
    align-items:flex-start;
    padding:20px 22px 15px;
    border-bottom:1px solid #e3eaf3;
}

.instructor-confirm-modal .modal-title{
    color:rgb(var(--theme-rgb-secondary,90,23,47));
    font-weight:900;
}

.instructor-confirm-modal .modal-body{
    padding:20px 22px;
    color:#4f6078;
    line-height:1.6;
}

.instructor-confirm-modal .modal-footer{
    padding:14px 22px 20px;
    border-top:0;
}

.instructor-confirm-modal .btn-danger{
    background:#b4232f;
    border-color:#b4232f;
}

.instructor-confirm-modal .btn-danger:hover,
.instructor-confirm-modal .btn-danger:focus{
    background:#8f1923;
    border-color:#8f1923;
}


/* =====================================================
   V11 - REGIONE E PROVINCIA
===================================================== */

.instructors-admin-page .territory-fields{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}

@media(max-width:767.98px){
    .instructors-admin-page .territory-fields{
        grid-template-columns:1fr;
    }
}


/* =====================================================
   V12 - LAYOUT FRONTEND FLUIDO
===================================================== */

.federal-instructors-page > .container{
    display:flex;
    min-width:0;
    flex-direction:column;
}

.federal-instructors-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:clamp(16px,1.35vw,22px);
}

.federal-instructor-card{
    min-width:0;
}

.federal-instructor-card__media{
    overflow:hidden;
    aspect-ratio:16 / 11;
    background:rgba(var(--theme-rgb-primary,91,42,134),.08);
}

.federal-instructor-card__media img{
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
}

.federal-instructor-card__body{
    min-width:0;
}

.federal-instructor-card__body h3,
.federal-instructor-card__body p{
    overflow-wrap:anywhere;
}

.instructors-unified-toolbar .row{
    --bs-gutter-x:clamp(.75rem,1.2vw,1rem);
    --bs-gutter-y:.85rem;
}

@media(max-width:1399.98px){
    .federal-instructors-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
}

@media(max-width:991.98px){
    .federal-instructors-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:575.98px){
    .federal-instructors-page{
        padding:20px 0 36px;
    }

    .instructors-unified-toolbar{
        padding:13px;
        border-radius:14px;
    }

    .instructors-results-head{
        align-items:center;
        margin:20px 0 12px;
    }

    .federal-instructors-grid{
        grid-template-columns:1fr;
        gap:14px;
    }

    .federal-instructor-card__media{
        aspect-ratio:16 / 10;
    }
}
