/* ============================================================
   CarShow Admin - CSS leggibile
   ============================================================ */

/* Base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #111827;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(5, 8, 13, .95), rgba(17, 25, 35, .92)),
        url('../../assets/img/torino-skyline2.jpg') center bottom / cover no-repeat;
}

.login-card,
.card {
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .12);
}

.login-card {
    width: min(100%, 420px);
}

.login-card img {
    height: 58px;
    width: auto;
    margin-bottom: 16px;
}

/* Top bar */
.top {
    background: #070b11;
    color: #fff;
}

.top-inner {
    width: min(100% - 32px, 1240px);
    min-height: 72px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
}

.brand img {
    height: 46px;
}

/* Navigazione */
.nav {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 8px;
}

.nav a {
    padding: 9px 12px;
    border-radius: 999px;
    color: #dbe4ee;
    font-weight: 800;
}

.nav a.active,
.nav a:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

/* Layout */
.main {
    width: min(100% - 32px, 1240px);
    margin: 28px auto 64px;
}

.head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.head h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    letter-spacing: -.04em;
}

.head p {
    color: #667085;
}

/* Pulsanti */
.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.btn.primary,
button.primary {
    background: #e51f2d;
}

.btn.light {
    background: #eef2f6;
    color: #111827;
}

.btn.danger,
button.danger {
    background: #991b1b;
}

.btn.small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: .86rem;
}

.admin-presenter-current-photo img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: cover;
    object-position: center 22%;
    border-radius: 14px;
    border: 1px solid #dbe2ea;
}

/* Griglie e statistiche */
.grid {
    display: grid;
    gap: 18px;
}

.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat strong {
    display: block;
    font-size: 2rem;
}

.stat span {
    color: #667085;
    font-weight: 800;
}

/* Tabelle */
.table-wrap {
    overflow: auto;
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .10);
}

table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5eaf0;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: #667085;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Righe alternate per migliorare la lettura */
tbody tr:nth-child(odd) {
    background-color: #fff;
}

tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

/* Hover leggero sulla riga */
tbody tr:hover {
    background-color: #eee4ef;
    transition: background-color .18s ease;
}

/* Badge */
.badge {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef2f6;
    font-size: .8rem;
    font-weight: 900;
}

.badge.ok {
    background: #dcfce7;
    color: #166534;
}

.badge.off {
    background: #fee2e2;
    color: #991b1b;
}

/* Azioni */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-users-grid {
    grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr);
    align-items: start;
}

.admin-users-grid h2 {
    margin-top: 0;
}

.admin-users-table {
    min-width: 680px;
}

.admin-users-table form {
    margin: 0;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 900;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cfd8e3;
    border-radius: 14px;
    font: inherit;
}

textarea {
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
}

textarea[name="seo_description"] {
    min-height: 120px;
}

.help {
    color: #667085;
    font-size: .9rem;
}

/* Alert */
.alert {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 800;
}

.alert.ok {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Immagini tabella */
.thumb {
    width: 90px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    background: #e5eaf0;
}

.logo-mini {
    width: 70px;
    height: 46px;
    padding: 6px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .stats,
    .form-grid,
    .admin-users-grid {
        grid-template-columns: 1fr;
    }

    .head {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ============================================================
   Admin video edit - player grande in testa + metadati YouTube
   ============================================================ */

.admin-video-player-top {
    margin-bottom: 22px;
}

.admin-video-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-video-preview-head h2 {
    margin: 0;
}

.admin-video-preview-head p {
    margin: 6px 0 0;
    color: #667085;
}

.admin-video-frame-large {
    width: min(100%, 900px);
    aspect-ratio: 16 / 9;
    margin-inline: auto;
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .20);
}

.admin-video-frame-large iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.admin-video-empty {
    min-height: 320px;
    display: grid;
    place-items: center;
    padding: 22px;
    border-radius: 24px;
    background: #f8fafc;
    color: #667085;
    text-align: center;
    font-weight: 800;
}

.youtube-meta-box {
    width: min(100%, 900px);
    margin: 16px auto 0;
}

.youtube-meta-grid {
    display: grid;
    grid-template-columns: 1.6fr .9fr;
    gap: 12px;
}

.youtube-meta-grid div,
.youtube-meta-loading {
    padding: 14px 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5eaf0;
}

.youtube-meta-grid span {
    display: block;
    margin-bottom: 4px;
    color: #667085;
    font-size: .82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.youtube-meta-grid strong {
    display: block;
    color: #111827;
}

.youtube-meta-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.youtube-meta-loading.error {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 780px) {
    .admin-video-preview-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .youtube-meta-grid {
        grid-template-columns: 1fr;
    }

    .youtube-meta-actions {
        justify-content: flex-start;
    }
}

/* ============================================================
   Admin video edit - player in testa
   ============================================================ */

.admin-video-player-top {
    margin-bottom: 22px;
}

.admin-video-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-video-preview-head h2 {
    margin: 0;
}

.admin-video-preview-head p {
    margin: 6px 0 0;
    color: #667085;
}

.admin-video-frame-large {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}

.admin-video-frame-large iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.admin-video-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    padding: 22px;
    border-radius: 22px;
    background: #f8fafc;
    color: #667085;
    text-align: center;
    font-weight: 800;
}

@media (max-width: 780px) {
    .admin-video-preview-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ============================================================
   Admin video edit - anteprima player
   ============================================================ */

.admin-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 22px;
    align-items: start;
}

.video-preview-card {
    position: sticky;
    top: 24px;
}

.video-preview-card h2 {
    margin-top: 0;
}

.admin-video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 14px;
}

.admin-video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.admin-video-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid #e5eaf0;
    background: #e5eaf0;
}

.admin-video-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    padding: 22px;
    border-radius: 18px;
    background: #f8fafc;
    color: #667085;
    text-align: center;
    font-weight: 800;
}

@media (max-width: 1050px) {
    .admin-edit-layout {
        grid-template-columns: 1fr;
    }

    .video-preview-card {
        position: static;
    }
}

/* ============================================================
   Admin video edit - player grande in testa + metadati YouTube
   ============================================================ */

.admin-video-player-top {
    margin-bottom: 22px;
}

.admin-video-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-video-preview-head h2 {
    margin: 0;
}

.admin-video-preview-head p {
    margin: 6px 0 0;
    color: #667085;
}

.admin-video-frame-large {
    width: min(100%, 1100px);
    aspect-ratio: 16 / 9;
    margin-inline: auto;
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .20);
}

.admin-video-frame-large iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.admin-video-empty {
    min-height: 320px;
    display: grid;
    place-items: center;
    padding: 22px;
    border-radius: 24px;
    background: #f8fafc;
    color: #667085;
    text-align: center;
    font-weight: 800;
}

.youtube-meta-box {
    width: min(100%, 1100px);
    margin: 16px auto 0;
}

.youtube-meta-grid {
    display: grid;
    grid-template-columns: 1.6fr .9fr;
    gap: 12px;
}

.youtube-meta-grid div,
.youtube-meta-loading {
    padding: 14px 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5eaf0;
}

.youtube-meta-grid span {
    display: block;
    margin-bottom: 4px;
    color: #667085;
    font-size: .82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.youtube-meta-grid strong {
    display: block;
    color: #111827;
}

.youtube-meta-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.youtube-meta-loading.error {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 780px) {
    .admin-video-preview-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .youtube-meta-grid {
        grid-template-columns: 1fr;
    }

    .youtube-meta-actions {
        justify-content: flex-start;
    }
}

/* ============================================================
   Admin video edit - FIX player dimensione + metadati YouTube
   ============================================================ */

/* Regola più specifica per sovrascrivere eventuali blocchi precedenti */
.admin-video-player-top #admin-video-preview .admin-video-frame-large {
    width: min(100%, 990px) !important;
    max-width: 990px !important;
    aspect-ratio: 16 / 9;
    margin-inline: auto;
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .20);
}

.admin-video-player-top #admin-video-preview .admin-video-frame-large iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.admin-video-player-top .youtube-meta-box {
    width: min(100%, 990px) !important;
    max-width: 990px !important;
    margin: 16px auto 0;
}

.youtube-meta-grid {
    display: grid;
    grid-template-columns: 1.6fr .9fr;
    gap: 12px;
}

.youtube-meta-grid div,
.youtube-meta-loading {
    padding: 14px 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5eaf0;
}

.youtube-meta-grid span {
    display: block;
    margin-bottom: 4px;
    color: #667085;
    font-size: .82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.youtube-meta-grid strong {
    display: block;
    color: #111827;
}

.youtube-meta-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.youtube-meta-loading.error {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 780px) {
    .youtube-meta-grid {
        grid-template-columns: 1fr;
    }

    .youtube-meta-actions {
        justify-content: flex-start;
    }
}

/* ============================================================
   Admin concessionarie - gestione sedi
   ============================================================ */

.admin-main-dealer-card,
.admin-branches-card,
.admin-branches-form-card {
    margin-bottom: 22px;
}

.admin-main-dealer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.admin-main-dealer-grid div {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5eaf0;
}

.admin-main-dealer-grid span {
    display: block;
    margin-bottom: 4px;
    color: #667085;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.admin-main-dealer-grid strong {
    display: block;
    color: #111827;
}

.admin-card-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-card-head h2 {
    margin: 0 0 4px;
}

.admin-card-head p {
    margin: 0;
    color: #667085;
}

.admin-checks-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5eaf0;
}

.admin-checks-row label {
    margin: 0;
}

@media (max-width: 1050px) {
    .admin-main-dealer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .admin-main-dealer-grid {
        grid-template-columns: 1fr;
    }

    .admin-card-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
.sponsor-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin-top: 10px;
}

.sponsor-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #dfe5ec;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
}

.sponsor-checkbox-row input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
}

.sponsor-checkbox-row span {
    line-height: 1.25;
}

.sponsor-checkbox-row small {
    color: #667085;
    font-weight: 500;
}

[hidden] {
    display: none !important;
}

@media (max-width: 700px) {
    .sponsor-checkbox-grid {
        grid-template-columns: 1fr;
    }
}
.admin-clients-menu{position:relative;color:#dce3ed}
.admin-clients-menu summary{list-style:none;cursor:pointer;padding:8px 12px;border-radius:999px;font-weight:700;min-height:44px;display:flex;align-items:center;gap:6px}
.admin-clients-menu summary::-webkit-details-marker{display:none}
.admin-clients-menu.active summary,.admin-clients-menu[open] summary{background:rgba(255,255,255,.1);color:#fff}
.admin-clients-menu summary:focus-visible,.admin-clients-submenu a:focus-visible{outline:3px solid #ffd400;outline-offset:2px}
.admin-clients-submenu{position:absolute;top:100%;left:0;z-index:100;min-width:270px;padding:8px;background:#101820;border:1px solid #465368;border-radius:12px;box-shadow:0 12px 28px #0003}
.admin-menu-end .admin-clients-submenu{left:auto;right:0}
.nav .admin-clients-submenu a{display:block;white-space:normal;padding:12px;border-radius:8px;color:#fff}
.nav .admin-clients-submenu a:hover,.nav .admin-clients-submenu a[aria-current="page"]{background:rgba(255,255,255,.12)}
@media(max-width:700px){.top-inner{flex-direction:column;align-items:flex-start;padding:12px 0}.admin-clients-submenu{position:static;min-width:0;width:min(290px,calc(100vw - 40px));margin-top:4px}}
