:root{
    --bg:#080a0e;
    --sidebar:#11151c;
    --panel:#171c24;
    --panel2:#1d232d;
    --line:#2a313d;

    --text:#f6f7fa;
    --muted:#929baa;

    --red:#ec174b;
    --green:#00d46a;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input{
    font:inherit;
}

button{
    cursor:pointer;
}

/* LOGIN */

.login-page{
    min-height:100vh;
    display:grid;
    place-items:center;

    background:
        radial-gradient(
            circle at top,
            #28101a,
            #080a0e 50%
        );
}

.login-box{
    width:min(430px,92vw);

    background:var(--panel);

    border:1px solid var(--line);
    border-radius:26px;

    padding:36px;
}

.brand{
    font-size:28px;
    font-weight:900;
    letter-spacing:3px;
}

.brand span{
    color:var(--red);
}

.login-subtitle{
    color:var(--muted);
    margin-top:4px;
}

.login-box h1{
    margin-top:36px;
}

.muted{
    color:var(--muted);
}

.login-box form{
    display:grid;
    gap:18px;
    margin-top:28px;
}

label{
    display:grid;
    gap:8px;

    color:#ccd2dc;

    font-size:14px;
}

input{
    width:100%;

    border:1px solid var(--line);
    border-radius:12px;

    padding:13px 14px;

    color:white;
    background:#0e1218;

    outline:none;
}

input:focus{
    border-color:#555f70;
}

.login-box button,
.new-sale,
.empty-panel button{
    border:0;
    border-radius:12px;

    padding:13px 18px;

    background:var(--green);

    font-weight:800;
}

.security-note{
    margin-top:24px;

    text-align:center;

    color:var(--muted);

    font-size:12px;
}

.alert{
    margin-top:20px;
    padding:12px;

    border-radius:10px;
}

.alert-error{
    background:#421521;
    color:#ff8199;
}

/* APP */

.app{
    min-height:100vh;

    display:grid;

    grid-template-columns:
        250px 1fr;
}

.sidebar{
    background:var(--sidebar);

    border-right:
        1px solid #202631;

    padding:28px 18px;

    display:flex;
    flex-direction:column;
}

.sidebar nav{
    display:grid;
    gap:8px;

    margin-top:40px;
}

.sidebar nav a{
    padding:14px 16px;

    border-radius:13px;

    color:#cbd1da;

    text-decoration:none;

    font-weight:700;
}

.sidebar nav a:hover,
.sidebar nav a.active{
    color:white;

    background:#491728;
}

.logout{
    margin-top:auto;

    color:var(--muted);

    text-decoration:none;

    padding:14px;
}

main{
    padding:32px;
}

header{
    display:flex;

    align-items:center;
    justify-content:space-between;

    gap:20px;

    margin-bottom:30px;
}

header h1{
    margin:0;
}

.new-sale{
    padding-left:22px;
    padding-right:22px;
}

.metrics{
    display:grid;

    grid-template-columns:
        repeat(4,1fr);

    gap:16px;
}

.metrics article{
    background:var(--panel);

    border:
        1px solid #232a35;

    border-radius:18px;

    padding:22px;
}

.metrics span{
    display:block;

    color:var(--muted);

    font-size:13px;
}

.metrics strong{
    display:block;

    margin-top:7px;

    font-size:31px;
}

.empty-panel{
    margin-top:22px;

    min-height:300px;

    display:flex;
    flex-direction:column;

    justify-content:center;
    align-items:center;

    text-align:center;

    background:var(--panel);

    border:
        1px solid #232a35;

    border-radius:20px;
}

.empty-panel p{
    color:var(--muted);
}

@media(max-width:900px){

    .app{
        grid-template-columns:
            82px 1fr;
    }

    .sidebar .brand{
        font-size:0;
    }

    .sidebar .brand::before{
        content:"TF";

        font-size:20px;
        font-weight:900;
    }

    .sidebar nav a{
        font-size:0;
        text-align:center;
    }

    .sidebar nav a::first-letter{
        font-size:20px;
    }

    .metrics{
        grid-template-columns:
            repeat(2,1fr);
    }

    main{
        padding:20px;
    }
}


/* INVENTARIO */

.button-link{
    text-decoration:none;
    color:#04130b;
}

.primary-button{
    display:inline-flex;
    justify-content:center;
    align-items:center;

    border:0;
    border-radius:12px;

    padding:13px 20px;

    background:var(--green);
    color:#04130b;

    font-weight:800;

    text-decoration:none;
}

.services-grid{
    display:grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(290px,1fr)
        );

    gap:18px;
}

.service-admin-card{
    background:var(--panel);

    border:
        1px solid #252c37;

    border-radius:20px;

    padding:20px;

    transition:
        transform .15s ease,
        border-color .15s ease;
}

.service-admin-card:hover{
    transform:translateY(-2px);

    border-color:#394352;
}

.service-disabled{
    opacity:.55;
}

.service-card-top{
    display:flex;

    align-items:center;

    gap:14px;
}

.service-card-icon{
    width:50px;
    height:50px;

    display:grid;
    place-items:center;

    border-radius:14px;

    background:#10151c;

    font-size:26px;
}

.service-card-top h3{
    margin:0 0 4px 0;

    font-size:18px;
}

.service-category{
    color:var(--muted);

    font-size:12px;
}

.service-stats{
    display:grid;

    grid-template-columns:
        repeat(4,1fr);

    gap:8px;

    margin-top:22px;
}

.service-stats div{
    background:#11161d;

    border-radius:11px;

    padding:10px;
}

.service-stats span{
    display:block;

    color:var(--muted);

    font-size:10px;
}

.service-stats strong{
    display:block;

    margin-top:3px;

    font-size:18px;
}

.service-tags{
    display:flex;

    flex-wrap:wrap;

    gap:7px;

    margin-top:18px;
}

.tag{
    display:inline-flex;

    align-items:center;

    border-radius:999px;

    padding:5px 9px;

    font-size:10px;

    font-weight:800;
}

.tag-green{
    background:#0c3c26;
    color:#5df3a5;
}

.tag-gray{
    background:#303640;
    color:#b9c0cb;
}

.tag-blue{
    background:#0c3145;
    color:#58d2ff;
}

.service-actions{
    display:flex;

    justify-content:flex-end;

    gap:8px;

    margin-top:20px;
}

.service-actions form{
    margin:0;
}

.secondary-action{
    border:
        1px solid #35404e;

    border-radius:10px;

    padding:8px 12px;

    background:#12171e;

    color:#dce1e8;

    font-size:12px;

    text-decoration:none;

    cursor:pointer;
}

.system-message{
    margin-bottom:18px;

    padding:13px 15px;

    border-radius:12px;

    background:#0e3b27;

    color:#62eea4;
}


/* MODAL SERVICIO */

.modal-overlay{
    position:fixed;

    inset:0;

    z-index:1000;

    display:grid;
    place-items:center;

    padding:20px;

    background:
        rgba(0,0,0,.76);
}

.service-modal{
    width:min(680px,96vw);

    max-height:92vh;

    overflow:auto;

    background:#171c24;

    border:
        1px solid #303846;

    border-radius:22px;

    padding:26px;
}

.modal-title{
    display:flex;

    align-items:start;
    justify-content:space-between;

    gap:20px;

    margin-bottom:24px;
}

.modal-title h2{
    margin:0;
}

.modal-title p{
    margin-bottom:0;
}

.modal-close{
    color:#fff;

    text-decoration:none;

    font-size:28px;

    line-height:1;
}

.service-form{
    display:grid;

    gap:16px;
}

.form-row{
    display:grid;

    grid-template-columns:
        repeat(2,minmax(0,1fr));

    gap:14px;
}

textarea{
    width:100%;

    resize:vertical;

    border:
        1px solid var(--line);

    border-radius:12px;

    padding:13px 14px;

    color:white;

    background:#0e1218;

    outline:none;

    font:inherit;
}

textarea:focus{
    border-color:#555f70;
}

.check-list{
    display:grid;

    gap:9px;

    padding:
        12px 0;
}

.check-item{
    display:flex;

    align-items:center;

    gap:10px;

    cursor:pointer;
}

.check-item input{
    width:auto;
}

@media(max-width:700px){

    .form-row{
        grid-template-columns:1fr;
    }

    .service-stats{
        grid-template-columns:
            repeat(2,1fr);
    }

}

/* CORRECCIÓN BOTONES/ENLACES */

a.new-sale,
a.primary-button,
a.button-link,
a.new-sale:visited,
a.primary-button:visited,
a.button-link:visited {
    text-decoration: none;
    color: #04130b;
}

.empty-panel a.primary-button {
    margin-top: 8px;
    background: var(--green);
    color: #04130b;
    padding: 13px 20px;
    border-radius: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}



/* CUENTAS */

.back-link{
    display:inline-block;
    margin-bottom:9px;
    color:var(--muted);
    text-decoration:none;
    font-size:13px;
}

.account-list{
    display:grid;
    gap:14px;
}

.account-row{
    background:var(--panel);
    border:1px solid #252d38;
    border-radius:18px;
    padding:20px;
}

.account-main{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
}

.account-main h3{
    margin:0;
    font-size:18px;
}

.account-login{
    margin-top:5px;
    color:var(--muted);
    font-size:12px;
}

.capacity-badge{
    display:inline-flex;
    padding:6px 10px;
    border-radius:999px;
    font-size:10px;
    font-weight:900;
    white-space:nowrap;
}

.capacity-green{
    background:#073d25;
    color:#5df4a5;
}

.capacity-yellow{
    background:#49390b;
    color:#ffe071;
}

.capacity-orange{
    background:#4b2b09;
    color:#ffb35c;
}

.capacity-red{
    background:#4a111b;
    color:#ff8198;
}

.account-metrics{
    display:grid;
    grid-template-columns:
        repeat(5,1fr);
    gap:9px;
    margin-top:18px;
}

.account-metrics div{
    background:#10151c;
    border-radius:11px;
    padding:11px;
}

.account-metrics span{
    display:block;
    color:var(--muted);
    font-size:10px;
}

.account-metrics strong{
    display:block;
    margin-top:4px;
    font-size:16px;
}

.account-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    margin-top:16px;
}

.warning-text{
    color:#ffd16e;
    font-weight:700;
}

.danger-text{
    color:#ff718b;
    font-weight:700;
}

.capacity-settings{
    padding:13px 14px;
    border-radius:12px;
    background:#10151c;
    border:1px solid #28313d;
}

.capacity-settings p{
    margin:5px 0 0;
    font-size:12px;
}

select{
    width:100%;
    border:1px solid var(--line);
    border-radius:12px;
    padding:13px 14px;
    color:white;
    background:#0e1218;
    outline:none;
    font:inherit;
}

select:focus{
    border-color:#555f70;
}

@media(max-width:850px){

    .account-metrics{
        grid-template-columns:
            repeat(2,1fr);
    }

    .account-main,
    .account-footer{
        align-items:flex-start;
        flex-direction:column;
    }
}

/* CUENTAS SIMPLIFICADAS */

.account-simple-modal{
    width:min(620px,95vw);
    padding:24px;
}

.account-settings-modal{
    width:min(680px,95vw);
}

.account-simple-modal .service-form{
    gap:12px;
}

.account-simple-modal label{
    gap:6px;
}

.date-format-note{
    margin-top:-3px;
    color:var(--muted);
    font-size:11px;
}

.account-subline{
    margin-top:4px;
    color:var(--muted);
    font-size:11px;
}

.account-simple-modal .primary-button{
    margin-top:4px;
}



/* CLIENTES */

.client-search{
    display:flex;
    gap:10px;
    margin-bottom:20px;
}

.client-search input{
    flex:1;
}

.client-search button{
    border:0;
    border-radius:11px;
    padding:0 20px;
    background:var(--green);
    font-weight:800;
}

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

.client-row{
    display:grid;
    grid-template-columns:
        minmax(260px,1fr)
        130px
        auto;

    align-items:center;

    gap:18px;

    padding:17px 19px;

    border:1px solid #252d38;
    border-radius:16px;

    background:var(--panel);
}

.client-disabled{
    opacity:.55;
}

.client-main{
    display:flex;
    align-items:center;
    gap:13px;
}

.client-avatar{
    width:44px;
    height:44px;

    display:grid;
    place-items:center;

    flex:0 0 44px;

    border-radius:13px;

    background:#10151c;

    font-weight:900;
    font-size:18px;
}

.client-main h3,
.assignment-client h3{
    margin:0 0 5px;
    font-size:16px;
}

.client-meta{
    margin-top:3px;
    color:var(--muted);
    font-size:11px;
}

.client-service-count span{
    display:block;
    color:var(--muted);
    font-size:10px;
}

.client-service-count strong{
    display:block;
    margin-top:3px;
    font-size:19px;
}

.client-modal{
    width:min(500px,95vw);
}


/* CLIENTES POR CUENTA */

.account-capacity-summary{
    display:grid;

    grid-template-columns:
        repeat(3,1fr);

    gap:12px;

    margin-bottom:18px;
}

.account-capacity-summary div{
    padding:16px;

    border-radius:14px;

    background:var(--panel);

    border:1px solid #252d38;
}

.account-capacity-summary span{
    display:block;

    color:var(--muted);

    font-size:11px;
}

.account-capacity-summary strong{
    display:block;

    margin-top:5px;

    font-size:20px;
}

.success-text{
    color:#59eca0;
}

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

.assignment-row{
    display:grid;

    grid-template-columns:
        minmax(250px,1fr)
        110px
        80px
        90px
        auto;

    align-items:center;

    gap:14px;

    padding:15px 17px;

    background:var(--panel);

    border:
        1px solid #252d38;

    border-radius:15px;
}

.assignment-client{
    display:flex;
    align-items:center;
    gap:12px;
}

.assignment-date span,
.assignment-price span{
    display:block;

    color:var(--muted);

    font-size:10px;
}

.assignment-date strong,
.assignment-price strong{
    display:block;

    margin-top:4px;

    font-size:14px;
}

.assignment-modal{
    width:min(590px,95vw);
}

.quick-client-fields{
    display:grid;
    gap:12px;

    padding:14px;

    border-radius:13px;

    background:#10151c;

    border:1px solid #29323e;
}

@media(max-width:850px){

    .client-row{
        grid-template-columns:1fr;
    }

    .assignment-row{
        grid-template-columns:1fr 1fr;
    }

    .assignment-client{
        grid-column:1/-1;
    }

    .account-capacity-summary{
        grid-template-columns:1fr;
    }
}


/* NUEVA VENTA RÁPIDA */

.sale-main{
    max-width:1000px;
}

.quick-sale-panel{
    width:min(760px,100%);

    background:var(--panel);

    border:1px solid #252d38;

    border-radius:20px;

    padding:24px;
}

.quick-sale-form{
    display:grid;
    gap:14px;
}

.sale-step{
    display:grid;

    grid-template-columns:
        36px 1fr;

    gap:14px;

    padding-bottom:14px;

    border-bottom:
        1px solid #252d38;
}

.sale-step-number{
    width:32px;
    height:32px;

    display:grid;
    place-items:center;

    border-radius:10px;

    background:#10151c;

    color:var(--green);

    font-weight:900;
}

.sale-step-content{
    display:grid;
    gap:12px;
}

.account-recommendation{
    padding:11px 13px;

    border-radius:11px;

    background:#10151c;

    color:var(--muted);

    font-size:12px;

    line-height:1.5;
}

.sale-submit{
    min-height:48px;

    margin-top:4px;

    font-size:15px;
}

@media(max-width:650px){

    .sale-step{
        grid-template-columns:1fr;
    }

    .sale-step-number{
        display:none;
    }

}

/* YOUTUBE - DURACIONES Y ALERTAS */

.duration-picker{
    display:grid;
    gap:8px;
}

.duration-picker > span{
    color:#ccd2dc;
    font-size:14px;
}

.duration-options{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px;
}

.duration-option{
    padding:11px 8px;
    border:1px solid #35404e;
    border-radius:10px;
    background:#10151c;
    color:#dce1e8;
    font-weight:700;
    cursor:pointer;
}

.duration-option.active{
    background:var(--green);
    border-color:var(--green);
    color:#04130b;
}

.assigned-service-email{
    color:#5deba0;
}

.account-expiry-alerts{
    display:grid;
    gap:7px;
    margin-top:15px;
}

.principal-alert{
    padding:10px 12px;
    border-radius:10px;
    font-size:11px;
    line-height:1.55;
}

.principal-danger{
    background:#45131c;
    color:#ff879c;
}

.principal-warning{
    background:#49320c;
    color:#ffd26e;
}

.principal-info{
    background:#102b3c;
    color:#7bd7ff;
}

.client-warning{
    background:#342b0b;
    color:#ffe17b;
}


/* YOUTUBE INVENTARIO V2 */

.youtube-tabs{
    display:flex;
    gap:8px;
    margin-bottom:20px;
    border-bottom:1px solid #252d38;
}

.youtube-tabs a{
    display:flex;
    align-items:center;
    gap:8px;
    padding:12px 15px;
    color:var(--muted);
    text-decoration:none;
    font-weight:700;
    border-bottom:2px solid transparent;
}

.youtube-tabs a.active{
    color:#fff;
    border-bottom-color:var(--green);
}

.youtube-tabs span{
    padding:3px 7px;
    border-radius:999px;
    background:#10151c;
    font-size:10px;
}

.yt-summary{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
    margin-bottom:18px;
}

.yt-summary div{
    padding:14px;
    border-radius:13px;
    border:1px solid #252d38;
    background:var(--panel);
}

.yt-summary span{
    display:block;
    color:var(--muted);
    font-size:10px;
}

.yt-summary strong{
    display:block;
    margin-top:4px;
    font-size:21px;
}

.yt-rental-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(285px,1fr));
    gap:13px;
}

.yt-rental-card{
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    min-height:185px;
    padding:18px;
    border:1px solid #252d38;
    border-radius:17px;
    background:var(--panel);
}

.yt-rental-card h3{
    margin:13px 0 7px;
    font-size:16px;
    word-break:break-word;
}

.yt-rental-status{
    display:inline-flex;
    padding:5px 9px;
    border-radius:999px;
    font-size:10px;
    font-weight:800;
}

.yt-rental-status.is-free{
    background:#073d25;
    color:#5df4a5;
}

.yt-rental-status.is-used{
    background:#4a111b;
    color:#ff8198;
}

.yt-assigned-to{
    margin-top:15px;
    padding:9px 10px;
    border-radius:10px;
    background:#10151c;
    color:var(--muted);
    font-size:11px;
}

.yt-assigned-to strong{
    color:#fff;
}

.yt-account-modal{
    width:min(600px,95vw);
}

@media(max-width:750px){

    .youtube-tabs{
        flex-direction:column;
    }

    .yt-summary{
        grid-template-columns:repeat(2,1fr);
    }
}


/* ==========================================================
   TITOFLIX_GLOBAL_LAYOUT_FIX_V1
   Normalización estructural de todas las páginas
   ========================================================== */

html,
body{
    width:100%;
    min-width:0;
    min-height:100%;
    margin:0;
    padding:0;
}

*,
*::before,
*::after{
    box-sizing:border-box;
}

body{
    overflow-x:hidden;
}


/* ----------------------------------------------------------
   CONTENEDOR PRINCIPAL
---------------------------------------------------------- */

.app{
    display:flex !important;
    align-items:stretch !important;

    width:100% !important;
    max-width:none !important;
    min-width:0 !important;

    min-height:100vh !important;

    margin:0 !important;
    padding:0 !important;

    grid-template-columns:none !important;
}


/* ----------------------------------------------------------
   SIDEBAR
   Solo ocupa espacio cuando realmente existe
---------------------------------------------------------- */

.app > .sidebar,
.app > aside.sidebar,
.app > aside{
    flex:0 0 300px !important;

    width:300px !important;
    min-width:300px !important;
    max-width:300px !important;
}


/* ----------------------------------------------------------
   AREA CENTRAL
---------------------------------------------------------- */

.app > main{
    display:block !important;

    flex:1 1 auto !important;

    width:auto !important;
    max-width:none !important;
    min-width:0 !important;

    margin:0 !important;

    padding:
        32px
        clamp(22px,3vw,48px)
        56px !important;

    grid-column:auto !important;

    transform:none !important;
}


/* Si NO existe sidebar, main ocupa toda la pantalla */

.app > main:first-child{
    width:100% !important;
}


/* ----------------------------------------------------------
   EVITAR CONTENEDORES ESTRECHOS HEREDADOS
---------------------------------------------------------- */

.app > main > header,
.app > main > section,
.app > main > article,
.app > main > div{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
}


main .container,
main .content,
main .content-area,
main .page-content,
main .page-wrapper,
main .wrapper{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
}


/* ----------------------------------------------------------
   GRIDS DE LOS MODULOS NUEVOS
---------------------------------------------------------- */

.fr-stats,
.fr-grid,

.yi-stats,
.yi-grid,

.iv3-grid,

.d3-stats,
.d3-services,

.mv-stats,
.mv-grid,

.am-grid,
.am-cards,

.st-grid,

.sys-grid{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
}


/* ----------------------------------------------------------
   PANELES
---------------------------------------------------------- */

.yi-panel,
.yi-card,

.iv3-card,

.d3-card,
.d3-service,

.mv-card,
.mv-panel,

.am-panel,
.am-card,

.st-panel,

.fr-card,
.fr-stat,

.sys-card{
    max-width:none !important;
    min-width:0 !important;
}


/* ----------------------------------------------------------
   FORMULARIOS
---------------------------------------------------------- */

input,
select,
textarea{
    max-width:100%;
}


/* ----------------------------------------------------------
   TABLET
---------------------------------------------------------- */

@media(max-width:1000px){

    .app > .sidebar,
    .app > aside.sidebar,
    .app > aside{
        flex-basis:250px !important;

        width:250px !important;
        min-width:250px !important;
        max-width:250px !important;
    }

}


/* ----------------------------------------------------------
   MOVIL
---------------------------------------------------------- */

@media(max-width:760px){

    .app{
        display:block !important;
    }


    .app > .sidebar,
    .app > aside.sidebar,
    .app > aside{
        width:100% !important;
        min-width:0 !important;
        max-width:none !important;
    }


    .app > main{
        width:100% !important;

        padding:
            22px
            15px
            40px !important;
    }


    .yi-stats,
    .yi-grid,

    .iv3-grid,

    .d3-stats,
    .d3-services,

    .mv-stats,
    .mv-grid,

    .am-grid,
    .am-cards,

    .st-grid,

    .fr-stats,
    .fr-grid,

    .sys-grid{
        grid-template-columns:1fr !important;
    }

}



/* ========================================================================
   TITOFLIX CONTROL V4 · CAPA OPERATIVA UNIFICADA · 2026-08-22
   Mantiene compatibilidad con módulos anteriores y elimina scroll lateral.
   ======================================================================== */
html,body{max-width:100%;overflow-x:hidden!important}
body{background:#070707!important}
body .app{display:grid!important;grid-template-columns:270px minmax(0,1fr)!important;min-height:100vh!important;width:100%!important;max-width:100%!important;overflow:visible!important}
body .sidebar.ttf-v4-sidebar,body .app>.sidebar{position:sticky!important;top:0!important;left:auto!important;width:auto!important;min-width:0!important;height:100vh!important;max-height:100vh!important;overflow-y:auto!important;overflow-x:hidden!important;display:flex!important;flex-direction:column!important;box-sizing:border-box!important;background:#090b0e!important;border-right:1px solid #242a32!important;z-index:30!important}
body main{min-width:0!important;width:auto!important;max-width:none!important;margin-left:0!important;overflow-x:hidden!important;padding:26px clamp(16px,2.4vw,34px)!important;box-sizing:border-box!important}
.ttf-v4-brand{display:block!important;text-decoration:none!important;padding:25px 22px 18px!important}
.ttf-v4-nav{display:grid!important;gap:4px!important;padding:4px 12px 16px!important}
.ttf-v4-nav a{display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important;padding:11px 12px!important;border-radius:10px!important;text-decoration:none!important;color:#a7b1bf!important;border:1px solid transparent!important;font-size:14px!important}
.ttf-v4-nav a:hover{background:#12171e!important;color:#fff!important}
.ttf-v4-nav a.active{background:#16221d!important;color:#fff!important;border-color:#244635!important}
.ttf-v4-nav-icon{width:22px!important;text-align:center!important;flex:0 0 22px!important}
.ttf-v4-sidebar-foot{margin-top:auto!important;padding:12px!important;border-top:1px solid #20262e!important}
.ttf-v4-sidebar-foot .logout{display:block!important;padding:10px 12px!important;border-radius:10px!important;color:#9ba8b8!important;text-decoration:none!important}
body header{min-width:0!important;max-width:100%!important;gap:14px!important;flex-wrap:wrap!important}
body header>div{min-width:0!important}
body h1,body h2,body h3{overflow-wrap:anywhere}
body input,body select,body textarea,body button{max-width:100%!important;box-sizing:border-box!important}
body img,body svg,body video{max-width:100%!important}
body .panel,body .stat-card,body section,body article,body form{min-width:0!important;box-sizing:border-box!important}
body table{max-width:100%!important}
.ttf-v4-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
.ttf-v4-state-grid{display:grid;grid-template-columns:repeat(6,minmax(145px,1fr));gap:10px;margin:14px 0 20px}
.ttf-v4-state-card{display:block;padding:14px 15px;border-radius:15px;background:#13181f;border:1px solid #29313c;color:#fff;text-decoration:none;min-width:0}
.ttf-v4-state-card span{display:block;color:#94a5bd;font-size:12px;margin-bottom:5px}
.ttf-v4-state-card strong{font-size:23px}
.v4-chip{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:800;white-space:nowrap}
.v4-status-active{background:#0e3524;color:#5df4a5}
.v4-status-soon{background:#49330c;color:#ffd16b}
.v4-status-today{background:#49300c;color:#ffbd66}
.v4-status-expired{background:#49101b;color:#ff849a}
.v4-status-suspended{background:#2d2739;color:#cbb6ff}
.v4-status-sync{background:#3b2510;color:#ffcb7b}
.ttf-v4-page-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0 0 18px}
.ttf-v4-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:18px}
.ttf-v4-kpi{padding:15px;border:1px solid #29313c;border-radius:15px;background:#13181f}
.ttf-v4-kpi span{display:block;color:#94a5bd;font-size:12px}.ttf-v4-kpi strong{display:block;font-size:22px;margin-top:5px}
.ttf-v4-empty{padding:22px;border:1px dashed #34404d;border-radius:15px;color:#94a5bd;text-align:center;background:#0f1318}
.ttf-v4-row-actions{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
.ttf-v4-wa{border-color:#24543c!important;color:#75e9a8!important;text-decoration:none!important}
.ttf-v4-sync-panel{margin-top:20px}.ttf-v4-sync-row{padding:12px 0;border-bottom:1px solid #29313c}.ttf-v4-sync-row:last-child{border-bottom:0}.ttf-v4-sync-row small{display:block;color:#94a5bd;margin-top:4px;overflow-wrap:anywhere}
.ttf-v4-filterbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.ttf-v4-filterbar input,.ttf-v4-filterbar select{min-width:150px;flex:1 1 190px}.ttf-v4-filterbar button{flex:0 0 auto}
.ttf-v4-client-row{display:grid;grid-template-columns:minmax(220px,1.5fr) 120px 120px 140px 145px auto;gap:12px;align-items:center;background:#171d25;border:1px solid #29313c;border-radius:16px;padding:15px;margin-bottom:9px;min-width:0}
.ttf-v4-client-row>*{min-width:0}.ttf-v4-client-name{font-size:16px;font-weight:800;overflow-wrap:anywhere}.ttf-v4-meta{color:#94a5bd;font-size:12px;margin-top:4px;overflow-wrap:anywhere}.ttf-v4-value{font-size:18px;font-weight:800}
.ttf-v4-alert-section{margin-bottom:18px;padding:17px;border:1px solid #29313c;border-radius:16px;background:#11161d}.ttf-v4-alert-section h2{margin-top:0}.ttf-v4-alert-row{display:grid;grid-template-columns:105px minmax(220px,1fr) 145px auto;gap:12px;align-items:center;padding:13px 0;border-bottom:1px solid #29313c}.ttf-v4-alert-row:last-child{border-bottom:0}
.ttf-v4-youtube-kpis{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;margin:0 0 18px}
.ttf-v4-youtube-kpis>div{background:#13181f;border:1px solid #29313c;border-radius:15px;padding:14px}.ttf-v4-youtube-kpis span{display:block;color:#94a5bd;font-size:12px}.ttf-v4-youtube-kpis strong{display:block;font-size:22px;margin-top:5px}
@media(max-width:1180px){.ttf-v4-state-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.ttf-v4-client-row{grid-template-columns:minmax(220px,1.4fr) repeat(2,110px) 130px auto}.ttf-v4-client-row .v4-col-collected{display:none}}
@media(max-width:900px){body .app{grid-template-columns:1fr!important}body .sidebar.ttf-v4-sidebar,body .app>.sidebar{position:relative!important;height:auto!important;max-height:none!important;border-right:0!important;border-bottom:1px solid #242a32!important}.ttf-v4-brand{padding:16px 16px 8px!important}.ttf-v4-nav{display:flex!important;overflow-x:auto!important;padding:8px 12px 12px!important;gap:6px!important}.ttf-v4-nav a{white-space:nowrap!important;flex:0 0 auto!important}.ttf-v4-sidebar-foot{display:none!important}body main{padding:18px 14px 28px!important}.ttf-v4-state-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ttf-v4-client-row,.ttf-v4-alert-row{grid-template-columns:1fr!important}.ttf-v4-youtube-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.ttf-v4-state-grid,.ttf-v4-youtube-kpis{grid-template-columns:1fr}.ttf-v4-page-actions>*{flex:1 1 auto;text-align:center}}

/* ========================================================================
   TITOFLIX CONTROL · BLOQUE 5 · UI PRO V5 · 2026-08-22
   Capa visual no destructiva. Mantiene la lógica existente y unifica
   navegación, tarjetas, formularios, tablas y módulos operativos.
   ======================================================================== */

:root{
    --ttf-bg:#07090d;
    --ttf-bg-soft:#0b0f14;
    --ttf-sidebar:#090c11;
    --ttf-panel:#121820;
    --ttf-panel-2:#171e27;
    --ttf-panel-3:#0d1319;
    --ttf-line:#26313d;
    --ttf-line-soft:#1d2630;
    --ttf-text:#f7f9fc;
    --ttf-muted:#8d9aae;
    --ttf-muted-2:#69788d;
    --ttf-green:#00d878;
    --ttf-green-soft:#0f3525;
    --ttf-red:#ef3157;
    --ttf-warning:#f0b84c;
    --ttf-radius:18px;
    --ttf-shadow:0 16px 46px rgba(0,0,0,.18);
}

html{
    background:var(--ttf-bg);
    scrollbar-color:#384656 #0a0e13;
}

body{
    background:
        radial-gradient(circle at 82% -10%,rgba(0,216,120,.055),transparent 32%),
        var(--ttf-bg)!important;
    color:var(--ttf-text)!important;
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
    font-size:15px;
    line-height:1.45;
    -webkit-font-smoothing:antialiased;
}

::selection{
    background:rgba(0,216,120,.28);
    color:#fff;
}

body .app{
    background:transparent!important;
}

body .sidebar.ttf-v4-sidebar,
body .app>.sidebar{
    background:
        linear-gradient(180deg,rgba(255,255,255,.012),transparent 16%),
        var(--ttf-sidebar)!important;
    border-right:1px solid var(--ttf-line-soft)!important;
    box-shadow:14px 0 34px rgba(0,0,0,.10);
}

.ttf-v4-brand,
body .sidebar .brand{
    color:#6d33bf!important;
    font-size:23px!important;
    font-weight:900!important;
    letter-spacing:2.8px!important;
    line-height:1!important;
}

.ttf-v4-brand span,
body .sidebar .brand span{
    color:#ff2758!important;
}

.ttf-v4-nav{
    gap:3px!important;
}

.ttf-v4-nav a{
    min-height:44px!important;
    padding:10px 12px!important;
    border-radius:11px!important;
    color:#a4afbd!important;
    font-weight:680!important;
    transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease!important;
}

.ttf-v4-nav a:hover{
    background:#111820!important;
    border-color:#212d38!important;
    color:#fff!important;
    transform:translateX(1px);
}

.ttf-v4-nav a.active{
    background:linear-gradient(90deg,#13271f,#101b18)!important;
    border-color:#28523d!important;
    color:#fff!important;
    box-shadow:inset 3px 0 0 var(--ttf-green)!important;
}

.ttf-v4-nav-icon{
    opacity:.92;
}

.ttf-v4-sidebar-foot{
    border-top:1px solid var(--ttf-line-soft)!important;
}

.ttf-v4-sidebar-foot .logout{
    color:#7f8da0!important;
}

.ttf-v4-sidebar-foot .logout:hover{
    background:#121820!important;
    color:#fff!important;
}

body main{
    background:transparent!important;
    padding:30px clamp(18px,2.6vw,40px) 64px!important;
}

body main>header,
body main .ccs-header,
body main .st3-head{
    margin-bottom:24px!important;
}

body main header h1,
body main .ccs-header h1,
body main .st3-head h1{
    font-size:clamp(30px,3vw,43px)!important;
    font-weight:860!important;
    letter-spacing:-1.25px!important;
    color:#fff!important;
}

body main h2{
    font-weight:820!important;
    letter-spacing:-.45px;
}

body main h3{
    font-weight:800!important;
}

.ttf-eyebrow{
    color:#6f91b6!important;
    letter-spacing:.18em!important;
    font-size:10px!important;
    font-weight:900!important;
}

.muted,
body .ttf-v4-meta{
    color:var(--ttf-muted)!important;
}

.primary-button,
.new-sale,
.empty-panel button,
.client-search button{
    min-height:43px!important;
    border:1px solid #03ba6a!important;
    border-radius:11px!important;
    padding:10px 16px!important;
    background:linear-gradient(180deg,#08dd7d,#00cb70)!important;
    color:#03130c!important;
    font-weight:850!important;
    line-height:1.1!important;
    box-shadow:0 8px 20px rgba(0,216,120,.10)!important;
    transition:transform .15s ease,filter .15s ease,box-shadow .15s ease!important;
}

.primary-button:hover,
.new-sale:hover,
.empty-panel button:hover,
.client-search button:hover{
    filter:brightness(1.045);
    transform:translateY(-1px);
    box-shadow:0 10px 26px rgba(0,216,120,.15)!important;
}

.secondary-action,
.button-link.secondary-action{
    min-height:40px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    border:1px solid #33404e!important;
    border-radius:10px!important;
    padding:9px 13px!important;
    background:#11171e!important;
    color:#dbe2eb!important;
    font-weight:720!important;
    font-size:12px!important;
    text-decoration:none!important;
    transition:background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease!important;
}

.secondary-action:hover{
    background:#18202a!important;
    border-color:#465568!important;
    color:#fff!important;
    transform:translateY(-1px);
}

body input:not([type="checkbox"]):not([type="radio"]),
body select,
body textarea{
    min-height:46px!important;
    border:1px solid #2a3542!important;
    border-radius:11px!important;
    background:#0c1117!important;
    color:#f8fafc!important;
    padding:11px 13px!important;
    outline:none!important;
    box-shadow:none!important;
    transition:border-color .15s ease,background .15s ease,box-shadow .15s ease!important;
}

body textarea{
    min-height:92px;
}

body input:not([type="checkbox"]):not([type="radio"]):focus,
body select:focus,
body textarea:focus{
    background:#0e141b!important;
    border-color:#456151!important;
    box-shadow:0 0 0 3px rgba(0,216,120,.07)!important;
}

body input::placeholder,
body textarea::placeholder{
    color:#657386!important;
    opacity:1;
}

body input[type="checkbox"],
body input[type="radio"]{
    accent-color:var(--ttf-green)!important;
}

body label{
    color:#cbd4df;
}

.panel,
.stat-card,
.mv-card,
.mv-panel,
.cd3-card,
.cd3-panel,
.lc-section,
.ccs-panel,
.ytc-card,
.ytc-table-card,
.ttf-v4-alert-section,
.ttf-v4-kpi,
.ttf-v4-state-card{
    border-color:var(--ttf-line)!important;
    background:linear-gradient(180deg,#151c25,#121820)!important;
    box-shadow:var(--ttf-shadow)!important;
}

.panel,
.mv-panel,
.cd3-panel,
.lc-section,
.ccs-panel,
.ttf-v4-alert-section{
    border-radius:var(--ttf-radius)!important;
}

.stat-card,
.mv-card,
.cd3-card,
.ttf-v4-kpi,
.ttf-v4-state-card{
    border-radius:15px!important;
}

.ttf-v4-state-card,
.dashboard-service,
.ttf-v4-client-row,
.ytc-card{
    transition:border-color .16s ease,transform .16s ease,background .16s ease!important;
}

.ttf-v4-state-card:hover,
.dashboard-service:hover,
.ttf-v4-client-row:hover,
.ytc-card:hover{
    border-color:#354454!important;
    transform:translateY(-1px);
}

.ttf-v4-state-card span,
.ttf-v4-kpi span,
.stat-card span{
    color:#8998aa!important;
}

.ttf-v4-state-card strong,
.ttf-v4-kpi strong,
.stat-card strong{
    color:#fff!important;
}

.v4-chip,
.ccs-badge,
.ytc-badge,
.cd3-badge,
.cd3-op-badge{
    letter-spacing:.01em;
}

.ttf-v4-filterbar,
.client-search,
.mv-tools,
.ccs-search{
    padding:10px!important;
    border:1px solid var(--ttf-line)!important;
    border-radius:14px!important;
    background:#10161d!important;
}

.ttf-v4-client-row{
    border-color:var(--ttf-line)!important;
    background:linear-gradient(180deg,#151c25,#121820)!important;
    padding:16px 17px!important;
    border-radius:16px!important;
}

.ttf-v4-client-name{
    color:#fff!important;
    font-size:17px!important;
}

.ttf-v4-value{
    color:#fff!important;
}

.ttf-v4-alert-section{
    padding:18px!important;
}

.ttf-v4-alert-row{
    border-bottom-color:#252f3a!important;
}

.ttf-v4-empty{
    background:#0d1218!important;
    border-color:#2b3743!important;
    color:#8190a4!important;
}

.dashboard-actions,
.mv-actions,
.ttf-v4-page-actions{
    gap:9px!important;
}

.dashboard-finance{
    gap:11px!important;
}

.dashboard-service{
    background:linear-gradient(180deg,#151d26,#11171e)!important;
    border-color:var(--ttf-line)!important;
    box-shadow:0 14px 36px rgba(0,0,0,.13)!important;
}

.dashboard-service h3{
    color:#fff!important;
}

.dashboard-service-stats{
    padding-top:12px;
    border-top:1px solid #222d38;
}

.mv-row,
.cd3-row,
.lc-row,
.dashboard-attention-row{
    border-bottom-color:#242f3a!important;
}

.mv-reminder,
.account-recommendation,
.cd3-history-item,
.cd3-netflix-summary>div,
.cd3-netflix-current>div{
    background:#0d1319!important;
    border-color:#27323e!important;
}

.cd3-netflix-current,
.cd3-netflix-summary{
    gap:9px!important;
}

.cd3-history-item{
    border-radius:13px!important;
}

.ytc-tabs{
    gap:4px!important;
    border-bottom-color:#25303b!important;
    padding:0 2px;
}

.ytc-tabs a{
    min-height:46px;
    display:flex;
    align-items:center;
    border-radius:10px 10px 0 0;
    color:#8e9caf!important;
    transition:background .15s ease,color .15s ease!important;
}

.ytc-tabs a:hover{
    background:#10161d;
    color:#fff!important;
}

.ytc-tabs a.active{
    color:#fff!important;
    border-bottom-color:var(--ttf-green)!important;
    background:linear-gradient(180deg,rgba(0,216,120,.055),transparent)!important;
}

.ytc-count{
    background:#202b36!important;
    color:#c9d3df!important;
}

.ytc-card{
    padding:17px!important;
    border-radius:16px!important;
}

.ytc-card h3{
    margin-top:11px!important;
    margin-bottom:7px!important;
}

.ytc-meta{
    color:#8797aa!important;
}

.ccs-shell{
    max-width:1600px!important;
}

.ccs-panel{
    padding:20px!important;
}

.ccs-service,
.ccs-platform,
.ccs-client-card{
    background:#0f151c!important;
    border-color:#27323e!important;
}

.ccs-service{
    border-radius:14px!important;
}

.ccs-platform summary{
    transition:background .15s ease;
}

.ccs-platform summary:hover{
    background:#141c24;
}

.ccs-note,
.ccs-mapping-note{
    line-height:1.5;
}

.s9-panel,
.quick-sale-panel{
    background:linear-gradient(180deg,#151c25,#121820)!important;
    border-color:var(--ttf-line)!important;
    box-shadow:var(--ttf-shadow)!important;
}

.sale-step{
    border-bottom-color:#25303b!important;
}

.sale-step-number{
    background:#0e1716!important;
    border:1px solid #244536;
}

.account-row,
.client-row,
.assignment-row,
.service-admin-card{
    background:linear-gradient(180deg,#151c25,#121820)!important;
    border-color:var(--ttf-line)!important;
}

.system-message{
    border:1px solid #256846!important;
    background:#102d20!important;
    color:#75eaaa!important;
}

.alert-error{
    border:1px solid #71333d!important;
    background:#30171d!important;
    color:#ffabb5!important;
}

body table{
    border-collapse:separate;
    border-spacing:0;
}

body table th{
    color:#8291a5!important;
    font-size:11px!important;
    text-transform:uppercase;
    letter-spacing:.055em;
    font-weight:800!important;
}

body table td,
body table th{
    border-color:#25303b!important;
}

body a{
    text-underline-offset:3px;
}

body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
*::-webkit-scrollbar{
    width:10px;
    height:10px;
}

body::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
*::-webkit-scrollbar-track{
    background:#0a0e13;
}

body::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb{
    background:#344151;
    border:2px solid #0a0e13;
    border-radius:999px;
}

body::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover{
    background:#455468;
}

@media(max-width:1180px){
    body main{
        padding-left:20px!important;
        padding-right:20px!important;
    }
}

@media(max-width:900px){
    body main{
        padding:20px 14px 42px!important;
    }

    body main header h1,
    body main .ccs-header h1,
    body main .st3-head h1{
        font-size:30px!important;
    }

    .ttf-v4-nav a:hover{
        transform:none;
    }
}

@media(max-width:560px){
    .primary-button,
    .secondary-action{
        min-height:42px!important;
    }

    .panel,
    .mv-panel,
    .cd3-panel,
    .lc-section,
    .ccs-panel,
    .ttf-v4-alert-section{
        border-radius:15px!important;
    }
}
