.admin { min-height: 100vh; }
.admin .header-inner { grid-template-columns: 1fr auto auto; }
.admin-main { max-width: 65rem; padding-block: 2.45rem 4rem; }
.admin h1 { font-size: clamp(2.15rem, 4.4vw, 3.25rem); margin-bottom: 1.25rem; }
.admin h2 { font-family: var(--sans); font-weight: 700; font-size: 1.1rem; line-height: 1.4; letter-spacing: normal; margin-bottom: 0; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 1.4rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.65rem; }
.admin-nav a, .text-link { color: var(--muted); font-weight: 700; text-decoration: none; }
.admin-nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .65rem; }
.admin-title { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.panel { padding: clamp(1rem, 3.3vw, 1.7rem); background: var(--white); border: 1px solid var(--line); border-radius: .85rem; }
.login-panel { max-width: 30rem; margin: 1rem auto; }
.login-panel h1 { font-size: clamp(1.95rem, 4.1vw, 2.55rem); }
.login-panel .eyebrow { margin-bottom: .5rem; }
.login-panel p { color: var(--muted); }
.admin-form, .editor-fields { display: grid; align-content: start; gap: 1rem; }
.admin-form label { display: grid; gap: .34rem; font-weight: 700; }
.admin-form input:not([type="checkbox"]), .admin-form textarea, .admin-form select {
    width: 100%;
    min-height: 2.75rem;
    padding: .55rem .7rem;
    border: 1px solid #c9b7b7;
    border-radius: .45rem;
    color: var(--ink);
    background: var(--white);
    font-weight: 400;
}
.admin-form input[type="file"] { font-size: .89rem; }
.admin-form input::file-selector-button { font: inherit; color: var(--ink); border: 0; border-radius: .22rem; padding: .24rem .5rem; margin-right: .45rem; background: var(--cream); cursor: pointer; }
.admin-form textarea { resize: vertical; }
.admin-form select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--plum) 50%), linear-gradient(135deg, var(--plum) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat; }
.admin-form .button { justify-self: start; }
.editor { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.editor-side { display: grid; gap: 1rem; align-content: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.admin-form label:has(.optional) { grid-template-columns: 1fr auto; }
.admin-form label:has(.optional) > :is(input, textarea) { grid-column: 1 / -1; }
.optional { color: var(--muted); font-weight: 500; font-size: .82rem; align-self: center; }
.field-help { font-size: .89rem; color: var(--muted); margin: -.35rem 0 0; }
.sample-help { margin-top: .85rem; }
.admin-preview { width: 100%; aspect-ratio: 4 / 3; border-radius: .45rem; object-fit: cover; }
.admin-form .checkbox { display: flex; align-items: center; gap: .45rem; font-weight: 500; }
.checkbox input { width: 1rem; height: 1rem; accent-color: var(--plum); }
.details-panel { max-width: 39rem; }
.message { padding: .85rem 1rem; border-radius: .6rem; font-weight: 600; }
.success { color: #234c36; background: #e2efe5; border: 1px solid #b6cfbf; }
.error { color: #742d28; background: #fae7df; border: 1px solid #e7b9a9; }
.inventory { padding: 0; }
.inventory table { width: 100%; border-collapse: collapse; text-align: left; }
.inventory th, .inventory td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.inventory th { font-size: .9rem; color: var(--muted); }
.inventory tr:last-child td { border-bottom: 0; }
.row-item, .row-actions { display: flex; align-items: center; gap: .65rem; }
.row-item > div { min-width: 0; overflow-wrap: anywhere; }
.row-item img { width: 3rem; height: 3rem; object-fit: cover; border-radius: .45rem; }
.row-item small { display: block; color: var(--muted); font-size: .86rem; }
.row-actions { justify-content: flex-end; gap: 1rem; font-weight: 600; }
.visibility { display: inline-block; font-size: .85rem; padding: .2rem .57rem; border-radius: 999px; color: #614155; background: #eee6ed; }
.visibility-published { color: #29513b; background: #e0efe3; }
.visibility-draft { color: #67482c; background: #f5e9d6; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.button-danger { background: #812f29; color: white; }
.button-danger:hover { background: #672223; }

@media (max-width: 690px) {
    .editor { grid-template-columns: 1fr; }
    .admin .header-inner { gap: .62rem; }
    .admin .header-inner .button { padding-inline: .65rem; }
    .inventory th, .inventory td { padding: .62rem .55rem; }
    .row-actions { gap: .65rem; }
}

@media (max-width: 440px) {
    .row-item img { display: none; }
    .row-actions { align-items: end; flex-direction: column; font-size: .9rem; gap: .3rem; }
    .form-row { grid-template-columns: 1fr; }
}
