/* ============================================================================
   YTAutomation — Panel UI  ·  "Studio Control" design system
   Dark, premium, full-bleed. Dopamine via a tri-tone gradient (iris→violet→aqua),
   glassmorphism, animated mesh background and tactile micro-interactions.
   Display: Bricolage Grotesque · Body: Onest · Mono: JetBrains Mono.
   Todas las clases/IDs del markup se conservan (solo cambia el aspecto).
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500..800&family=Onest:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
  /* Lienzo */
  --bg: #070711;
  --bg-2: #0a0a16;
  --surface: #14141f;
  --surface-2: #1a1a28;
  --surface-3: #212236;
  --glass: rgba(20, 21, 36, .68);
  --border: #272840;
  --border-strong: #3b3d5e;
  --hair: rgba(255, 255, 255, .065);

  --text: #eef0fb;
  --muted: #a4a7c2;
  --subtle: #6e7191;

  /* Acentos dopamina (refinados, tier-1) */
  --iris: #7b6bff;
  --violet: #b15cff;
  --aqua: #2fe0d6;
  --pink: #ff5fa6;
  --grad: linear-gradient(115deg, #7b6bff 0%, #b15cff 48%, #2fe0d6 100%);
  --grad-soft: linear-gradient(135deg, #7b6bff 0%, #2fe0d6 100%);
  --grad-hot: linear-gradient(115deg, #ff5fa6 0%, #b15cff 100%);

  --ok: #35e4a6;
  --warn: #ffb454;
  --danger: #ff5d7a;
  --info: #4ab8ff;

  --r-sm: 9px; --r-md: 13px; --r-lg: 18px; --r-xl: 26px;
  --sidebar-w: 250px;
  --shadow-1: 0 1px 0 rgba(255,255,255,.05) inset, 0 14px 40px rgba(0,0,0,.40);
  --shadow-pop: 0 10px 34px rgba(124,108,255,.42);

  --font-display: "Bricolage Grotesque", "Onest", system-ui, sans-serif;
  --font-body: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px;
  border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--iris); background-clip: padding-box; }
::selection { background: rgba(123,107,255,.35); color: #fff; }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14.5px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* Mesh ambiental + grano (atmósfera y profundidad) */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40vw 40vw at 8% -2%, rgba(123,107,255,.20), transparent 60%),
    radial-gradient(38vw 38vw at 100% 8%, rgba(47,224,214,.14), transparent 60%),
    radial-gradient(46vw 46vw at 88% 108%, rgba(255,95,166,.12), transparent 60%),
    radial-gradient(50vw 50vw at 0% 120%, rgba(177,92,255,.12), transparent 60%);
  filter: saturate(118%);
  animation: drift 26s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(-2%, 1.5%, 0) scale(1.06); }
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------------------------------------------------------------- Layout -- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; padding: 22px 14px;
  background: linear-gradient(180deg, rgba(23,24,40,.85), rgba(9,9,20,.92));
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--hair);
  display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 2px; }
.brand .logo {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--grad); background-size: 180% 180%; border-radius: 12px;
  color: #fff; font-size: 16px; box-shadow: var(--shadow-pop);
  animation: hue 8s ease infinite;
}
@keyframes hue { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-text strong { font-family: var(--font-display); font-size: 17px; font-weight: 700;
  letter-spacing: .2px; }
.brand-text .muted { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; }

.tabs { display: flex; flex-direction: column; gap: 3px; }
.tab {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
  color: var(--muted); padding: 11px 13px; border-radius: var(--r-md);
  font: 500 14px var(--font-body); transition: color .16s, background .16s, transform .12s;
}
.tab .ic { width: 18px; text-align: center; opacity: .8; font-size: 15px; transition: .16s; }
.tab:hover { background: rgba(255,255,255,.04); color: var(--text); }
.tab:hover .ic { opacity: 1; transform: scale(1.12); }
.tab.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(123,107,255,.20), rgba(47,224,214,.06));
  box-shadow: 0 0 0 1px var(--hair) inset;
}
.tab.active::before {
  content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px;
  border-radius: 99px; background: var(--grad); box-shadow: 0 0 12px rgba(123,107,255,.8);
}
.tab.active .ic { opacity: 1; color: var(--aqua); }

.budget { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.usage-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--subtle); margin-bottom: 2px; }
.usage-title span { color: var(--aqua); }
.chip {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,.03); border: 1px solid var(--hair);
  border-radius: var(--r-md); padding: 8px 12px; font-size: 11.5px; color: var(--muted);
}
.chip b { color: var(--aqua); font-size: 13px; font-weight: 700;
  text-shadow: 0 0 12px rgba(47,224,214,.5); }
.chip.low b { color: var(--danger); text-shadow: 0 0 12px rgba(255,93,122,.5); }

.main { flex: 1; min-width: 0; }
main { flex: 1; min-width: 0; width: 100%; max-width: 1760px; margin: 0 auto;
  padding: 36px clamp(22px, 4vw, 52px) 84px; }

.view { display: none; }
.view.active { display: block; }
.view.active > * { animation: rise .42s cubic-bezier(.2,.75,.25,1) backwards; }
.view.active > *:nth-child(1) { animation-delay: .02s; }
.view.active > *:nth-child(2) { animation-delay: .07s; }
.view.active > *:nth-child(3) { animation-delay: .12s; }
.view.active > *:nth-child(4) { animation-delay: .17s; }
.view.active > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h2 { font-family: var(--font-display); font-size: 25px; font-weight: 700; margin: 0 0 22px;
  letter-spacing: -.2px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }

/* ---------------------------------------------------------------- Cards --- */
.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)) ,
    var(--surface);
  border: 1px solid var(--hair); border-radius: var(--r-lg);
  padding: 24px 26px; box-shadow: var(--shadow-1);
}
.form label { display: block; margin-bottom: 16px; font-size: 12.5px;
  color: var(--muted); font-weight: 500; }
.form strong { display: block; margin: 20px 0 6px; font-family: var(--font-display);
  color: var(--text); font-size: 12.5px; text-transform: uppercase; letter-spacing: 1.1px;
  font-weight: 600; }
.form strong::after { content: ""; display: block; height: 1px; margin-top: 8px;
  background: linear-gradient(90deg, var(--hair), transparent); }
.form strong:first-child { margin-top: 0; }

.form input, .form select, .form textarea,
.card input, .card select, .card textarea {
  display: block; width: 100%; margin-top: 7px; padding: 11px 14px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
.form input::placeholder, .card input::placeholder, .form textarea::placeholder { color: var(--subtle); }
.form input:focus, .form select:focus, .form textarea:focus,
.card input:focus, .card select:focus, .card textarea:focus {
  outline: none; border-color: var(--iris); background-color: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(123,107,255,.22), 0 0 26px rgba(123,107,255,.16);
}
.form textarea { resize: vertical; line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type="file"] { padding: 8px 10px; cursor: pointer; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: 13px; padding: 8px 15px; border: none; border-radius: var(--r-sm);
  background: var(--grad-soft); color: #fff; font-weight: 600; cursor: pointer; font: inherit;
  transition: filter .15s, box-shadow .15s, transform .12s;
}
input[type="file"]::file-selector-button:hover {
  filter: brightness(1.12); transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(123,107,255,.45); }
input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
code { font-family: var(--font-mono); font-size: 12px; color: var(--aqua);
  background: rgba(47,224,214,.08); padding: 1px 6px; border-radius: 5px; }

/* --------------------------------------------------------------- Botones -- */
.btn {
  position: relative; overflow: hidden; border: 1px solid var(--border-strong);
  background: var(--surface-3); color: var(--text);
  padding: 11px 19px; border-radius: var(--r-md); cursor: pointer; font: 600 14px var(--font-body);
  letter-spacing: .2px; transition: transform .12s ease, box-shadow .18s, border-color .16s, background .16s;
}
.btn:hover { transform: translateY(-1.5px); border-color: var(--iris);
  box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary {
  background: var(--grad); background-size: 160% 160%; border: none; color: #fff;
  letter-spacing: .3px; box-shadow: var(--shadow-pop);
}
.btn.primary::after {           /* destello al pasar el cursor */
  content: ""; position: absolute; inset: 0; transform: translateX(-130%);
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transition: transform .6s ease;
}
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 34px rgba(123,107,255,.6),
  0 0 26px rgba(47,224,214,.3); }
.btn.primary:hover::after { transform: translateX(130%); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255,255,255,.05); transform: none;
  box-shadow: none; }
.btn.danger { background: none; border-color: transparent; color: var(--danger); padding: 9px 14px; }
.btn.danger:hover { background: rgba(255,93,122,.12); border-color: var(--danger);
  box-shadow: none; transform: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

/* --------------------------------------------------------- Jobs / listas -- */
.jobs { display: flex; flex-direction: column; gap: 12px; }
.job-card {
  position: relative; background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--r-lg); padding: 17px 20px; display: flex; align-items: center;
  gap: 14px; cursor: pointer; box-shadow: var(--shadow-1);
  transition: border-color .15s, transform .14s, box-shadow .18s;
}
.job-card::before {            /* barra de acento que aparece en hover */
  content: ""; position: absolute; left: 0; top: 14%; bottom: 14%; width: 3px;
  border-radius: 99px; background: var(--grad); opacity: 0; transition: opacity .18s;
}
.job-card:hover { transform: translateY(-2px); border-color: rgba(123,107,255,.45);
  box-shadow: 0 14px 38px rgba(0,0,0,.45), 0 0 30px rgba(123,107,255,.14); }
.job-card:hover::before { opacity: 1; }
.job-card .idea { flex: 1; font-weight: 600; }
.job-card .idea small { color: var(--muted); font-weight: 400; }

/* --------------------------------------------------------------- Badges --- */
.badge { font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap; letter-spacing: .4px; text-transform: uppercase; }
.badge.queued { color: var(--muted); background: rgba(164,167,194,.12); }
.badge.running, .badge.uploading { color: #0a0a16;
  background: linear-gradient(120deg, var(--aqua), #5ff0c2); box-shadow: 0 0 18px rgba(47,224,214,.4); }
.badge.awaiting_approval { color: var(--warn); background: rgba(255,180,84,.15);
  border-color: rgba(255,180,84,.3); }
.badge.done { color: #04130d; background: linear-gradient(120deg, var(--ok), #7bf0c4);
  box-shadow: 0 0 18px rgba(53,228,166,.35); }
.badge.failed { color: var(--danger); background: rgba(255,93,122,.15);
  border-color: rgba(255,93,122,.3); }
.badge.cancelled { color: var(--subtle); background: rgba(110,113,145,.12); }

.msg { margin-top: 12px; font-size: 13px; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }

/* ----------------------------------------------------- Timeline de pasos -- */
.timeline { display: flex; flex-direction: column; gap: 2px; margin-top: 20px; }
.step { display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border-left: 2px solid var(--border); }
.step .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong);
  transition: all .2s; }
.step.running .dot { background: var(--aqua);
  box-shadow: 0 0 0 4px rgba(47,224,214,.18), 0 0 16px var(--aqua); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(47,224,214,.08), 0 0 18px var(--aqua); } }
.step.succeeded .dot { background: var(--ok); box-shadow: 0 0 12px rgba(53,228,166,.6); }
.step.failed .dot { background: var(--danger); box-shadow: 0 0 12px rgba(255,93,122,.6); }
.step .name { flex: 1; text-transform: capitalize; font-weight: 600; }
.step .st { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------ Grids / tarjetas -- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start;
  margin-bottom: 16px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px; }
.struct-card { background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-1);
  transition: transform .14s, border-color .15s, box-shadow .18s; }
.struct-card:hover { transform: translateY(-2px); border-color: rgba(123,107,255,.4);
  box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.struct-card .head { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 9px; }
.struct-card .head strong { font-family: var(--font-display); font-size: 14px; }
.struct-card .beat { font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.struct-card .beat .em { color: var(--aqua); opacity: .85; }
.inherited-note { font-size: 12.5px; color: var(--warn); margin-bottom: 14px;
  padding: 10px 14px; border: 1px solid rgba(255,180,84,.25); border-radius: var(--r-md);
  background: rgba(255,180,84,.07); }

.actions { display: flex; gap: 12px; margin-top: 22px; }
.empty { color: var(--muted); text-align: center; padding: 54px;
  border: 1px dashed var(--border); border-radius: var(--r-lg);
  background: rgba(255,255,255,.015); }
.empty.small { padding: 20px; font-size: 13px; }

/* ------------------------------------------------- Subsecciones / toolbar -- */
.subsection { margin-bottom: 26px; }
.subsection-head { font-family: var(--font-display); font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.1px; color: var(--subtle); margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--hair); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

/* Login (overlay a pantalla completa) */
.login-overlay { position: fixed; inset: 0; z-index: 100; display: flex;
  align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(60vw 60vh at 20% 0%, rgba(123,107,255,.18), transparent 60%),
    radial-gradient(50vw 50vh at 100% 100%, rgba(47,224,214,.12), transparent 60%), var(--bg); }
.login-overlay[hidden] { display: none; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 6px;
  background: var(--glass); backdrop-filter: blur(20px); border: 1px solid var(--border-strong);
  border-radius: var(--r-xl); padding: 30px 28px; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.login-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display);
  font-weight: 700; font-size: 18px; color: var(--text); margin-bottom: 4px; }
.login-brand .logo { width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--grad); border-radius: 10px; color: #fff; font-size: 15px; box-shadow: var(--shadow-pop); }
.login-card h2 { margin: 2px 0 12px; font-size: 20px; }
.login-card label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.login-card input { display: block; width: 100%; margin-top: 6px; padding: 11px 14px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font: inherit; }
.login-card input:focus { outline: none; border-color: var(--iris);
  box-shadow: 0 0 0 3px rgba(123,107,255,.22); }

/* Input suelto + fila de añadir */
.input { padding: 11px 14px; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--subtle); }
.input:focus { outline: none; border-color: var(--iris);
  box-shadow: 0 0 0 3px rgba(123,107,255,.22), 0 0 22px rgba(123,107,255,.16); }
.add-inline { display: flex; gap: 8px; align-items: center; }

/* Selects al tono del panel (flecha custom; oculta la nativa) */
.select, .form select, .card select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23a4a7c2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 38px;
}
.select {
  margin: 0; padding-top: 11px; padding-bottom: 11px; padding-left: 14px;
  background-color: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.select:hover, .form select:hover, .card select:hover { border-color: var(--border-strong); }
.select:focus { outline: none; border-color: var(--iris); background-color: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(123,107,255,.22), 0 0 22px rgba(123,107,255,.16); }
.select option, .form select option, .card select option {
  background: var(--surface-2); color: var(--text); }

/* Campo de solo lectura + avisos */
.readonly-field { margin-top: 7px; padding: 11px 14px;
  background: linear-gradient(135deg, rgba(123,107,255,.10), rgba(47,224,214,.06));
  border: 1px solid var(--hair); border-radius: var(--r-sm); color: var(--aqua);
  font-weight: 600; font-size: 13px; }
.form select:disabled { opacity: .5; cursor: not-allowed; }
.inline-warn { color: var(--danger); font-size: 10.5px; font-weight: 600;
  text-transform: none; letter-spacing: 0; }

/* Vista previa de subtítulos */
.sub-preview-frame { position: relative; height: 200px; width: 356px; max-width: 100%;
  margin-top: 7px; border-radius: var(--r-md); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #2a3350 0%, #0c0f1a 72%);
  display: flex; justify-content: center; box-shadow: inset 0 0 0 1px var(--hair); }
.sub-preview-frame[data-pos="top"] { align-items: flex-start; padding-top: 18px; }
.sub-preview-frame[data-pos="center"] { align-items: center; }
.sub-preview-frame[data-pos="bottom"] { align-items: flex-end; padding-bottom: 20px; }
.sub-sample { font-weight: 800; text-align: center; line-height: 1.12; padding: 0 12px;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 0 6px #000; }
.sub-off { color: var(--muted); font-size: 12px; align-self: center; }

/* Canales conectados a YouTube */
.yt-channels { display: flex; flex-wrap: wrap; gap: 11px; }
.yt-chip { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--hair); border-radius: 999px;
  padding: 10px 16px; color: var(--text); box-shadow: var(--shadow-1);
  transition: transform .14s, border-color .15s; }
.yt-chip:hover { transform: translateY(-2px); border-color: rgba(123,107,255,.4); }
.yt-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); }
.yt-chip.on .dot { background: #36e27b; box-shadow: 0 0 12px rgba(54,226,123,.7); }
.yt-chip.off { color: var(--muted); }
.yt-chip small { color: var(--subtle); font-weight: 500; }

/* Casillas en fila (texto a la izquierda, checkbox grande a su derecha) */
.check-row, label.check-row { display: flex; align-items: center; gap: 11px;
  font-size: 13.5px; color: var(--text); cursor: pointer; }
.check-row span { color: var(--muted); }
.check-row input[type="checkbox"] { flex: 0 0 auto; width: 21px; height: 21px; margin: 0;
  accent-color: var(--iris); cursor: pointer; }

/* Inputs de fecha/hora a tono del tema oscuro (picker oscuro + icono claro) */
input[type="date"], input[type="datetime-local"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .7; transition: opacity .15s; }
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ----------------------------------------------------------------- Modal -- */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,6,16,.66);
  backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px; z-index: 60; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay[hidden] { display: none; }
.modal { width: 100%; max-width: 640px; background: var(--glass); backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong); border-radius: var(--r-xl);
  box-shadow: 0 30px 90px rgba(0,0,0,.7), 0 0 0 1px var(--hair) inset;
  max-height: 86vh; overflow-y: auto; animation: pop .26s cubic-bezier(.2,.8,.25,1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--hair); position: sticky; top: 0;
  background: var(--glass); backdrop-filter: blur(20px); z-index: 1; }
.modal-head strong { font-family: var(--font-display); color: var(--text); font-size: 15px; }
.modal-body { padding: 22px; }
.preview-video { width: 100%; border-radius: var(--r-md); background: #000; max-height: 56vh; }

/* --------------------------------------------------------- Publicaciones -- */
.pub-card { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap; background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 11px; box-shadow: var(--shadow-1);
  transition: border-color .15s, transform .14s; }
.pub-card:hover { border-color: rgba(123,107,255,.35); transform: translateY(-1px); }
.pub-card .idea { color: var(--text); font-size: 14.5px; font-weight: 600; margin-bottom: 7px; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; }
.pub-meta .meta { font-size: 12px; color: var(--muted); }
.pub-meta .meta.warn { color: var(--pink); }
.pub-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }

/* Librería de música */
.music-row { display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  margin-bottom: 9px; border: 1px solid var(--hair); border-radius: var(--r-md);
  background: rgba(255,255,255,.025); }
.music-row .music-name { flex: 0 0 auto; max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: var(--aqua); font-size: 13px; font-weight: 600; }
.music-row audio { flex: 1 1 auto; height: 34px; min-width: 120px; }
.music-row .btn.danger { flex: 0 0 auto; padding: 4px 10px; }

/* Branding */
.brand-list { margin: 6px 0 4px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-bottom: 7px; border: 1px solid var(--hair);
  border-radius: var(--r-sm); background: rgba(255,255,255,.025); }
.brand-row .brand-name { font-size: 13px; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.brand-row .btn.danger { flex: 0 0 auto; padding: 3px 9px; }

/* Imagen de referencia */
.ref-current { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.ref-thumb { max-height: 66px; max-width: 112px; border-radius: var(--r-sm);
  border: 1px solid var(--border); object-fit: cover; }
.ref-current .btn.danger { padding: 4px 10px; }

/* Registro de actividad */
.evlog { margin: 18px 0 4px; border: 1px solid var(--hair); border-radius: var(--r-lg);
  padding: 12px 16px; background: rgba(255,255,255,.02); }
.evlog summary { cursor: pointer; color: var(--aqua); font-size: 13px; font-weight: 600; }
.ev-list { margin-top: 12px; max-height: 240px; overflow-y: auto;
  font-family: var(--font-mono); font-size: 12px; }
.ev { padding: 3px 0; color: var(--muted); }
.ev.ev-ok { color: var(--aqua); }
.ev.ev-err { color: var(--danger); }

/* --------------------------------------------------------- Responsivo ---- */
@media (max-width: 860px) {
  .grid2, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row;
    flex-wrap: wrap; align-items: center; }
  .app { flex-direction: column; }
  .tabs { flex-direction: row; flex-wrap: wrap; }
  .budget { flex-direction: row; flex-wrap: wrap; margin: 0; }
  main { padding: 24px 18px 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, body::before { animation: none !important; transition: none !important; }
}
