/* ================================================
   ADMIN USUARIOS - Sport Frances
   ================================================ */

/* ===== ALERTAS ===== */
.alert-success,
.alert-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #d4edda;
}

.alert-error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #f8d7da;
}

.alert-success svg,
.alert-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stats-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    stroke: white;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.stat-success .stat-icon {
    background: rgba(40, 167, 69, 0.3);
}

.stat-warning .stat-icon {
    background: rgba(255, 193, 7, 0.3);
}

.stat-alumnos .stat-icon {
    background: rgba(59, 130, 246, 0.3);
}

.stat-entrenadores .stat-icon {
    background: rgba(245, 158, 11, 0.3);
}

.stat-instructores .stat-icon {
    background: rgba(20, 184, 166, 0.3);
}

.stat-admins .stat-icon {
    background: rgba(139, 92, 246, 0.3);
}

@media (max-width: 768px) {
    .stats-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid,
    .stats-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 20px;
    }
}

/* ===== FILTROS ===== */
.filters-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    stroke: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    transition: all 0.2s;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.filter-select-wrapper {
    min-width: 150px;
}

.filter-select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.filter-select option {
    background: #3d6a94;
    color: white;
}

.btn-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-filter svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 600px) {
    .filters-row {
        flex-direction: column;
    }

    .search-box,
    .filter-select-wrapper {
        min-width: 100%;
    }
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.btn-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #4a7ba7 0%, #5b8fb9 100%);
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(74, 123, 167, 0.3);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 123, 167, 0.4);
}

.btn-add svg {
    width: 18px;
    height: 18px;
}

/* ===== LISTA DE USUARIOS ===== */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

.user-card.inactive {
    opacity: 0.6;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.user-email {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-role {
    background: rgba(74, 123, 167, 0.4);
    color: white;
}

.badge-inactive {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.user-rut {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-action {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-action svg {
    width: 18px;
    height: 18px;
}

.btn-edit {
    background: rgba(74, 123, 167, 0.3);
    color: white;
}

.btn-edit:hover {
    background: rgba(74, 123, 167, 0.5);
}

.btn-password {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.btn-password:hover {
    background: rgba(255, 193, 7, 0.4);
}

.btn-password svg {
    stroke: #ffc107;
}

.btn-deactivate {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.btn-deactivate:hover {
    background: rgba(220, 53, 69, 0.4);
}

.btn-deactivate svg {
    stroke: #dc3545;
}

.btn-activate {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.btn-activate:hover {
    background: rgba(40, 167, 69, 0.4);
}

.btn-activate svg {
    stroke: #28a745;
}

.btn-delete {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.btn-delete:hover {
    background: rgba(220, 53, 69, 0.4);
}

.btn-delete svg {
    stroke: #dc3545;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.empty-state svg {
    width: 60px;
    height: 60px;
    stroke: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
    opacity: 0.8;
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4a7ba7 0%, #5b8fb9 100%);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 123, 167, 0.4);
}

/* ===== FORM CARD ===== */
.form-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.form-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4a7ba7 0%, #5b8fb9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

.form-icon-warning {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
}

.form-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin: 0 0 4px 0;
}

.form-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* ===== FORM SECTIONS ===== */
.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-select option {
    background: #3d6a94;
    color: white;
}

.field-validation-error {
    display: block;
    color: #ff8a8a;
    font-size: 12px;
    margin-top: 6px;
}

.validation-summary {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 20px;
    color: #f8d7da;
    font-size: 14px;
}

.validation-summary ul {
    margin: 0;
    padding-left: 20px;
}

/* ===== TOGGLE ===== */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.toggle {
    position: relative;
    width: 50px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: #28a745;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

/* ===== INFO/WARNING BOXES ===== */
.info-box,
.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.info-box {
    background: rgba(74, 123, 167, 0.2);
    border: 1px solid rgba(74, 123, 167, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.warning-box {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.info-box svg,
.warning-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-box svg {
    stroke: #ffc107;
}

/* ===== PASSWORD INPUT ===== */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-toggle-password:hover {
    color: white;
}

.btn-toggle-password svg {
    width: 20px;
    height: 20px;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
}

.btn-cancel {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-submit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4a7ba7 0%, #5b8fb9 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(74, 123, 167, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 123, 167, 0.4);
}

.btn-submit svg {
    width: 18px;
    height: 18px;
}

.btn-submit.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-submit.btn-warning:hover {
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.4);
}

@media (max-width: 480px) {
    .form-card {
        padding: 18px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}
