/*
 * Tema Bernava per Filament: riproduce l'aspetto del vecchio portale Yii2 (Metronic "dark-sidebar"
 * ricolorato): sidebar blu #2957A4 con testo bianco, pagina grigio chiaro, font Inter,
 * login a schermo diviso con pannello blu e logo.
 * Palette ripresa da web/css/site.css del progetto Yii2.
 */
:root {
    --bernava-blue: #2957A4;
    --bernava-blue-dark: #1F4685;
    --bernava-red: #E53935;
    --bernava-gray-100: #F5F7FA;
    --bernava-gray-200: #EEF2F7;
    --bernava-gray-300: #DCE3EC;
    --bernava-text: #2B3445;
}

body.fi-body,
.fi-body {
    background-color: var(--bernava-gray-100);
    color: var(--bernava-text);
}

/* ---- Sidebar ---- */
.fi-sidebar {
    background-color: var(--bernava-blue);
    border-right: 0;
    --tw-ring-shadow: 0 0 #0000;
}

.fi-sidebar-header {
    background-color: var(--bernava-blue);
    box-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    height: auto;
    min-height: 5rem;
    padding-block: .75rem;
}

.fi-sidebar-nav {
    background-color: var(--bernava-blue);
}

.fi-sidebar-group-label,
.fi-sidebar-group-collapse-btn,
.fi-sidebar-group-btn svg {
    color: rgba(255, 255, 255, .6);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .75rem;
}

.fi-sidebar-item-btn,
.fi-sidebar-item-label,
.fi-sidebar-item-icon {
    color: #fff;
}

.fi-sidebar-item-btn:hover,
.fi-sidebar-item-btn:focus-visible {
    background-color: rgba(255, 255, 255, .1);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-sidebar-item-btn[aria-current="page"] {
    background-color: rgba(255, 255, 255, .18);
}

.fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #fff;
    font-weight: 600;
}

.fi-sidebar-footer,
.fi-sidebar .fi-icon-btn {
    color: #fff;
}

/* ---- Barra superiore ---- */
.fi-topbar > nav,
.fi-topbar nav {
    background-color: #fff;
    box-shadow: 0 1px 0 var(--bernava-gray-300);
    --tw-ring-shadow: 0 0 #0000;
}

/* ---- Contenuto ---- */
.fi-header-heading {
    color: var(--bernava-text);
    font-weight: 700;
}

.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-modal-window {
    border-radius: .75rem;
    box-shadow: 0 0 20px 0 rgba(76, 87, 125, .04);
}

.fi-ta-header-cell {
    background-color: var(--bernava-gray-100);
    color: #596273;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .03em;
}

/* ---- Login (schermo diviso: form a sinistra, pannello blu con logo a destra) ---- */
.fi-simple-layout {
    background: linear-gradient(90deg, #fff 0, #fff 50%, var(--bernava-blue) 50%, var(--bernava-blue) 100%);
    min-height: 100vh;
}

.fi-simple-layout-header,
.fi-simple-main-ctn {
    width: 50%;
    margin-right: auto;
    margin-left: 0;
}

.fi-simple-main {
    background: #fff;
    box-shadow: none;
    --tw-ring-shadow: 0 0 #0000;
}

.fi-simple-header .fi-logo,
.fi-simple-header img {
    display: none; /* il logo grande è mostrato nel pannello blu, vedi ::after sotto */
}

.fi-simple-layout::after {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    background: url('/images/logo_bernava.png') center / min(70%, 34rem) no-repeat;
    pointer-events: none;
}

@media (max-width: 1023px) {
    .fi-simple-layout {
        background: var(--bernava-blue);
    }

    .fi-simple-layout-header,
    .fi-simple-main-ctn {
        width: 100%;
    }

    .fi-simple-layout::after {
        display: none;
    }

    .fi-simple-header .fi-logo,
    .fi-simple-header img {
        display: block;
    }
}

/* ---- Dashboard (da web/css/site.css Yii2: classi dashboard-*) ---- */
.bd { display: flex; flex-direction: column; gap: 1.5rem; }
.bd-card { background: #fff; border-radius: 1rem; box-shadow: 0 12px 32px rgba(43, 52, 69, .08); }
.bd-pad { padding: 1.75rem; }
.bd-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.bd-grid .bd-grid { gap: 1.25rem; }
@media (min-width: 768px) { .bd-grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) { .bd-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) {
    .bd-grid-4 { grid-template-columns: repeat(4, 1fr); }
    .bd-grid-8-4 { grid-template-columns: 2fr 1fr; }
    .bd-grid-7-5 { grid-template-columns: 7fr 5fr; }
}
.bd-title { font-size: 1.1rem; font-weight: 700; color: #181c32; margin: 0 0 1.25rem; }
.bd-mt { margin-top: 1rem; }
.bd-muted { color: #7e8299; }
.bd-strong { font-weight: 700; color: #181c32; }
.bd-sm { font-size: .85rem; }
.bd-xs { font-size: .75rem; }
.bd-right { text-align: right; flex-shrink: 0; }
.bd-flex { display: flex; align-items: center; gap: 1rem; }
.bd-row-between { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.bd-link { color: var(--bernava-blue); font-weight: 700; }

.bd-hero {
    position: relative; overflow: hidden; border-radius: 1.25rem; padding: 2rem; min-height: 260px;
    display: flex; align-items: center; justify-content: space-between; gap: 2rem;
    background: radial-gradient(circle at top right, rgba(255,255,255,.24), transparent 34%),
        linear-gradient(135deg, #2957A4 0%, #1F4685 52%, #16325F 100%);
    box-shadow: 0 22px 55px rgba(41, 87, 164, .22);
}
.bd-hero::after { content: ""; position: absolute; right: -6rem; bottom: -8rem; width: 18rem; height: 18rem; border-radius: 999px; background: rgba(255,255,255,.08); }
.bd-hero-text { position: relative; z-index: 1; max-width: 42rem; color: #fff; }
.bd-hero h1 { font-size: 2.25rem; font-weight: 800; margin: 1rem 0; color: #fff; }
.bd-hero p { opacity: .75; font-size: 1.05rem; margin-bottom: 2rem; }
.bd-hero-art { position: relative; z-index: 1; width: 360px; max-width: 40%; filter: drop-shadow(0 18px 35px rgba(0,0,0,.18)); }
@media (max-width: 767px) { .bd-hero { flex-direction: column; align-items: flex-start; } .bd-hero-art { max-width: 260px; } }
.bd-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .8rem; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; font-size: .875rem; font-weight: 600; }
.bd-dot { width: .4rem; height: .4rem; border-radius: 999px; background: #fff; }
.bd-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.bd-btn { display: inline-block; padding: .65rem 1.4rem; border-radius: .5rem; font-weight: 600; font-size: .9rem; line-height: 1.2; }
.bd-btn-sm { padding: .45rem .9rem; font-size: .8rem; }
.bd-btn-soft { background: #e8eef9; color: var(--bernava-blue); }
.bd-btn-light { background: #fff; color: #3f4254; }
.bd-btn-primary { background: var(--bernava-blue); color: #fff; }
.bd-btn:hover { filter: brightness(.96); }

.bd-kpi { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem; }
.bd-kpi-icon { width: 3rem; height: 3rem; color: #a1a5b7; }
.bd-kpi-label { text-transform: uppercase; font-size: .8rem; font-weight: 600; color: #a1a5b7; }
.bd-kpi-value { font-size: 1.9rem; line-height: 1; letter-spacing: -.04em; font-weight: 800; color: #181c32; margin: .5rem 0; }

.bd-link-card { border: 1px solid #eef2f7; border-radius: 1rem; padding: 1.5rem; transition: transform .2s, box-shadow .2s, border-color .2s; }
.bd-link-card:hover { transform: translateY(-3px); box-shadow: 0 18px 30px rgba(31,41,55,.08); border-color: #dce3ec; }
.bd-link-card .bd-btn { margin-top: 1.25rem; }
.bd-link-head { display: flex; align-items: center; gap: 1.25rem; }
.bd-link-icon { width: 52px; min-width: 52px; height: 52px; border-radius: 1rem; display: inline-flex; align-items: center; justify-content: center; }
.bd-link-icon svg { width: 1.4rem; height: 1.4rem; }
.bd-primary { background: rgba(41,87,164,.12); color: #2957A4; }
.bd-success { background: rgba(46,158,91,.12); color: #2E9E5B; }
.bd-warning { background: rgba(244,166,42,.16); color: #C97D00; }
.bd-info { background: rgba(91,192,235,.15); color: #257CA3; }

.bd-cover {
    display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: 2rem; min-height: 180px; color: #fff;
    background: linear-gradient(180deg, rgba(41,87,164,.88), rgba(31,70,133,.92)), url("/images/bg-2.jpg") center/cover no-repeat;
}
.bd-cover h3 { font-size: 1.9rem; font-weight: 800; margin: 1rem 0 .5rem; color: #fff; }
.bd-cover p { opacity: .75; font-size: 1.05rem; }

.bd-badge { display: inline-block; padding: .25rem .6rem; border-radius: .4rem; font-size: .75rem; font-weight: 600; }
.bd-badge-primary { background: #e8eef9; color: var(--bernava-blue); }
.bd-badge-success { background: #e3f6ec; color: #2E9E5B; }
.bd-badge-warning { background: #fff4de; color: #C97D00; }
.bd-badge-danger { background: #ffe8ea; color: #E53935; }
.bd-badge-info { background: #e5f3fb; color: #257CA3; }

.bd-status-list { display: flex; flex-direction: column; gap: 1rem; }
.bd-status { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px dashed #dce3ec; }
.bd-status:last-child { padding-bottom: 0; border-bottom: 0; }

.bd-mini { background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%); }
.bd-progress-row { display: flex; justify-content: space-between; margin: 1.25rem 0 .5rem; font-size: .9rem; }
.bd-progress { height: 8px; border-radius: 99px; overflow: hidden; }
.bd-progress > div { height: 100%; border-radius: 99px; }
.bd-progress-primary { background: #e8eef9; }
.bd-progress-primary > div { background: var(--bernava-blue); }
.bd-progress-success { background: #e3f6ec; }
.bd-progress-success > div { background: #2E9E5B; }
.bd-sep { border: 0; border-top: 1px dashed #dce3ec; margin: 1.5rem 0; }

.bd-map-shell { position: relative; border-radius: 1rem; overflow: hidden; }
.bd-map { height: 420px; z-index: 0; }
.bd-map-legend { position: absolute; left: .75rem; bottom: 1.75rem; z-index: 500; background: rgba(255,255,255,.95); border-radius: .5rem; padding: .5rem .75rem; font-size: .75rem; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.bd-map-legend > div { display: flex; align-items: center; gap: .5rem; }
.bd-legend-dot { width: .6rem; height: .6rem; border-radius: 999px; display: inline-block; }

.bd-list-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px dashed #dce3ec; }
.bd-list-row:last-child { border-bottom: 0; }
.bd-avatar { width: 50px; height: 50px; border-radius: 999px; background: #eef2f7; color: #3f4254; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bd-thumb { width: 56px; height: 56px; border-radius: .85rem; object-fit: cover; background: #eef2f7; flex-shrink: 0; }
.bd-thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: #7b8497; }
.bd-thumb-empty svg { width: 1.5rem; height: 1.5rem; }

/* ---- Modali laterali (slide-over): più larghezza utile ---- */
.fi-modal.fi-modal-slide-over .fi-modal-window {
    width: 80vw;
    max-width: 80vw;
}

@media (max-width: 1023px) {
    .fi-modal.fi-modal-slide-over .fi-modal-window {
        width: 100vw;
        max-width: 100vw;
    }
}

/* ---- Mappa nel form punto vendita ---- */
.bd-picker-map { height: 320px; border-radius: .75rem; overflow: hidden; z-index: 0; }
.bd-picker-msg { margin-top: .5rem; font-size: .8rem; color: #7e8299; }

.z-index-1{
    z-index: 1;
}
