﻿/* ==========================
   LOKER'S - TARIFAS (UI PRO)
   FIX + ESTILO 100% ESTABLE
   ========================== */

:root {
    --bg: #0b1220;
    --panel: rgba(255,255,255,.06);
    --panel2: rgba(255,255,255,.09);
    --border: rgba(255,255,255,.12);
    --border2: rgba(255,255,255,.18);
    --text: rgba(255,255,255,.92);
    --muted: rgba(255,255,255,.70);
    --muted2: rgba(255,255,255,.55);
    --shadow: 0 18px 60px rgba(0,0,0,.45);
    --shadow2: 0 10px 30px rgba(0,0,0,.35);
    --radius: 16px;
    --radius2: 14px;
    --blue: #4aa3ff;
    --blue2: #2b7bff;
    --teal: #22c7b8;
    --danger: #ff5c6b;
}

* {
    box-sizing: border-box;
}

.tf-page {
    padding: 18px 18px 26px;
    color: var(--text);
}

/* ======================================
   HEADER
   ====================================== */
.tf-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 6px 2px 14px;
}

.tf-kicker {
    font-size: 12px;
    letter-spacing: .3px;
    color: var(--muted2);
    margin-bottom: 4px;
}

.tf-title {
    font-size: 28px;
    margin: 0;
    line-height: 1.15;
}

.tf-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.tf-stat {
    min-width: 96px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05));
    border: 1px solid var(--border);
    box-shadow: var(--shadow2);
    text-align: right;
}

.tf-stat__label {
    font-size: 12px;
    color: var(--muted);
}

.tf-stat__value {
    font-size: 20px;
    font-weight: 800;
    margin-top: 2px;
}

/* ======================================
   LAYOUT (SIEMPRE EN COLUMNA)
   ====================================== */
.tf-grid {
    display: grid;
    grid-template-columns: 1fr; /* ✅ UNA COLUMNA (FORM ARRIBA, TABLA ABAJO) */
    gap: 16px;
    align-items: start;
    max-width: 980px; /* ✅ CENTRADO Y PRO */
    margin: 0 auto;
}

/* ======================================
   CARDS
   ====================================== */
.tf-card {
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tf-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.08));
}

.tf-card__title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 13px;
}

.tf-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(255,255,255,.10));
    box-shadow: 0 0 0 3px rgba(74,163,255,.16);
}

.tf-card__body {
    padding: 14px;
}

.tf-card__foot {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.04));
}

/* ======================================
   FORM
   ====================================== */
.tf-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tf-field--full {
    grid-column: 1 / -1;
}

.tf-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.tf-inputwrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,.18);
}

.tf-ico {
    opacity: .85;
    font-size: 14px;
}

.tf-input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
}

    .tf-input::placeholder {
        color: rgba(255,255,255,.35);
    }

.tf-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted2);
}

/* ----- Time parts (hora/minuto) ----- */
.tf-inputwrap--timeparts {
    gap: 10px;
}

.tf-timeparts {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.tf-timepart {
    width: 78px;
    max-width: 92px;
    text-align: center;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid var(--border2);
    background: rgba(255,255,255,.04);
    color: var(--text);
    outline: none;
    font-size: 14px;
}

    .tf-timepart:focus {
        border-color: rgba(74,163,255,.55);
        box-shadow: 0 0 0 3px rgba(74,163,255,.14);
    }

.tf-timecolon {
    color: rgba(255,255,255,.68);
    font-weight: 900;
}

/* ======================================
   BOTONES
   ====================================== */
.tf-card.tf-form .tf-card__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.tf-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.06);
    color: var(--text);
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
}

    .tf-btn:hover {
        background: rgba(255,255,255,.10);
    }

.tf-btn--primary {
    border-color: rgba(74,163,255,.38);
    background: linear-gradient(180deg, rgba(74,163,255,.24), rgba(74,163,255,.10));
}

    .tf-btn--primary:hover {
        border-color: rgba(74,163,255,.60);
        background: linear-gradient(180deg, rgba(74,163,255,.30), rgba(74,163,255,.12));
    }

.tf-btn--ghost {
    background: transparent;
}

.tf-btn__ico {
    font-size: 14px;
}

/* ======================================
   TABLE CARD (Header tools)
   ====================================== */
.tf-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tf-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,.18);
    font-size: 12px;
}

.tf-pill__k {
    color: var(--muted);
}

.tf-pill__v {
    font-weight: 900;
}

/* ======================================
   TABLE (100% estable + sticky arriba)
   ====================================== */
.tf-card__body--table {
    padding: 0; /* ✅ tabla encajada limpia */
}

/* Contenedor scrolleable */
.tf-tablewrap {
    position: relative !important;
    overflow: auto !important;
    max-height: 340px;
    /* separación visual interna */
    padding: 10px 12px 12px;
}

/* Tabla */
.tf-tablex {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 0; /* ✅ evita que se "apriete raro" */
}

    /* ✅ FIX DEFINITIVO: THEAD ARRIBA */
    .tf-tablex thead {
        display: table-header-group !important;
        position: sticky !important;
        top: 0 !important;
        bottom: auto !important;
        z-index: 30 !important;
    }

        .tf-tablex thead th {
            position: sticky !important;
            top: 0 !important;
            bottom: auto !important;
            z-index: 31 !important;
            padding: 12px 12px;
            font-size: 12px;
            color: rgba(255,255,255,.90);
            background: linear-gradient(180deg, rgba(10,18,32,.96), rgba(10,18,32,.82)) !important;
            border-bottom: 1px solid var(--border);
            box-shadow: 0 10px 18px rgba(0,0,0,.22) !important;
        }

            /* Bordes suaves en header */
            .tf-tablex thead th:first-child {
                border-top-left-radius: 14px;
            }

            .tf-tablex thead th:last-child {
                border-top-right-radius: 14px;
            }

    /* Body */
    .tf-tablex tbody td {
        padding: 12px 12px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        color: rgba(255,255,255,.88);
        font-size: 13px;
        background: rgba(0,0,0,.10);
    }

    .tf-tablex tbody tr:hover td {
        background: rgba(255,255,255,.05);
    }

/* Columnas */
.tf-col--n {
    width: 90px;
}

.tf-col--act {
    width: 140px;
}

.tf-right {
    text-align: right;
}

/* Badge */
.tf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
    font-weight: 900;
    font-size: 12px;
}

/* Acciones */
.tf-iconbtn {
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: var(--text);
    border-radius: 12px;
    padding: 7px 9px;
    cursor: pointer;
    margin-left: 6px;
}

    .tf-iconbtn:hover {
        background: rgba(255,255,255,.10);
    }

.tf-iconbtn--danger {
    border-color: rgba(255,92,107,.35);
    background: rgba(255,92,107,.10);
}

/* Estado vacío */
.tf-empty {
    padding: 22px 12px !important;
    background: rgba(0,0,0,.10);
}

.tf-empty__box {
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 18px;
    border-radius: 14px;
    border: 1px dashed rgba(255,255,255,.16);
    background: rgba(255,255,255,.04);
}

.tf-empty__emoji {
    font-size: 22px;
}

.tf-empty__title {
    font-weight: 900;
    font-size: 13px;
}

.tf-empty__text {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* Footer tip */
.tf-card__foot--hint {
    color: var(--muted);
    font-size: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.tf-muted {
    color: rgba(255,255,255,.78);
    font-weight: 800;
}

/* ======================================
   RESPONSIVE
   ====================================== */
@media (max-width: 820px) {
    .tf-grid {
        max-width: 100%;
    }

    .tf-fields {
        grid-template-columns: 1fr;
    }

    .tf-tablewrap {
        max-height: 320px;
    }
}

@media (max-width: 520px) {
    .tf-timepart {
        width: 76px;
    }

    .tf-title {
        font-size: 24px;
    }
}
