:root {
    --bg: #070b13;
    --card: #141926;
    --card-glass: rgba(22, 28, 42, .55);
    --border: #2a3040;
    --hairline: rgba(255, 255, 255, .08);
    --text: #e6e8ec;
    --muted: #9aa0aa;
    --accent: #4f8cff;
    --accent-2: #2f6bf0;
    --input-bg: rgba(255, 255, 255, .03);
    --radius: 16px;
    color-scheme: dark; /* native controls (select dropdowns, scrollbars) render dark */
}

* { box-sizing: border-box; }

/* Native <select> option lists dark (Firefox/others that ignore color-scheme). */
select option, select optgroup { background: #141926; color: var(--text); }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    background:
        radial-gradient(900px 520px at 16% -10%, rgba(58, 110, 230, .30), transparent 60%),
        radial-gradient(760px 520px at 108% 6%, rgba(40, 80, 180, .14), transparent 55%),
        var(--bg);
    background-attachment: fixed;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* App shell: sidebar + main */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px;
    flex: 0 0 220px;
    background: rgba(12, 16, 26, .55);
    border-right: 1px solid var(--hairline);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    padding: 1rem .75rem;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar__brand {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    padding: .4rem .6rem 1.2rem;
    font-size: 1.05rem;
}
.sidebar__nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .6rem; border-radius: 8px;
    color: var(--text); text-decoration: none; font-size: .95rem;
}
.nav-item:hover { background: #1e222b; }
.nav-item.active { background: rgba(79,140,255,.15); color: var(--accent); }
.nav-item__icon { width: 1.2rem; text-align: center; }
.sidebar__foot { border-top: 1px solid var(--border); padding-top: .75rem; margin-top: .75rem; }
.sidebar__foot .email { font-size: .78rem; padding: 0 .6rem .5rem; word-break: break-all; }

/* Sidebar header (brand + collapse) and toggle buttons */
.sidebar { transition: width .15s ease, flex-basis .15s ease; }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .8rem; }
.sidebar__head .sidebar__brand { padding: .4rem .6rem; } /* head owns the bottom spacing */
.sidebar__collapse, .hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; padding: 0; flex: 0 0 auto;
    background: transparent; border: 1px solid var(--hairline); border-radius: 8px;
    color: var(--muted); cursor: pointer;
}
.sidebar__collapse svg, .hamburger svg { width: 18px; height: 18px; }
.sidebar__collapse:hover, .hamburger:hover { color: var(--text); background: #1e222b; }
.hamburger { display: none; }
.nav-backdrop { display: none; }

.main { flex: 1; min-width: 0; padding: 2rem 1.75rem 4rem; }
.page-title { font-size: 1.4rem; margin: 0 0 1.25rem; }

/* Desktop only: collapsed = icon-only sidebar */
@media (min-width: 721px) {
    .app--collapsed .sidebar { width: 62px; flex-basis: 62px; padding-left: .5rem; padding-right: .5rem; }
    .app--collapsed .sidebar__brand,
    .app--collapsed .nav-item__label,
    .app--collapsed .account__mail { display: none; }
    .app--collapsed .sidebar__head { justify-content: center; }
    .app--collapsed .nav-item { justify-content: center; gap: 0; padding-left: .4rem; padding-right: .4rem; }
    .app--collapsed .account { justify-content: center; }
    .app--collapsed .sidebar__collapse svg { transform: rotate(180deg); }
}

/* Mobile: off-canvas sidebar toggled by the hamburger */
@media (max-width: 720px) {
    .hamburger { display: inline-flex; position: fixed; top: .6rem; left: .6rem; z-index: 70; background: rgba(12,16,26,.9); }
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; width: 240px; flex-basis: 240px;
        z-index: 80; transform: translateX(-100%); transition: transform .2s ease; flex-direction: column;
    }
    .app--nav-open .sidebar { transform: none; }
    .app--nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 75; }
    .sidebar__collapse { display: none; }
    .main { padding: 3.4rem 1.25rem 4rem; }
}

.card {
    background: var(--card-glass);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.card--narrow {
    max-width: 430px;
    margin: 8vh auto 0;
    padding: 2.5rem;
    border-radius: 22px;
}
.card--narrow h1 { font-size: 2rem; margin-bottom: .4rem; }
.card--form {
    max-width: 640px;
    margin: 3rem auto 0;
    border-radius: 22px;
    padding: 2rem;
}
.signup-link { text-align: center; margin-top: 1rem; }
.signup-link a { color: var(--accent); text-decoration: none; }

h1 { margin: 0 0 .25rem; font-size: 1.5rem; }
h2 { margin: 0 0 1rem; font-size: 1.15rem; }

.muted { color: var(--muted); }
code { background: #000; padding: .1em .35em; border-radius: 4px; font-size: .9em; }

/* Formulario */
form label {
    display: block;
    margin-bottom: 1rem;
    font-size: .9rem;
    color: var(--text);
}
form input {
    display: block;
    width: 100%;
    margin-top: .45rem;
    padding: .8rem .9rem;
    background: var(--input-bg);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color .15s, box-shadow .15s;
}
form input::placeholder { color: #5b6270; }
form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, .22);
}

/* Iconos en email/contraseña (login/signup) */
input[type="email"], input[type="password"] {
    background-repeat: no-repeat;
    background-position: .95rem center;
    background-size: 18px;
    padding-left: 2.7rem;
}
input[type="email"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239aa0aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E");
}
input[type="password"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239aa0aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

button, .btn {
    display: inline-block;
    padding: .8rem 1rem;
    background: linear-gradient(180deg, #5b9bff, var(--accent-2));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(47, 107, 240, .35);
    transition: filter .15s, box-shadow .15s;
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:disabled { opacity: .6; cursor: default; filter: none; }
button { width: 100%; }
.btn--ghost { background: transparent; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
/* Discreet outline button: colored border, same background as the rest. */
.btn--outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); box-shadow: none; }
.btn--ghost:hover, .btn--outline:hover { filter: none; background: rgba(255, 255, 255, .04); }
.btn--sm { width: auto; padding: .3rem .6rem; font-size: .85rem; }

/* Paginación (admin jobs) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: 1rem; }
.pager .btn { min-width: 2.2rem; text-align: center; }
.pager__current { background: var(--accent); color: #fff; cursor: default; }
.pager__gap { padding: 0 .25rem; color: var(--muted); }

/* Precios (admin) — edición inline */
.prices-table td { vertical-align: middle; }
.prices-table input[type="number"], .prices-table input[type="text"] { width: 100%; padding: .3rem .45rem; }
.prices-table td:nth-child(4) input { width: 3.2rem; }
.prices-actions { white-space: nowrap; display: flex; gap: .4rem; }

/* Edición de créditos (admin) */
.credits-cell { white-space: nowrap; }
/* Users table: keep the email column narrow (ellipsis, full value on hover) */
.umail { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
/* Update button flagged when the account balance is 0 or negative */
.credit-update--zero { border-color: #ff6b6b; color: #ff8a8a; }
.credit-update--zero:hover { background: rgba(255, 107, 107, .12); }
/* Users email filter */
.users-filter { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.users-filter input[type="text"] { width: auto; min-width: 16rem; height: 2rem; margin: 0; padding: 0 .6rem; background: var(--input-bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--text); }
.credit-value { margin-right: .5rem; }

/* Modal */
.modal {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(0, 0, 0, .55);
    display: flex; align-items: center; justify-content: center;
}
.modal[hidden] { display: none; }
.modal__box {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 1.5rem; width: 380px; max-width: 92vw;
}
.modal__box h3 { margin: 0 0 .25rem; }
.modal__actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.modal__actions .btn { width: auto; }

.alert {
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert--error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}
.alert--ok {
    background: rgba(126,224,160,.12);
    border: 1px solid #2f6b46;
    color: #7ee0a0;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.topbar .brand { font-weight: 600; }
.topbar .spacer { flex: 1; }

/* Créditos */
.credits-big {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
}
.stat {
    flex: 1;
    min-width: 140px;
    background: #0f1115;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .85rem 1rem;
}
.stat__label { display: block; font-size: .8rem; color: var(--muted); }
.stat__value { display: block; font-size: 1.4rem; font-weight: 600; margin-top: .2rem; }
.stat__unit { font-size: .9rem; font-weight: 500; color: var(--muted); }

/* Admin dashboard chart */
.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.chart-toolbar h2 { margin: 0; }
.chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); }
.chart-controls label { margin: 0; color: var(--muted); }
.chart-controls select, .chart-controls input[type="date"] {
    width: auto; height: 2rem; margin: 0; padding: 0 .5rem;
    background: var(--input-bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--text);
}
.chart-custom { display: inline-flex; align-items: center; gap: .4rem; }
.chart-total { margin-left: .25rem; }
.chart-total strong { color: var(--text); }
.chart-box { position: relative; height: 340px; }

/* Detalles */
.details {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: .5rem 1rem;
    margin: 0;
}
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* Tabla */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 500; }
.table th .sort { color: var(--muted); text-decoration: none; white-space: nowrap; }
.table th .sort:hover { color: var(--text); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* Channels (New render) — legacy parity, UI only */
.channels-card { padding: 0; }
.channels-summary { cursor: pointer; padding: 1.25rem 1.5rem; font-weight: 600; font-size: 1.05rem; list-style: none; }
.channels-summary::-webkit-details-marker { display: none; }
.channels-summary::before { content: '▸'; color: var(--muted); margin-right: .5rem; display: inline-block; }
.channels-card[open] .channels-summary::before { content: '▾'; }
.channels { padding: 0 1.5rem 1.25rem; }
.ch-top { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.ch-top__label { width: 110px; flex: 0 0 110px; color: var(--muted); font-size: .9rem; }
.ch-sep { border: none; border-top: 1px solid var(--hairline); margin: .7rem 0; }
.channels-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .25rem; }
.ch-item { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.channels input { display: inline-block; width: auto; margin: 0; } /* override global "form input { width:100% }" */
.channels label { margin: 0; } /* override global "form label { margin-bottom:1rem }" */
.channels input[type="checkbox"] { width: 15px; height: 15px; flex: 0 0 auto; padding: 0; margin: 0; align-self: center; }
.ch-main { display: inline-flex; align-items: center; gap: .4rem; width: 112px; flex: 0 0 112px; height: 1.85rem; cursor: pointer; font-size: .88rem; line-height: 1; }
.ch-name { flex: 1; min-width: 0; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-extra { display: inline-flex; align-items: center; gap: .35rem; min-height: 1.85rem; font-size: .85rem; line-height: 1; color: var(--muted); }
.channels select { width: auto; max-width: 8rem; height: 1.85rem; line-height: 1; padding: 0 .45rem; background: var(--input-bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--text); font-size: .82rem; box-sizing: border-box; vertical-align: middle; }
.channels select.ch-wide { max-width: 16rem; }
.channels .ch-num { width: 4.6rem; height: 1.85rem; padding: 0 .4rem; background: var(--input-bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--text); font-size: .82rem; box-sizing: border-box; }
.channels .ch-ctl:disabled { opacity: .4; }
.channels--off { opacity: .55; }
.ch-note { margin: 1rem 0 0; font-size: .8rem; }

/* Wide tables (admin): don't wrap cells; scroll horizontally if they overflow. */
.table-scroll { overflow-x: auto; }
.table--nowrap th, .table--nowrap td { white-space: nowrap; }
.table .icons { white-space: nowrap; }
.icon { text-decoration: none; font-size: 1.1rem; margin-right: .4rem; }
.link { color: var(--accent); text-decoration: none; }
.preview-grid { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; align-items: flex-start; }
.preview-img {
    height: 320px; max-width: 100%;
    overflow: hidden; background: transparent;
}
/* El box se ajusta al ancho real de la imagen (altura fija 320px), así no hay
   relleno lateral por letterboxing y el gap horizontal iguala al vertical. */
.preview-img img { display: block; width: auto; height: 100%; max-width: 100%; object-fit: contain; }
.row--expired { opacity: .55; }
.tag {
    display: inline-block; font-size: .7rem; padding: .05rem .4rem; margin-left: .3rem;
    border: 1px solid var(--error-border); color: var(--error-text); border-radius: 6px;
}
.state { font-size: .75rem; padding: .12rem .5rem; border-radius: 6px; text-transform: capitalize; }
.state--done { color: #7ee0a0; background: rgba(126,224,160,.12); }
.state--rendering { color: var(--accent); background: rgba(79,140,255,.12); }
.state--booting, .state--pending, .state--uploading { color: var(--muted); background: #1e222b; }
.state--started { color: #f2c94c; background: rgba(242,201,76,.14); }
.state--error { color: var(--error-text); background: var(--error-bg); }
.state--cancelled { color: #ffb27a; background: rgba(255,178,122,.12); }

/* Formulario de render */
.fs {
    border: 1px solid var(--hairline); border-radius: 12px;
    padding: 1rem 1rem .25rem; margin: 0 0 1rem;
}
.fs legend { color: var(--muted); font-size: .8rem; padding: 0 .4rem; text-transform: uppercase; letter-spacing: .04em; }
.fs:disabled, fieldset[disabled] { opacity: .45; }
.fs select {
    display: block; width: 100%; margin-top: .4rem; padding: .7rem .8rem;
    background: var(--input-bg); border: 1px solid var(--hairline); border-radius: 12px; color: var(--text); font-size: 1rem;
}
.check { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; font-size: .95rem; color: var(--text); }
.check input { width: auto; margin: 0; }
.res { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; }
.res input[type="number"] { margin-top: 0; }
.res__x { color: var(--muted); }
.form-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
/* Billing details form: keep fields at a readable width, not full-panel */
.billing-form { max-width: 620px; }
.billing-form .field--sm { flex: 0 0 220px; }
.field { display: block; margin-bottom: 1rem; font-size: .9rem; color: var(--muted); flex: 1; min-width: 200px; }
.field--sm { flex: 0 0 160px; min-width: 140px; }
.field input, .field select, .field textarea {
    display: block; width: 100%; margin-top: .4rem; padding: .7rem .8rem;
    background: var(--input-bg); border: 1px solid var(--hairline); border-radius: 12px;
    color: var(--text); font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 8rem; font-family: inherit; }
.field input[type="file"] { padding: .5rem; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, .22);
}
.form-actions { display: flex; align-items: center; gap: 1rem; }
.form-actions button { width: auto; }
.error-text { color: var(--error-text); font-size: .9rem; }

/* Renders en curso */
.job-row { margin-bottom: 1rem; }
.job-row__head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .35rem; font-size: .9rem; }
.job-row__name { font-weight: 600; }
.job-row__right { display: inline-flex; align-items: center; gap: .6rem; }
.job-row__cancel {
    padding: .2rem .6rem; font-size: .8rem; line-height: 1.4; cursor: pointer;
    color: #ff8a8a; background: transparent; border: 1px solid rgba(255,138,138,.45);
    border-radius: 999px; width: auto;
}
.job-row__cancel:hover:not(:disabled) { background: rgba(255,138,138,.12); }
.job-row__cancel:disabled { opacity: .6; cursor: default; }

/* Grupo de renders: tira de previews (arriba) + líneas de progreso apiladas */
.render-previews { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.render-thumb { border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden; background: #0b0e14; }
.render-thumb img { display: block; width: 100%; height: calc(100% - 1.1rem); object-fit: cover; background: #0b0e14; }
.render-thumb__cap { display: block; height: 1.1rem; line-height: 1.1rem; font-size: .68rem; color: var(--muted); padding: 0 .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.render-previews.sz-lg .render-thumb { width: 220px; height: 148px; }
.render-previews.sz-md .render-thumb { width: 150px; height: 105px; }
.render-previews.sz-sm .render-thumb { width: 104px; height: 76px; }
.render-previews.sz-xs .render-thumb { width: 74px; height: 56px; }

.job-line { margin-bottom: .6rem; }
.job-line__head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .25rem; font-size: .85rem; }
.job-line__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-line__right { display: inline-flex; align-items: center; gap: .5rem; flex: none; }
.job-row__preview {
    margin-bottom: .5rem; border: 1px solid var(--hairline); border-radius: 10px;
    overflow: hidden; background: #0b0e14; max-width: 320px;
}
.job-row__preview img { display: block; width: 100%; height: auto; }
.launch-actions { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.progress { height: 10px; background: #0f1115; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.progress__bar {
    height: 100%; width: 0; background: linear-gradient(90deg, #4f8cff, #7db0ff);
    transition: width .4s ease;
}
/* Color de barra por estado (booting vs rendering claramente distintos) */
.progress__bar.upfiles,
.progress__bar.wait      { background: #3a4150; animation: barpulse 1.2s ease-in-out infinite; }
.progress__bar.booting   { background: linear-gradient(90deg, #e0a33f, #f2c877); animation: barpulse 1.1s ease-in-out infinite; }
.progress__bar.rendering { background: linear-gradient(90deg, #4f8cff, #7db0ff); }
.progress__bar.uploading { background: linear-gradient(90deg, #9b7ce0, #bda4f2); animation: barpulse 1.2s ease-in-out infinite; }
.progress__bar.done      { background: linear-gradient(90deg, #4fd08c, #7ee0a0); }
.progress__bar.error     { background: linear-gradient(90deg, #d05656, #e08a8a); }
@keyframes barpulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.job-row__link { margin-left: .5rem; color: var(--accent); text-decoration: none; }

/* Chip de estado */
.chip {
    display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; padding: .1rem .45rem; border-radius: 6px; vertical-align: middle;
}
.chip--upfiles, .chip--wait { background: #2a2f3a; color: #9aa0aa; }
.chip--booting   { background: rgba(224,163,63,.18);  color: #e6b25a; }
.chip--rendering { background: rgba(79,140,255,.18);  color: #7db0ff; }
.chip--uploading { background: rgba(155,124,224,.18); color: #bda4f2; }
.chip--done      { background: rgba(126,224,160,.15); color: #7ee0a0; }
.chip--error     { background: var(--error-bg);       color: var(--error-text); }

/* ============================ Dashboard / New render redesign ============================ */

/* Sidebar refinements */
.sidebar { width: 210px; flex: 0 0 210px; }
.nav-item__icon { width: 18px; height: 18px; flex: 0 0 18px; text-align: initial; }
.sidebar__foot .account { display: flex; align-items: center; gap: .55rem; padding: .3rem .6rem .7rem; }
.account__avatar {
    width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
    background: rgba(79,140,255,.2); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700;
}
.account__mail { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Page head + compact credit chip */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.page-head .page-title { margin-bottom: 1.25rem; }
.stat-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.25rem; }
.page-head__actions { display: inline-flex; gap: .5rem; flex-wrap: wrap; }

/* Compra de créditos */
.buy-card { max-width: 560px; }
.pkg-chips { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }
.pkg-chip {
    flex: 1 1 84px; min-width: 84px; padding: 1rem .5rem; cursor: pointer; color: inherit;
    background: var(--input-bg); border: 1px solid var(--hairline); border-radius: var(--radius);
    text-align: center; font-size: 1.2rem; font-weight: 600; transition: border-color .15s, box-shadow .15s;
}
.pkg-chip:hover { border-color: var(--accent); }
.pkg-chip--active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79, 140, 255, .35); }
.buy-summary { margin: 1.25rem 0; }
.buy-summary .summary-row { display: flex; justify-content: space-between; padding: .3rem 0; }
.buy-summary .summary-row--total { border-top: 1px solid var(--hairline); margin-top: .4rem; padding-top: .7rem; font-size: 1.1rem; }
#payment-element { margin: 1rem 0 1.25rem; }
#address-element { margin-bottom: .6rem; }
.buy-subhead { margin: 1.25rem 0 .6rem; font-size: .95rem; font-weight: 600; }
.buy-vat { margin-top: .6rem; }
.pay-btn { width: 100%; }
.credit-chip {
    display: inline-block; margin: 0 0 1.25rem; padding: .5rem .9rem;
    border: 1px solid var(--hairline); border-radius: 999px; background: var(--card-glass); font-size: .95rem;
}
.stat-row .credit-chip { margin: 0; }
.credit-chip strong { color: var(--accent); }
.credit-chip a { color: var(--accent); text-decoration: none; }

/* Two-column render layout */
.render-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; align-items: start; }
.render-main { min-width: 0; }
.render-side { position: sticky; top: 1.5rem; }
@media (max-width: 900px) { .render-layout { grid-template-columns: 1fr; } .render-side { position: static; } }

.summary-card h2 { margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--hairline); font-size: .9rem; }
.summary-row:last-of-type { border-bottom: none; }
.summary-card button { margin-top: 1.1rem; }
.render-msg { margin: .6rem 0 0; }
.hint { margin: .4rem 0 0; font-size: .8rem; }

/* Dropzone */
.dropzone { border: 1.5px dashed var(--border); border-radius: 14px; padding: 2rem 1rem; text-align: center; transition: border-color .15s, background .15s; }
.dropzone--over { border-color: var(--accent); background: rgba(79,140,255,.06); }
.dropzone__title { font-weight: 600; margin-bottom: .35rem; }

/* File list */
.filelist { list-style: none; margin: 1rem 0 0; padding: 0; }
.fileitem { display: flex; align-items: center; gap: .75rem; padding: .55rem .2rem; border-bottom: 1px solid var(--hairline); font-size: .9rem; }
.fileitem:last-child { border-bottom: none; }
.fileitem__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileitem__ok { color: #7ee0a0; font-size: .8rem; }
.fileitem__size { font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 5.5rem; text-align: right; }
.fileitem__rm { width: auto; padding: 0 .5rem; background: transparent; border: none; color: var(--muted); box-shadow: none; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.fileitem__rm:hover { color: var(--error-text); filter: none; }

/* Radios */
.radio { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; font-size: .95rem; cursor: pointer; }
.radio input { width: auto; margin: 0; accent-color: var(--accent); }
.override { margin-top: 1rem; }
/* Render settings rows — same single-column style as Channels */
.set-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.set-row__label { width: 130px; flex: 0 0 130px; color: var(--muted); font-size: .9rem; }
.override .res { margin-top: 0; }
.override .res input[type="number"] { height: 1.95rem; padding: 0 .45rem; box-sizing: border-box; }
.set-row select { width: auto; min-width: 11rem; height: 1.95rem; padding: 0 .5rem; background: var(--input-bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--text); font-size: .9rem; box-sizing: border-box; }

/* Switch */
.switch { display: flex; align-items: center; gap: .6rem; margin: .5rem 0; cursor: pointer; font-size: .95rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: relative; width: 38px; height: 22px; flex: 0 0 38px; border-radius: 999px; background: #2a3040; border: 1px solid var(--hairline); transition: background .15s; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cfd3da; transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); background: #fff; }
.switch--inline { margin: 0; }

/* Units inside fields */
.unit { color: var(--muted); font-size: .85rem; margin: 0 .35rem 0 .15rem; }
.res input[type="number"] { width: 4.5rem; margin-top: 0; }
.res .switch--inline { margin-right: .1rem; }
