/* ============================================================
   ADMIN AREA STYLESHEET
   ============================================================ */

/* ---------- Login Page ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}
.login-container { width: 100%; max-width: 420px; padding: 1rem; }
.login-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 1.6rem; margin: 0.5rem 0 0.25rem; }
.login-header p { color: var(--text-muted); font-size: 0.9rem; }
.login-back { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }

/* ---------- Admin Layout ---------- */
.admin-body { background: var(--bg-light); }

.admin-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    width: 260px;
    height: 100vh;
    background: var(--primary);
    color: #fff;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: left var(--transition);
    overflow-y: auto;
}
.admin-sidebar.open { left: 0; }

.sidebar-header {
    padding: 1.25rem 1.5rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.65);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-link.active {
    color: var(--accent);
    background: rgba(201,168,76,0.1);
    border-left-color: var(--accent);
}
.sidebar-icon { font-size: 1.1rem; width: 24px; text-align: center; }

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ---------- Main Content ---------- */
.admin-main {
    margin-left: 0;
    transition: margin-left var(--transition);
    min-height: 100vh;
}

.admin-topbar {
    background: var(--bg);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 0.25rem;
}
.topbar-right { font-weight: 500; color: var(--text-light); font-size: 0.9rem; }

.admin-content { padding: 1.5rem; }

.admin-page-title { font-size: 1.6rem; margin-bottom: 1.5rem; }
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ---------- Stats Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-blue { background: #e3f2fd; }
.stat-green { background: #e8f5e9; }
.stat-purple { background: #f3e5f5; }
.stat-gold { background: #fff8e1; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h2 { font-size: 1.1rem; margin: 0; }
.card-body { padding: 1.25rem; }

.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

/* ---------- Chart Bars ---------- */
.chart-bars { display: flex; flex-direction: column; gap: 0.75rem; }
.chart-bar-item { display: flex; align-items: center; gap: 0.75rem; }
.chart-bar-label { width: 120px; font-size: 0.85rem; font-weight: 500; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-bar-track { flex: 1; height: 24px; background: var(--bg-light); border-radius: 12px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 12px; min-width: 4px; transition: width 0.6s ease; }
.chart-bar-value { width: 30px; text-align: right; font-weight: 700; font-size: 0.9rem; color: var(--primary); }

/* ---------- Prenotazioni filtri ---------- */
.prenotazioni-filtri {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}
.vista-toggle { display: flex; gap: 0.5rem; }
.data-nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.data-nav .form-control { width: auto; }

/* ---------- Drag Handle ---------- */
.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1.1rem;
    user-select: none;
}
.drag-handle:active { cursor: grabbing; }

/* ---------- Client Info Grid ---------- */
.client-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.client-info-item .label { display: block; font-size: 0.8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.client-info-item .value { font-size: 1.05rem; font-weight: 600; color: var(--primary); }

/* ---------- Overlay ---------- */
.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    display: none;
}
.admin-overlay.show { display: block; }

/* ---------- Slider Admin Grid ---------- */
.slider-admin-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.slider-admin-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: center;
}
.slider-admin-img { width: 160px; height: 90px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; }
.slider-admin-img img { width: 100%; height: 100%; object-fit: cover; }
.slider-admin-info { flex: 1; }
.slider-admin-info strong { display: block; margin-bottom: 0.25rem; }
.slider-admin-info span { color: var(--text-muted); font-size: 0.9rem; display: block; margin-bottom: 0.5rem; }
.slider-admin-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Service Image Preview (admin) ---------- */
.service-img-preview { max-width: 200px; max-height: 120px; border-radius: var(--radius); margin-top: 0.5rem; object-fit: cover; }
.service-img-current { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.service-img-current img { width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 600px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .prenotazioni-filtri { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (min-width: 992px) {
    .admin-sidebar { left: 0; }
    .admin-main { margin-left: 260px; }
    .sidebar-toggle { display: none; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .dashboard-grid { grid-template-columns: 1.5fr 1fr; }
}
