/* StudioCensea Backend Styles */

/* ===== UNIFORMAZIONE STILI ===== */

/* Header delle pagine standardizzato */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.page-header h1 i {
    margin-right: 0.5rem;
    color: #6c757d;
}

/* Pulsanti standardizzati */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn i {
    margin-right: 0.375rem;
}

.btn-group .btn {
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Card standardizzate - Manteniamo solo personalizzazioni non invasive */
.card {
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

/* IMPORTANTE: Forziamo gli stili AdminLTE con !important per override site.css */

/* Supporto per elevation di AdminLTE - DEVE sovrascrivere tutto */
.elevation-1 {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24) !important;
}

.elevation-2 {
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23) !important;
}

.elevation-3 {
    box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23) !important;
}

.elevation-4 {
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22) !important;
}

.elevation-5 {
    box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22) !important;
}

/* Supporto per card-outline di AdminLTE con !important */
.card-outline {
    border-top: 3px solid #dee2e6 !important;
}

.card-primary.card-outline {
    border-top-color: #007bff !important;
}

.card-secondary.card-outline {
    border-top-color: #6c757d !important;
}

.card-success.card-outline {
    border-top-color: #28a745 !important;
}

.card-info.card-outline {
    border-top-color: #17a2b8 !important;
}

.card-warning.card-outline {
    border-top-color: #ffc107 !important;
}

.card-danger.card-outline {
    border-top-color: #dc3545 !important;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 0.75rem 1.25rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.card-title i {
    margin-right: 0.5rem;
    color: #6c757d;
}

/* Tabelle standardizzate */
.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
}

.table-responsive {
    border-radius: 0.375rem;
}

/* Badge standardizzati */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

/* Filtri standardizzati */
.filters-section {
    margin-bottom: 1.5rem;
}

.filters-section .card-body {
    background-color: #f8f9fa;
}

/* Spazio uniforme */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Layout responsive standardizzato */
@media (max-width: 768px) {
    .page-header .d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .page-header h1 {
        margin-bottom: 1rem;
        text-align: center;
        font-size: 1.5rem;
    }
    
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .btn-group .btn {
        margin: 0.125rem;
        min-width: 120px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .filters-section .form-inline {
        flex-direction: column;
    }
    
    .filters-section .form-group {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .filters-section .form-control {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
}

.brand-image {
    width: 33px;
    height: 33px;
}

/* Logo Styling */
.brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    transition: width 0.3s ease-in-out;
    overflow: hidden;
    white-space: nowrap;
    height: auto;
    min-height: 4.5rem;
}

.brand-image-expanded {
    max-width: calc(80% - 1rem) !important;
    max-height: 57px !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.brand-image-collapsed {
    max-height: 32px !important;
    max-width: 32px !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* Centra il logo quando la sidebar è collassata */
.sidebar-collapse .brand-link {
    padding: 1rem 0.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4.5rem; /* Allinea con l'altezza del brand-link */
}

/* Nasconde completamente l'immagine non utilizzata per evitare sovrapposizioni */
.sidebar-collapse .brand-image-expanded {
    display: none !important;
}

.sidebar-collapse .brand-image-collapsed {
    display: block !important;
}

/* Stili per i sottomenu */
.nav-treeview {
    padding-left: 1rem; /* Indentazione dei sottomenu */
}

.nav-treeview .nav-link {
    padding-left: 2rem; /* Padding aggiuntivo per i link dei sottomenu */
    font-size: 0.9rem; /* Font leggermente più piccolo */
}

.nav-treeview .nav-icon {
    font-size: 0.8rem; /* Icone più piccole per i sottomenu */
}

.brand-text {
    font-weight: 300 !important;
}

/* Dashboard cards */
.small-box {
    border-radius: 0.375rem;
}

/* Fix per le icone delle small-box che si spostano */
.small-box {
    position: relative !important;
    overflow: hidden !important;
}

.small-box .icon {
    transition: opacity 0.3s ease !important;
    color: rgba(0, 0, 0, 0.15) !important;
    z-index: 0 !important;
}

/* Fix icon positioning - keep AdminLTE defaults but with controlled animation */
.small-box .icon > i,
.small-box .icon > i.fa,
.small-box .icon > i.fas,
.small-box .icon > i.far,
.small-box .icon > i.fab,
.small-box .icon > i.fal,
.small-box .icon > i.fad,
.small-box .icon > i.ion {
    position: absolute !important;
    right: 15px !important;
    top: 20px !important;
    font-size: 70px !important;
    transition: transform 0.3s ease !important;
    transform-origin: center center !important;
}

/* CRITICAL: Override AdminLTE hover with controlled scale */
.small-box:hover .icon > i,
.small-box:hover .icon > i.fa,
.small-box:hover .icon > i.fas,
.small-box:hover .icon > i.far,
.small-box:hover .icon > i.fab,
.small-box:hover .icon > i.fal,
.small-box:hover .icon > i.fad,
.small-box:hover .icon > i.ion,
.small-box:hover .icon > svg {
    /* Subtle scale with rotation for elegant effect */
    transform: scale(1.05) rotate(3deg) !important;
    -webkit-transform: scale(1.05) rotate(3deg) !important;
    color: rgba(0, 0, 0, 0.2) !important;
}

.small-box .inner {
    position: relative !important;
    z-index: 1 !important;
}

/* Grid improvements */
.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-responsive {
    border-radius: 0.375rem;
}

/* Cards */
.card {
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    border: none;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,.125);
    padding: 0.75rem 1.25rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Buttons */
.btn {
    border-radius: 0.25rem;
    font-weight: 500;
}

.btn-group-sm > .btn, .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Application buttons - AdminLTE style */
.btn-app {
    border-radius: 3px;
    position: relative;
    padding: 15px 5px;
    margin: 0 0 10px 10px;
    min-width: 80px;
    height: 60px;
    text-align: center;
    color: #666;
    border: 1px solid #ddd;
    background-color: #f4f4f4;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-app:hover {
    background: #f0f0f0;
    color: #444;
    border-color: #aaa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-app > i {
    font-size: 20px;
    display: block;
    margin-bottom: 5px;
}

.btn-app.bg-primary {
    color: #fff !important;
    background-color: #007bff !important;
    border-color: #007bff;
}

.btn-app.bg-success {
    color: #fff !important;
    background-color: #28a745 !important;
    border-color: #28a745;
}

.btn-app.bg-warning {
    color: #212529 !important;
    background-color: #ffc107 !important;
    border-color: #ffc107;
}

.btn-app.bg-danger {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545;
}

.btn-app.bg-info {
    color: #fff !important;
    background-color: #17a2b8 !important;
    border-color: #17a2b8;
}

.btn-app.bg-secondary {
    color: #fff !important;
    background-color: #6c757d !important;
    border-color: #6c757d;
}

.btn-app.bg-primary:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3;
}

.btn-app.bg-success:hover {
    background-color: #218838 !important;
    border-color: #1e7e34;
}

.btn-app.bg-warning:hover {
    background-color: #e0a800 !important;
    border-color: #d39e00;
}

.btn-app.bg-danger:hover {
    background-color: #c82333 !important;
    border-color: #bd2130;
}

.btn-app.bg-info:hover {
    background-color: #138496 !important;
    border-color: #117a8b;
}

.btn-app.bg-secondary:hover {
    background-color: #5a6268 !important;
    border-color: #545b62;
}

/* Forms */
.form-control {
    border-radius: 0.25rem;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* File input styling */
.form-control-file {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: #fff;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Sidebar */
.main-sidebar {
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}

.nav-sidebar .nav-link {
    border-radius: 0.25rem;
    margin: 0.1rem 0.5rem;
}

.nav-sidebar .nav-link.active {
    background-color: #007bff !important;
    color: white !important;
}

/* Content wrapper */
.content-wrapper {
    background-color: #f8f9fa;
}

.content-header {
    padding: 15px 0;
}

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 400;
    margin: 0;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #6c757d;
}

/* Status badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.5rem;
}

/* Login page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    margin: 7% auto;
}

.login-logo {
    font-size: 2.1rem;
    font-weight: 300;
    margin-bottom: 0.9rem;
    text-align: center;
    color: white;
}

.login-card-body {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .small-box .inner h3 {
        font-size: 2rem;
    }
    
    .card-tools .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.card {
    animation: fadeInUp 0.5s ease-out;
}

/* Loading states */
.btn:disabled {
    cursor: not-allowed;
}

.table-loading {
    position: relative;
}

.table-loading::after {
    content: "Caricamento...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 500;
}

/* ===== STILI EMAIL PLAIN TEXT ===== */
/* Uniforma la visualizzazione delle email plain text con il resto del sistema */
.email-plain-text,
.message-body-text,
pre.email-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif !important;
    font-size: 14px;
    line-height: 1.6;
    color: #212529;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: none;
    border: none;
    margin: 0;
    padding: 0;
}

/* Rimuove font monospace da tutti i pre nelle email */
.email-view pre,
.message-view pre,
.card-body pre {
    font-family: inherit !important;
}