/* Capa visual moderna (estilo de las apps de IA actuales): tipografía Inter local,
   paleta neutra con acento índigo/violeta, superficies limpias y controles suaves.
   Se carga después de styles.css y enhancements.css; solo redefine tokens y acabados. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F7F7F9;
  --surface: #FFFFFF;
  --sidebar: #F1F1F5;
  --sidebar-hover: #E7E7EE;
  --selected: #E9E6FE;
  --border: #E6E6EC;
  --border-strong: #D5D5DE;
  --text: #15151C;
  --text-2: #3D3D4A;
  --muted: #6E6E7E;
  --accent: #5B4CF0;
  --accent-2: #3E8BFF;
  --accent-hover: #4A3BDB;
  --accent-soft: #EEECFE;
  --on-accent: #FFFFFF;
  --focus: #A79CFF;
  --shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 8px 24px rgba(20, 20, 40, .05);
  --input-bg: #FFFFFF;
  --gradient: linear-gradient(135deg, #6A5AF9 0%, #3E8BFF 100%);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.006em;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E12;
    --surface: #16161C;
    --sidebar: #111116;
    --sidebar-hover: #1D1D25;
    --selected: #262243;
    --border: #25252E;
    --border-strong: #33333E;
    --text: #EDEDF3;
    --text-2: #C9C9D6;
    --muted: #9696A8;
    --accent: #8C7FFF;
    --accent-2: #5AA2FF;
    --accent-hover: #A296FF;
    --accent-soft: #221F3B;
    --on-accent: #FFFFFF;
    --focus: #8C7FFF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .28);
    --input-bg: #1A1A21;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E12;
  --surface: #16161C;
  --sidebar: #111116;
  --sidebar-hover: #1D1D25;
  --selected: #262243;
  --border: #25252E;
  --border-strong: #33333E;
  --text: #EDEDF3;
  --text-2: #C9C9D6;
  --muted: #9696A8;
  --accent: #8C7FFF;
  --accent-2: #5AA2FF;
  --accent-hover: #A296FF;
  --accent-soft: #221F3B;
  --on-accent: #FFFFFF;
  --focus: #8C7FFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .28);
  --input-bg: #1A1A21;
}

body { font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; }
.brand strong { font-weight: 700; letter-spacing: -0.02em; }

/* Controles */
input, select {
  border-color: var(--border);
  border-radius: 10px;
  min-height: 40px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover { border-color: var(--border-strong); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.primary, .ghost, .link-btn, .primary-link, .danger-btn { border-radius: 11px; font-weight: 600; transition: transform .08s ease, box-shadow .15s ease, background .15s ease; }
.primary, .primary-link { background: var(--gradient); box-shadow: 0 6px 16px rgba(91, 76, 240, .25); }
.primary:hover, .primary-link:hover { background: var(--gradient); filter: brightness(1.06); }
.primary:active, .ghost:active { transform: translateY(1px); }
.primary:disabled { box-shadow: none; filter: grayscale(.3); }
.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.ghost:hover { background: var(--sidebar-hover); filter: none; }
.icon-btn { border-radius: 10px; }

/* Superficies */
.card { border-radius: 16px; box-shadow: var(--shadow); }
.sidebar { border-right: 1px solid var(--border); }
.badge, .pill { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.step-num { background: var(--gradient); color: #fff; border: 0; }
.progress > div, .progress > span { background: var(--gradient); }
.drop { border-radius: 14px; border-color: var(--border-strong); background: var(--bg); }
.drop:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Lista de trabajos tipo chat */
.job-entry { border-radius: 12px; }
.job-entry.selected { background: var(--selected); box-shadow: inset 3px 0 0 var(--accent); }
.job-name { font-weight: 550; }
.popover { border-radius: 14px; }

/* Barra lateral contraíble (escritorio) */
.app-layout { transition: grid-template-columns .22s ease; }
.app-layout.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app-layout.sidebar-collapsed .sidebar { visibility: hidden; overflow: hidden; border-right: 0; }

/* Barra de acciones del trabajo */
.workspace-foot { backdrop-filter: blur(10px); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- interfaz simplificada ---------- */
.native-hidden { display: none !important; }
.field-block { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button.on small { color: var(--accent); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); padding: 7px 13px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer; transition: border-color .15s, background .15s; }
.chips button:hover { border-color: var(--border-strong); }
.chips button.on, .chips button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chips.small button { padding: 5px 11px; font-size: 12.5px; }
.voice-card { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.voice-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--gradient); font-size: 20px; flex: none; }
.voice-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.voice-card-info strong { font-size: 15px; }
.voice-card-info .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 14px; }
.file-icon { font-size: 26px; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip label.ghost { cursor: pointer; }
.danger-text { color: var(--danger) !important; }
.advanced summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; font-weight: 650; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "▾"; color: var(--muted); }
.advanced[open] summary::after { content: "▴"; }
.advanced[open] summary { margin-bottom: 14px; }
.gallery-card { width: min(860px, 100%); max-height: 86vh; display: flex; flex-direction: column; gap: 14px; }
.gallery-head { display: flex; justify-content: space-between; align-items: center; }
.gallery-head h2 { margin: 0; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.gallery-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; min-width: 160px; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; overflow-y: auto; padding: 2px; }
.voice-tile { border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.voice-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.voice-tile .muted { font-size: 12px; }
.voice-tile-actions { display: flex; gap: 6px; margin-top: auto; }
.voice-tile-actions button { flex: 1; }
.subtitle-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
video::cue { background: rgba(0, 0, 0, .72); color: #fff; font-family: "Inter", system-ui, sans-serif; }
@media (max-width: 767px) {
  .voice-card { flex-wrap: wrap; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
}

/* Selección múltiple en la lista lateral */
.list-tools { display: flex; align-items: center; justify-content: space-between; padding-right: 6px; }
.list-tools .list-label { margin: 0; }
.list-tools .link-btn { padding: 4px 8px; font-size: 12.5px; }
.bulk-bar { position: sticky; top: 0; z-index: 2; margin: 6px 4px 8px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.bulk-all { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bulk-actions button { flex: 1; padding: 6px 8px; font-size: 12.5px; }
.job-entry { align-items: center; }
.job-check { margin-left: 10px; width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); flex: none; }
.job-entry.checked { background: var(--accent-soft); }

/* Sección de la colección Premium en la galería de voces */
.voice-section { grid-column: 1 / -1; margin: 12px 0 2px; font-size: 13px; font-weight: 650;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Borrado automático de trabajos */
.retention { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; }
.retention .check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.retention-days { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.retention-days input { width: 90px; }
.retention .primary.small { justify-self: start; }

/* Galería: pestañas y favoritas */
.gallery-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.gallery-tabs button { background: none; border: 0; padding: 8px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.gallery-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.voice-tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.fav-btn { background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px; }
.fav-btn[aria-pressed="true"] { color: #F5B301; }
.voice-tile .lang-note { font-size: 11.5px; color: var(--accent); }
