/**
 * FacileSuite - Custom CSS
 * Bootstrap 5 based with custom styling
 */

/* ========================================
   VARIABILI CSS
======================================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    
    --sidebar-width: 260px;
    --header-height: 60px;
    
    --transition-speed: 0.3s;
}

/* ========================================
   RESET E BASE
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    background-color: #f9fafb;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--secondary-color);
}

/* Auto-resize textarea */
textarea.form-control {
    overflow: hidden;
    resize: none;
    transition: height 0.1s ease;
    min-height: 80px;
}

/* ========================================
   LAYOUT PRINCIPALE
======================================== */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform var(--transition-speed);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.sidebar-menu {
    padding: 20px 0;
    list-style: none;
}

.sidebar-menu-item {
    margin-bottom: 5px;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-speed);
}

.sidebar-menu-link:hover,
.sidebar-menu-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

/* Content Area */
.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    margin-right: 20px;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 20px 30px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

/* ========================================
   COMPONENTI
======================================== */

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    transition: transform var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stats-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    min-width: 0;
}

.stats-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
    order: 2;
}

.stats-card-label {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    order: 1;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 24px;
}

.breadcrumb-item {
    font-size: 14px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #9ca3af;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 10px 16px;
    transition: border-color var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tables */
.table {
    font-size: 14px;
}

.table thead th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #e5e7eb;
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 12px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border-left: 4px solid;
}

/* Dropdown User */
.user-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background var(--transition-speed);
}

.user-dropdown:hover {
    background: #f3f4f6;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
}

.user-role {
    font-size: 12px;
    color: #6b7280;
}

/* Language Dropdown */
#languageDropdown {
    border: 1px solid #d1d5db;
    padding: 8px 12px;
}

#languageDropdown .fi {
    font-size: 20px;
    line-height: 1;
}

#languageDropdown:hover {
    background: #f9fafb;
    border-color: var(--primary-color);
}

.dropdown-menu .dropdown-item .fi {
    font-size: 18px;
    line-height: 1;
}

.dropdown-menu .dropdown-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.dropdown-menu .dropdown-item:hover:not(.active) {
    background: #f3f4f6;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content-wrapper {
        margin-left: 0;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .header {
        padding: 0 15px;
    }
}

@media (max-width: 1024px) {
    /* Tablet in portrait mode */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content-wrapper {
        margin-left: 0;
    }
}

/* ========================================
   RTL SUPPORT
======================================== */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
}

[dir="rtl"] .content-wrapper {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

[dir="rtl"] .sidebar-menu-icon {
    margin-right: 0;
    margin-left: 12px;
}

/* RTL Mobile/Tablet */
@media (max-width: 1024px) {
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }
    
    [dir="rtl"] .sidebar.active {
        transform: translateX(0);
    }
    
    [dir="rtl"] .content-wrapper {
        margin-right: 0;
    }
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: "‹";
}

/* ========================================
   UTILITIES
======================================== */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }

.shadow-sm { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important; }
.shadow { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important; }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important; }

/* ========================================
   LOGIN & REGISTRAZIONE
======================================== */
body.login-page,
body.register-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper,
.register-wrapper {
    width: 100%;
    max-width: 900px;
    padding: 0;
}

.login-card,
.register-card {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header,
.register-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 40px;
    text-align: center;
}

.login-header h1,
.register-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.login-body,
.register-body {
    padding: 45px 60px 50px;
    background: white;
}

.input-group-custom {
    position: relative;
    margin-bottom: 20px;
}

.input-group-custom .input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #667eea;
    z-index: 5;
    pointer-events: none;
}

.input-group-custom input {
    height: 62px;
    padding: 12px 20px 12px 60px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    width: 100%;
}

.input-group-custom input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

.input-group-custom input::placeholder {
    color: #adb5bd;
}

.input-group-custom label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    font-size: 22px;
    transition: color 0.3s;
    z-index: 5;
}

.password-toggle:hover {
    color: #667eea;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 55px !important;
}

.btn-login,
.btn-register {
    width: 100%;
    padding: 14px 20px;
    font-size: 17px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    transition: all 0.3s;
}

.btn-login:hover,
.btn-register:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

/* Dropdown lingua nella pagina login */
.login-card .input-group-custom select.form-select,
.register-card .input-group-custom select.form-select {
    height: 50px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background-color: #f8f9fa;
    cursor: pointer;
}

.login-card .input-group-custom select.form-select:focus,
.register-card .input-group-custom select.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    background-color: white;
}

/* Trial Badge */
.trial-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.trial-badge i {
    margin-right: 5px;
}

/* Success Message Registration */
.success-message {
    text-align: center;
    padding: 20px;
}

.success-message h3 {
    color: #28a745;
    font-size: 24px;
    margin-bottom: 15px;
}

.success-message h3 i {
    font-size: 32px;
    vertical-align: middle;
    margin-right: 10px;
}

.codice-tenant-display {
    background: #f8f9fa;
    border: 2px dashed #667eea;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.codice-tenant-display .codice {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Form Section Registration */
.form-section {
    margin-bottom: 30px;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.form-section-title i {
    margin-right: 8px;
    color: #667eea;
}

.required-field::after {
    content: " *";
    color: #dc3545;
}

/* ========================================
   SIDEBAR SUBMENU
======================================== */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-submenu.active {
    max-height: 500px;
}

.sidebar-submenu-item {
    padding: 0;
}

.sidebar-submenu-link {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 50px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sidebar-submenu-link i {
    margin-inline-end: 10px;
    font-size: 16px;
}

.sidebar-submenu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding-inline-start: 55px;
}

.sidebar-submenu-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 600;
    border-inline-start: 3px solid #007bff;
}

.sidebar-menu-link .la-angle-down {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.sidebar-menu-link.active .la-angle-down {
    transform: rotate(180deg);
}

/* ========================================
   WORK REPORTS FORM
======================================== */
.mobile-form {
    max-width: 1200px;
    margin: 0 auto;
}

.operator-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.operator-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.operator-item label {
    margin-bottom: 0;
    cursor: pointer;
    flex: 1;
}

.service-item {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.service-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.service-code {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-name {
    font-size: 0.9rem;
    color: #6c757d;
}

.pdf-info-icon {
    color: #0d6efd;
    font-size: 1rem;
    text-decoration: none;
}

.pdf-info-icon:hover {
    color: #0b5ed7;
}

.service-checkbox {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    background: #f8f9fa;
}

.service-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.service-checkbox label {
    font-size: 1rem;
    margin-bottom: 0;
}

/* ========================================
   WORK REPORTS LIST - AI CHATBOT
======================================== */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(13, 110, 253, 0); }
    100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); }
}

.chat-message {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message .bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Rimuovi overlay del modal chatbot */
#aiChatbotModal.modal {
    background: transparent !important;
}

#aiChatbotModal .modal-backdrop {
    display: none !important;
}

/* Assicura che il modal non copra tutta la pagina */
body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* ========================================
   RESPONSIVE - TABLET
======================================== */
@media (min-width: 768px) and (max-width: 1199px) {
    /* Layout 2 colonne */
    .form-row-tablet {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    /* Layout 3 colonne per info rapportino */
    .form-row-3col {
        display: grid;
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 1rem;
        align-items: start;
    }
    
    .form-row-tablet .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group-full {
        grid-column: 1 / -1;
    }
    
    .mobile-form .card {
        margin-bottom: 1rem;
    }
    
    .mobile-form .card-body {
        padding: 1.5rem;
    }
    
    .mobile-form label {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .mobile-form input,
    .mobile-form select,
    .mobile-form textarea {
        font-size: 1rem;
        padding: 0.65rem;
    }
    
    /* Operatori e Servizi: layout centrato e flessibile */
    .operators-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
        align-items: flex-start;
    }
    
    .operators-grid .operator-item {
        width: auto;
        min-width: 250px;
        max-width: 280px;
        flex: 0 1 auto;
    }
    
    .services-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
        align-items: flex-start;
    }
    
    .services-grid .service-item {
        width: auto;
        min-width: 250px;
        max-width: 280px;
        flex: 0 1 auto;
    }
    
    /* Work Reports - Layout ottimizzato tablet */
    .work-reports-stats .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .work-reports-stats .card {
        height: 100%;
    }
    
    .work-reports-stats .card-body {
        padding: 1.25rem;
    }
    
    .work-reports-stats h6 {
        font-size: 0.85rem;
    }
    
    .work-reports-stats h3 {
        font-size: 1.75rem;
    }
    
    .work-reports-filters .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .work-reports-filters .form-control,
    .work-reports-filters .form-select {
        font-size: 0.95rem;
    }
    
    .work-reports-filters .btn {
        padding: 0.5rem 1rem;
    }
    
    /* Tabella rapportini - scroll fluido e leggibile */
    .work-reports-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .work-reports-table-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .work-reports-table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .work-reports-table-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    .work-reports-table-container::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    .work-reports-table-container table {
        min-width: 1100px;
    }
    
    /* Tabella rapportini - ridotta ma leggibile */
    .work-reports-table-container th {
        font-size: 0.85rem;
        padding: 0.75rem 0.5rem;
        font-weight: 600;
        white-space: nowrap;
    }
    
    .work-reports-table-container td {
        font-size: 0.9rem;
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    .work-reports-table-container .btn-group {
        gap: 0.25rem;
        display: flex;
    }
    
    .work-reports-table-container .btn-sm {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .work-reports-table-container .badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        white-space: nowrap;
    }
    
    /* Indicatore scroll */
    .table-scroll-indicator {
        display: block;
        text-align: center;
        padding: 0.5rem;
        background: linear-gradient(90deg, transparent, rgba(0,0,0,0.05), transparent);
        font-size: 0.85rem;
        color: #6c757d;
        margin-top: -1px;
    }

    /* Login responsive tablet */
    .login-wrapper,
    .register-wrapper {
        max-width: 500px;
    }
    
    .login-header,
    .register-header {
        padding: 40px 30px;
    }
    
    .login-header h1,
    .register-header h1 {
        font-size: 32px;
    }
    
    .login-body,
    .register-body {
        padding: 35px 30px 40px;
    }
    
    .input-group-custom .input-icon {
        left: 18px;
        font-size: 22px;
    }
    
    .input-group-custom input {
        height: 58px;
        padding: 10px 20px 10px 55px;
        font-size: 15px;
    }
    
    .btn-login,
    .btn-register {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* ========================================
   SIGNATURE PAD STYLING
======================================== */
.signature-pad-container {
    border: 2px solid #0d6efd;
    border-radius: 8px;
    background-color: #f8f9fa;
    padding: 15px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.signature-pad-container:hover {
    border-color: #0b5ed7;
    box-shadow: inset 0 0 12px rgba(13, 110, 253, 0.15);
}

.signature-canvas {
    border: 2px dashed #6c757d;
    background-color: #ffffff;
    cursor: crosshair;
    touch-action: none;
    display: block;
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.signature-canvas:active {
    border-color: #0d6efd;
    border-style: solid;
}

/* Dark mode support per signature pad */
[data-bs-theme="dark"] .signature-pad-container {
    background-color: #2d3748;
    border-color: #4a90e2;
}

[data-bs-theme="dark"] .signature-canvas {
    background-color: #1a202c;
    border-color: #718096;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .signature-pad-container {
        padding: 10px;
    }
    
    .signature-canvas {
        min-height: 150px;
    }
}

/* ========================================
   RESPONSIVE - DESKTOP LARGE
======================================== */
@media (min-width: 1200px) {
    /* Layout 2 colonne */
    .form-row-tablet {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    /* Layout 3 colonne per info rapportino */
    .form-row-3col {
        display: grid;
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 1rem;
        align-items: start;
    }
    
    .form-group-full {
        grid-column: 1 / -1;
    }
    
    .mobile-form .card-body {
        padding: 1.5rem;
    }
    
    .mobile-form label {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .mobile-form input,
    .mobile-form select,
    .mobile-form textarea {
        font-size: 1rem;
        padding: 0.65rem;
    }
    
    .operators-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
        align-items: flex-start;
    }
    
    .operators-grid .operator-item {
        width: auto;
        min-width: 250px;
        max-width: 280px;
        flex: 0 1 auto;
    }
    
    .services-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
        align-items: flex-start;
    }
    
    .services-grid .service-item {
        width: auto;
        min-width: 250px;
        max-width: 280px;
        flex: 0 1 auto;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
======================================== */
@media (max-width: 767px) {
    /* Form mobile */
    .mobile-form .form-group {
        margin-bottom: 1.5rem;
    }
    
    .mobile-form label {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    .mobile-form input,
    .mobile-form select,
    .mobile-form textarea {
        font-size: 1.1rem;
        padding: 0.75rem;
        height: auto;
    }
    
    .mobile-form .btn {
        font-size: 1.1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .service-checkbox {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .service-checkbox input[type="checkbox"] {
        width: 24px;
        height: 24px;
        margin-right: 10px;
    }
    
    /* Operatori e servizi - mobile centrati */
    .operators-grid,
    .services-grid {
        justify-content: center;
    }
    
    .operators-grid .operator-item,
    .services-grid .service-item {
        min-width: 280px;
        max-width: 100%;
    }
    
    /* Work Reports - Mobile */
    .work-reports-stats {
        grid-template-columns: 1fr;
    }
    
    .work-reports-header {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .work-reports-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .work-reports-header .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .work-reports-filters .col-md-3,
    .work-reports-filters .col-md-2,
    .work-reports-filters .col-md-1 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .work-reports-table-container {
        font-size: 0.85rem;
    }
    
    .work-reports-table-container table {
        min-width: 800px;
    }
    
    .work-reports-table-container th,
    .work-reports-table-container td {
        padding: 0.4rem;
        font-size: 0.85rem;
    }
    
    .work-reports-table-container .btn-group {
        flex-wrap: nowrap;
    }
    
    .work-reports-table-container .btn-sm {
        padding: 0.2rem 0.3rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    body.login-page,
    body.register-page {
        padding: 10px;
    }
    
    .login-wrapper,
    .register-wrapper {
        max-width: 100%;
    }
    
    .login-header,
    .register-header {
        padding: 30px 20px;
    }
    
    .login-header h1,
    .register-header h1 {
        font-size: 28px;
    }
    
    .login-body,
    .register-body {
        padding: 25px 20px 30px;
    }
    
    .btn-login,
    .btn-register {
        padding: 12px 20px;
        font-size: 16px;
    }
}
