body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-top: 76px; /* Height of fixed navbar */
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-back:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(220, 109, 29, 0.3);
}

.btn-back i {
    transition: transform 0.3s ease;
}

.btn-back:hover i {
    transform: translateX(-3px);
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 2rem;
    filter: brightness(0) invert(1);
}

.deadline-badge {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 50px;
}

.info-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.info-item label {
    font-weight: 600;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.info-item .value {
    color: #6c757d;
}

.description-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.btn-custom {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    margin: 0.5rem;
    transition: all 0.3s ease;
}

.btn-white {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
}

.btn-white:hover {
    background: transparent;
    color: white;
}

.btn-outline-white {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-white:hover {
    background: white;
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #c75f18;
    border-color: #c75f18;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.login-register-box {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 2rem;
}

.login-register-box h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.description-content {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.description-content h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.description-section-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-top: 3rem;
}

.sidebar {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 2rem;
}

.contact-info {
    background: #e9ecef;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.contact-info h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.questionari-list {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.questionario-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.questionario-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* SweetAlert2 Custom Styling */
.swal2-popup {
    padding: 2rem !important;
}

.swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
}

.swal2-input,
.swal2-textarea {
    margin: 0.5rem 0 !important;
    padding: 0.75rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    font-size: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.swal2-input:focus,
.swal2-textarea:focus {
    border-color: var(--primary-color) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(220, 109, 29, 0.1) !important;
}

.swal2-html-container .mb-3 {
    margin-bottom: 1rem !important;
    text-align: left !important;
}

.swal2-html-container .form-label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    text-align: left !important;
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .btn-back {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}

/* Modern Futuristic Navigation */
.navbar-custom {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(220, 109, 29, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 0;
}

.navbar-custom.fixed-top {
    z-index: 1030;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

.navbar-brand-logo {
    height: 40px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover .navbar-brand-logo {
    transform: scale(1.05);
}

.nav-link-modern {
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    padding: 0.5rem 1.25rem !important;
    color: #2c3e50 !important;
    transition: all 0.3s ease;
}

.nav-link-modern::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), #e8772e);
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-modern:hover {
    color: var(--primary-color) !important;
}

.nav-link-modern:hover::before {
    width: 80%;
}

.nav-user {
    font-weight: 600;
    color: #2c3e50 !important;
    padding: 0.5rem 1.25rem !important;
    position: relative;
}

.nav-user::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary-color), #e8772e);
    border-radius: 2px;
}

.btn-login,
.btn-register,
.btn-logout {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-login {
    background: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-color);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    z-index: -1;
}

.btn-login:hover {
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 109, 29, 0.3);
}

.btn-login:hover::before {
    width: 300%;
    height: 300%;
}

.btn-register {
    background: linear-gradient(135deg, var(--primary-color), #e8772e);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(220, 109, 29, 0.2);
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 109, 29, 0.4);
}

.btn-logout {
    background: rgba(220, 109, 29, 0.08);
    color: var(--primary-color);
    border: 1.5px solid transparent;
}

.btn-logout:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 109, 29, 0.3);
}

/* Navbar toggler animation */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: 2px solid rgba(220, 109, 29, 0.2);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23dc6d1d' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile menu styles */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-radius: 12px;
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-link-modern::before {
        display: none;
    }

    .nav-link-modern {
        padding: 0.75rem 1rem !important;
        border-radius: 8px;
        margin: 0.25rem 0;
    }

    .nav-link-modern:hover {
        background: rgba(220, 109, 29, 0.08);
    }

    .nav-user::before {
        display: none;
    }

    .nav-user {
        padding: 0.75rem 1rem !important;
        background: rgba(220, 109, 29, 0.08);
        border-radius: 8px;
        margin: 0.25rem 0;
    }

    .btn-login,
    .btn-register,
    .btn-logout {
        display: block;
        text-align: center;
        margin: 0.5rem 0;
        width: 100%;
    }
}


/* Body and Layout */
body.auth-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container for Login/Register Pages */
.login-container,
.register-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

/* Card Styles */
.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
}

.register-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 3rem;
    max-width: 650px;
    width: 100%;
    margin: 0 auto;
}

/* Logo Styles */
.login-logo {
    max-width: 200px;
    margin-bottom: 2rem;
}

.register-logo {
    max-width: 180px;
    margin-bottom: 1.5rem;
}

/* Form Control Styles */
.login-card .form-control:focus,
.register-card .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 109, 29, 0.25);
}

/* Divider */
.divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
}

.divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    color: #6c757d;
}

/* Password Requirements */
.password-requirements {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Responsive Styles */
@media (max-width: 576px) {

    .login-card,
    .register-card {
        padding: 2rem 1.5rem;
    }
}


/* =========================================================================
   SHARED DESIGN PRIMITIVES (used across index.php, pratica.php, etc.)
   Promoted from index.php's inline $additional_css so all pages can use them.
   ========================================================================= */

/* Welcome header */
.welcome-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #b8551a 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 20px 20px;
}

/* Section title */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

/* Action button (quick action tile) */
.action-btn {
    display: block;
    background: white;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    border: 2px solid transparent;
    height: 100%;
}
.action-btn:hover {
    box-shadow: 0 6px 20px rgba(220, 109, 29, 0.25);
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff 0%, #fff5f0 100%);
}
.action-btn .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
    transition: all 0.3s ease;
}
.action-btn:hover .icon { transform: scale(1.1) rotate(5deg); }
.action-btn .btn-text {
    color: #2d3748;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    transition: all 0.3s ease;
}
.action-btn:hover .btn-text { color: var(--primary-color); }

@media (max-width: 767px) {
    .action-btn { padding: 1.25rem 0.75rem; }
    .action-btn .icon { width: 45px; height: 45px; font-size: 1.25rem; margin-bottom: 0.75rem; }
    .action-btn .btn-text { font-size: 0.875rem; }
}
@media (max-width: 576px) {
    .action-btn { padding: 1rem 0.5rem; }
    .action-btn .icon { width: 40px; height: 40px; font-size: 1.125rem; margin-bottom: 0.5rem; }
    .action-btn .btn-text { font-size: 0.75rem; }
}

/* Bando card (list item) */
.bando-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}
.bando-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}
.bando-card h5 { color: #2d3748; margin-bottom: 0.75rem; font-weight: 600; }
.bando-card .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #718096;
}
.bando-card .meta > span { display: flex; align-items: center; gap: 0.375rem; }

/* Service + status badges */
.service-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-inserted { background: #e6f7ff; color: #0066cc; }
.status-pending { background: #fff7e6; color: #d46b08; }
.status-approved { background: #f6ffed; color: #52c41a; }
.status-rejected { background: #fff1f0; color: #cf1322; }

/* Submission item */
.submission-item {
    padding: 1rem;
    border-left: 3px solid #e2e8f0;
    margin-bottom: 0.75rem;
    background: #f7fafc;
    border-radius: 0 8px 8px 0;
    transition: all 0.2s ease;
}
.submission-item:hover { background: #edf2f7; border-left-color: var(--primary-color); }

/* Quick action button (sidebar) */
.quick-action-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}
.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 109, 29, 0.3);
}

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: #718096; }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }


/* =========================================================================
   PRATICA PAGE — reuses existing design primitives (info-card, bando-card,
   section-title, btn-primary, empty-state). Only components without
   equivalents are defined below.
   ========================================================================= */

/* Legacy color/spacing tokens consumed by inline styles in pratica.js.
   Kept here so the JS module stays source-compatible without a sweeping
   find/replace across inline style="" attributes. */
:root {
    --w: #ffffff;
    --bg: #f8f9fa;
    --bg2: #eeecea;
    --bg3: #e4e2de;
    --b: #e9ecef;
    --b2: #d4d1cc;
    --b3: #b8b4ae;
    --t0: #2d3748;
    --t1: #2c2c30;
    --t2: #4a4a50;
    --t3: #6c757d;
    --t4: #a0aec0;
    --t5: #c0c0c6;
    --tx: #2d3748;
    --tx2: #6c757d;
    --tx3: #a0aec0;
    --em: #28a745;
    --em2: #218838;
    --em3: #10b981;
    --em4: #b7eb8f;
    --ep: #f0fff4;
    --em-bg: #f0fff4;
    --am: #d46b08;
    --am2: #856404;
    --am3: #f59e0b;
    --am4: #ffeaa7;
    --ap: #fff3cd;
    --am-bg: #fff3cd;
    --ro: #dc3545;
    --ro2: #c82333;
    --ro3: #fb7185;
    --ro4: #f5c6cb;
    --rp: #f8d7da;
    --ro-bg: #f8d7da;
    --sk: #17a2b8;
    --sk2: #0050b3;
    --sk3: #38bdf8;
    --sk4: #91d5ff;
    --sp: #e6f7ff;
    --sk-bg: #e6f7ff;
    --vi: #6f42c1;
    --vi2: #6d28d9;
    --vi3: #a78bfa;
    --vi4: #ddd6fe;
    --vp: #f5eefe;
    --r1: 4px;
    --r2: 8px;
    --r3: 10px;
    --r4: 16px;
    --s0: 0 1px 2px rgba(0, 0, 0, 0.04);
    --s1: 0 1px 4px rgba(0, 0, 0, 0.08);
    --s2: 0 4px 12px rgba(0, 0, 0, 0.08);
    --s3: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Pratica shell */
.pratica-shell { padding-bottom: 2rem; }
.pratica-shell .container-pratica { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.pratica-shell .num { font-family: 'Courier New', monospace; font-weight: 600; }

/* Pratica header — uses welcome-section as base, adds KPI strip */
.pratica-header-meta { font-size: 0.875rem; opacity: 0.9; margin-top: 0.25rem; }
.pratica-header-meta span + span::before { content: '·'; margin: 0 0.5rem; }

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}
.kpi-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    backdrop-filter: blur(10px);
}
.kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 0.3rem;
}
.kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}
.kpi-value.kpi-sm { font-size: 1rem; }

@media (max-width: 768px) {
    .kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .kpi-card { padding: 0.625rem 0.75rem; }
    .kpi-value { font-size: 1.1rem; }
}

/* Tabs — nav-pills underline style using primary-color */
.pratica-tabs {
    display: flex;
    gap: 0;
    background: white;
    border-bottom: 2px solid #f0f0f0;
    border-radius: 10px 10px 0 0;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}
.pratica-tabs::-webkit-scrollbar { display: none; }
.pratica-tabs .tab-btn {
    flex: none;
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6c757d;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.pratica-tabs .tab-btn i { margin-right: 0.4rem; font-size: 0.85rem; }
.pratica-tabs .tab-btn:hover { color: var(--primary-color); }
.pratica-tabs .tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.pane { display: none; }
.pane.active { display: block; }
.pane { min-width: 0; }
.pane > * { max-width: 100%; }

/* Pane loading / empty (reuse empty-state from index.php but scoped) */
.pane-loading,
.pane-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}
.pane-loading .spinner-border { color: var(--primary-color); }
.pane-empty i { font-size: 3rem; opacity: 0.3; margin-bottom: 0.75rem; display: block; }

/* Mini KPI grid (inside Panoramica) */
.mini-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.mini-kpi {
    background: white;
    border-radius: 10px;
    padding: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}
.mini-kpi .mini-kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
    margin-bottom: 0.3rem;
}
.mini-kpi .mini-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}
@media (max-width: 576px) {
    .mini-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Progress bar */
.pratica-progress {
    height: 6px;
    border-radius: 99px;
    background: #e9ecef;
    overflow: hidden;
}
.pratica-progress-bar {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary-color), #e8772e);
    transition: width 0.5s ease;
}

/* Pipeline stepper */
.pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 1rem 0;
}
.pipe-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.pipe-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    z-index: 2;
    transition: all 0.3s;
    background: #cbd5e0;
}
.pipe-dot.done { background: #28a745; }
.pipe-dot.active {
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(220, 109, 29, 0.2);
}
.pipe-line {
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}
.pipe-step:last-child .pipe-line { display: none; }
.pipe-line.done { background: #28a745; }
.pipe-label {
    font-size: 0.72rem;
    color: #6c757d;
    margin-top: 0.4rem;
    text-align: center;
    font-weight: 500;
}
.pipe-step.active .pipe-label { color: var(--primary-color); font-weight: 700; }
.pipe-step.done .pipe-label { color: #28a745; }

/* Quick-action grid (uses existing .action-btn but in compact grid) */
.qa-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

/* Proiezione erogazione card */
.proj-card {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.proj-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(40, 167, 69, 0.15);
    font-size: 0.9rem;
}
.proj-row:last-child { border-bottom: none; }
.proj-row.total {
    border-top: 2px solid #28a745;
    padding-top: 0.55rem;
    margin-top: 0.3rem;
    font-weight: 700;
    font-size: 1rem;
}
.proj-label { color: #555; }
.proj-value { font-weight: 600; font-family: 'Courier New', monospace; }

/* Activity list (recent activity) */
.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    background: var(--primary-color);
}
.activity-dot.dot-success { background: #28a745; }
.activity-dot.dot-warning { background: #ffc107; }
.activity-dot.dot-danger { background: #dc3545; }
.activity-dot.dot-info { background: #17a2b8; }
.activity-text { font-size: 0.875rem; color: #2d3748; }
.activity-time { font-size: 0.75rem; color: #a0aec0; margin-top: 0.1rem; }

/* Voci (piano di spesa) layout */
.voci-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    min-height: 400px;
}
.voci-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    margin: 0;
    color: var(--primary-color);
}
.voci-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: #4a5568;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.voci-nav-item:hover { background: #f8f9fa; color: var(--primary-color); }
.voci-nav-item.active {
    border-left-color: var(--primary-color);
    background: #fff5f0;
    color: var(--primary-color);
    font-weight: 600;
}
.voci-count {
    margin-left: auto;
    font-size: 0.72rem;
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 99px;
}
.voci-nav-item.active .voci-count { background: var(--primary-color); color: white; }

@media (max-width: 768px) {
    .voci-layout { grid-template-columns: 1fr; }
}

/* Deadline items (scadenziario) */
.deadline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid #e2e8f0;
    background: white;
    border-radius: 0 10px 10px 0;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}
.deadline-item:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.deadline-item.dl-urgent { border-left-color: #dc3545; }
.deadline-item.dl-soon { border-left-color: #ffc107; }
.deadline-item.dl-ok { border-left-color: #28a745; }
.deadline-item.dl-past { border-left-color: #adb5bd; opacity: 0.6; }
.deadline-date {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 90px;
    flex-shrink: 0;
    color: var(--primary-color);
}
.deadline-title { font-weight: 600; font-size: 0.9rem; color: #2d3748; }
.deadline-desc { font-size: 0.8rem; color: #718096; margin-top: 0.2rem; }

/* Comunicazioni timeline */
.comm-timeline {
    position: relative;
    padding-left: 1.75rem;
    max-width: 100%;
    box-sizing: border-box;
}
.comm-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}
.comm-item {
    position: relative;
    margin-bottom: 1rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.comm-item::before {
    content: '';
    position: absolute;
    left: -1.25rem;
    top: 1.1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
}
.comm-item.comm-client::before { background: #17a2b8; }

/* Spunte stile WhatsApp (solo messaggi inviati da te) */
.comm-ticks-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.35rem;
}
.comm-ticks {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    user-select: none;
}
.comm-ticks .fa-check {
    font-size: 0.72rem;
    font-weight: 700;
}
.comm-ticks-sent {
    color: #8696a0;
}
.comm-ticks-sent .fa-check {
    margin: 0;
}
.comm-ticks-read {
    color: #53bdeb;
}
.comm-ticks-read .fa-check:first-child {
    margin-right: -0.38em;
    opacity: 0.95;
}
.comm-ticks-read .fa-check:last-child {
    position: relative;
    z-index: 1;
}

.comm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.comm-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d3748;
    word-break: break-word;
    min-width: 0;
    flex: 1;
}
.comm-date { font-size: 0.75rem; color: #a0aec0; white-space: nowrap; flex-shrink: 0; }
.comm-body {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.comm-form {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    box-sizing: border-box;
}
.comm-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 90px;
    transition: border-color 0.2s;
}
.comm-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 109, 29, 0.12);
}

/* Variazioni cards */
.var-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.var-hd {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.var-code { font-family: 'Courier New', monospace; font-size: 0.8rem; color: #a0aec0; }
.var-type { font-size: 1rem; font-weight: 600; color: #2d3748; margin-top: 0.15rem; }
.var-meta { font-size: 0.78rem; color: #a0aec0; margin-top: 0.2rem; }
.var-body {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.6;
    border-bottom: 1px solid #f0f0f0;
}
.var-delta-strip {
    display: flex;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    flex-wrap: wrap;
}
.var-delta {
    font-size: 0.8rem;
    padding: 0.22rem 0.6rem;
    border-radius: 99px;
    font-weight: 600;
}
.var-delta.pos { background: #d4edda; color: #155724; }
.var-delta.neg { background: #f8d7da; color: #721c24; }
.var-delta.neutral { background: #e2e8f0; color: #4a5568; }

/* Simulatore */
.sim-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 768px) { .sim-grid { grid-template-columns: 1fr; } }
.sim-input-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.sim-result-card {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 10px;
    padding: 1.25rem;
}
.sim-row { display: flex; justify-content: space-between; padding: 0.35rem 0; font-size: 0.9rem; }
.sim-row.total {
    border-top: 2px solid #1890ff;
    padding-top: 0.55rem;
    margin-top: 0.3rem;
    font-weight: 700;
}
.sim-label { color: #6c757d; }
.sim-value { font-family: 'Courier New', monospace; font-weight: 600; }
.sim-delta {
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.4rem;
}
.sim-delta.pos { background: #d4edda; color: #155724; }
.sim-delta.neg { background: #f8d7da; color: #721c24; }
.sim-delta.neutral { background: #e2e8f0; color: #4a5568; }

/* Raffronto table (confronto tab) */
.raffronto-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.raffronto-table th {
    padding: 0.55rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    text-align: left;
}
.raffronto-table th.col-prev { background: #fff5f5; color: #c53030; }
.raffronto-table th.col-cons { background: #f0fff4; color: #22543d; }
.raffronto-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid #f0f0f0; }
.raffronto-table tr.changed td.col-prev { background: rgba(245, 101, 101, 0.04); }
.raffronto-table tr.changed td.col-cons { background: rgba(72, 187, 120, 0.04); }
.raffronto-table tr.total-row td {
    border-top: 2px solid #e9ecef;
    font-weight: 700;
    background: #f8f9fa;
}
.delta-pos { color: #28a745; font-weight: 700; }
.delta-neg { color: #dc3545; font-weight: 700; }

/* Confronto pratiche table */
.cp-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.cp-table th {
    padding: 0.625rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    text-align: left;
}
.cp-table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid #f0f0f0; }
.cp-table tr:hover td { background: #f8f9fa; }
.cp-table tr.current td { background: #fff5f0; font-weight: 600; }
.cp-bar { height: 6px; border-radius: 99px; background: #e9ecef; overflow: hidden; min-width: 80px; }
.cp-bar-fill { height: 100%; border-radius: 99px; transition: width 0.5s; }

/* Questionario step cards */
.q-step-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
.q-step-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
}
.q-step-title { font-size: 1rem; font-weight: 600; color: var(--primary-color); }
.q-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    margin-right: 0.5rem;
}
.q-step-body { padding: 1.25rem; }
.q-field {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 1.15rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
.q-field:hover { border-color: #cbd5e0; }
.q-field.answered {
    border-left: 3px solid #28a745;
    background: #f0fff4;
}
.q-field-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.q-field-label .q-req { color: #dc3545; }
.q-field-hint { font-size: 0.78rem; color: #718096; margin-bottom: 0.4rem; line-height: 1.5; }
.q-field input[type=text],
.q-field input[type=number],
.q-field input[type=date],
.q-field input[type=email],
.q-field select,
.q-field textarea {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    width: 100%;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.q-field input:focus,
.q-field select:focus,
.q-field textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 109, 29, 0.12);
    outline: none;
}
.q-field textarea { min-height: 80px; resize: vertical; }
.q-admin-files {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
}
.q-admin-files-title { font-size: 0.78rem; font-weight: 700; color: #0050b3; margin-bottom: 0.35rem; }
.q-file-item { font-size: 0.8rem; color: #0050b3; padding: 0.15rem 0; display: flex; align-items: center; gap: 0.35rem; }
.q-progress { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.q-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e0;
    transition: all 0.2s;
}
.q-progress-dot.done { background: #28a745; }
.q-progress-dot.active {
    background: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 109, 29, 0.2);
}
.q-progress-dot.error { background: #dc3545; }
.q-sent-info {
    background: #f0fff4;
    border: 1px solid #b7eb8f;
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    font-size: 0.8rem;
    color: #22543d;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Dropzone */
.dropzone-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
}
.dropzone-area:hover,
.dropzone-area.dragover {
    border-color: var(--primary-color);
    background: #fff5f0;
}
.dropzone-area .dz-icon {
    font-size: 2rem;
    color: #a0aec0;
    margin-bottom: 0.5rem;
}
.dropzone-area .dz-text { font-size: 0.9rem; color: #4a5568; }
.dropzone-area .dz-text strong { color: var(--primary-color); }

.file-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f0fff4;
    border: 1px solid #b7eb8f;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-size: 0.82rem;
}
.file-preview .remove-file { cursor: pointer; color: #dc3545; margin-left: auto; }

/* Archivio grid */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.archive-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    cursor: pointer;
}
.archive-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(220, 109, 29, 0.15);
    transform: translateY(-2px);
}
.archive-icon { font-size: 2rem; color: #a0aec0; margin-bottom: 0.4rem; }
.archive-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.2rem;
    word-break: break-word;
}
.archive-meta { font-size: 0.75rem; color: #a0aec0; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-hd {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6c757d;
    text-align: center;
    padding: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cal-day {
    min-height: 60px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.3rem 0.4rem;
    font-size: 0.78rem;
    transition: background 0.15s;
}
.cal-day:hover { background: #f8f9fa; }
.cal-day.today { border-color: #28a745; background: #f0fff4; }
.cal-day.other { opacity: 0.35; }
.cal-day .cal-num { font-weight: 600; font-size: 0.78rem; margin-bottom: 0.15rem; }
.cal-evt {
    font-size: 0.65rem;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-evt.urgent { background: #f8d7da; color: #721c24; }
.cal-evt.soon { background: #fff3cd; color: #856404; }
.cal-evt.ok { background: #d4edda; color: #155724; }

/* Onboarding */
.onboard-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 9998; }
.onboard-card {
    position: fixed;
    z-index: 9999;
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 380px;
}
.onboard-step {
    font-size: 0.72rem;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}
.onboard-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; color: #2d3748; }
.onboard-text { font-size: 0.9rem; color: #4a5568; line-height: 1.6; margin-bottom: 1rem; }
.onboard-dots { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.onboard-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e0;
    transition: all 0.2s;
}
.onboard-dots span.active {
    background: var(--primary-color);
    width: 20px;
    border-radius: 4px;
}
.onboard-btns { display: flex; justify-content: space-between; }

/* Firma OTP banner */
.firma-banner {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.firma-banner .firma-icon { font-size: 1.5rem; }
.firma-banner .firma-text { flex: 1; }
.firma-banner .firma-text h4 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.15rem; color: #0050b3; }
.firma-banner .firma-text p { font-size: 0.82rem; color: #1890ff; margin: 0; }

/* Scadenze banner */
.scad-banner {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 0.75rem 1.15rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.scad-banner.urgent { background: #f8d7da; border-color: #f5c6cb; }
.scad-banner-icon { font-size: 1.15rem; flex-shrink: 0; }
.scad-banner-text { flex: 1; font-size: 0.9rem; color: #2d3748; }
.scad-banner-text strong { color: #856404; }
.scad-banner.urgent .scad-banner-text strong { color: #721c24; }
.scad-banner-days {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Cosa manca list */
.manca-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid #e9ecef;
    background: white;
}
.manca-item:hover { border-color: var(--primary-color); background: #fff5f0; }
.manca-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.manca-icon.warn { background: #fff3cd; color: #856404; }
.manca-icon.error { background: #f8d7da; color: #721c24; }
.manca-icon.info { background: #e6f7ff; color: #0050b3; }
.manca-text { flex: 1; font-size: 0.875rem; color: #2d3748; }
.manca-text small { display: block; color: #a0aec0; font-size: 0.75rem; margin-top: 0.1rem; }
.manca-arrow { color: #a0aec0; font-size: 0.75rem; }

/* Doc expiry */
.doc-expiry {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.doc-expiry.expiring { border-color: #ffeaa7; background: #fff3cd; }
.doc-expiry.expired { border-color: #f5c6cb; background: #f8d7da; }
.doc-expiry-icon { font-size: 1rem; flex-shrink: 0; }
.doc-expiry-text { flex: 1; font-size: 0.875rem; }
.doc-expiry-days { font-family: 'Courier New', monospace; font-weight: 600; font-size: 0.9rem; }

/* Timeline (attività) */
.tl-wrap { position: relative; padding-left: 2rem; }
.tl-wrap::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}
.tl-event { position: relative; margin-bottom: 1.25rem; }
.tl-event::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: var(--primary-color);
    z-index: 1;
}
.tl-event.tipo-stato::before { background: #28a745; }
.tl-event.tipo-questionario::before { background: #17a2b8; }
.tl-event.tipo-documento::before { background: #6f42c1; }
.tl-event.tipo-scadenza::before { background: #ffc107; }
.tl-event.tipo-comunicazione::before { background: #06b6d4; }
.tl-event.tipo-variazione::before { background: #ec4899; }
.tl-event.tipo-sistema::before { background: #a0aec0; }
.tl-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.tl-card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.tl-date { font-size: 0.72rem; color: #a0aec0; font-family: 'Courier New', monospace; }
.tl-action { font-size: 0.9rem; font-weight: 600; color: #2d3748; }
.tl-desc { font-size: 0.82rem; color: #6c757d; margin-top: 0.15rem; }

/* SAL badges */
.sal-badge {
    font-size: 0.72rem;
    padding: 0.18rem 0.5rem;
    border-radius: 99px;
    font-weight: 600;
}
.sal-accettato { background: #d4edda; color: #155724; }
.sal-ridotto { background: #fff3cd; color: #856404; }
.sal-escluso { background: #f8d7da; color: #721c24; }
.sal-nel_sal { background: #e6f7ff; color: #0050b3; }
.sal-da_verificare { background: #e2e8f0; color: #4a5568; }

/* Report box */
.report-box { overflow: hidden; }
.report-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.report-box-header h3 {
    font-size: 1.05rem;
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

/* Period navigator (pill group) */
.report-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 999px;
    padding: 0.15rem;
}
.report-nav .btn {
    border: none;
    background: transparent;
    color: var(--primary-color);
    padding: 0.25rem 0.55rem;
    line-height: 1;
    border-radius: 999px;
    font-size: 0.75rem;
}
.report-nav .btn:hover { background: white; color: var(--primary-color); }
.report-nav .btn:focus { box-shadow: none; }
.report-period-label {
    font-weight: 600;
    font-size: 0.82rem;
    min-width: 110px;
    text-align: center;
    color: #2d3748;
    white-space: nowrap;
}

/* Body (rendered by JS) */
.report-box-body { font-size: 0.875rem; }
.report-box-body .report-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
    color: #6c757d;
}
.report-box-body .report-header > span:first-child {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

/* KPI strip — auto-fit for narrow containers */
.report-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.report-kpi-card {
    background: #f8f9fa;
    border: 1px solid #eef0f2;
    border-radius: 8px;
    padding: 0.6rem 0.4rem;
    text-align: center;
    min-width: 0;
}
.report-kpi-label {
    font-size: 0.65rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.report-kpi-value {
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 0.2rem;
    color: var(--primary-color);
    word-break: break-word;
    line-height: 1.15;
}

/* Section headings inside the report body */
.report-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0.85rem 0 0.4rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.report-section-title i { color: var(--primary-color); font-size: 0.78rem; }

/* Row item (scadenza/evento) */
.report-list-row {
    display: flex;
    gap: 0.6rem;
    padding: 0.4rem 0;
    font-size: 0.82rem;
    border-bottom: 1px solid #f0f0f0;
    align-items: baseline;
    word-break: break-word;
}
.report-list-row:last-child { border-bottom: none; }
.report-list-date {
    font-family: 'Courier New', monospace;
    color: #6c757d;
    min-width: 68px;
    flex-shrink: 0;
    font-size: 0.74rem;
    font-weight: 600;
}
.report-list-text { flex: 1; min-width: 0; color: #2d3748; }
.report-list-text.fw-bold { font-weight: 600; }

.report-empty {
    text-align: center;
    padding: 1.5rem 0.5rem;
    color: #a0aec0;
    font-size: 0.85rem;
}

/* Panoramica 2-column layout */
.panoramica-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1rem;
}
@media (max-width: 991px) {
    .panoramica-grid { grid-template-columns: 1fr; }
}

/* Variazioni stato badges */
.var-stato-approvata { background: #d4edda; color: #155724; }
.var-stato-rifiutata { background: #f8d7da; color: #721c24; }
.var-stato-in_istruttoria { background: #fff3cd; color: #856404; }
.var-stato-bozza { background: #e6f7ff; color: #0050b3; }
.var-stato-presentata { background: #f5eefe; color: #6f42c1; }
