/**
 * Stile principale
 * 
 * File CSS per l'intero sistema.
 */


i, [class^="fa-"], [class*=" fa-"], .fa, .fas, .far, .fab {
  font-style: normal !important;
  font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome' !important;
}


/* Variabili */
:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #e74c3c;
    --secondary-dark: #c0392b;
    --success-color: #2ecc71;
    --success-dark: #27ae60;
    --warning-color: #f39c12;
    --warning-dark: #d35400;
    --danger-color: #e74c3c;
    --danger-dark: #c0392b;
    --info-color: #3498db;
    --info-dark: #2980b9;
    --light-color: #ecf0f1;
    --light-dark: #bdc3c7;
    --dark-color: #34495e;
    --dark-dark: #2c3e50;
    --text-color: #333;
    --body-bg: #f5f5f5;
    --card-bg: #fff;
    --header-bg: #fff;
    --sidebar-bg: #2c3e50;
    --sidebar-color: #ecf0f1;
    --sidebar-width: 250px;
    --header-height: 60px;
    --footer-height: 40px;
    --border-radius: 4px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset e base */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--body-bg);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Header */
.main-header {
    background-color: var(--header-bg);
    box-shadow: var(--box-shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 100;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin-right: 20px;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.main-nav a:hover::after {
    width: 100%;
}

.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
}

.user-info:hover {
    background-color: var(--light-color);
}

.user-info span {
    margin-right: 5px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    min-width: 150px;
    padding: 5px 0;
    margin-top: 5px;
    display: none;
    list-style: none;
}

.user-menu.active .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 8px 15px;
    color: var(--text-color);
    text-decoration: none;
}

.dropdown-menu li a:hover {
    background-color: var(--light-color);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    overflow-y: auto;
    z-index: 99;
    box-shadow: var(--box-shadow);
}

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

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

.sidebar-menu > li > a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--sidebar-color);
    text-decoration: none;
    position: relative;
}

.sidebar-menu > li > a i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar-menu > li > a:hover, 
.sidebar-menu > li.active > a {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu .submenu {
    list-style: none;
    padding-left: 35px;
    display: none;
}

.sidebar-menu > li.active .submenu {
    display: block;
}

.sidebar-menu .submenu li a {
    display: block;
    padding: 8px 15px;
    color: var(--sidebar-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.sidebar-menu .submenu li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - var(--footer-height));
    padding: 15px 0;
    margin-top: var(--header-height);
}

.main-content.with-sidebar {
    margin-left: var(--sidebar-width);
}

/* Footer */
.main-footer {
    background-color: var(--header-bg);
    color: var(--text-color);
    padding: 10px 0;
    text-align: center;
    height: var(--footer-height);
}

.main-footer.with-sidebar {
    margin-left: var(--sidebar-width);
}

/* Cards */
.dashboard-card, .card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px;
    border-bottom: 1px solid var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.card-content {
    padding: 15px;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 15px;
    display: flex;
    align-items: center;
}

.stat-icon {
    font-size: 2rem;
    margin-right: 15px;
    color: var(--primary-color);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

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

.quick-action-btn i {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--light-color);
}

.table th {
    font-weight: 600;
    background-color: var(--light-color);
}

.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-striped tbody tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

.badge-update {
    background-color: var(--primary-color);
    color: white;
}

.badge-backup {
    background-color: var(--success-color);
    color: white;
}

.badge-maintenance {
    background-color: var(--warning-color);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-group.has-error .form-control {
    border-color: var(--danger-color);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 15px;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--light-color);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
}

.btn:hover {
    background-color: var(--light-dark);
    color: var(--text-color);
}

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

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: var(--success-dark);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: var(--warning-dark);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-dark);
    color: white;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    transition: opacity 0.5s ease;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error, .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Auth pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--body-bg);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 0 15px;
}

.auth-box {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Pagination */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    justify-content: center;
}

.pagination li {
    margin: 0 3px;
}

.pagination a, .pagination span {
    display: block;
    padding: 6px 12px;
    border: 1px solid var(--light-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
}

.pagination a:hover {
    background-color: var(--light-color);
}

.pagination .active span {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .disabled span {
    color: #999;
    cursor: not-allowed;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-0 {
    margin-top: 0;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

/* Form row */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 10px;
    padding-left: 10px;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding-right: 10px;
    padding-left: 10px;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-right: 10px;
    padding-left: 10px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Filter container */
.filter-container {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
}

.search-field {
    display: flex;
    gap: 10px;
}

/* Headers */
.page-header {
    margin-bottom: 20px;
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Responsive */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-header {
        position: static;
        height: auto;
    }
    
    .header-content {
        flex-direction: column;
        padding: 10px 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        margin-top: 10px;
    }
    
    .main-nav li {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        margin-bottom: 15px;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 0;
    }
    
    .main-content.with-sidebar {
        margin-left: 0;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .col-md-6, .col-md-3, .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Icone Font Awesome */
.icon-eye:before { content: "\f06e"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-edit:before { content: "\f303"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-trash:before { content: "\f2ed"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-plus:before { content: "\f067"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-refresh:before { content: "\f021"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-backup:before { content: "\f0c7"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-activity:before { content: "\f0ae"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-arrow-left:before { content: "\f060"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-dashboard:before { content: "\f3fd"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-users:before { content: "\f0c0"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-user-plus:before { content: "\f234"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-globe:before { content: "\f0ac"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-globe-plus:before { content: "\f0ac"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-clipboard-plus:before { content: "\f46d"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-chart:before { content: "\f080"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-tools:before { content: "\f7d9"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-external-link:before { content: "\f35d"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-bell:before { content: "\f0f3"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-cog:before { content: "\f013"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-paper-plane:before { content: "\f1d8"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-list:before { content: "\f03a"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-pause:before { content: "\f04c"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-play:before { content: "\f04b"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-download:before { content: "\f019"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.icon-chevron-down:before { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; }

/* Migliora aspetto dei pulsanti con icone */
.btn i {
    margin-right: 5px;
}

.btn-sm i {
    margin-right: 0;
}

/* Correggi l'allineamento delle icone nei badge */
.badge i {
    margin-right: 3px;
}

/* Stili per le azioni */
.actions {
    display: flex;
    gap: 5px;
}

/* Icone nella sidebar */
.sidebar-menu i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

i.fa, 
i.fas,
i.far, 
i.fal, 
i.fab,
i.fa-solid,
i.fa-regular,
i.fa-light,
i.fa-thin,
i.fa-duotone,
i.fa-brands,
span.fa, 
span.fas,
span.far, 
span.fal, 
span.fab,
span.fa-solid,
span.fa-regular,
span.fa-light,
span.fa-thin,
span.fa-duotone,
span.fa-brands {
  font-style: normal !important;
  font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome' !important;
  display: inline-block !important;
}