:root {
    --ink: #292631;
    --muted: #706c76;
    --paper: #f7f6f3;
    --line: #e5e1e5;
    --plum: #652d50;
    --plum-dark: #6A0F49;
    --accent: #b99c67;
    --green: #276345;
    --radius: 14px
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Atlas Gibson', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55
}

a {
    color: var(--plum);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

button,
input,
select,
textarea {
    font: inherit
}

button,
a,
input,
select,
textarea,
[contenteditable] {
    outline-offset: 4px
}

button {
    cursor: pointer
}

h1,
h2,
h3,
p {
    margin-top: 0
}

h1 {
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 12px;
    font-weight: 650
}

h2 {
    font-size: 19px;
    line-height: 1.3;
    margin-bottom: 8px
}

h3 {
    font-size: 16px
}

small,
.hint {
    color: var(--muted);
    font-size: 13px
}

small {
    display: block
}

.sr-only,
.skip:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap
}

.skip:focus {
    background: white;
    padding: 12px;
    position: fixed;
    z-index: 10
}

.admin-header {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    background: white;
    border-bottom: 1px solid var(--line)
}

.brand {
    display: flex;
    gap: 13px;
    align-items: center;
    font-size: 24px;
    letter-spacing: 3px;
    color: var(--plum);
    font-weight: 700
}

.brand:hover {
    text-decoration: none
}

.brand small {
    font-size: 11px;
    letter-spacing: .4px;
    font-weight: 500
}

.brand-mark {
    width: 43px;
    height: 48px;
    border: 1px solid var(--accent);
    display: grid;
    place-items: center;
    font-family: Georgia, serif;
    font-size: 34px;
    font-weight: 400;
    letter-spacing: 0;
    border-radius: 22px 22px 3px 3px
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 13px
}

.header-actions form {
    margin: 0
}

.user {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-left: 1px solid var(--line);
    padding-left: 24px
}

.admin-shell {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    min-height: calc(100vh - 88px)
}

.sidebar {
    padding: 40px 24px;
    border-right: 1px solid var(--line);
    background: #fff
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 1.7px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 14px
}

.sidebar-title {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 20px
}

.sidebar nav a {
    padding: 14px;
    display: flex;
    justify-content: space-between;
    border-radius: 8px;
    margin: 5px 0;
    color: var(--muted)
}

.sidebar nav a[aria-current] {
    background: #f1e8ee;
    color: var(--plum);
    font-weight: 650
}

.sidebar-note {
    border-top: 1px solid var(--line);
    padding-top: 30px;
    margin-top: 70px;
    font-size: 13px
}

.sidebar-note p {
    color: var(--muted);
    margin: 10px 0 50px
}

main {
    padding: 42px clamp(22px, 4vw, 64px) 70px;
    max-width: 1440px;
    width: 100%;
    margin: auto
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin: 0 0 30px
}

.page-heading p {
    color: var(--muted);
    margin-bottom: 0
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 19px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.5;
    white-space: nowrap;
    text-decoration: none
}

.button:hover {
    text-decoration: none
}

.primary {
    background: var(--plum);
    color: white
}

.primary:hover {
    background: var(--plum-dark)
}

.secondary {
    background: white;
    color: var(--plum);
    border-color: #cfc3cc
}

.quiet {
    background: transparent;
    border-color: var(--line);
    color: var(--ink)
}

button:disabled {
    cursor: wait;
    opacity: .65
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 30px
}

.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 21px 24px;
    color: var(--ink)
}

.stat:hover {
    text-decoration: none;
    border-color: var(--accent)
}

.stat.selected {
    border-top: 3px solid var(--plum);
    padding-top: 19px
}

.stat>span {
    font-weight: 600;
    color: var(--muted);
    font-size: 13px
}

.stat strong {
    font-size: 34px;
    display: block;
    line-height: 1.5;
    font-weight: 600
}

.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden
}

.search-form {
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 200px auto;
    align-items: end;
    gap: 15px;
    border-bottom: 1px solid var(--line)
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px
}

input:not([type=checkbox]),
select,
textarea {
    display: block;
    background: white;
    border: 1px solid #ccc7cd;
    border-radius: 7px;
    padding: 11px 12px;
    width: 100%;
    color: var(--ink)
}

input[type=file] {
    font-size: 13px;
    padding: 10px
}

input::file-selector-button {
    border: 0;
    background: #eee7ec;
    color: var(--plum);
    padding: 7px 10px;
    border-radius: 4px;
    margin-right: 8px;
    cursor: pointer
}

.table-top {
    padding: 23px 24px 12px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center
}

.table-top h2 {
    margin: 0;
    font-size: 16px
}

.table-top>span {
    color: var(--muted);
    font-size: 12px
}

.table-scroll {
    overflow: auto
}

table {
    border-collapse: collapse;
    width: 100%;
    text-align: left
}

th {
    font-size: 11px;
    letter-spacing: .4px;
    color: var(--muted);
    background: #faf9fa;
    font-weight: 600;
    padding: 12px 24px;
    white-space: nowrap
}

td {
    border-top: 1px solid #f0edf0;
    padding: 20px 24px;
    font-size: 13px
}

td:first-child {
    width: 52%;
    min-width: 240px
}

td strong {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 5px
}

td small {
    font-size: 11px
}

td:last-child {
    text-align: right
}

.badge {
    display: inline-block;
    padding: 5px 11px;
    background: #f2eee5;
    color: #806327;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap
}

.badge.published {
    color: var(--green);
    background: #e8f2ec
}

.edit-link {
    font-weight: 600;
    white-space: nowrap
}

.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    border-top: 1px solid var(--line);
    padding: 18px 24px;
    font-size: 13px
}

.empty {
    padding: 50px !important;
    text-align: center !important;
    color: var(--muted)
}

.notice {
    background: #f5f1e8;
    color: #6f572b;
    border: 1px solid #e6dcc9;
    border-radius: 9px;
    padding: 15px 20px;
    margin-bottom: 25px;
    font-size: 14px
}

.notice.success {
    color: var(--green);
    border-color: #bcd7c8;
    background: #edf6f0
}

.notice.error {
    color: #933c3c;
    border-color: #e8bebe;
    background: #fcf0f0
}

.back {
    font-size: 13px;
    display: inline-block;
    margin-bottom: 25px
}

.form-panel {
    padding: 30px;
    margin-bottom: 24px
}

.section-heading {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 26px
}

.section-heading p {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 0
}

.step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3edf1;
    color: var(--plum);
    font-size: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px
}

.code-label {
    font-size: 12px;
    color: var(--muted)
}

.editor-field {
    margin-bottom: 26px
}

.editor-field:last-child {
    margin-bottom: 0
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 7px;
    background: #faf9fa;
    border: 1px solid #ccc7cd;
    border-radius: 7px 7px 0 0
}

.editor-toolbar button {
    border: 1px solid transparent;
    background: transparent;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--ink)
}

.editor-toolbar button:hover {
    background: #eee5ec;
    border-color: #d8cbd3
}

.editor-surface {
    min-height: 145px;
    padding: 15px;
    border: 1px solid #ccc7cd;
    border-top: 0;
    border-radius: 0 0 7px 7px;
    max-height: 600px;
    overflow: auto
}

.editor-surface p:last-child {
    margin-bottom: 0
}

.editor-surface table {
    width: auto
}

.editor-surface td,
.editor-surface th {
    border: 1px solid #ddd;
    padding: 6px
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px
}

.upload-box {
    border: 1px dashed #cbc0c8;
    border-radius: 9px;
    padding: 20px;
    background: #fcfafb
}

.upload-box p {
    font-size: 12px;
    color: var(--muted);
    min-height: 35px
}

.file-selection {
    font-size: 12px;
    display: block;
    color: var(--plum);
    margin-top: 8px;
    word-break: break-word
}

.hint {
    margin: 20px 0 0
}

.current-cover {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 24px
}

.current-cover img {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: 7px
}

.attachment-list {
    padding: 0;
    list-style: none
}

.attachment-list li {
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center
}

.attachment-list small {
    font-size: 11px
}

.checkbox {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    font-weight: 400;
    font-size: 12px
}

.publish-panel {
    background: #eee6ec;
    border: 1px solid #dfd1da;
    border-radius: var(--radius);
    padding: 30px;
    display: flex;
    justify-content: space-between;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap
}

.publish-panel>div:first-child {
    max-width: 460px
}

.publish-panel p {
    font-size: 13px;
    color: #6e5266;
    margin-bottom: 0
}

.save-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.save-status:empty {
    display: none
}

.save-status {
    width: 100%
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr
}

.login-intro {
    background: var(--plum-dark);
    color: white;
    padding: 65px clamp(30px, 7vw, 100px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh
}

.login-intro .brand,
.login-intro .brand small {
    color: white
}

.login-intro h1 {
    font-family: Georgia, serif;
    font-size: clamp(32px, 4vw, 55px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-top: 70px
}

.login-intro p {
    color: #dec9d7;
    max-width: 390px
}

.login-intro small {
    color: #c8afbf
}

.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 30px
}

.login-card {
    max-width: 400px;
    width: 100%
}

.login-card>p {
    color: var(--muted);
    margin-bottom: 30px
}

.login-card label {
    margin-top: 20px
}

.login-card .primary {
    margin-top: 30px;
    width: 100%
}

.login-card .hint {
    border-top: 1px solid var(--line);
    padding-top: 22px;
    margin-top: 30px
}

.login-card .back {
    margin-top: 25px
}

.login-card h1 {
    font-size: 32px
}

.attachment-list+h3 {
    margin-top: 25px
}

@media(min-width:1600px) {
    main {
        padding-top: 52px
    }
}

@media(max-width:1050px) {
    .admin-shell {
        grid-template-columns: 200px 1fr
    }

    .admin-header {
        padding: 0 22px
    }

    .header-actions {
        gap: 12px
    }

    .user {
        display: none
    }

    main {
        padding: 30px 24px
    }

    .sidebar {
        padding: 30px 16px
    }

    .page-heading {
        align-items: flex-start
    }

    .page-heading h1 {
        font-size: 30px
    }

    .search-form {
        grid-template-columns: 1fr 170px
    }

    .search-form button {
        grid-column: 1/-1
    }

    .publish-panel {
        display: block
    }

    .save-actions {
        margin-top: 20px
    }
}

@media(max-width:720px) {
    .admin-header {
        height: auto;
        min-height: 85px;
        gap: 15px;
        padding: 16px;
        flex-wrap: wrap
    }

    .brand {
        font-size: 21px
    }

    .header-actions {
        gap: 15px
    }

    .admin-shell {
        display: block
    }

    .sidebar {
        padding: 15px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line)
    }

    .sidebar .eyebrow,
    .sidebar-title,
    .sidebar-note,
    .sidebar>small {
        display: none
    }

    .sidebar nav {
        display: flex;
        gap: 6px
    }

    .sidebar nav a {
        flex: 1;
        justify-content: center;
        padding: 10px 5px;
        font-size: 12px
    }

    .sidebar nav a span:last-child {
        display: none
    }

    main {
        padding: 27px 16px 50px
    }

    .page-heading {
        flex-wrap: wrap;
        margin-bottom: 24px
    }

    .page-heading h1 {
        font-size: 29px
    }

    .page-heading .button {
        width: 100%
    }

    .stats {
        gap: 8px;
        margin-bottom: 22px
    }

    .stat {
        padding: 14px 11px
    }

    .stat.selected {
        padding-top: 12px
    }

    .stat strong {
        font-size: 27px
    }

    .stat>span {
        font-size: 11px
    }

    .stat small {
        font-size: 9px
    }

    .search-form {
        padding: 18px;
        grid-template-columns: 1fr
    }

    .table-top {
        padding: 20px 18px
    }

    th,
    td {
        padding: 15px 18px
    }

    .form-panel {
        padding: 20px
    }

    .form-grid,
    .upload-grid {
        grid-template-columns: 1fr
    }

    .publish-panel {
        padding: 22px
    }

    .save-actions .button {
        width: 100%
    }

    .attachment-list li {
        display: block
    }

    .checkbox {
        margin-top: 10px
    }

    .login-page {
        display: block
    }

    .login-intro {
        min-height: 0;
        padding: 30px;
        gap: 30px
    }

    .login-intro h1 {
        font-size: 30px;
        margin: 0 0 12px
    }

    .login-intro>small {
        display: none
    }

    .login-intro p {
        margin: 0
    }

    .login-main {
        padding: 35px 22px
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center
    }

    .editor-toolbar button {
        padding: 5px 7px
    }
}
/* Selector de catálogo con búsqueda integrada. */
.catalogo-combo { position: relative; }
.catalogo-combo input { padding-right: 32px; }
.catalogo-combo::after { content: '▾'; position: absolute; right: 12px; top: 14px; pointer-events: none; color: #71134b; }
.catalogo-opciones { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 8px 24px #0002; }
.catalogo-opciones [role="option"], .catalogo-vacio { padding: 10px 14px; }
.catalogo-opciones [role="option"] { cursor: pointer; }
.catalogo-opciones [role="option"]:hover, .catalogo-opciones [aria-selected="true"] { background: #f6e9f1; color: #71134b; }
.catalogo-vacio { color: #64748b; }
.catalogo-opciones[hidden], select[hidden] { display: none; }

/* Identidad del sitio: paleta de estilos.css y fuentes locales de style.css. */
@font-face {
    font-family: 'Atlas Gibson';
    src: url('fonts/gibson-regular-webfont.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Atlas Gibson';
    src: url('fonts/gibson-semibold-webfont.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
:root {
    --guinda: #4A001F;
    --morado: #6A0F49;
    --rosa-claro: #FFC3D0;
    --rosa-fuerte: #D2417C;
    --gris: #6D807F;
    --blanco: #fff;
    --plum: var(--morado);
    --plum-dark: var(--guinda);
    --ink: var(--guinda);
    --muted: #596b6a;
    --paper: #f3f6fa;
}
.admin-header { border-bottom: 5px solid var(--morado); min-height: 94px; height: auto; padding-top: 8px; padding-bottom: 8px; }
.admin-logo { display: block; height: 72px; max-width: 180px; object-fit: contain; }
.header-actions, .header-actions a, .header-actions .user, .header-actions .quiet { color: var(--guinda); font-weight: 400; }
.sidebar { background: var(--morado); color: var(--blanco); border-right: 0; }
.sidebar .eyebrow, .sidebar-title, .sidebar nav a, .sidebar-note p, .sidebar > small { color: var(--blanco); }
.sidebar nav a[aria-current], .sidebar nav a:hover { background: var(--guinda); color: var(--blanco); }
.sidebar-note { border-top-color: #ffffff55; }
.page-heading h1 { color: var(--morado); font-weight: 600; letter-spacing: 0; }
.panel { background: var(--blanco); box-shadow: 0 4px 20px #4a001f0b; }
.form-panel > .section-heading { background: var(--morado); color: var(--blanco); margin: -30px -30px 26px; padding: 24px 30px; border-radius: var(--radius) var(--radius) 0 0; }
.form-panel > .section-heading h2, .form-panel > .section-heading p, .form-panel > .section-heading .code-label { color: var(--blanco); }
.form-panel > .section-heading .code-label { margin: 10px 0 0; }
.section-heading .step { background: var(--guinda); color: var(--blanco); }
.table-top { background: var(--morado); color: var(--blanco); border-radius: var(--radius) var(--radius) 0 0; padding-bottom: 20px; }
.table-top > span { color: var(--blanco); }
.button { font-weight: 400; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .editor-surface:focus-visible { outline: 2px solid var(--morado); outline-offset: 2px; }
@media (max-width: 640px) {
    .admin-logo { height: 56px; max-width: 140px; }
}@media (max-width: 720px) {
    .form-panel > .section-heading { margin: -20px -20px 24px; padding: 20px; }
}
