:root{
  --bg:#0a0a0a; --surface:#141414; --surface2:#1b1b1b; --border:rgba(255,255,255,.09);
  --text:#f5f4f0; --muted:#9c9893; --accent:#c9a24b; --accent2:#dcb45f; --danger:#e05959;
  --radius:14px;
  --font-display:'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
*{box-sizing:border-box; margin:0; padding:0;}
html{-webkit-text-size-adjust:100%;}
body{background:var(--bg); color:var(--text); font-family:var(--font-body); min-height:100dvh; overflow-x:hidden;}
img{max-width:100%; display:block;}
button, input, select, textarea{font-family:inherit;}
a{color:inherit;}

.app-shell{display:flex; min-height:100dvh;}
.sidebar{width:260px; flex-shrink:0; background:var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; padding:20px 16px; position:sticky; top:0; height:100dvh; overflow-y:auto;}
.brand{font-weight:800; letter-spacing:.14em; font-size:14px; color:var(--accent); padding:8px 8px 20px;}
.nav-btn{display:flex; align-items:center; gap:10px; width:100%; background:none; border:none; color:var(--muted); text-align:left; padding:11px 12px; border-radius:10px; font-size:14px; font-weight:600; cursor:pointer; min-height:44px;}
.nav-btn:hover{background:var(--surface2); color:var(--text);}
.nav-btn.active{background:var(--surface2); color:var(--accent);}
.sidebar-footer{margin-top:auto; padding-top:16px; border-top:1px solid var(--border);}
.logout-btn{width:100%; background:none; border:1px solid var(--border); color:var(--muted); padding:10px; border-radius:10px; cursor:pointer; font-size:13px; min-height:44px;}
.logout-btn:hover{color:var(--text); border-color:var(--muted);}

.main{flex:1; min-width:0; padding:clamp(16px,3vw,36px);}
.topbar{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:24px; flex-wrap:wrap;}
.topbar h1{font-family:var(--font-display); font-size:clamp(20px,3vw,26px); font-weight:800;}
.btn{display:inline-flex; align-items:center; gap:8px; background:var(--accent); color:#0a0a0a; border:none; padding:11px 18px; border-radius:10px; font-weight:700; font-size:14px; cursor:pointer; min-height:44px; text-decoration:none;}
.btn:hover{background:var(--accent2);}
.btn.secondary{background:var(--surface2); color:var(--text); border:1px solid var(--border);}
.btn.secondary:hover{border-color:var(--muted);}
.btn.danger{background:transparent; color:var(--danger); border:1px solid var(--danger);}
.btn.danger:hover{background:var(--danger); color:#fff;}
.btn:disabled{opacity:.5; cursor:default;}

.grid-talents{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px;}
.talent-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; cursor:pointer; transition:border-color .15s;}
.talent-card:hover{border-color:var(--accent);}
.talent-cover{aspect-ratio:4/3; background:var(--surface2) center/cover no-repeat; display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:32px;}
.talent-body{padding:14px;}
.talent-name{font-weight:700; font-size:15px; margin-bottom:4px;}
.talent-niche{color:var(--muted); font-size:12.5px; margin-bottom:10px;}
.status-pill{display:inline-block; font-size:11px; font-weight:700; padding:4px 10px; border-radius:999px; letter-spacing:.03em;}
.status-pill.published{background:rgba(46,196,120,.15); color:#4fd88a;}
.status-pill.draft{background:rgba(255,255,255,.08); color:var(--muted);}
.empty-state{text-align:center; padding:60px 20px; color:var(--muted);}

.editor{max-width:960px;}
.tabs{display:flex; gap:6px; overflow-x:auto; margin-bottom:22px; border-bottom:1px solid var(--border); padding-bottom:2px;}
.tab-btn{background:none; border:none; color:var(--muted); padding:10px 14px; font-weight:700; font-size:13.5px; cursor:pointer; white-space:nowrap; border-bottom:2px solid transparent; min-height:44px;}
.tab-btn.active{color:var(--accent); border-bottom-color:var(--accent);}
.panel{display:none;}
.panel.active{display:block;}

.field{margin-bottom:16px;}
.field label{display:block; font-size:12.5px; font-weight:700; color:var(--muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:.04em;}
.field input, .field select, .field textarea{width:100%; background:var(--surface); border:1px solid var(--border); color:var(--text); padding:11px 13px; border-radius:10px; font-size:14.5px;}
.field input:focus, .field select:focus, .field textarea:focus{outline:none; border-color:var(--accent);}
.field textarea{resize:vertical; min-height:100px;}
.field-row{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
@media (max-width:640px){ .field-row{grid-template-columns:1fr;} }

.theme-picker{display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; margin-bottom:20px;}
.theme-opt{border:2px solid var(--border); border-radius:12px; padding:14px; cursor:pointer; text-align:center;}
.theme-opt.selected{border-color:var(--accent);}
.theme-swatch{height:36px; border-radius:8px; margin-bottom:8px;}
.theme-opt span{font-size:12.5px; font-weight:700;}

.list-block{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; margin-bottom:14px;}
.list-block .row{display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap;}
.list-block .row > *{flex:1; min-width:120px;}
.remove-btn{background:none; border:1px solid var(--border); color:var(--muted); width:36px; height:36px; border-radius:8px; cursor:pointer; flex:0 0 auto !important; min-width:36px !important;}
.remove-btn:hover{color:var(--danger); border-color:var(--danger);}
.shot-btn{display:inline-flex; align-items:center; justify-content:center; gap:6px; background:none; border:1px dashed var(--border); color:var(--muted); border-radius:8px; padding:0 10px; cursor:pointer; font-size:12.5px; text-align:center; min-height:38px; flex:1; min-width:150px !important;}
.shot-btn:hover{color:var(--text); border-color:var(--accent, #c9a24b);}
.shot-thumb{flex:0 0 auto !important; min-width:38px !important; width:38px; height:38px; border-radius:8px; overflow:hidden; border:1px solid var(--border); display:block;}
.shot-thumb img{width:100%; height:100%; object-fit:cover; display:block;}
.add-btn{background:var(--surface2); border:1px dashed var(--border); color:var(--muted); padding:12px; border-radius:10px; width:100%; cursor:pointer; font-weight:700; font-size:13.5px; min-height:44px;}
.add-btn:hover{color:var(--accent); border-color:var(--accent);}

.upload-zone{border:2px dashed var(--border); border-radius:var(--radius); padding:30px 16px; text-align:center; color:var(--muted); cursor:pointer; margin-bottom:18px;}
.upload-zone:hover{border-color:var(--accent); color:var(--accent);}
.asset-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px;}
.asset-item{position:relative; border-radius:10px; overflow:hidden; background:var(--surface2); aspect-ratio:4/5;}
.asset-item img, .asset-item video{width:100%; height:100%; object-fit:cover;}
.asset-item .del{position:absolute; top:6px; right:6px; background:rgba(0,0,0,.65); color:#fff; border:none; width:28px; height:28px; border-radius:8px; cursor:pointer; font-size:14px; z-index:2;}
.asset-item .tag{position:absolute; bottom:6px; left:6px; background:rgba(0,0,0,.65); color:#fff; font-size:10px; padding:3px 7px; border-radius:6px; font-weight:700;}
.asset-item .asset-cat{position:absolute; left:0; right:0; bottom:0; width:100%; background:rgba(10,10,10,.82); color:#fff; border:none; border-top:1px solid rgba(255,255,255,.12); font-size:12px; font-weight:700; padding:9px 8px; cursor:pointer; min-height:36px; border-radius:0;}
.asset-item .asset-cat:focus{outline:2px solid var(--accent);}
.asset-item .asset-cat option{background:#141414; color:#fff;}

.share-box{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:22px;}
.share-box input{flex:1; min-width:200px; background:var(--surface2); border:1px solid var(--border); color:var(--text); padding:10px 12px; border-radius:8px; font-size:13.5px;}

/* Accesos de marcas */
.brands-toolbar{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px;}
.brands-toolbar input[type="search"]{flex:1; min-width:220px; background:var(--surface); border:1px solid var(--border); color:var(--text); padding:11px 13px; border-radius:10px; font-size:14px; min-height:44px;}
.brands-toolbar input[type="search"]:focus{outline:none; border-color:var(--accent);}
.brands-toolbar select{background:var(--surface); border:1px solid var(--border); color:var(--text); padding:11px 13px; border-radius:10px; font-size:13.5px; min-height:44px; cursor:pointer;}
.brands-count{color:var(--muted); font-size:12.5px; margin-bottom:12px;}
.kit-tags{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px;}
.kit-tag{display:inline-flex; align-items:center; gap:5px; background:var(--surface2); border:1px solid var(--border); color:var(--text); font-size:11px; font-weight:600; padding:4px 9px; border-radius:999px;}
.kit-tag .kit-tag-count{color:var(--accent); font-weight:800;}

/* Visitas del media kit (tab Estadísticas) */
.visits-box{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; margin-bottom:6px;}
.visits-summary{display:flex; gap:22px; flex-wrap:wrap; margin-bottom:14px;}
.visits-summary .vs-num{font-size:26px; font-weight:800; color:var(--accent); line-height:1.1;}
.visits-summary .vs-label{font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-top:2px;}
.visits-unlocked-list{border-top:1px solid var(--border); padding-top:12px; margin-top:4px;}
.visits-unlocked-item{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px;}
.visits-unlocked-item:last-child{border-bottom:none;}
.visits-unlocked-item .vu-brand{font-weight:700;}
.visits-unlocked-item .vu-email{color:var(--muted); font-size:11.5px; word-break:break-all;}
.visits-unlocked-item .vu-meta{text-align:right; color:var(--muted); font-size:11.5px; flex-shrink:0;}

.toast{position:fixed; bottom:20px; right:20px; background:var(--surface2); border:1px solid var(--accent); color:var(--text); padding:13px 18px; border-radius:10px; font-size:14px; font-weight:600; z-index:100; box-shadow:0 8px 24px rgba(0,0,0,.4); max-width:calc(100vw - 40px);}

@media (max-width:840px){
  .app-shell{flex-direction:column;}
  .sidebar{width:100%; height:auto; position:static; flex-direction:row; align-items:center; overflow-x:auto; padding:12px;}
  .brand{padding:0 12px 0 0;}
  .sidebar-footer{margin-top:0; margin-left:auto; padding-top:0; border-top:none;}
  .nav-btn{white-space:nowrap;}
}

.hint{color:var(--muted); font-size:12.5px; line-height:1.5; margin:-6px 0 12px;}
.hint:empty{display:none;}

.asset-item{cursor:grab; transition:box-shadow .15s, opacity .15s, transform .15s; touch-action:manipulation;}
.asset-item.dragging{opacity:.35;}
.asset-item.drop-before{box-shadow:-4px 0 0 0 var(--accent);}
.asset-item.drop-after{box-shadow:4px 0 0 0 var(--accent);}
.asset-item .ord{position:absolute; top:6px; left:6px; display:flex; gap:3px; align-items:center; z-index:2;}
.asset-item .ord .pos{background:rgba(0,0,0,.7); color:#fff; font-size:11px; font-weight:800; padding:0 7px; height:28px; border-radius:8px; display:flex; align-items:center;}
.asset-item .ord button{background:rgba(0,0,0,.65); color:#fff; border:none; width:28px; height:28px; border-radius:8px; cursor:pointer; font-size:13px;}
.asset-item .ord button:hover:not(:disabled){background:var(--accent); color:#0a0a0a;}
.asset-item .ord button:disabled{opacity:.3; cursor:default;}
.asset-item.is-video{aspect-ratio:16/10;}
.asset-item .pp-badge{position:absolute; bottom:44px; left:6px; background:var(--accent); color:#0a0a0a; font-size:10px; font-weight:800; padding:3px 7px; border-radius:6px; z-index:2;}

.upload-queue{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; margin-bottom:20px; max-width:960px;}
.upload-queue .uq-head{display:flex; justify-content:space-between; gap:10px; font-size:13px; font-weight:700; margin-bottom:8px;}
.upload-queue .uq-total{height:6px; background:var(--surface2); border-radius:999px; overflow:hidden; margin-bottom:10px;}
.upload-queue .uq-total i{display:block; height:100%; width:0; background:var(--accent); transition:width .2s;}
.upload-queue .uq-list{display:flex; flex-direction:column; gap:6px; max-height:220px; overflow-y:auto;}
.upload-queue .uq-row{display:grid; grid-template-columns:minmax(0,1fr) 120px 48px; gap:10px; align-items:center; font-size:12.5px;}
.upload-queue .uq-name{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.upload-queue .uq-bar{height:6px; background:var(--surface2); border-radius:999px; overflow:hidden;}
.upload-queue .uq-bar i{display:block; height:100%; width:0; background:var(--accent);}
.upload-queue .uq-row.done .uq-bar i{background:#4fd88a;}
.upload-queue .uq-row.err .uq-bar i{background:var(--danger); width:100% !important;}
.upload-queue .uq-pct{text-align:right; color:var(--muted);}
.upload-queue .uq-row.err .uq-pct{color:var(--danger);}
@media (max-width:640px){ .upload-queue .uq-row{grid-template-columns:minmax(0,1fr) 70px 42px;} }

.pp-editor{display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:20px; margin-bottom:6px;}
@media (max-width:840px){ .pp-editor{grid-template-columns:1fr;} }
.pp-empty{grid-column:1/-1; color:var(--muted); font-size:13px; background:var(--surface); border:1px dashed var(--border); border-radius:var(--radius); padding:18px;}
.pp-frame{position:relative; overflow:hidden; background:var(--surface2); border-radius:12px; border:1px solid var(--border);}
.pp-frame img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:var(--pp-x,50%) var(--pp-y,50%); transform:scale(var(--pp-zoom,1)); transform-origin:var(--pp-x,50%) var(--pp-y,50%); user-select:none; -webkit-user-drag:none; pointer-events:none;}
.pp-main{aspect-ratio:16/9; cursor:grab; touch-action:none;}
.pp-main.grabbing{cursor:grabbing;}
.pp-side{display:flex; flex-direction:column; gap:12px;}
.pp-previews{display:flex; gap:14px; align-items:flex-end;}
.pp-previews figure{margin:0; text-align:center; font-size:11px; color:var(--muted);}
.pp-previews figure .pp-frame{margin:0 auto 4px;}
.pp-mobile{width:84px; aspect-ratio:9/16;}
.pp-avatar{width:84px; height:84px; border-radius:50%;}
.pp-thumbs{grid-column:1/-1; display:flex; gap:8px; overflow-x:auto; padding-bottom:4px;}
.pp-thumb{flex:0 0 auto; width:56px; height:70px; border-radius:8px; overflow:hidden; border:2px solid transparent; cursor:pointer; padding:0; background:var(--surface2);}
.pp-thumb img{width:100%; height:100%; object-fit:cover;}
.pp-thumb.sel{border-color:var(--accent);}
.pp-ctrl{display:grid; grid-template-columns:70px 1fr 44px; gap:10px; align-items:center; font-size:12px; color:var(--muted);}
.pp-ctrl input[type=range]{width:100%; accent-color:var(--accent); min-height:28px;}
.pp-ctrl output{text-align:right; color:var(--text); font-weight:700;}
.rate-hint{flex-basis:100%; font-size:12px; color:#e0b354; background:rgba(224,179,84,.1); border:1px solid rgba(224,179,84,.3); border-radius:8px; padding:6px 10px;}
