/* Cake Platform — panel de administración y pantallas de acceso (Sprint 02).
 * Usa las variables de app.css: --plum, --raspberry, --icing, --line, --muted, --ok, --down. */
:root {
    --warn: #8A5300;
    --plum-deep: #2A1724;
    --raspberry-soft: #F6E7EE;
    --sidebar-w: 15rem;
    --radius: 6px;
}

/* ------------------------------------------------------------ utilidades */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
}
.muted, .hint { color: var(--muted); }
.hint { display: block; font-size: .875rem; margin: .25rem 0 0; }
code { font-size: .875em; background: var(--icing); padding: .05rem .3rem; border-radius: 3px; }

/* ------------------------------------------------------------ botones */
.button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 2.5rem; padding: .5rem 1rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; color: var(--plum);
    font: inherit; font-weight: 600; text-decoration: none;
    cursor: pointer;
}
.button:hover { border-color: var(--plum); }
.button--primary { background: var(--raspberry); border-color: var(--raspberry); color: #fff; }
.button--primary:hover { background: #77224A; border-color: #77224A; }
.button--danger { color: var(--down); border-color: #E5B9B5; }
.button--danger:hover { border-color: var(--down); }
.button--quiet { border-color: transparent; background: none; }
.button--block { width: 100%; }
.link-button {
    border: 0; background: none; padding: 0;
    color: var(--raspberry); font: inherit; text-decoration: underline; cursor: pointer;
}

/* ------------------------------------------------------------ mensajes */
.notice {
    margin: 0 0 1.25rem; padding: .75rem 1rem;
    border-left: 4px solid var(--muted); border-radius: var(--radius);
    background: #fff;
}
.notice--ok { border-left-color: var(--ok); background: #EEF6F1; }
.notice--error { border-left-color: var(--down); background: #FBEDEC; }

/* ------------------------------------------------------------ formularios */
.form { display: grid; gap: 1.125rem; max-width: 30rem; }
.form--wide { max-width: 48rem; }
.form-grid { display: grid; gap: 1.125rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.field { display: grid; gap: .375rem; align-content: start; }
.field--full { grid-column: 1 / -1; }
.field label, .fieldset legend { font-weight: 600; }
.field input, .field select {
    width: 100%; min-height: 2.5rem; padding: .5rem .625rem;
    border: 1px solid #CDBBC5; border-radius: var(--radius);
    background: #fff; color: var(--plum); font: inherit;
}
.field input:focus-visible, .field select:focus-visible, .check input:focus-visible {
    outline: 3px solid var(--raspberry); outline-offset: 1px;
}
.field input[aria-invalid="true"] { border-color: var(--down); }
.field-error { margin: 0; color: var(--down); font-size: .875rem; font-weight: 600; }
.static-value { margin: 0; padding: .5rem 0; }
.fieldset { margin: 0; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.fieldset--bare { padding: 0; border: 0; background: none; display: grid; gap: 1.125rem; }
.fieldset legend { padding: 0 .375rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.check-list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.check-list--columns { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.check { display: flex; align-items: flex-start; gap: .625rem; cursor: pointer; }
.check input { width: 1.125rem; height: 1.125rem; margin-top: .2rem; accent-color: var(--raspberry); flex: none; }
.check--disabled { cursor: not-allowed; opacity: .6; }

/* ------------------------------------------------------------ acceso (login) */
.auth-page { background: var(--icing); }
.auth-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 2.5rem);
}
.auth-main { flex: 1; display: grid; place-items: start center; padding: clamp(1rem, 6vh, 4rem) 1rem 3rem; }
.auth-card {
    width: 100%; max-width: 26rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    border-top: 6px solid var(--raspberry);
}
.auth-card h1 { font-size: 1.75rem; }
.lead { color: var(--muted); margin: 0 0 1.5rem; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin: 1.25rem 0 0; font-size: .9375rem; }

/* ------------------------------------------------------------ panel: estructura */
.admin-page { background: var(--icing); }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) 1fr; }

.sidebar {
    display: flex; flex-direction: column;
    background: var(--plum); color: #F3E6EC;
    padding: 1.5rem 0 1rem;
}
.sidebar-brand { display: grid; padding: 0 1.25rem 1.5rem; color: #fff; text-decoration: none; }
.sidebar-brand-name { font-weight: 700; font-size: 1.125rem; line-height: 1.2; }
.sidebar-brand-area { color: #CFB3C1; font-size: .875rem; }
.sidebar-nav { list-style: none; margin: 0; padding: 0; }
.sidebar-nav a {
    display: block; padding: .625rem 1.25rem;
    color: #F3E6EC; text-decoration: none;
    border-left: 4px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .06); }
.sidebar-nav a[aria-current="page"] { background: var(--plum-deep); border-left-color: #E28AB0; color: #fff; font-weight: 600; }
.sidebar-nav a:focus-visible { outline: 3px solid #E28AB0; outline-offset: -3px; }
.sidebar-version { margin: auto 0 0; padding: 1rem 1.25rem 0; color: #A98A9A; font-size: .8125rem; }

.admin-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; align-items: center; gap: 1.25rem;
    padding: .75rem clamp(1rem, 3vw, 2rem);
    background: #fff; border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; }
.topbar-user { display: grid; margin-right: auto; line-height: 1.3; min-width: 0; }
.topbar-name { color: var(--plum); font-weight: 700; text-decoration: none; }
.topbar-name:hover { text-decoration: underline; }
.topbar-roles { color: var(--muted); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { margin: 0; }

.admin-content { flex: 1; width: 100%; max-width: 76rem; padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2rem) 3rem; }

/* ------------------------------------------------------------ panel: contenido */
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.625rem, 3vw, 2.125rem); margin: 0 0 .25rem; }
.page-head .lead { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.page-head--row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.breadcrumb { margin: 0 0 .25rem; font-size: .9375rem; }

.panel { margin: 0 0 1.75rem; padding: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel--plain { max-width: 48rem; }
.form + .panel { margin-top: 2rem; }
.panel h2 { margin: 0 0 .75rem; font-size: 1.125rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; }
.empty { color: var(--muted); padding: 1.5rem 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; margin: 0 0 1.75rem; }
.stats > div { padding: 1rem 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.stats dt { color: var(--muted); font-size: .9375rem; }
.stats dd { margin: .125rem 0 0; font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem;
    padding: .625rem 0; border-top: 1px solid var(--line);
}
.activity-action { font-weight: 600; }
.activity-meta { display: flex; gap: .75rem; color: var(--muted); font-size: .9375rem; }

.filters {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: .875rem 1rem;
    margin: 0 0 1.25rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.filters .field { min-width: 10rem; }
.filters .field--grow { flex: 1 1 16rem; }
.filters-actions { display: flex; align-items: center; gap: 1rem; min-height: 2.5rem; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel .table-wrap { border: 0; }
.table-wrap--scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .75rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { font-size: .875rem; color: var(--muted); font-weight: 600; background: #FDFAFB; }
.table tbody tr:last-child td { border-bottom: 0; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > a, .row-actions > form { display: inline-block; margin: 0 0 0 1rem; }

.tag {
    display: inline-block; margin-left: .375rem; padding: .05rem .5rem;
    border: 1px solid var(--line); border-radius: 999px;
    font-size: .75rem; font-weight: 600; color: var(--muted); vertical-align: .1em;
}
.tag--accent { border-color: #E2B8CB; color: var(--raspberry); }

.status { display: inline-flex; align-items: center; gap: .375rem; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.status--active { color: var(--ok); }
.status--inactive { color: var(--muted); }
.status--suspended { color: var(--down); }

.matrix { border-collapse: collapse; min-width: 100%; font-size: .9375rem; }
.matrix th, .matrix td { padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.matrix thead th { vertical-align: bottom; font-size: .8125rem; color: var(--muted); font-weight: 600; }
.matrix tbody th { text-align: left; font-weight: 400; min-width: 15rem; }
.matrix-role { display: inline-block; max-width: 6rem; }
.matrix td { text-align: center; color: var(--raspberry); }

.changes { font-size: .875rem; }
.changes > div { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin-bottom: .25rem; }
.changes-label { font-weight: 600; color: var(--muted); }
.kv { background: var(--icing); border-radius: 3px; padding: 0 .375rem; overflow-wrap: anywhere; }
.kv-key { color: var(--muted); }

.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin: 1rem 0; color: var(--muted); }
.pagination > span:first-child { margin-right: auto; }
.pagination-links { display: flex; gap: 1rem; }

.facts--compact > div { padding: .625rem 0; }
.danger-zone { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); max-width: 48rem; }

/* ------------------------------------------------------------ móvil */
@media (max-width: 52rem) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 20;
        width: min(80vw, 18rem);
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(42, 23, 36, .45); }
    .menu-toggle { display: inline-flex; }
    .topbar { flex-wrap: wrap; gap: .75rem; }
    .topbar .menu-toggle {
        min-height: 2.5rem; padding: .375rem .75rem;
        border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
        font: inherit; font-weight: 600; color: var(--plum);
    }

    .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table--stack tr { display: block; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .table--stack td { display: block; position: relative; padding: .25rem 0 .25rem 8.75rem; border: 0; min-height: 1.75rem; overflow-wrap: anywhere; }
    .table--stack td::before { content: attr(data-label); position: absolute; left: 0; top: .3rem; width: 8rem; color: var(--muted); font-size: .875rem; }
    .table--stack td .tag { margin-left: 0; }
    .table--stack td.row-actions { display: block; text-align: left; white-space: normal; padding: .5rem 0 0; }
    .table--stack td.row-actions > a, .table--stack td.row-actions > form { margin: 0 1.25rem .25rem 0; }
    .table--stack td.row-actions::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
}

.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------ Sprint 03: zonas y cobertura */
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num, .table td.num { text-align: right; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.hint--inline { display: inline; margin-left: .5rem; font-weight: 400; }
.field textarea {
    width: 100%; padding: .5rem .625rem;
    border: 1px solid #CDBBC5; border-radius: var(--radius);
    background: #fff; color: var(--plum); font: inherit; resize: vertical;
}
.field textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.field textarea:focus-visible, .select-compact:focus-visible { outline: 3px solid var(--raspberry); outline-offset: 1px; }
.field--narrow { min-width: 7rem !important; max-width: 8rem; }
.field input[type="file"] { padding: .375rem; }

.status--partial { color: var(--warn); }
.status--coming-soon { color: #2D5C8A; }
.status--not-covered { color: var(--down); }

.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: -.5rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.tabs a {
    padding: .5rem .875rem; margin-bottom: -1px;
    color: var(--muted); text-decoration: none; font-weight: 600;
    border-bottom: 3px solid transparent;
}
.tabs a:hover { color: var(--plum); }
.tabs a[aria-current="page"] { color: var(--plum); border-bottom-color: var(--raspberry); }

.inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.inline-form--spaced { margin-top: .5rem; }
.select-compact {
    min-height: 2.125rem; padding: .25rem .5rem;
    border: 1px solid #CDBBC5; border-radius: var(--radius);
    background: #fff; color: var(--plum); font: inherit; font-size: .9375rem;
}
.link-button--danger { color: var(--down); }

.split { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 1.5rem; align-items: start; }
.split-side { margin: 0; }
.split-main { min-width: 0; }
.filters--compact { padding: .75rem 1rem; }
.zip-cell { font-weight: 600; font-size: 1.0625rem; letter-spacing: .02em; }

.report h2 { font-size: 1rem; margin: 0 0 .5rem; }
.report h2:not(:first-child) { margin-top: 1rem; }
.report-error { color: var(--down); }
.zip-chips { display: flex; flex-wrap: wrap; gap: .375rem; margin: 0; }
.zip-chips span {
    padding: .125rem .5rem; border-radius: 4px;
    background: #EEF6F1; color: var(--ok);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .875rem;
}
.zip-chips--error span { background: #FBEDEC; color: var(--down); }
.zip-chips--muted span { background: var(--icing); color: var(--muted); }
.conflicts { margin: .5rem 0 0; padding-left: 1.25rem; }
.conflicts li { margin: .25rem 0; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0 1.5rem; }
.stats--demand { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.stats--demand .hint { margin: .25rem 0 0; font-size: .8125rem; }
.stats .stat--accent { border-top: 4px solid var(--raspberry); }

.bars { width: 100%; border-collapse: collapse; }
.bars th, .bars td { padding: .375rem .5rem; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.bars thead th { font-size: .875rem; color: var(--muted); font-weight: 600; }
.bars tbody tr:last-child th, .bars tbody tr:last-child td { border-bottom: 0; }
.bars td.num { text-align: right; white-space: nowrap; }
.bar-cell { width: 45%; min-width: 6rem; }
.bar { display: block; width: 100%; height: .625rem; }
.bar rect { fill: var(--raspberry); }

.consents { list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.consents .is-yes { color: var(--plum); font-weight: 600; }
.consents .is-no { color: var(--muted); }

@media (max-width: 52rem) {
    .split { grid-template-columns: 1fr; }
    .table--stack th[data-label] { display: block; position: relative; padding: .25rem 0 .25rem 8.75rem; border: 0; text-align: left; }
    .table--stack th[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: .3rem; width: 8rem; color: var(--muted); font-size: .875rem; font-weight: 400; letter-spacing: 0; }
    .table--stack td.num { text-align: left; }
}

/* ------------------------------------------------------------ Sprint 04: catálogo (panel) */
.status--draft { color: var(--muted); }
.status--archived { color: #6B5A64; }
.tree-indent { display: inline-block; }
.tree-indent--1 { padding-left: 1.25rem; }
.tree-indent--2 { padding-left: 2.5rem; }
.tree-indent--3, .tree-indent--4 { padding-left: 3.75rem; }
li.tree-indent { display: list-item; }
.field--check { justify-content: end; min-height: 2.5rem; align-content: end; }

.money-input { display: inline-flex; align-items: center; gap: .25rem; width: 100%; max-width: 10rem; }
.money-input > span[aria-hidden] { color: var(--muted); }
.money-input input {
    width: 100%; min-height: 2.25rem; padding: .375rem .5rem;
    border: 1px solid #CDBBC5; border-radius: var(--radius); font: inherit; font-variant-numeric: tabular-nums; color: var(--plum); background: #fff;
}
.money-input input[readonly], .field input[readonly], .field textarea[readonly] { background: var(--icing); color: var(--muted); }
.field .money-input { max-width: none; }
.input-short { width: 5rem; min-height: 2.25rem; padding: .25rem .5rem; border: 1px solid #CDBBC5; border-radius: var(--radius); font: inherit; }
.input-color { width: 6.5rem; }

.product-cell { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; }
.product-cell:hover strong { text-decoration: underline; }
.thumb { width: 3rem; height: 3rem; object-fit: cover; border-radius: 6px; flex: none; background: var(--icing); }
.thumb--empty { display: inline-block; background: repeating-linear-gradient(135deg, #F6E7EE 0 6px, #FBF6F8 6px 12px); }

.publish-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    margin: 0 0 1.25rem; padding: 1rem 1.25rem;
    background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius);
}
.publish-bar.is-ready { border-left-color: var(--ok); }
.publish-title { margin: 0; font-weight: 600; }
.issue-list { margin: .25rem 0 0; padding-left: 1.25rem; color: var(--muted); }
.publish-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.publish-actions form { margin: 0; }
.button[disabled] { opacity: .5; cursor: not-allowed; }

.tabs--editor { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; }
.editor-table td, .editor-table th { vertical-align: middle; }
.editor-table .check { justify-content: center; }

.value-chips { display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.value-chips span { display: inline-flex; align-items: center; gap: .25rem; }
.value-chips .is-inactive { color: var(--muted); text-decoration: line-through; }
.swatch { width: .875rem; height: .875rem; border: 1px solid rgba(0, 0, 0, .15); border-radius: 3px; flex: none; }
.swatch--lg { width: 1.375rem; height: 1.375rem; border-radius: 50%; }
.value-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .625rem 0 .25rem; border-top: 1px solid var(--line); margin: 0; }
.value-row input[type="text"], .value-row select { min-height: 2.25rem; padding: .25rem .5rem; border: 1px solid #CDBBC5; border-radius: var(--radius); font: inherit; }
.value-row .money-input { width: 8rem; }
.value-delete { margin: 0 0 .5rem; }
.panel h3 { font-size: 1rem; margin: 1.5rem 0 .75rem; }

.preview-image { display: block; max-width: 18rem; max-height: 12rem; object-fit: cover; border-radius: var(--radius); margin-bottom: .75rem; }

.media-grid { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.media-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; display: grid; gap: .5rem; align-content: start; }
.media-card.is-primary { border-color: var(--raspberry); box-shadow: 0 0 0 1px var(--raspberry); }
.media-preview { aspect-ratio: 4 / 3; background: var(--icing); border-radius: 4px; overflow: hidden; }
.media-preview img, .media-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-meta { margin: 0; }
.media-meta .hint { overflow-wrap: anywhere; }
.media-form { display: grid; gap: .375rem; margin: 0; font-size: .875rem; }
.media-form label { display: grid; gap: .125rem; color: var(--muted); }
.media-form input { min-height: 2rem; padding: .25rem .5rem; border: 1px solid #CDBBC5; border-radius: 4px; font: inherit; color: var(--plum); }
.media-form button { justify-self: start; }
.media-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.media-actions form { margin: 0; }

[hidden] { display: none !important; }
.editor-table .money-input input { min-width: 5.5rem; }

/* ---------------------------------------------------------------- Sprint 06: workspace de solicitudes */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.status--req { display: inline-block; padding: .125rem .5rem; border-radius: 999px; font-size: .8125rem; font-weight: 700; background: var(--icing); border: 1px solid var(--line); }
.status--submitted { color: #2D5C8A; }
.status--under-review { color: var(--warn); }
.status--needs-information { color: #8E2C55; }
.status--ready-for-quote { color: var(--ok); }
.status--declined { color: var(--down); }
.status--cancelled { color: var(--muted); }
.status-counts { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.status-counts a { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; color: inherit; }
.status-counts a[aria-current="true"] { border-color: var(--raspberry); box-shadow: 0 0 0 1px var(--raspberry); }
.status-counts .status { border: 0; background: none; padding: 0; }

.workspace { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); align-items: start; }
.workspace-side { position: sticky; top: 1rem; }
.workspace .panel { scroll-margin-top: 1rem; }
.workspace .summary-list > div { grid-template-columns: minmax(7rem, 12rem) 1fr; gap: .75rem; padding: .5rem 0; }
.workspace .summary-list dd { font-weight: 500; }
.workspace-side textarea, .panel textarea, .panel select { width: 100%; padding: .5rem .75rem; border: 1px solid #CDBBC5; border-radius: var(--radius); font: inherit; background: #fff; color: var(--plum); }
.ref-grid--admin { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.button--small { min-height: 2.25rem; padding: .25rem .75rem; font-size: .875rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); display: grid; gap: .75rem; }
.timeline li { position: relative; font-size: .9375rem; }
.timeline li::before { content: ""; position: absolute; left: -1.4rem; top: .45rem; width: .625rem; height: .625rem; border-radius: 50%; background: var(--raspberry); }
.timeline .hint { margin-top: .125rem; }
.notes { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .75rem; }
.notes li { padding: .625rem .75rem; background: var(--icing); border-radius: var(--radius); overflow-wrap: anywhere; }
.notes p { margin: 0; }

@media (max-width: 60rem) {
    .workspace { grid-template-columns: 1fr; }
    .workspace-side { position: static; order: -1; }
}
.field--date { min-width: 9.5rem; max-width: 11rem; }

/* ---------------------------------------------------------------- Sprint 06A */
.badge { display: inline-block; padding: .0625rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; vertical-align: middle; font-family: var(--font); letter-spacing: .02em; }
.badge--demo { background: #FFF4D6; color: #7A5300; border: 1px solid #E9CF8B; }
.badge--hold { background: #E9EEF7; color: #2D5C8A; border: 1px solid #B9C9E2; }
.status--quoted { color: #2D5C8A; }
.attention-counts { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.attention { display: inline-flex; align-items: baseline; gap: .375rem; padding: .375rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: inherit; text-decoration: none; }
.attention strong { font-size: 1.125rem; }
.attention.is-alert { border-color: var(--down); background: #FBEDEC; color: var(--down); }
.attention.is-warn { border-color: #E9CF8B; background: #FFF8E6; color: var(--warn); }
.attention[aria-current="true"] { box-shadow: 0 0 0 2px var(--raspberry); }
.attention-badge { display: inline-block; padding: .0625rem .5rem; border-radius: 999px; font-size: .8125rem; font-weight: 700; border: 1px solid var(--line); background: var(--icing); }
.attention-badge--overdue { background: #FBEDEC; border-color: #E5B9B5; color: var(--down); }
.attention-badge--due-soon { background: #FFF8E6; border-color: #E9CF8B; color: var(--warn); }
.attention-badge--contacted { background: #EEF6F1; border-color: #BFDCCB; color: var(--ok); }
.attention-badge--not-required, .attention-badge--none, .attention-badge--no-due { color: var(--muted); }
#attention .attention-badge + .hint { display: inline; margin-left: .375rem; }
.status--mail-pending, .status--mail-sending { color: var(--warn); }
.status--mail-accepted { color: var(--ok); }
.status--mail-failed { color: var(--down); }
.status--mail-skipped { color: var(--muted); }
.hours-table input[type="time"] { min-height: 2.5rem; padding: .25rem .5rem; border: 1px solid #CDBBC5; border-radius: var(--radius); font: inherit; }
.hours-table .field-error { display: block; font-size: .8125rem; }
.panel input[type="time"], .panel input[type="datetime-local"], .panel input[type="date"] { min-height: 2.5rem; }
.inline-form { margin-top: .75rem; }

/* Sprint 06B: modo piloto e imágenes DEMO */
.admin-banner {
    display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline;
    margin: 0 0 1rem; padding: .75rem 1rem; border-radius: var(--radius); border: 1px solid;
}
.admin-banner a { margin-left: auto; font-weight: 600; }
.admin-banner--demo { background: #FFF6E5; border-color: #E8C988; color: #6B4A00; }
.admin-banner--pilot { background: #EEF2FB; border-color: #B9C9E2; color: #2D4A75; }
.demo-grid { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.demo-grid .media-card, .demo-grid .media-card > * { min-width: 0; }
.demo-grid .media-meta { display: grid; gap: .25rem; justify-items: start; }
.demo-grid .media-form input { width: 100%; min-width: 0; }
.demo-grid .media-form input[type="file"] { max-width: 100%; font-size: .8125rem; }
.demo-grid .link-button { text-align: left; white-space: normal; }
.demo-help ol { margin: .5rem 0 0; padding-left: 1.25rem; }
.demo-help li { margin: .25rem 0; }

/* Sprint 07: cotizaciones */
.status--q-draft { color: var(--muted); }
.status--q-sent { color: #2D5C8A; }
.status--q-revision-requested { color: var(--warn); }
.status--q-accepted { color: var(--ok); }
.status--q-declined { color: var(--down); }
.status--q-expired { color: #6B5A64; }
.status--q-cancelled, .status--q-superseded { color: var(--muted); }
.quote-chip { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; margin: 0 0 .5rem; }
.quote-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin: 0; }
.inline-form input[type="text"] { min-width: 14rem; }
.panel--internal { border-left: 4px solid #B9C9E2; }
.quote-items input[type="text"], .quote-items select { width: 100%; min-width: 0; }
.quote-items .input-short { max-width: 6rem; }
.item-actions { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; white-space: nowrap; }
.item-actions form { margin: 0; }
.item-add { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.item-add h3 { margin: 0 0 .5rem; font-size: 1rem; }
.quote-summary { position: sticky; top: 1rem; }
.followup-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .5rem; }
.followup { padding: .5rem .625rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.followup.is-closed { opacity: .7; }
.followup.is-late { border-color: var(--down); }
.followup-form { display: flex; flex-wrap: wrap; gap: .375rem; margin: .375rem 0 0; }
.followup-form select, .followup-form input { max-width: 100%; }
.text-alert { color: var(--down); font-weight: 600; }
.text-warn { color: var(--warn); font-weight: 600; }
.stat-inline { margin: .25rem 0; font-size: 1.25rem; font-weight: 700; }
.label { display: block; font-weight: 600; }
.timeline q { quotes: "“" "”"; }
.quote-table { font-size: .875rem; }
.quote-table th, .quote-table td { padding-left: .5rem; padding-right: .5rem; }
.quote-table .mono { font-size: .8125rem; }
.quote-items { table-layout: auto; }
.quote-items td:nth-child(1) { width: 9rem; }
.quote-items td:nth-child(2) { min-width: 14rem; }
.quote-items td:nth-child(3), .quote-items td:nth-child(4) { width: 6.5rem; }
@media (min-width: 52rem) { .quote-editor .workspace-main .table-wrap { overflow-x: auto; } }

/* ---------------------------------------------------------------- Sprint 06C: Website → Homepage */
.hp-form .fieldset { display: grid; gap: 1rem; }
.hp-images { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.hp-image { display: flex; gap: 1rem; align-items: flex-start; }
.hp-thumb { width: 6rem; height: 7.5rem; object-fit: cover; border-radius: 3rem 3rem 8px 8px; background: var(--icing); flex: none; border: 1px solid var(--line); }
.hp-image .thumb--empty, .hp-tile .thumb--empty { width: 6rem; height: 7.5rem; border-radius: 3rem 3rem 8px 8px; }
.hp-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: .875rem; }
.hp-tile { display: flex; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #FDFBF9; }
.hp-tile--new { border-style: dashed; background: #fff; }
.hp-tile-fields { flex: 1; min-width: 0; display: grid; gap: .75rem; }
.hp-tile-title { margin: 0; display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.hp-tile-title code { word-break: break-all; }
.hp-tile-checks { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.field-label { font-weight: 600; }
@media (max-width: 40rem) {
    .hp-tile, .hp-image { flex-direction: column; }
}

/* ---------------------------------------------------------------- Sprint 08: órdenes y pagos */
.status--o-draft { color: var(--muted); }
.status--o-pending-payment { color: var(--warn); }
.status--o-awaiting-confirmation { color: #2D5C8A; }
.status--o-confirmed, .status--o-paid { color: var(--ok); }
.status--o-cancelled { color: var(--muted); text-decoration: line-through; }
.status--o-unpaid { color: var(--down); }
.status--o-partially-paid, .status--o-refund-pending { color: var(--warn); }
.status--o-partially-refunded, .status--o-refunded { color: #6B5A64; }
.status--p-succeeded, .status--r-processed { color: var(--ok); }
.status--p-pending, .status--r-pending { color: var(--warn); }
.status--p-failed, .status--r-failed { color: var(--down); }
.status--p-cancelled { color: var(--muted); }
.stats--money { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin-bottom: .75rem; }
.stats--money dd { font-size: 1.5rem; }
.stats--money .hint { margin: .25rem 0 0; font-size: .8125rem; }
.money-forms { display: grid; gap: .75rem; margin-top: 1rem; }
.action-box { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; background: #FDFBFC; }
.action-box > summary { cursor: pointer; font-weight: 700; }
.action-box[open] > summary { margin-bottom: .75rem; }
.check-results { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .375rem; }
.check-result { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.check-result--ok > span:first-child { color: var(--ok); font-weight: 700; }
.check-result--no > span:first-child { color: var(--down); font-weight: 700; }
.sub-title { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.section-title { font-size: 1.125rem; margin: 1.5rem 0 .75rem; }
.order-table td { vertical-align: middle; }

/* ------------------------------------------------------------ Sprint 09: producción y portal de productores */
.notice--warn { border-left-color: var(--warn); background: #FFF6E5; }
.page-head--actions { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.page-head--actions > div { min-width: 0; flex: 1 1 20rem; }
h2 .count { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.75rem; padding: 0 .4rem; margin-left: .25rem; border-radius: 999px; background: var(--icing); border: 1px solid var(--line); font-size: .875rem; vertical-align: middle; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .375rem 1rem; margin: 0 0 .75rem; }
.fieldset--plain { border: 0; padding: 0; margin: 0 0 1rem; }
.fieldset--plain legend { font-weight: 600; margin-bottom: .375rem; }
.zip-chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.zip-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .375rem; padding: .25rem .625rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .875rem; }
.zip-chip .inline-form { margin: 0; }
.zip-chip--off { opacity: .55; text-decoration: line-through; }
.capacity-table .row--blocked th, .capacity-table .row--blocked td { background: #FBEDEC; }
.row--current td { background: var(--raspberry-soft); }
.candidates-table td:first-child { width: 2rem; }
.capacity-grid th, .capacity-grid td { white-space: nowrap; }
.capacity-grid .cap { font-variant-numeric: tabular-nums; font-size: .875rem; }
.capacity-grid .cap small { display: block; color: var(--warn); font-size: .75rem; }
.cap--free { background: #EEF6F1; }
.cap--some { background: #FFF6E5; }
.cap--high { background: #FBE3D9; font-weight: 700; }
.cap--blocked { background: #F1E8EC; color: var(--muted); }
.cap--none { color: var(--muted); }
.status--p-active, .status--p-accepted { color: var(--ok); }
.status--p-pending-approval, .status--p-pending-acceptance, .status--p-proposed { color: var(--warn); }
.status--p-suspended, .status--p-rejected { color: var(--down); }
.status--p-inactive, .status--p-cancelled, .status--p-reassigned { color: var(--muted); }

/* Portal del productor (sin barra lateral) */
.partner-page { background: var(--icing); }
.partner-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding: .75rem clamp(1rem, 4vw, 2rem); background: var(--plum-deep); color: #fff; }
.partner-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.125rem; }
.partner-brand small { display: block; font-weight: 400; font-size: .8125rem; opacity: .8; }
.partner-bar-right { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.partner-bar .lang-switch, .partner-bar .lang-switch button, .partner-bar .partner-user { color: #fff; }
.partner-bar .button--quiet { color: #fff; border-color: rgba(255, 255, 255, .4); background: transparent; }
.partner-content { max-width: 72rem; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 2rem; }
.partner-foot { max-width: 72rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 2rem; }
.partner-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.partner-card a { display: grid; gap: .25rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: inherit; text-decoration: none; }
.partner-card a:hover, .partner-card a:focus-visible { border-color: var(--raspberry); }
.partner-refs { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.partner-refs img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.button--block { width: 100%; }
@media (max-width: 40rem) {
    .partner-bar-right { width: 100%; justify-content: space-between; }
    .page-head--actions .button { width: 100%; }
}

/* Sprint 09: el formulario de asignación ocupa todo el ancho (tabla de candidatos) */
.form.form--wide { max-width: none; }

/* ======================================================================
 * Sprint 10 — biblioteca de diseños (admin), producción, QC y portal.
 * ==================================================================== */
.two-col { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.replace-box { margin-top: .75rem; }
.replace-box > summary { cursor: pointer; color: var(--raspberry); font-weight: 600; }
.replace-box[open] > summary { margin-bottom: .75rem; }
.sort-save { margin: .75rem 0; }
.sort-save:not([hidden]) { display: flex; gap: .5rem; align-items: center; padding: .5rem .75rem; border-radius: var(--radius); background: #FFF4D6; }
[data-sortable] > * { cursor: grab; }
[data-sortable] > .is-dragging { opacity: .5; }
.tree-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; max-height: 22rem; overflow: auto; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tree-checks li.tree-indent { display: block; }
.tree-indent--3 { padding-left: 3.75rem; }
.tree-indent--4 { padding-left: 5rem; }
.tree-checks .is-inactive { opacity: .6; }
.pick-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); }
.pick-grid label { display: grid; gap: .25rem; padding: .375rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; font-size: .8125rem; }
.pick-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.pick-grid label:has(input:checked) { border-color: var(--raspberry); box-shadow: 0 0 0 1px var(--raspberry); }
.design-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
.design-card { display: grid; gap: .375rem; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.design-card-link { color: inherit; text-decoration: none; display: grid; gap: .375rem; }
.design-card-link:hover .design-card-title { color: var(--raspberry); }
.design-thumb { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--icing); }
.design-card-title { margin: 0; font-weight: 600; font-size: .9375rem; }
.design-card-meta { margin: 0; font-size: .8125rem; color: var(--muted); }
.input--narrow { width: 5rem; }
.table--compact td, .table--compact th { padding: .375rem .5rem; }
.table--compact input[type="text"] { width: 100%; min-width: 8rem; }
.form--inline { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; max-width: none; }
.form--inline .field { margin: 0; }
.tabs--small { margin: 0; border-bottom: 0; }
.tabs--small a { padding: .25rem .625rem; }

/* Estados de trabajos de producción y de QC */
.status--job-scheduled { color: #2D5C8A; }
.status--job-in-progress { color: var(--warn); }
.status--job-awaiting-qc { color: #6A3FA0; }
.status--job-qc-rejected { color: var(--down); }
.status--job-qc-approved { color: var(--ok); }
.status--job-ready-for-handoff { color: #fff; background: var(--ok); padding: .0625rem .5rem; border-radius: 999px; }
.status--job-cancelled { color: var(--muted); text-decoration: line-through; }
.status--qc-pending { color: #6A3FA0; }
.status--qc-approved { color: var(--ok); }
.status--qc-rejected { color: var(--down); }
.status--qc-correction-required { color: var(--warn); }
.prio { display: inline-block; padding: .0625rem .5rem; border-radius: 999px; font-size: .8125rem; font-weight: 700; border: 1px solid var(--line); background: #fff; }
.prio--low { color: var(--muted); }
.prio--high { color: var(--warn); border-color: #E9CF8B; background: #FFF8E6; }
.prio--urgent { color: #fff; background: var(--down); border-color: var(--down); }
.sev { font-weight: 700; }
.sev--low { color: var(--muted); }
.sev--medium { color: var(--warn); }
.sev--high { color: #B4471E; }
.sev--critical { color: #fff; background: var(--down); padding: 0 .375rem; border-radius: 4px; }

/* Etapas */
.task-list { list-style: none; margin: 0; padding: 0; counter-reset: task; display: grid; gap: .5rem; }
.task { counter-increment: task; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .625rem .75rem .625rem 2.75rem; position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.task::before { content: counter(task); position: absolute; left: .75rem; top: .625rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: .8125rem; font-weight: 700; background: var(--icing); border: 1px solid var(--line); }
.task--completed::before { content: "✓"; background: var(--ok); color: #fff; border-color: var(--ok); }
.task--skipped { opacity: .7; }
.task--skipped::before { content: "–"; }
.task--in-progress { border-color: var(--warn); }
.task--corrective { border-left: 4px solid var(--down); }
.task-main { display: grid; gap: .125rem; flex: 1 1 14rem; }
.task-actions { display: flex; flex-wrap: wrap; gap: .375rem; align-items: center; }
.task-actions input[type="text"] { width: 12rem; max-width: 100%; }

/* Evidencias, incidentes, QC */
.evidence-grid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); }
.evidence-grid li { display: grid; gap: .25rem; font-size: .8125rem; }
.evidence-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--icing); }
.incident { padding: .75rem; margin-bottom: .75rem; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); background: #fff; }
.incident p { margin: .25rem 0; }
.incident--medium { border-left-color: var(--warn); }
.incident--high { border-left-color: #B4471E; }
.incident--critical { border-left-color: var(--down); background: #FDF1F0; }
.qc-form .check-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }

/* Calendario */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.cal-nav { display: flex; gap: .5rem; align-items: center; margin: 0; }
.cal { display: grid; gap: .5rem; }
.cal--week { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
.cal--month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day { min-height: 6rem; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cal-day.is-today { border-color: var(--raspberry); box-shadow: inset 0 3px 0 var(--raspberry); }
.cal-day.is-empty { background: transparent; }
.cal-date { margin: 0 0 .375rem; font-size: .875rem; }
.cal-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.cal-item a { display: grid; gap: .0625rem; padding: .25rem .375rem; border-radius: 4px; border-left: 3px solid var(--line); background: var(--icing); color: inherit; text-decoration: none; font-size: .8125rem; }
.cal-item a:hover { background: #F1E8EC; }
.cal-item--high a { border-left-color: var(--warn); }
.cal-item--urgent a { border-left-color: var(--down); }
.cal-meta { color: var(--muted); }
@media (max-width: 48rem) { .cal--month { grid-template-columns: 1fr; } .cal--month .cal-day.is-empty { display: none; } }

/* Sprint 10 — marca en el panel y el portal: el logotipo (fondo blanco original) va en una placa clara */
.sidebar-brand { grid-template-columns: auto 1fr; column-gap: .75rem; align-items: center; }
.sidebar-brand-logo, .partner-brand-logo { grid-row: span 2; display: inline-flex; padding: 3px; border-radius: 10px; background: #fff; line-height: 0; }
.sidebar-brand-logo img, .partner-brand-logo img { height: 2.5rem; width: auto; border-radius: 7px; }
.partner-brand { display: inline-flex; align-items: center; gap: .75rem; }
.brand-swatches { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.brand-swatches li { display: grid; gap: .25rem; }
.brand-swatches label { display: grid; grid-template-columns: 2rem 1fr; column-gap: .625rem; align-items: center; }
.brand-swatches label .hint { grid-column: 2; }
.brand-swatch { grid-row: span 2; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); }
[data-swatch="primary"] { background: var(--brand-primary); }
[data-swatch="accent"] { background: var(--brand-accent); }
[data-swatch="chocolate"] { background: var(--brand-chocolate); }
[data-swatch="frosting"] { background: var(--brand-frosting); }
[data-swatch="cream"] { background: var(--brand-cream); }
[data-swatch="ink_soft"] { background: var(--brand-ink-soft); }
.brand-logo-preview img { display: block; height: 10rem; width: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.brand-icons { list-style: none; margin: .75rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.brand-icons li { display: grid; justify-items: center; gap: .25rem; }
.brand-icons img { border: 1px solid var(--line); }
.brand-og { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.evidence-grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)) !important; }
.evidence-grid li { min-width: 0; }
.check-grid { list-style: none; padding: 0; }
.workspace--job .workspace-side { position: static; }
.brand-swatches input[type="text"] { width: 8.5rem; }

/* ---------------------------------------------------------------- Sprint 11: logística (panel, conductor, punto) */
.status--ff-pending-preparation, .status--ff-ready-to-schedule { color: var(--muted); }
.status--ff-scheduled { color: #2D5C8A; }
.status--ff-awaiting-handoff { color: #6A3FA0; }
.status--ff-in-transit, .status--ff-out-for-delivery { color: var(--warn); }
.status--ff-at-pickup-point { color: #0F6E78; }
.status--ff-delivered, .status--ff-picked-up { color: #fff; background: var(--ok); padding: .0625rem .5rem; border-radius: 999px; }
.status--ff-delivery-failed, .status--ff-on-hold { color: var(--down); }
.status--ff-cancelled { color: var(--muted); text-decoration: line-through; }
.badge--warn { background: #FFF1D6; color: #6B4A00; }
.warn-text { color: var(--warn); font-weight: 600; }
.row--late td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.link-list { margin: 0; padding: 0; list-style: none; }
.link-list li { padding: .375rem 0; border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 0; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1rem 0 0; }
.action-row details[open] { flex-basis: 100%; }
.action-row form { margin: 0; }
details > summary.button { list-style: none; display: inline-flex; cursor: pointer; }
details > summary.button::-webkit-details-marker { display: none; }
details.correction { margin-top: 1rem; }
details.correction > summary, .manual-proof > summary { cursor: pointer; color: var(--muted); font-size: .9375rem; }
.status-bars { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.status-bars a { text-decoration: none; }
.stop-list { margin: .5rem 0 0; padding-left: 1.25rem; }
.stop-list .stop { padding: .375rem 0; }
.stop--completed { color: var(--muted); }
.stop--failed strong { color: var(--down); }
.desk-list { margin: 0; padding: 0; list-style: none; }
.desk-list li { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.cal-list-day { margin: 1.5rem 0 .5rem; font-size: 1.125rem; }
.cal-list-day.is-today { color: var(--raspberry); }
.cal-item--ff-customer_pickup { border-left-color: #0F6E78; }
.cal-item--late { background: #FFF6E5; }
.timeline--correction { border-left: 3px solid var(--warn); padding-left: .5rem; }
.proof-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.proof-list li { padding: .75rem 0; border-top: 1px solid var(--line); }
.signature-img { border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.proof-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.input--code { max-width: 10rem; font-size: 1.5rem; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; }
.signature-field .label { display: block; font-weight: 600; margin-bottom: .25rem; }
.signature-pad { display: block; width: 100%; max-width: 36rem; height: auto; aspect-ratio: 600 / 220; border: 1px dashed #B59AAA; border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; }
.signature-actions { margin: .25rem 0 0; }
.rate { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.rate--inactive { opacity: .65; }
.policy-table { max-width: 32rem; }
.panel-sub { margin-top: 1rem; }
.evidence-grid--small img { width: 96px; height: 96px; }

/* Portal del conductor y mesa de recogida (mobile-first: una columna, botones grandes) */
.driver-content { max-width: 40rem; }
.driver-list { display: grid; gap: .75rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.driver-card-link { display: grid; gap: .25rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; }
.driver-card-link:hover, .driver-card-link:focus-visible { border-color: var(--plum); }
.driver-card-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.driver-card--assigned .driver-card-link { border-left: 4px solid var(--warn); }
.driver-list--done .driver-card-link { opacity: .75; }
.driver-big { font-size: 1.375rem; font-weight: 700; margin: 0; }
.driver-actions form { margin: 0 0 .75rem; }
.driver-actions details { margin: 0 0 .75rem; }
.button--block { display: flex; width: 100%; justify-content: center; min-height: 3rem; font-size: 1.0625rem; }
.driver-page .field input[type="file"] { width: 100%; }
@media (max-width: 40rem) {
    .driver-page .page-head h1 { font-size: 1.5rem; }
    .driver-page .panel { padding: 1rem; }
}

/* ---------------------------------------------------------------- Sprint 12: finanzas (panel y portal del productor) */
.status--fin-draft, .status--fin-none, .status--fin-voided, .status--fin-superseded, .status--fin-archived, .status--fin-cancelled { color: var(--muted); }
.status--fin-proposed, .status--fin-under-review, .status--fin-pending, .status--fin-processing, .status--fin-estimated, .status--fin-open { color: #6A3FA0; }
.status--fin-agreed, .status--fin-committed, .status--fin-approved, .status--fin-active, .status--fin-reviewed { color: #2D5C8A; }
.status--fin-accrued, .status--fin-adjusted, .status--fin-actual, .status--fin-resolved { color: var(--ok); }
.status--fin-paid { color: #fff; background: var(--ok); padding: .0625rem .5rem; border-radius: 999px; }
.status--fin-partially-paid { color: var(--ok); }
.status--fin-held-review, .status--fin-disputed, .status--fin-on-hold, .status--fin-missing, .status--fin-incomplete { color: var(--warn); }
.status--fin-failed, .status--fin-rejected, .status--fin-reversed { color: var(--down); }
.status--fin-voided, .status--fin-cancelled { text-decoration: line-through; }
td .status { white-space: normal; }
.table--compact th, .table--compact td { padding: .375rem .5rem; }
.table--compact th[scope="row"] { font-weight: 400; text-align: left; }
.fin-waterfall { max-width: 44rem; }
.fin-waterfall .fin-subtotal th, .fin-waterfall .fin-subtotal td { border-top: 1px solid var(--line); }
.fin-waterfall .fin-total th, .fin-waterfall .fin-total td { border-top: 2px solid var(--plum); font-size: 1.0625rem; }
.fin-card { padding: .875rem 0; border-bottom: 1px solid var(--line); }
.fin-card:last-of-type { border-bottom: 0; }
.fin-card > p { margin: 0 0 .5rem; }
.fin-card--voided { opacity: .65; }
.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem 1.25rem; margin: .5rem 0; }
.meta-list dt { color: var(--muted); font-size: .875rem; }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }
.workspace-side .meta-list { grid-template-columns: 1fr; }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.field--wide { grid-column: 1 / -1; }
.row--muted td { color: var(--muted); }
.snapshot { max-height: 18rem; overflow: auto; padding: .75rem; background: #FBF7F9; border: 1px solid var(--line); border-radius: 4px; font-size: .8125rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.stack-actions { display: grid; gap: .5rem; margin: .75rem 0; }
.stack-actions form { margin: 0; }
.tabs--sub { margin-top: -.5rem; font-size: .9375rem; }
.thread { margin: 0 0 1rem; padding: 0; list-style: none; }
.thread-item { padding: .75rem 1rem; margin: 0 0 .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-width: 46rem; }
.thread-item p { margin: 0 0 .25rem; }
.thread-item--user, .thread-item--cakevia, .thread-item--system { margin-left: 2rem; background: #FBF7F9; }
.count { display: inline-grid; place-items: center; min-width: 1.5rem; padding: 0 .35rem; border-radius: 999px; background: var(--icing, #F7EEF2); border: 1px solid var(--line); font-size: .8125rem; }
fieldset { margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
@media (max-width: 40rem) {
    .thread-item--user, .thread-item--cakevia, .thread-item--system { margin-left: .75rem; }
    .fin-waterfall td.hint, .fin-waterfall td:last-child { font-size: .8125rem; }
}

/* ---------------------------------------------------------------- Sprint 12A: portafolio */
.badge--ok { background: #EEF6F1; color: #2F7A57; border: 1px solid #BFDCCB; }
.badge--muted { background: #F1ECEF; color: #6B5A64; border: 1px solid #DDD2D8; }
.badge--danger { background: #FBEFEF; color: #8A2A2A; border: 1px solid #E8C2C2; }
.design-card-meta .badge--featured, .meta-line .badge--featured, .portfolio-row .badge--featured { background: #FFF1D6; color: #6B4A00; border: 1px solid #EBD3A1; }
.meta-line { display: flex; flex-wrap: wrap; gap: .375rem; align-items: center; margin: .25rem 0 0; }
.portfolio-thumb { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: calc(var(--radius) - 2px); background: #F4EEF1; }
.portfolio-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portfolio-video-tag { position: absolute; left: .375rem; bottom: .375rem; padding: .0625rem .5rem; border-radius: 999px; background: rgba(43, 22, 36, .78); color: #fff; font-size: .75rem; font-weight: 700; }
.split--wide { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
@media (max-width: 60rem) { .split--wide { grid-template-columns: 1fr; } }
.portfolio-preview img, .portfolio-preview video { display: block; width: 100%; max-height: 32rem; object-fit: contain; background: #F4EEF1; border-radius: calc(var(--radius) - 2px); }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.button-row .inline-form { margin: 0; }
.disclosure { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.disclosure > summary { cursor: pointer; font-weight: 600; color: var(--raspberry); }
.panel--danger { border-color: #E8C2C2; }
.portfolio-row { display: inline-flex; align-items: center; gap: .625rem; }
.portfolio-row img { width: 48px; height: 60px; object-fit: cover; border-radius: 6px; background: #F4EEF1; }
