/* ════════════════════════════════════════════════════════════
   STRATOS PAGE – stile Material Design 3 per le maschere,
   coerente con stratos-modal.css e con i sottomenu della home.
   Uso: <div class="... stratos-page sec-vendite|sec-attivita|sec-assistenza|sec-anagrafiche|sec-utility|sec-report">
   Header a gradiente opzionale: <div class="row stratos-hero"> con <span class="stratos-hero-icon las la-..."></span>
   ════════════════════════════════════════════════════════════ */

.stratos-page {
    --sec-color: #1A73E8;
    --sec-soft: rgba(26, 115, 232, .10);
    --sec-grad: linear-gradient(145deg, #174EA6 0%, #1A73E8 100%);
}
.stratos-page.sec-vendite    { --sec-color: #1A73E8; --sec-soft: rgba(26,115,232,.10); --sec-grad: linear-gradient(145deg, #174EA6 0%, #1A73E8 100%); }
.stratos-page.sec-attivita   { --sec-color: #E37400; --sec-soft: rgba(249,171,0,.14);  --sec-grad: linear-gradient(145deg, #E37400 0%, #F9AB00 100%); }
.stratos-page.sec-assistenza { --sec-color: #007B83; --sec-soft: rgba(18,181,203,.12); --sec-grad: linear-gradient(145deg, #007B83 0%, #12B5CB 100%); }
.stratos-page.sec-anagrafiche{ --sec-color: #188038; --sec-soft: rgba(52,168,83,.12); --sec-grad: linear-gradient(145deg, #188038 0%, #34A853 100%); }
.stratos-page.sec-utility    { --sec-color: #455A64; --sec-soft: rgba(96,125,139,.14); --sec-grad: linear-gradient(145deg, #37474F 0%, #607D8B 100%); }
.stratos-page.sec-report     { --sec-color: #D93025; --sec-soft: rgba(217,48,37,.12); --sec-grad: linear-gradient(145deg, #B31412 0%, #D93025 100%); }

/* ── Animazione d'ingresso (fade + slide, a cascata) ── */
@keyframes stratosPageIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.stratos-page > *,
.stratos-page .stratos-hero,
.stratos-page form > .row:not(.stratos-hero) {
    animation: stratosPageIn .45s cubic-bezier(.2, 0, 0, 1) backwards;
}
.stratos-page > *:nth-child(2) { animation-delay: .06s; }
.stratos-page > *:nth-child(3) { animation-delay: .12s; }
.stratos-page form > .row:nth-of-type(2) { animation-delay: .10s; }
.stratos-page form > .row:nth-of-type(3) { animation-delay: .18s; }

/* ── Contenitori: widget e card ──
   niente overflow:hidden, così i menu a tendina (tom-select, datepicker) non vengono tagliati */
.stratos-page .widget-content-area,
.stratos-page .card {
    --card-r: 24px;
    border: none !important;
    border-radius: var(--card-r) !important;
    background: #fff;
    box-shadow: 0 1px 3px rgba(60,64,67,.15), 0 6px 20px rgba(60,64,67,.10);
}
.stratos-page .card { margin-bottom: 1.25rem; }
.stratos-page .card > .card-body { padding: 20px 24px; }

/* Card annidate: raggio ridotto ed elevazione più leggera */
.stratos-page .card .card {
    --card-r: 16px;
    box-shadow: 0 1px 2px rgba(60,64,67,.12), 0 2px 8px rgba(60,64,67,.08);
}

/* ── Header a gradiente (card-header) ── */
.stratos-page .card-header:not(.stratos-plain-header) {
    background: var(--sec-grad) !important;
    color: #fff !important;
    border: none !important;
    padding: 16px 22px !important;
    border-radius: var(--card-r) var(--card-r) 0 0 !important;
}
.stratos-page .card-header:not(.stratos-plain-header):has(+ .collapse:not(.show)) { border-radius: var(--card-r) !important; }
.stratos-page .card-header:not(.stratos-plain-header) span:not(.badge),
.stratos-page .card-header:not(.stratos-plain-header) i,
.stratos-page .card-header:not(.stratos-plain-header) .icons { color: #fff !important; }
.stratos-page .card-header [data-bs-toggle="collapse"] { cursor: pointer; }
.stratos-page .card-header:not(.stratos-plain-header) .icons { display: inline-block; transition: transform .25s ease; }
.stratos-page .card-header:not(.stratos-plain-header) [aria-expanded="true"] .icons { transform: rotate(180deg); }
.stratos-page .card-header:not(.stratos-plain-header) .fs-5 > .las:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    border-radius: 12px;
    background: rgba(255,255,255,.18);
    vertical-align: middle;
    font-size: 1.35rem !important;
}

/* Header di card annidate: tinta soft anziché gradiente */
.stratos-page .card .card .card-header:not(.stratos-plain-header) { background: var(--sec-soft) !important; }
.stratos-page .card .card .card-header:not(.stratos-plain-header) span:not(.badge),
.stratos-page .card .card .card-header:not(.stratos-plain-header) i,
.stratos-page .card .card .card-header:not(.stratos-plain-header) .icons { color: var(--sec-color) !important; }
.stratos-page .card .card .card-header:not(.stratos-plain-header) .fs-5 > .las:first-child { background: #fff; }

/* ── Footer card ── */
.stratos-page .card-footer {
    background: #f8f9fa !important;
    border-top: 1px solid rgba(0,0,0,.06) !important;
    padding: 14px 24px;
    border-radius: 0 0 var(--card-r) var(--card-r) !important;
}
.stratos-page .card-footer:empty,
.stratos-page .card-footer:not(:has(*)) { display: none; }

/* ── Header "hero" a gradiente (come l'header delle modal) ── */
.stratos-page .stratos-hero {
    background: var(--sec-grad);
    color: #fff;
    border-radius: 20px;
    margin: 0;
    padding: 16px 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.stratos-page .stratos-hero .fs-4,
.stratos-page .stratos-hero .text-muted,
.stratos-page .stratos-hero i { color: #fff !important; }
.stratos-page .stratos-hero .text-muted { opacity: .85; }
.stratos-page .stratos-hero:not(.stratos-detail-header) .badge {
    background: rgba(255,255,255,.22) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    padding: 6px 12px;
}
.stratos-page .stratos-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-size: 1.6rem;
}
.stratos-page .stratos-hero .btn {
    background: #fff !important;
    color: var(--sec-color) !important;
    border: none !important;
    font-weight: 700;
}
.stratos-page .stratos-hero .btn span { color: var(--sec-color) !important; }

.stratos-page .stratos-detail-header {
    padding: 20px 24px;
}
.stratos-page.sec-anagrafiche .btn-primary,
.stratos-page.sec-anagrafiche .btn-info,
.stratos-page.sec-anagrafiche .stratos-primary-action {
    background: var(--sec-grad) !important;
    border-color: var(--sec-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(24,128,56,.18);
}

/* ── Icone dei titoli in box soft (titoli tab e "media-info") ── */
.stratos-page .tab-pane span.fs-4 > .las:first-child,
.stratos-page .media-info > .las:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    border-radius: 12px;
    background: var(--sec-soft);
    color: var(--sec-color);
    vertical-align: middle;
    font-size: 1.35rem !important;
}

/* ── Box KPI / totali ── */
.stratos-page .rounded[class*="bg-light-"] {
    border-radius: 16px !important;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stratos-page .rounded[class*="bg-light-"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(60,64,67,.15);
}
.stratos-page .card.style-5 .avatar-title { background: var(--sec-grad) !important; color: #fff; }

/* ── Tab a pillola ── */
.stratos-page .nav-pills { gap: 6px; flex-wrap: wrap; }
.stratos-page .nav-pills .nav-link {
    border-radius: 999px !important;
    padding: 8px 18px;
    font-weight: 600;
    color: var(--sec-color) !important;
    background: var(--sec-soft) !important;
    border: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.stratos-page .nav-pills .nav-link:hover { transform: translateY(-2px); }
.stratos-page .nav-pills .nav-link.active {
    background: var(--sec-grad) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.stratos-page .nav-pills .nav-link.active i,
.stratos-page .nav-pills .nav-link.active svg,
.stratos-page .nav-pills .nav-link.active > .las { color: #fff !important; }
.stratos-page .tab-pane.fade.show { animation: stratosPageIn .35s ease backwards; }

/* ── Pulsanti ── */
.stratos-page .btn {
    border-radius: 12px !important;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stratos-page .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,.15);
}

/* ── Form ── */
.stratos-page .form-control,
.stratos-page .form-select,
.stratos-page .input-group-text,
.stratos-page .ts-control {
    border-radius: 12px !important;
}
.stratos-page .input-group > :not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.stratos-page .input-group > :not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.stratos-page .form-control:focus,
.stratos-page .form-select:focus,
.stratos-page .ts-wrapper.focus .ts-control {
    border-color: var(--sec-color) !important;
    box-shadow: 0 0 0 3px var(--sec-soft) !important;
}
.stratos-page .form-label,
.stratos-page .form-group > label,
.stratos-page .form-group > small.text-muted {
    font-weight: 600;
    font-size: .8rem;
    color: #5f6368 !important;
}
.stratos-page .alert { border-radius: 16px; }

/* ── List group come tile ── */
.stratos-page .list-group-icons-meta .list-group-item {
    border: 1px solid rgba(0,0,0,.06) !important;
    border-radius: 16px !important;
    margin-bottom: 8px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stratos-page .list-group-icons-meta .list-group-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(60,64,67,.15);
}

/* ── Tabelle ── */
.stratos-page .table > thead > tr > th {
    background: var(--sec-soft) !important;
    color: var(--sec-color) !important;
    font-weight: 700;
    border: none !important;
}
.stratos-page .table > thead > tr > th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.stratos-page .table > thead > tr > th:last-child  { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.stratos-page .table tbody td .las.la-edit { color: var(--sec-color); }
.stratos-page .dataTables_wrapper .page-item.active .page-link {
    background: var(--sec-color) !important;
    border-color: var(--sec-color) !important;
}

/* ── Separatori ── */
.stratos-page .border-top { border-top-color: rgba(0,0,0,.06) !important; }

/* Applicare al solo elenco, lasciando gli accordion di ricerca fuori dal contenitore. */
.stratos-page.stratos-list-page {
    --card-r: 24px;
    padding: 0 0 20px;
    border: none !important;
    border-radius: var(--card-r) !important;
    background: #fff;
    box-shadow: 0 1px 3px rgba(60,64,67,.15), 0 6px 20px rgba(60,64,67,.10);
}
/* La toolbar generata da DataTables mantiene il tema originale. */
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)),
.stratos-list-page .stratos-inbox-toolbar {
    background: var(--sec-grad);
    color: #fff;
    padding: 20px 24px !important;
    margin-bottom: 20px;
    border: none !important;
    border-radius: var(--card-r) var(--card-r) 0 0;
}
.stratos-list-page .stratos-inbox-toolbar { margin-bottom: 0; }
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) > .row {
    margin-left: 0;
    margin-right: 0;
    row-gap: 12px;
}
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) > .row > [class*="col-"] > .fs-4,
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) > .row > [class*="col-"] > .fs-6,
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) .text-muted:not(.card *),
.stratos-list-page .stratos-inbox-toolbar > span,
.stratos-list-page .stratos-inbox-toolbar > span > i {
    color: #fff !important;
}
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) .text-muted:not(.card *),
.stratos-list-page .stratos-inbox-toolbar > .text-muted { opacity: .85; }
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) > .row > [class*="col-"] > .fs-4 > .las:first-child,
.stratos-list-page .stratos-inbox-toolbar > span > .las:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 8px;
    border-radius: 12px;
    background: rgba(255,255,255,.18);
    color: #fff;
    vertical-align: middle;
}
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) .btn-info,
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) .btn-primary,
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) .btn-light-primary,
.stratos-list-page .stratos-inbox-toolbar .btn {
    background: #fff !important;
    border-color: #fff !important;
    color: var(--sec-color) !important;
    font-weight: 600;
}
.stratos-list-page .dt--top-section:not(:has(.dataTables_filter, .dataTables_length)) .d-sm-flex {
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.stratos-list-page .inbox-wrapper { border-radius: 0 0 var(--card-r) var(--card-r); }

.stratos-page.sec-attivita .fc .fc-button-primary {
    background: var(--sec-soft) !important;
    border-color: var(--sec-color) !important;
    border-radius: 12px;
    color: var(--sec-color) !important;
    box-shadow: none !important;
}
.stratos-page.sec-attivita .fc .fc-button-primary:hover,
.stratos-page.sec-attivita .fc .fc-button-primary:not(:disabled).fc-button-active,
.stratos-page.sec-attivita .fc .fc-button-primary:not(:disabled):active {
    background: var(--sec-grad) !important;
    color: #fff !important;
}
.stratos-page.sec-attivita .fc .fc-button-primary:focus-visible {
    outline: 2px solid var(--sec-color);
    outline-offset: 3px;
}
.stratos-page.sec-attivita .fc-toolbar-title { color: var(--sec-color); }
.stratos-page.sec-attivita .fc .fc-daygrid-day.fc-day-today {
    background: var(--sec-soft);
}
.stratos-page.sec-attivita .fc-day-today .fc-daygrid-day-number {
    background: var(--sec-grad);
}

.stratos-page.sec-assistenza .btn-primary,
.stratos-page.sec-assistenza .btn-info,
.stratos-page.sec-assistenza .stratos-primary-action {
    background: var(--sec-grad) !important;
    border-color: var(--sec-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0,123,131,.18);
}
.stratos-page.sec-report .btn-primary,
.stratos-page.sec-report .btn-info,
.stratos-page.sec-report .stratos-primary-action {
    background: var(--sec-grad) !important;
    border-color: var(--sec-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(217,48,37,.18);
}

/* ── Report: filtri nella toolbar a gradiente, KPI e grafici ── */
.stratos-page .stratos-report-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}
.stratos-page .stratos-report-filters .form-label {
    margin-bottom: 2px;
    color: #fff !important;
    opacity: .9;
}
.stratos-page .stratos-report-filters .form-control { min-width: 140px; border: none; }
.stratos-list-page .dt--top-section .stratos-report-filters .btn-outline-light {
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.7) !important;
    background: rgba(255,255,255,.12) !important;
    font-weight: 600;
}
.stratos-page .stratos-report-body { padding: 0 24px; }
.stratos-page .stratos-kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 18px 20px;
    border-radius: 20px;
    background: #fff;
    border-left: 4px solid var(--sec-color);
    box-shadow: 0 1px 2px rgba(60,64,67,.12), 0 2px 8px rgba(60,64,67,.08);
    transition: transform .2s ease, box-shadow .2s ease;
}
.stratos-page .stratos-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(60,64,67,.15);
}
.stratos-page .stratos-kpi-icon {
    display: inline-flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--sec-soft);
    color: var(--sec-color);
    font-size: 1.6rem;
}
.stratos-page .stratos-kpi-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: #5f6368;
}
.stratos-page .stratos-kpi-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--sec-color);
}
.stratos-page .stratos-kpi.kpi-primary { --kpi-color: #4361ee; --kpi-soft: rgba(67,97,238,.12); }
.stratos-page .stratos-kpi.kpi-success { --kpi-color: #00ab55; --kpi-soft: rgba(0,171,85,.12); }
.stratos-page .stratos-kpi.kpi-info    { --kpi-color: #2196f3; --kpi-soft: rgba(33,150,243,.12); }
.stratos-page .stratos-kpi.kpi-warning { --kpi-color: #e2a03f; --kpi-soft: rgba(226,160,63,.14); }
.stratos-page .stratos-kpi[class*="kpi-"] .stratos-kpi-icon {
    background: var(--kpi-soft);
    color: var(--kpi-color);
}
.stratos-page .stratos-kpi[class*="kpi-"] .stratos-kpi-value { color: var(--kpi-color); }
.stratos-page .stratos-chart { min-height: 340px; }
.stratos-page .stratos-card-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,.18);
    cursor: pointer;
    transition: background .2s ease;
}
.stratos-page .stratos-card-toggle:hover,
.stratos-page .stratos-card-toggle:focus-visible { background: rgba(255,255,255,.32); outline: none; }
.stratos-page .stratos-card-toggle .las { font-size: 1.2rem; transition: transform .25s ease; }
.stratos-page .stratos-card-toggle.collapsed .las { transform: rotate(180deg); }

.stratos-page .stratos-section-text { color: var(--sec-color); }
.stratos-page.stratos-client-page { padding: 20px 24px; }
.stratos-page .stratos-hero h1 { color: #fff !important; }

/* ── Tema scuro ── */
body.dark .stratos-page.stratos-list-page {
    background: #0e1726;
    box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
body.dark .stratos-page .widget-content-area,
body.dark .stratos-page .card {
    background: #0e1726;
    box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
body.dark .stratos-page .card .card { background: #1b2e4b; }
body.dark .stratos-page .stratos-kpi {
    background: #1b2e4b;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
body.dark .stratos-page .stratos-kpi-label { color: #bfc9d4; }
body.dark .stratos-page .card-footer {
    background: #1b2e4b !important;
    border-top-color: rgba(255,255,255,.06) !important;
}
body.dark .stratos-page .list-group-icons-meta .list-group-item { border-color: rgba(255,255,255,.08) !important; }
body.dark .stratos-page .form-label,
body.dark .stratos-page .form-group > label,
body.dark .stratos-page .form-group > small.text-muted { color: #bfc9d4 !important; }
body.dark .stratos-page .border-top { border-top-color: rgba(255,255,255,.08) !important; }

/* ── Riduzione movimento ── */
@media (prefers-reduced-motion: reduce) {
    .stratos-page > *,
    .stratos-page .stratos-hero,
    .stratos-page form > .row,
    .stratos-page .tab-pane.fade.show { animation: none !important; }
    .stratos-page .btn:hover,
    .stratos-page .nav-pills .nav-link:hover,
    .stratos-page .rounded[class*="bg-light-"]:hover,
    .stratos-page .stratos-kpi:hover,
    .stratos-page .list-group-icons-meta .list-group-item:hover { transform: none; }
}
