/* Bloqueo scroll al abrir modal */
body.tm-modal-open { overflow: hidden; }

.tm-admin-users {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    color: #fff;
}

.tm-users-header {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 18px;
}

.tm-admin-users h2 {
    margin: 0;
    color: orange;
    font-size: 28px;
    letter-spacing: .3px;
}

.tm-muted {
    color: #9aa3ad;
    font-size: 13px;
    margin: 6px 0 0;
}

.tm-users-search {
    min-width: 340px;
}

.tm-users-search label {
    display: block;
    font-size: 12px;
    color: #ff9b2f;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .7px;
}

.tm-users-search input {
    width: 100%;
    background: #0b0b0b;
    border: 1px solid rgba(255,255,255,.10);
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}
.tm-users-search input:focus {
    border-color: rgba(255,165,0,.55);
    box-shadow: 0 0 0 4px rgba(255,165,0,.10);
}

.tm-users-list {
    display: grid;
    gap: 12px;
}

/* Filas usuario */
.tm-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(18,18,18,.9), rgba(10,10,10,.95));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 14px 16px;
}

.tm-user-name {
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 2px;
}

.tm-user-email {
    font-size: 13px;
    color: #9aa3ad;
}

/* Botones */
.tm-btn {
    border: none;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: .2px;
}

.tm-btn-view {
    background: orange;
    color: #000;
}

.tm-btn-primary {
    background: orange;
    color: #000;
}

.tm-btn-secondary {
    background: rgba(255,255,255,.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,.10);
}

/* =========================
 * MODAL
 * ========================= */
.tm-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 99999;
}

.tm-modal.is-open { display: block; }

.tm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(6px);
}

.tm-modal-dialog {
    position: relative;
    width: min(980px, calc(100% - 22px));
    margin: 30px auto;
    background: linear-gradient(180deg, rgba(18,18,18,.98), rgba(10,10,10,.98));
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,.55);
    overflow: hidden;
}

.tm-modal-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.tm-modal-head h3 {
    margin: 0;
    font-size: 18px;
}

.tm-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.tm-modal-body {
    padding: 16px;
}

/* Skeleton */
.tm-skeleton-line {
    height: 14px;
    background: rgba(255,255,255,.06);
    border-radius: 10px;
    margin-bottom: 10px;
    animation: pulse 1.2s infinite ease-in-out;
}
@keyframes pulse {
    0% { opacity: .35; }
    50% { opacity: .8; }
    100% { opacity: .35; }
}

/* Cards dentro del modal */
.tm-detail-grid {
    display: grid;
    grid-template-columns: 1.4fr .6fr;
    gap: 14px;
    margin-bottom: 14px;
}

.tm-card {
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 14px;
}

.tm-card-full { margin-top: 12px; }

.tm-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.tm-card-head h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
}

.tm-card-actions { display: flex; gap: 8px; }

/* Form grid */
.tm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tm-field label {
    display: block;
    font-size: 12px;
    color: #ff9b2f;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 6px;
}

.tm-field input,
.tm-field select {
    width: 100%;
    padding: 11px 12px;
    background: #0b0b0b;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    color: #fff;
    outline: none;
    line-height: 1.2;
}

.tm-field input:disabled {
    opacity: .85;
    cursor: not-allowed;
}

.tm-field input:focus,
.tm-field select:focus {
    border-color: rgba(255,165,0,.55);
    box-shadow: 0 0 0 4px rgba(255,165,0,.10);
}

.tm-field-wide { grid-column: 1 / -1; }

.tm-inline-msg {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    display: none;
}
.tm-inline-msg.ok {
    background: rgba(0,120,60,.25);
    border: 1px solid rgba(0,180,90,.35);
}
.tm-inline-msg.err {
    background: rgba(150,0,0,.22);
    border: 1px solid rgba(255,0,0,.25);
}

/* Entrenamientos */
.tm-train-filter {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.tm-train-list {
    display: grid;
    gap: 10px;
}

.tm-train-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 12px;
}

.tm-train-title {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tm-chip {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,165,0,.12);
    border: 1px solid rgba(255,165,0,.22);
    color: #ffb45c;
    font-size: 12px;
    font-weight: 800;
}

.tm-train-sub {
    margin-top: 6px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 12px;
}

.tm-kv {
    color: #d7dde3;
    opacity: .95;
}

#tmTrainingsWrap.is-loading { opacity: .55; pointer-events: none; }

.tm-empty, .tm-error {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.35);
}
.tm-error { border-color: rgba(255,0,0,.25); }

/* Modal imagen */
.tm-imgmodal .tm-imgmodal-dialog {
    position: relative;
    width: min(920px, calc(100% - 22px));
    margin: 30px auto;
    background: rgba(0,0,0,.92);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    overflow: hidden;
    padding: 12px;
}

.tm-imgmodal img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 900px) {
    .tm-users-header { flex-direction: column; align-items: stretch; }
    .tm-users-search { min-width: 100%; }
    .tm-detail-grid { grid-template-columns: 1fr; }
    .tm-form-grid { grid-template-columns: 1fr; }
    .tm-train-row { flex-direction: column; align-items: stretch; }
}
