﻿:root{
    --bg:#f4f6f8;
    --card:#ffffff;
    --text:#1d1d1f;
    --muted:#6e6e73;
    --border:#d9dde3;
    --primary:#B9322B;
    --primary-hover:#9f2924;
    --danger:#b00020;
    --radius:10px;
    --shadow:0 8px 24px rgba(0,0,0,.06);
}

/*
INDEX
- BASE
- LOGIN
- LAYOUT
- BUTTONS
- PANEL
- TABLE
- BADGES
- COMPATIBILITÀ VECCHIE CLASSI
- PUBLIC REPORT PAGE
- PUBLIC REPORT ICONS
- REPORT RUN
- FORM ADMIN
- REPORT LOADING OVERLAY
- CONTROL CENTER / EVENTS STATUS
- RESPONSIVE
*/

/* BASE */

*{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    padding:0;
}

body{
    min-height:100vh;
    font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:var(--bg);
    color:var(--text);
}

/* LOGIN */

.login-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:32px;
}

.login-card{
    width:100%;
    max-width:420px;
    background:var(--card);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:34px;
}

.app-title{
    margin:0 0 8px;
    font-size:28px;
    font-weight:700;
}

.app-subtitle{
    margin:0 0 28px;
    color:var(--muted);
    font-size:15px;
    line-height:1.5;
}

.login-footer{
    margin-top:24px;
    color:var(--muted);
    font-size:12px;
    text-align:center;
}

/* LAYOUT */

.page{
    max-width:1200px;
    margin:0 auto;
    padding:30px 24px;
}

.page-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-bottom:24px;
}

.page-header h1,
.page-title{
    margin:0;
    font-size:28px;
    font-weight:700;
}

.page-header p{
    margin:6px 0 0;
    color:var(--muted);
    font-size:15px;
}

.header-actions{
    display:flex;
    gap:10px;
    align-items:center;
}

/* BUTTONS */

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:0 15px;
    border-radius:7px;
    border:1px solid transparent;
    font-size:14px;
    font-weight:600;
    text-decoration:none;
    cursor:pointer;
    white-space:nowrap;
}

.btn-primary{
    color:#fff;
    background:var(--primary);
}

.btn-primary:hover{
    background:var(--primary-hover);
}

.btn-secondary{
    background:#fff;
    color:#333;
    border-color:#cfd4dc;
}

.btn-secondary:hover{
    background:#f1f1f1;
}

.btn-small{
    min-height:34px;
    padding:0 11px;
    font-size:13px;
}

/* PANEL */

.panel{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:20px;
}

.panel-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
    margin-bottom:16px;
}

.panel-header h2{
    margin:0;
    font-size:20px;
    font-weight:700;
}

.counter{
    color:var(--muted);
    font-size:14px;
}

.empty-state{
    padding:28px;
    background:#f7f8fa;
    border:1px dashed var(--border);
    border-radius:8px;
    color:var(--muted);
    text-align:center;
}

/* TABLE */

.table-wrapper{
    width:100%;
    overflow-x:auto;
}

.data-table{
    width:100%;
    border-collapse:collapse;
    font-size:14px;
}

.data-table th,
.data-table td{
    padding:12px 10px;
    border-bottom:1px solid #e5e7eb;
    text-align:left;
    vertical-align:middle;
}

.data-table th{
    background:#f7f8fa;
    color:#333;
    font-weight:700;
}

.data-table tr{
    transition:background .15s ease;
}

.data-table tr:hover{
    background:#f2f4f7;
}

.text-right{
    text-align:right !important;
}

/* BADGES */

.code-badge{
    display:inline-block;
    padding:4px 8px;
    background:#eef1f4;
    border:1px solid #dde2e8;
    border-radius:6px;
    font-family:Consolas, Monaco, monospace;
    font-size:13px;
    letter-spacing:0.5px;
    font-weight:600;
}

.status-badge{
    display:inline-block;
    padding:4px 8px;
    border-radius:6px;
    font-size:12px;
    font-weight:700;
}

.status-active{
    background:#e8f6ee;
    color:#137333;
    border:1px solid #b7e1c5;
}

.status-inactive{
    background:#f3f4f6;
    color:#6b7280;
    border:1px solid #d1d5db;
}

/* COMPATIBILITÀ VECCHIE CLASSI */

.card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:20px;
}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
    gap:20px;
}

.event-card{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.event-title,
.event-name{
    font-weight:600;
    font-size:16px;
}

.event-code{
    font-size:13px;
    color:var(--muted);
}

/* PUBLIC REPORT PAGE */

.public-report-page{
    min-height:100vh;
    background:
        radial-gradient(circle at top left, rgba(185,50,43,.14), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f4f6f8 100%);
}

.public-hero{
    padding:46px 24px 28px;
}

.public-hero-inner{
    max-width:1120px;
    margin:0 auto;
    background:#ffffff;
    border:1px solid var(--border);
    border-radius:18px;
    box-shadow:var(--shadow);
    padding:34px;
    display:flex;
    justify-content:space-between;
    gap:28px;
    align-items:center;
}

.public-kicker{
    color:var(--primary);
    font-size:13px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.08em;
    margin-bottom:10px;
}

.public-hero h1{
    margin:0;
    font-size:34px;
    line-height:1.12;
    letter-spacing:-.03em;
}

.public-hero p{
    margin:12px 0 20px;
    color:var(--muted);
    font-size:16px;
}

.public-meta{
    display:inline-flex;
    align-items:center;
    gap:10px;
    padding:8px 12px;
    background:#f7f8fa;
    border:1px solid var(--border);
    border-radius:999px;
    font-size:13px;
}

.public-meta span{
    color:var(--muted);
}

.public-meta strong{
    font-family:Consolas, Monaco, monospace;
    letter-spacing:.04em;
}

.public-hero-badge{
    width:122px;
    height:122px;
    border-radius:24px;
    background:var(--primary);
    color:#fff;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    font-size:42px;
    font-weight:800;
    box-shadow:0 14px 28px rgba(185,50,43,.24);
    flex:0 0 auto;
}

.public-hero-badge span{
    margin-top:3px;
    font-size:13px;
    font-weight:700;
}

.public-content{
    max-width:1120px;
    margin:0 auto;
    padding:0 24px 48px;
}

.public-report-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
    gap:18px;
}

.public-report-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:0 8px 22px rgba(0,0,0,.045);
    padding:22px;
    display:flex;
    flex-direction:column;
    gap:18px;
    transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.public-report-card:hover{
    transform:translateY(-3px);
    box-shadow:0 14px 32px rgba(0,0,0,.08);
    border-color:#c8ccd4;
}

.public-report-icon{
    width:52px;
    height:52px;
    border-radius:14px;
    background:#f7f8fa;
    border:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
}

.public-report-type{
    color:var(--primary);
    font-size:13px;
    font-weight:800;
    margin-bottom:6px;
}

.public-report-body h2{
    margin:0;
    font-size:20px;
    line-height:1.25;
}

.public-report-actions{
    display:flex;
    gap:10px;
    margin-top:auto;
}

.public-report-actions .btn{
    flex:1;
}

.public-report-actions .btn-primary{
    box-shadow:0 6px 14px rgba(185,50,43,.25);
}

.public-report-actions .btn-primary:hover{
    box-shadow:0 8px 18px rgba(185,50,43,.32);
}

.public-empty{
    background:#fff;
    border:1px dashed var(--border);
    border-radius:18px;
    padding:46px 24px;
    text-align:center;
    box-shadow:var(--shadow);
}

.public-empty-icon{
    font-size:42px;
    margin-bottom:12px;
}

.public-empty h2{
    margin:0 0 8px;
}

.public-empty p{
    margin:0;
    color:var(--muted);
}

/* PUBLIC REPORT ICONS */

.public-report-icon.icon-export_full::before{
    content:"";
    width:18px;
    height:22px;
    border:2px solid var(--primary);
    border-radius:3px;
    position:absolute;
}

.public-report-icon.icon-export_full::after{
    content:"";
    width:8px;
    height:8px;
    border-left:2px solid var(--primary);
    border-bottom:2px solid var(--primary);
    transform:rotate(-45deg);
    position:absolute;
    bottom:10px;
}

.public-report-icon.icon-totals::before{
    content:"Σ";
    font-size:22px;
    font-weight:700;
    color:var(--primary);
}

.public-report-icon.icon-statistics::before{
    content:"";
    width:18px;
    height:14px;
    background:
        linear-gradient(var(--primary), var(--primary)) left bottom/3px 6px no-repeat,
        linear-gradient(var(--primary), var(--primary)) center bottom/3px 10px no-repeat,
        linear-gradient(var(--primary), var(--primary)) right bottom/3px 14px no-repeat;
}

.public-report-icon.icon-alphabetical::before{
    content:"A-Z";
    font-size:12px;
    font-weight:700;
    color:var(--primary);
}

.public-report-icon.icon-holders_guests::before{
    content:"";
    width:16px;
    height:16px;
    border-radius:50%;
    background:var(--primary);
    position:absolute;
    left:12px;
    top:12px;
}

.public-report-icon.icon-holders_guests::after{
    content:"";
    width:12px;
    height:12px;
    border-radius:50%;
    background:#ccc;
    position:absolute;
    right:12px;
    bottom:12px;
}


.public-report-icon.icon-pivot::before{
    content:"";
    width:22px;
    height:22px;
    position:absolute;
    background:
        linear-gradient(var(--primary),var(--primary)) 0 0/10px 10px no-repeat,
        linear-gradient(#b0b8c8,#b0b8c8) 12px 0/10px 10px no-repeat,
        linear-gradient(#b0b8c8,#b0b8c8) 0 12px/10px 10px no-repeat,
        linear-gradient(#d8dde8,#d8dde8) 12px 12px/10px 10px no-repeat;
}
/* REPORT RUN */

.report-summary{
    display:grid;
    grid-template-columns:180px 140px 1fr;
    gap:14px;
    margin-bottom:20px;
}

.summary-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:16px;
}

.summary-card span{
    display:block;
    color:var(--muted);
    font-size:13px;
    margin-bottom:6px;
}

.summary-card strong{
    display:block;
    font-size:17px;
    line-height:1.3;
}

.summary-wide strong{
    font-size:15px;
    font-weight:600;
}

.report-table-wrapper{
    max-height:68vh;
    overflow:auto;
}

.report-preview-table{
    min-width:900px;
}

.report-preview-table thead th{
    position:sticky;
    top:0;
    z-index:2;
}

.report-preview-table td{
    white-space:nowrap;
}

.row-holder-guests td{
    background:#d6ebff;
    font-weight:700;
}

.row-holder-alone td{
    background:#f5f5f5;
    font-weight:700;
}

/* REPORT DUPLICATI */

.report-preview-table tr.row-duplicate-group td{
    background:#fff4e5;
}

.report-preview-table tr.row-duplicate-group:hover td{
    background:#ffe8c2;
}
.debug-panel{
    margin-top:20px;
}

.debug-panel pre{
    background:#111827;
    color:#e5e7eb;
    border-radius:8px;
    padding:18px;
    overflow:auto;
    font-size:13px;
}

/* FORM ADMIN */

.form-panel{
    margin-bottom:18px;
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:18px;
}

.form-group{
    margin-bottom:18px;
}

.form-group label{
    display:block;
    margin-bottom:7px;
    font-size:14px;
    font-weight:600;
}

.form-control{
    width:100%;
    height:44px;
    border:1px solid var(--border);
    border-radius:8px;
    padding:0 13px;
    font-size:15px;
    background:#fff;
    color:var(--text);
    outline:none;
}

.form-control:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(185,50,43,.14);
}

.textarea-control{
    height:auto;
    min-height:110px;
    padding-top:12px;
    resize:vertical;
}

.monospace-control{
    font-family:Consolas, Monaco, monospace;
    font-size:13px;
}

.field-help,
.section-help{
    margin:6px 0 0;
    color:var(--muted);
    font-size:13px;
    line-height:1.45;
}

.checkbox-row{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-top:4px;
    font-weight:600;
    cursor:pointer;
}

.alert{
    padding:12px 14px;
    border-radius:8px;
    margin-bottom:18px;
    font-size:14px;
}

.alert-error{
    background:#fff2f2;
    color:var(--danger);
    border:1px solid #ffd1d1;
}

.alert-warning{
    background:#fff8e6;
    color:#8a5a00;
    border:1px solid #f3d28a;
}

.field-check-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));
    gap:10px;
}

.field-check{
    display:flex;
    align-items:center;
    gap:8px;
    min-height:38px;
    padding:9px 10px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:8px;
    cursor:pointer;
}

.field-check:hover{
    background:#f7f8fa;
}

.field-check span{
    font-size:13px;
    word-break:break-word;
}
.field-technical-name{
    display:block;
    margin-top:2px;
    font-size:11px;
    line-height:1.3;
    color:#8a8f98;
    font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    word-break:break-all;
    font-weight:400;
}
.suggestion-box{
    margin:14px 0 18px;
    padding:14px;
    background:#f7f8fa;
    border:1px solid var(--border);
    border-radius:10px;
}

.suggestion-box strong{
    display:block;
    margin-bottom:10px;
}

.suggestion-list{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:7px;
}

.suggestion-list code{
    display:inline-block;
    padding:5px 8px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:6px;
    font-size:12px;
}

.labels-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
    gap:14px;
}

.subsection-title{
    margin:22px 0 8px;
    font-size:17px;
}


.pivot-label-grid{
    display:grid;
    gap:8px;
    margin-top:8px;
}

.pivot-label-header,
.pivot-label-row{
    display:grid;
    grid-template-columns:1fr 24px 1fr 72px;
    align-items:center;
    gap:8px;
}

.pivot-label-header{
    font-size:11px;
    font-weight:700;
    color:#94a3b8;
    text-transform:uppercase;
    letter-spacing:.04em;
    padding:0 0 2px;
}

.pivot-label-orig{
    font-size:13px;
    color:#475569;
    background:#f1f5f9;
    border:1px solid #e2e8f0;
    border-radius:8px;
    padding:7px 10px;
    font-family:monospace;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.pivot-label-arrow{
    text-align:center;
    color:#94a3b8;
    font-size:15px;
}

.pivot-label-input{
    min-width:0;
}

.pivot-order-input{
    min-width:0;
    text-align:center;
}
.form-actions-sticky{
    position:sticky;
    bottom:0;
    z-index:5;
    margin-top:18px;
    padding:14px 0;
    background:linear-gradient(180deg, rgba(244,246,248,0), var(--bg) 35%);
    display:flex;
    justify-content:flex-end;
    gap:10px;
}

/* REPORT LOADING OVERLAY */

.report-loading-overlay{
    position:fixed;
    inset:0;
    z-index:9999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:rgba(255,255,255,.72);
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);
}

.report-loading-overlay.is-visible{
    display:flex;
}

.report-loading-card{
    width:100%;
    max-width:420px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    box-shadow:0 24px 60px rgba(0,0,0,.18);
    padding:28px;
    text-align:center;
}

.report-loading-topline{
    width:42px;
    height:5px;
    border-radius:999px;
    background:var(--primary);
    margin:0 auto 18px;
}

.report-loading-card h2{
    margin:0 0 8px;
    font-size:21px;
    font-weight:700;
}

.report-loading-card p{
    margin:0 0 20px;
    color:var(--muted);
    font-size:14px;
    line-height:1.45;
}

.report-loading-progress{
    width:100%;
    height:7px;
    overflow:hidden;
    background:#eef1f4;
    border-radius:999px;
}

.report-loading-progress-bar{
    width:42%;
    height:100%;
    border-radius:999px;
    background:var(--primary);
    animation:reportProgress 1.15s ease-in-out infinite;
}

@keyframes reportProgress{
    0%{
        transform:translateX(-120%);
    }

    55%{
        transform:translateX(65%);
    }

    100%{
        transform:translateX(260%);
    }
}

/* CONTROL CENTER / EVENTS STATUS */

.control-center-header{
    align-items:flex-start;
}

.live-status-bar{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:7px;
    margin-top:10px;
    font-size:13px;
    color:#64748b;
}

.live-dot{
    width:9px;
    height:9px;
    border-radius:999px;
    background:#22c55e;
    box-shadow:0 0 0 5px rgba(34,197,94,.14);
    animation:livePulse 1.8s infinite;
}

.live-separator{
    color:#cbd5e1;
}

@keyframes livePulse{
    0%{
        box-shadow:0 0 0 0 rgba(34,197,94,.35);
    }

    70%{
        box-shadow:0 0 0 8px rgba(34,197,94,0);
    }

    100%{
        box-shadow:0 0 0 0 rgba(34,197,94,0);
    }
}

/* SUMMARY CONTROL CENTER */

.control-summary{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(135px, 1fr));
    gap:10px;
    margin-bottom:16px;
}

.control-summary .summary-card{
    min-height:72px;
    padding:12px;
}

.control-summary .summary-card span{
    font-size:12px;
}

.control-summary .summary-card strong{
    font-size:20px;
}

/* EVENT CARDS COMPACT */

.events-status-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));
    gap:14px;
    margin-top:18px;
}

.event-status-card{
    position:relative;
    background:#fff;
    border:1px solid rgba(15,23,42,.08);
    border-radius:18px;
    box-shadow:0 12px 28px rgba(15,23,42,.08);
    overflow:hidden;
    transition:transform .18s ease, box-shadow .18s ease;
}

.event-status-card:hover{
    transform:translateY(-2px);
    box-shadow:0 18px 38px rgba(15,23,42,.12);
}

.event-status-card::after{
    content:"Apri dettagli";
    position:absolute;
    right:14px;
    bottom:12px;
    font-size:10px;
    font-weight:700;
    color:#64748b;
    opacity:0;
    transform:translateY(4px);
    transition:opacity .18s ease, transform .18s ease;
    pointer-events:none;
}

.event-status-card:hover::after{
    opacity:1;
    transform:translateY(0);
}

.event-status-toggle{
    width:100%;
    border:0;
    background:transparent;
    padding:0;
    text-align:left;
    cursor:pointer;
    font:inherit;
    color:inherit;
}

.event-status-toggle:hover .event-status-title h2{
    color:var(--primary);
}

.event-status-head{
    padding:16px;
}

.event-status-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:10px;
    margin-bottom:10px;
}

.event-status-title h2{
    margin:0 0 6px;
    font-size:17px;
    line-height:1.2;
    color:#0f172a;
}

.event-status-title .code-badge{
    display:inline-flex;
    width:fit-content;
    font-size:11px;
    padding:3px 6px;
}

.event-status-date{
    margin-top:7px;
    font-size:12px;
    color:#64748b;
}

.event-status-badge{
    white-space:nowrap;
    border-radius:999px;
    padding:5px 8px;
    font-size:11px;
    font-weight:700;
}

.event-status-badge.status-active{
    background:#dcfce7;
    color:#166534;
}

.event-status-badge.status-ready{
    background:#e0f2fe;
    color:#075985;
}

.event-status-badge.status-warning{
    background:#fef3c7;
    color:#92400e;
}

.event-status-badge.status-inactive{
    background:#fee2e2;
    color:#991b1b;
}

.event-status-metrics{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:7px;
    margin-top:12px;
}

.event-status-metric{
    min-height:64px;
    padding:8px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:12px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.event-status-metric span{
    display:block;
    min-height:25px;
    font-size:10px;
    line-height:1.2;
    color:#64748b;
}

.event-status-metric strong{
    display:block;
    margin-top:6px;
    font-size:18px;
    line-height:1;
    color:#0f172a;
}

.event-status-foot{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-top:12px;
    font-size:12px;
    color:#64748b;
}

.event-status-arrow{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:20px;
    height:20px;
    border-radius:999px;
    background:#f1f5f9;
    font-size:12px;
    font-weight:800;
    color:#334155;
}

.event-status-detail{
    display:none !important;
}

/* DETTAGLIO REPORT NEL POPUP */

.event-detail-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:12px;
    margin-bottom:18px;
}

.event-detail-box{
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:16px;
    padding:14px;
}

.event-detail-box span{
    display:block;
    font-size:12px;
    color:#64748b;
    margin-bottom:7px;
}

.event-detail-box strong{
    display:block;
    font-size:22px;
    color:#0f172a;
}

.event-detail-note{
    margin:4px 0 18px;
    color:#64748b;
    font-size:13px;
}

.event-report-list{
    display:grid;
    gap:10px;
}

.event-report-item{
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:16px;
    padding:14px;
}

.event-report-main{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
    margin-bottom:12px;
}

.event-report-main h3{
    margin:0 0 5px;
    font-size:15px;
    color:#0f172a;
}

.event-report-main p{
    margin:0;
    font-size:13px;
    color:#64748b;
}

.event-report-stats{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:8px;
    margin-top:10px;
}

.event-report-stat{
    background:#f8fafc;
    border-radius:12px;
    padding:9px;
    font-size:12px;
    color:#64748b;
}

.event-report-stat strong{
    display:block;
    color:#0f172a;
    font-size:15px;
    margin-top:3px;
}

.event-detail-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:18px;
}

.event-status-empty{
    background:#fff;
    border:1px dashed #cbd5e1;
    border-radius:16px;
    padding:18px;
    color:#64748b;
}

/* CONTROL CENTER MODAL - RIDOTTO */

.event-modal-overlay{
    position:fixed;
    inset:0;
    z-index:9999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:28px;
    background:rgba(15,23,42,.58);
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);
}

.event-modal-overlay.is-visible{
    display:flex;
}

.event-modal{
    width:min(980px, 100%);
    max-height:86vh;
    overflow:hidden;
    background:#f8fafc;
    border-radius:24px;
    box-shadow:0 30px 90px rgba(15,23,42,.35);
    border:1px solid rgba(255,255,255,.55);
    animation:modalIn .2s ease-out;
}

@keyframes modalIn{
    from{
        opacity:0;
        transform:translateY(14px) scale(.98);
    }

    to{
        opacity:1;
        transform:translateY(0) scale(1);
    }
}

.event-modal-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:14px;
    padding:18px 20px;
    background:linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom:1px solid #e2e8f0;
}

.event-modal-title h2{
    margin:0 0 6px;
    font-size:21px;
    color:#0f172a;
}

.event-modal-title p{
    margin:0;
    color:#64748b;
    font-size:13px;
}

.event-modal-close{
    width:36px;
    height:36px;
    border:1px solid #cbd5e1;
    border-radius:999px;
    background:#fff;
    color:#0f172a;
    cursor:pointer;
    font-size:21px;
    line-height:1;
}

.event-modal-close:hover{
    background:#fee2e2;
    border-color:#fecaca;
    color:#991b1b;
}

.event-modal-body{
    max-height:calc(86vh - 82px);
    overflow:auto;
    padding:18px 20px 22px;
}

/* BOX INGRANDITO NEL POPUP - RIDOTTO */

.event-modal-overview{
    margin-bottom:18px;
}

.event-modal-overview .event-status-head{
    padding:18px;
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:20px;
    box-shadow:0 12px 28px rgba(15,23,42,.08);
}

.event-modal-overview .event-status-top{
    margin-bottom:14px;
}

.event-modal-overview .event-status-title h2{
    font-size:24px;
    letter-spacing:-.03em;
}

.event-modal-overview .code-badge{
    font-size:13px;
    padding:5px 8px;
}

.event-modal-overview .event-status-date{
    font-size:13px;
    margin-top:10px;
}

.event-modal-overview .event-status-badge{
    font-size:12px;
    padding:7px 11px;
}

.event-modal-overview .event-status-metrics{
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:10px;
}

.event-modal-overview .event-status-metric{
    min-height:86px;
    padding:12px;
    border-radius:14px;
}

.event-modal-overview .event-status-metric span{
    min-height:28px;
    font-size:11px;
}

.event-modal-overview .event-status-metric strong{
    margin-top:8px;
    font-size:26px;
    letter-spacing:-.04em;
}

.event-modal-overview .event-status-foot{
    margin-top:14px;
    padding-top:12px;
    border-top:1px solid #e2e8f0;
    font-size:13px;
}

.event-modal-overview .event-status-arrow{
    display:none;
}

/* DETTAGLIO REPORT VISIBILE NEL POPUP */

.event-modal-detail .event-status-detail{
    display:block !important;
    padding:0;
    border-top:0;
    background:transparent;
}

.event-modal-body .event-detail-grid{
    grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
    gap:10px;
}

.event-modal-body .event-detail-box{
    padding:11px;
    border-radius:14px;
}

.event-modal-body .event-detail-box span{
    font-size:11px;
    margin-bottom:6px;
}

.event-modal-body .event-detail-box strong{
    font-size:18px;
}

.event-modal-body .event-report-list{
    gap:10px;
}

.event-modal-body .event-report-item{
    padding:12px;
    border-radius:14px;
    box-shadow:0 8px 20px rgba(15,23,42,.06);
}

.event-modal-body .event-report-main{
    margin-bottom:10px;
}

.event-modal-body .event-report-main h3{
    font-size:14px;
}

.event-modal-body .event-report-main p{
    font-size:12px;
}

.event-modal-body .event-report-stats{
    gap:7px;
}

.event-modal-body .event-report-stat{
    padding:8px;
    font-size:11px;
}

.event-modal-body .event-report-stat strong{
    font-size:14px;
}

body.modal-open{
    overflow:hidden;
}

/* RESPONSIVE */

@media (max-width:800px){
    .report-summary{
        grid-template-columns:1fr;
    }
}

@media (max-width:780px){
    .control-summary{
        grid-template-columns:1fr;
    }

    .events-status-grid{
        grid-template-columns:1fr;
    }

    .event-status-metrics{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .event-status-head{
        padding:14px;
    }

    .event-status-metric{
        min-height:60px;
    }

    .event-status-metric strong{
        font-size:18px;
    }

    .event-report-stats{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .event-status-top{
        flex-direction:column;
    }

    .event-modal-overlay{
        padding:12px;
    }

    .event-modal{
        width:100%;
        max-height:94vh;
        border-radius:20px;
    }

    .event-modal-header{
        padding:16px;
    }

    .event-modal-title h2{
        font-size:19px;
    }

    .event-modal-body{
        padding:16px;
        max-height:calc(94vh - 76px);
    }

    .event-modal-overview .event-status-title h2{
        font-size:21px;
    }

    .event-modal-overview .event-status-metrics{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .event-modal-overview .event-status-metric{
        min-height:82px;
        padding:12px;
    }

    .event-modal-overview .event-status-metric span{
        font-size:11px;
    }

    .event-modal-overview .event-status-metric strong{
        font-size:24px;
    }

    .live-status-bar{
        font-size:12px;
    }
}

@media (max-width:760px){
    .public-hero{
        padding:22px 14px 18px;
    }

    .public-hero-inner{
        padding:24px;
        flex-direction:column;
        align-items:flex-start;
    }

    .public-hero h1{
        font-size:28px;
    }

    .public-hero-badge{
        width:100%;
        height:auto;
        min-height:82px;
        border-radius:16px;
        flex-direction:row;
        gap:10px;
        font-size:34px;
    }

    .public-content{
        padding:0 14px 34px;
    }

    .public-report-actions{
        flex-direction:column;
    }

    .form-grid{
        grid-template-columns:1fr;
    }

    
.pivot-label-grid{
    display:grid;
    gap:8px;
    margin-top:8px;
}

.pivot-label-header,
.pivot-label-row{
    display:grid;
    grid-template-columns:1fr 24px 1fr 72px;
    align-items:center;
    gap:8px;
}

.pivot-label-header{
    font-size:11px;
    font-weight:700;
    color:#94a3b8;
    text-transform:uppercase;
    letter-spacing:.04em;
    padding:0 0 2px;
}

.pivot-label-orig{
    font-size:13px;
    color:#475569;
    background:#f1f5f9;
    border:1px solid #e2e8f0;
    border-radius:8px;
    padding:7px 10px;
    font-family:monospace;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.pivot-label-arrow{
    text-align:center;
    color:#94a3b8;
    font-size:15px;
}

.pivot-label-input{
    min-width:0;
}

.pivot-order-input{
    min-width:0;
    text-align:center;
}
.form-actions-sticky{
        flex-direction:column-reverse;
    }

    .form-actions-sticky .btn{
        width:100%;
    }
}

@media (max-width:700px){
    .page{
        padding:20px 14px;
    }

    .page-header{
        align-items:flex-start;
        flex-direction:column;
    }

    .header-actions{
        width:100%;
    }

    .header-actions .btn{
        flex:1;
    }

    .panel{
        padding:14px;
    }

    .data-table th,
    .data-table td{
        padding:10px 8px;
    }
}
/* ==========================================================================
   REPORT CONFIG - EXPORT FULL
   ========================================================================== */

.output-help{
    margin:0 0 16px;
    padding:12px 14px;
    border-left:4px solid var(--primary);
    border-radius:8px;
    background:#fff7f6;
    color:var(--muted);
    font-size:14px;
    line-height:1.45;
}

.output-table th:first-child,
.output-table td:first-child{
    width:74px;
    text-align:center;
}

.output-table th:nth-child(2),
.output-table td:nth-child(2){
    width:92px;
    text-align:center;
}

.output-table th:nth-child(4),
.output-table td:nth-child(4){
    width:320px;
}

.output-order-input{
    max-width:76px;
    text-align:center;
}

.output-label-input{
    width:100%;
    min-width:220px;
}

.field-title{
    display:block;
    font-weight:600;
    color:var(--text);
}

.config-json-preview{
    max-height:320px;
    overflow:auto;
    padding:14px;
    border:1px solid var(--border);
    border-radius:10px;
    background:#111827;
    color:#e5e7eb;
    font-size:12px;
    line-height:1.45;
}

@media (max-width:900px){
    .output-table th:nth-child(4),
    .output-table td:nth-child(4){
        width:auto;
    }

    .output-label-input{
        min-width:160px;
    }
}
/* ==========================================================================
   REPORT CONFIG - EXPORT FULL
   ========================================================================== */

.output-help{
    margin:0 0 16px;
    padding:12px 14px;
    border-left:4px solid var(--primary);
    border-radius:8px;
    background:#fff7f6;
    color:var(--muted);
    font-size:14px;
    line-height:1.45;
}

.output-table th:first-child,
.output-table td:first-child{
    width:74px;
    text-align:center;
}

.output-table th:nth-child(2),
.output-table td:nth-child(2){
    width:92px;
    text-align:center;
}

.output-table th:nth-child(4),
.output-table td:nth-child(4){
    width:320px;
}

.output-order-input{
    width:74px;
    height:36px;
    border:1px solid var(--border);
    border-radius:8px;
    padding:0 8px;
    text-align:center;
    font-size:14px;
    background:#fff;
}

.output-label-input{
    width:100%;
    height:38px;
    border:1px solid var(--border);
    border-radius:8px;
    padding:0 10px;
    font-size:14px;
    background:#fff;
}

.output-order-input:focus,
.output-label-input:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(185,50,43,.14);
    outline:none;
}

.field-title{
    display:block;
    font-weight:600;
    color:var(--text);
}

.config-json-preview{
    max-height:320px;
    overflow:auto;
    padding:14px;
    border:1px solid var(--border);
    border-radius:10px;
    background:#111827;
    color:#e5e7eb;
    font-size:12px;
    line-height:1.45;
}

.report-config-form .panel{
    margin-bottom:18px;
}

.report-config-form select.form-control{
    appearance:auto;
}

@media (max-width:900px){
    .output-table th:nth-child(4),
    .output-table td:nth-child(4){
        width:auto;
    }
}
.actions-cell {
    min-width: 380px;
    white-space: nowrap;
}

.actions-cell .btn {
    margin-bottom: 4px;
}