/* ── ADMIN PANEL STYLES ── */
        .admin-wrapper {
            width: 100%;
        }

        .admin-header {
            margin-bottom: 40px;
        }

        .admin-header h1 {
            font-size: 42px;
            font-weight: 700;
            letter-spacing: -1px;
            background: linear-gradient(135deg, #f43f5e, #a78bfa);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 8px;
        }

        .admin-header p {
            font-size: 15px;
            color: var(--text-secondary);
            margin-bottom: 0;
        }

        /* Stats bar */
        .admin-stats {
            display: flex;
            gap: 16px;
            margin-bottom: 32px;
            flex-wrap: wrap;
        }

        .stat-card {
            background: rgba(31, 41, 55, 0.6);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            padding: 16px 24px;
            min-width: 140px;
        }

        .stat-card .stat-label {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }

        .stat-card .stat-value {
            font-size: 28px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .stat-card.admin-stat .stat-value { color: #f43f5e; }
        .stat-card.user-stat  .stat-value { color: #a78bfa; }

        /* Search + filter bar */
        .admin-controls {
            display: flex;
            gap: 12px;
            margin-bottom: 24px;
            flex-wrap: wrap;
            align-items: center;
        }

        .admin-search {
            flex: 1;
            min-width: 200px;
            background: rgba(31, 41, 55, 0.6);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 8px;
            padding: 10px 16px;
            color: var(--text-primary);
            font-size: 14px;
            outline: none;
            transition: border-color 0.2s;
        }

        .admin-search:focus {
            border-color: rgba(99, 102, 241, 0.5);
        }

        .admin-search::placeholder { color: rgba(209,213,219,0.4); }

        .filter-select {
            background: rgba(31, 41, 55, 0.6);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 8px;
            padding: 10px 16px;
            color: var(--text-primary);
            font-size: 14px;
            outline: none;
            cursor: pointer;
        }

        .filter-select option { background: #1f2937; }

        /* Table */
        .admin-table-wrap {
            background: rgba(15, 23, 42, 0.5);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 16px;
            overflow: hidden;
        }

        .admin-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }

        .admin-table thead {
            background: rgba(31, 41, 55, 0.8);
        }

        .admin-table th {
            padding: 14px 20px;
            text-align: left;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-secondary);
            font-weight: 600;
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }

        .admin-table td {
            padding: 14px 20px;
            border-bottom: 1px solid rgba(255,255,255,0.04);
            color: var(--text-secondary);
            vertical-align: middle;
        }

        .admin-table tbody tr {
            transition: background 0.2s;
        }

        .admin-table tbody tr:hover {
            background: rgba(99, 102, 241, 0.05);
        }

        .admin-table tbody tr:last-child td {
            border-bottom: none;
        }

        /* User info cell */
        .user-cell {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-avatar-sm {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: linear-gradient(135deg, #6366f1, #ec4899);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 13px;
            color: white;
            flex-shrink: 0;
        }

        .user-name {
            color: var(--text-primary);
            font-weight: 500;
        }

        .user-id {
            font-size: 11px;
            color: rgba(209,213,219,0.4);
        }

        /* Badge ruolo */
        .badge-ruolo {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .badge-ruolo.admin {
            background: rgba(244, 63, 94, 0.15);
            color: #f43f5e;
            border: 1px solid rgba(244, 63, 94, 0.3);
        }

        .badge-ruolo.user {
            background: rgba(167, 139, 250, 0.1);
            color: #a78bfa;
            border: 1px solid rgba(167, 139, 250, 0.2);
        }

        /* Azioni */
        .actions-cell {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .btn-action {
            padding: 6px 14px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .btn-promote {
            background: rgba(99, 102, 241, 0.15);
            color: #818cf8;
            border: 1px solid rgba(99, 102, 241, 0.3);
        }

        .btn-promote:hover {
            background: rgba(99, 102, 241, 0.3);
            color: #fff;
        }

        .btn-demote {
            background: rgba(167, 139, 250, 0.1);
            color: #a78bfa;
            border: 1px solid rgba(167, 139, 250, 0.2);
        }

        .btn-demote:hover {
            background: rgba(167, 139, 250, 0.25);
            color: #fff;
        }

        .btn-delete {
            background: rgba(244, 63, 94, 0.1);
            color: #f43f5e;
            border: 1px solid rgba(244, 63, 94, 0.25);
        }

        .btn-delete:hover {
            background: rgba(244, 63, 94, 0.25);
            color: #fff;
        }

        .btn-action:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }

        /* Loading / empty / error states */
        .table-state {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-secondary);
        }

        .table-state .state-icon {
            font-size: 40px;
            margin-bottom: 12px;
        }

        .spinner {
            width: 32px;
            height: 32px;
            border: 3px solid rgba(99,102,241,0.2);
            border-top-color: #6366f1;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 12px;
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        /* Toast notifiche */
        #toast {
            position: fixed;
            bottom: 30px;
            right: 30px;
            padding: 12px 20px;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 500;
            z-index: 9999;
            opacity: 0;
            transform: translateY(10px);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            pointer-events: none;
        }

        #toast.show {
            opacity: 1;
            transform: translateY(0);
        }

        #toast.success {
            background: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.4);
            color: #34d399;
        }

        #toast.error {
            background: rgba(244, 63, 94, 0.15);
            border: 1px solid rgba(244, 63, 94, 0.4);
            color: #f43f5e;
        }

        /* Modal conferma eliminazione */
        .confirm-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(4px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .confirm-overlay.active { display: flex; }

        .confirm-box {
            background: #0f172a;
            border: 1px solid rgba(244, 63, 94, 0.3);
            border-radius: 16px;
            padding: 32px;
            max-width: 380px;
            width: 90%;
            text-align: center;
        }

        .confirm-box .confirm-icon { font-size: 40px; margin-bottom: 16px; }

        .confirm-box h3 {
            color: var(--text-primary);
            font-size: 18px;
            margin-bottom: 8px;
        }

        .confirm-box p {
            color: var(--text-secondary);
            font-size: 14px;
            margin-bottom: 24px;
            line-height: 1.5;
        }

        .confirm-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
        }

        .btn-cancel-confirm {
            padding: 10px 24px;
            border-radius: 8px;
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.1);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s;
        }

        .btn-cancel-confirm:hover { background: rgba(255,255,255,0.1); color: #fff; }

        .btn-confirm-delete {
            padding: 10px 24px;
            border-radius: 8px;
            background: rgba(244, 63, 94, 0.2);
            border: 1px solid rgba(244, 63, 94, 0.4);
            color: #f43f5e;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.2s;
        }

        .btn-confirm-delete:hover { background: rgba(244, 63, 94, 0.35); color: #fff; }

        /* Link admin nella navbar */
        .nav-admin-link {
            color: #f43f5e !important;
        }

        .nav-admin-link:hover {
            background-color: rgba(244, 63, 94, 0.1) !important;
        }
