/* File: css/admin-dashboard.css */
/* Stili specifici per la Dashboard di Amministrazione */

/* Layout principale */
.admin-container {
    padding: 2rem 0;
    min-height: 100vh;
    background: transparent;
}

/* Header della dashboard */
.dashboard-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* KPI Cards */
.kpi-card {
    background: white;
    border: 1px solid var(--hub-bordo);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

/* Niente barra in alto: il colore della scheda lo porta gia il bordo a sinistra,
   due accenti sullo stesso riquadro facevano confusione. */
.kpi-card::before {
    content: none;
}

.kpi-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.kpi-label {
    color: var(--muted-color);
    font-weight: 500;
    margin-bottom: 0;
}

.kpi-icon {
    font-size: 3rem;
    opacity: 0.1;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Sezioni della dashboard */
.dashboard-section {
    background: white;
    border: 1px solid var(--hub-bordo);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    background: #f6fafc;
    padding: 1.5rem;
    border-bottom: 1px solid var(--hub-bordo);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0;
    flex: 1;
}

.section-content {
    padding: 1.5rem;
}

/* Filtri */
.filters-container, .filter-section {
    background: #f6fafc;
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--hub-bordo);
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 600;
    color: var(--muted-color);
    margin-bottom: 0.5rem;
}

/* Pulsanti */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 58, 95, 0.32);
}

.btn-success {
    background: linear-gradient(135deg, #4E7614 0%, var(--brand-verde) 100%);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(92, 119, 1, 0.32);
}

/* Tabelle */
.table-container {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-color: var(--hub-bordo);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f6fafc;
}

/* Grafici */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.chart-container--compact {
  height: 180px; /* riduce l’altezza per limitare lo spazio vuoto */
  margin: 0.5rem 0; /* margini più contenuti */
}

/* Widget di avvisi */
.alert-widget {
    border-left: 4px solid var(--danger-color);
    background: rgba(192, 57, 43, 0.07);
    border-color: rgba(192, 57, 43, 0.25);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.alert-widget .alert {
    margin-bottom: 0.5rem;
}

.alert-widget .alert:last-child {
    margin-bottom: 0;
}

/* Contatori */
.counter-display {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    border: 1px solid var(--hub-bordo);
    box-shadow: var(--shadow-sm);
}

.counter-number {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
}

.counter-label {
    color: var(--muted-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* Loading states */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Timestamp */
.last-update {
    color: var(--muted-color);
    font-size: 0.9rem;
    text-align: right;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-title {
        font-size: 2rem;
    }
    
    .kpi-number {
        font-size: 2rem;
    }
    
    .counter-number {
        font-size: 2.5rem;
    }
    
    .section-content {
        padding: 1rem;
    }
    
    .filters-container {
        padding: 1rem;
    }
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-section {
    animation: fadeInUp 0.6s ease-out;
}

.kpi-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Utilità */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.border-gradient {
    border: 2px solid;
    border-image: var(--gradient-accent) 1;
}

/* Miglioramenti layout */
.card-body {
    padding: 1.5rem;
}

.card-body h6 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.badge {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

/* Pulsanti export migliorati */
.btn-outline-success {
    border: 2px solid var(--success-color);
    color: var(--success-color);
    background: transparent;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-success:hover {
    background: var(--success-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(92, 119, 1, 0.3);
}

/* Miglioramenti tabelle */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
}

.table th {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Spacing migliorato */
.mb-3 {
    margin-bottom: 1.5rem !important;
}

.mt-3 {
    margin-top: 1.5rem !important;
}

/* Form controls migliorati */
.form-control, .form-select {
    border: 1px solid var(--hub-bordo);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--hub-turchese);
    box-shadow: 0 0 0 3px rgba(22, 166, 166, 0.18);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--muted-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Stili per le card dei dettagli dei tecnici */
.technician-detail-card {
    background: #f6fafc;
    border: 1px solid var(--hub-bordo);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    transition: all 0.3s ease;
}

.technician-detail-card:hover {
    background: #eef4f8;
    border-color: #cfe0ea;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.technician-detail-card h6 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0;
}

.technician-detail-card .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.technician-detail-card .text-muted {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.technician-detail-card .fw-bold {
    font-size: 1.1rem;
    color: var(--dark-color);
}