/* admin.css - Stili specifici per la Dashboard Amministratore */

/* Layout Base */
.admin-body {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 10;
    border-right: 1px solid var(--border-color);
    background: var(--bg-color);
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.admin-logo {
    height: 40px;
}

.badge-admin {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background: var(--bg-light);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item.text-danger {
    color: #ef4444;
    margin-top: auto;
}

.nav-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    box-shadow: var(--shadow-sm);
}

.header-content h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.75rem;
    color: var(--text-main);
}

.header-content p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Table */
.table-container {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    padding: 1rem;
    overflow-x: auto;
    box-shadow: var(--shadow-md);
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.modern-table th {
    padding: 1rem;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.modern-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.modern-table tbody tr:hover {
    background: var(--bg-light);
}

.customer-info {
    display: flex;
    flex-direction: column;
}

.customer-name {
    font-weight: 600;
    color: var(--text-main);
}

.customer-email {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.canceled {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.inactive {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Modal */
.glass-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-main);
    padding: 0;
    box-shadow: var(--shadow-lg);
}

.glass-modal::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--secondary-color-dark);
    color: white;
    border-color: var(--secondary-color-dark);
}

.modal-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0 0 0.25rem 0;
}

.modal-header p {
    margin: 0;
    color: var(--text-light);
}

.modal-body {
    padding: 0;
    overflow-y: auto;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem;
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-color);
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

/* Info Grid inside Modal */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.info-label {
    display: block;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Installations List */
.location-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.location-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.location-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.installation-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.installation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.installation-tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--border-color);
    color: var(--text-main);
    font-weight: 500;
}

/* Interventions Select Colors */
.select-da-prenotare {
    background-color: rgba(56, 189, 248, 0.2) !important;
    color: #0284c7 !important;
    border-color: #38bdf8 !important;
    font-weight: 600;
}

.select-prenotato {
    background-color: rgba(250, 204, 21, 0.2) !important;
    color: #ca8a04 !important;
    border-color: #facc15 !important;
    font-weight: 600;
}

.select-svolto {
    background-color: rgba(74, 222, 128, 0.2) !important;
    color: #16a34a !important;
    border-color: #4ade80 !important;
    font-weight: 600;
}

/* Search input focus */
#search-input:focus,
.intervention-select:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.1);
}

/* Buttons */
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-action {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-action:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.btn-action.text-danger:hover {
    color: #ef4444;
}
/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-main {
        margin-left: 0;
    }
}
