:root {
  --cream: #f2efe7;
  --paper: #faf8f2;
  --ink: #192019;
  --forest: #213126;
  --wine: #7b3040;
  --gold: #b69b61;
  --line: rgba(25, 32, 25, .18);
  --white: #fff;
  --green: #35614a;
  --red: #9a3e46;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { background: #e8e4da; }
body { margin: 0; color: var(--ink); background: #e8e4da; font-family: var(--sans); line-height: 1.55; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 9px 14px; background: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.admin-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 36px; min-height: 82px; padding: 12px 28px; color: #fff; background: var(--forest); }
.admin-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.admin-brand img { width: 56px; height: 56px; }
.admin-brand span { display: grid; }
.admin-brand strong { font-family: var(--serif); font-size: 1.12rem; font-weight: 400; }
.admin-brand small { font-size: .59rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.admin-header nav { display: flex; align-items: center; gap: 22px; }
.admin-header nav a { color: rgba(255,255,255,.8); font-size: .67rem; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.admin-account { display: flex; align-items: center; gap: 14px; font-size: .72rem; }
.admin-account form { margin: 0; }
.link-button { padding: 0; border: 0; color: #e7c89b; background: transparent; font-weight: 750; text-decoration: underline; cursor: pointer; }

.admin-shell { width: min(1240px, calc(100vw - 48px)); min-height: calc(100vh - 130px); margin: 0 auto; padding: 54px 0 80px; }
.admin-footer { padding: 20px 24px; color: rgba(255,255,255,.58); background: #162018; text-align: center; font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow { margin: 0 0 12px; color: var(--wine); font-size: .68rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.page-heading { max-width: 800px; margin-bottom: 38px; }
.page-heading h1, .auth-card h1 { margin: 0; font-family: var(--serif); font-size: clamp(3rem, 6vw, 5.2rem); font-weight: 400; letter-spacing: -.05em; line-height: .95; }
.page-heading p:last-child, .auth-card > p { color: #586159; }
.page-heading-actions { display: flex; align-items: end; justify-content: space-between; gap: 32px; max-width: none; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border: 1px solid var(--forest); border-radius: 99px; color: #fff; background: var(--forest); font-size: .7rem; font-weight: 800; letter-spacing: .075em; text-decoration: none; text-transform: uppercase; cursor: pointer; }
.button:hover { color: var(--forest); background: transparent; }
.button-secondary { color: var(--forest); background: transparent; }
.button-secondary:hover { color: #fff; background: var(--forest); }
.button-publish { border-color: var(--green); background: var(--green); }
.button-publish:hover { color: var(--green); background: transparent; }
.button-danger { border-color: var(--red); background: var(--red); }
.button-danger:hover { color: var(--red); background: transparent; }
.button-small { min-height: 38px; padding: 0 15px; font-size: .62rem; }

.panel, .auth-card { padding: 34px; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 20px 55px rgba(28,37,29,.08); }
.panel h2 { margin-top: 0; font-family: var(--serif); font-size: 2rem; font-weight: 400; }
.panel-narrow { max-width: 650px; }
.auth-card { max-width: 540px; margin: 5vh auto; }
.auth-card-wide { max-width: 760px; }

.admin-form { display: grid; gap: 20px; margin-top: 28px; }
.admin-form label, .editor-layout label, .reject-form label { display: grid; gap: 7px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.admin-form small, .editor-layout small { color: #697069; font-size: .68rem; font-weight: 500; letter-spacing: 0; }
.admin-form input, .admin-form textarea, .admin-form select, .editor-layout input, .editor-layout textarea, .editor-layout select, .inline-form input, .reject-form textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #aeb3ac; border-radius: 3px; color: var(--ink); background: #fff; }
.admin-form textarea, .editor-layout textarea, .reject-form textarea { resize: vertical; }
.help { margin-top: 24px !important; font-size: .75rem; }

.flash, .form-errors, .review-note { margin-bottom: 28px; padding: 16px 19px; border-left: 4px solid var(--wine); background: #fff; }
.flash-success { border-color: var(--green); }
.flash-error, .form-errors { border-color: var(--red); color: #6f2730; }
.form-errors ul { margin-bottom: 0; }
.form-errors p { margin: 14px 0 0; font-weight: 700; }
.draft-safety-notice { margin-bottom: 28px; padding: 16px 19px; border-left: 4px solid var(--gold); color: #3f493f; background: #fff9e8; }
.field-feedback { display: block; margin-top: 2px; font-size: .7rem !important; font-weight: 700 !important; letter-spacing: 0 !important; }
.field-feedback.is-error { color: #842f39 !important; }
.field-feedback.is-success { color: var(--green) !important; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red) !important; background: #fff7f7 !important; box-shadow: 0 0 0 2px rgba(154,62,70,.12); }
form[aria-busy="true"] { opacity: .72; }

.admin-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(300px,.65fr); gap: 28px; align-items: start; }
.user-list, .content-list { display: grid; }
.user-card, .content-row { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.user-card:first-child, .content-row:first-child { padding-top: 0; }
.user-card:last-child, .content-row:last-child { padding-bottom: 0; border-bottom: 0; }
.user-card h3, .content-row h2 { margin: 0; font-family: var(--serif); font-size: 1.55rem; font-weight: 400; }
.user-card p, .content-row p { margin: 5px 0; color: #5c655d; font-size: .78rem; }
.user-card small, .content-row small { color: #737a73; }
.user-card.is-disabled { opacity: .58; }
.content-row.is-highlighted { margin: 0 -18px; padding: 23px 18px; border-left: 4px solid var(--green); background: #edf3ed; box-shadow: 0 8px 24px rgba(33,49,38,.08); }
.content-row.is-highlighted:first-child { padding-top: 23px; }
.content-row.is-highlighted:last-child { padding-bottom: 23px; }
.user-actions, .row-actions, .moderation-actions { display: flex; align-items: center; gap: 12px; }
.user-actions details { position: relative; }
.user-actions summary { font-size: .7rem; font-weight: 700; cursor: pointer; }
.inline-form { position: absolute; z-index: 3; top: calc(100% + 10px); right: 0; display: flex; gap: 8px; width: 390px; padding: 14px; border: 1px solid var(--line); background: #fff; box-shadow: 0 18px 45px rgba(0,0,0,.16); }
.row-actions a:not(.button) { color: var(--wine); font-size: .7rem; font-weight: 800; text-decoration: none; text-transform: uppercase; }

.status { display: inline-flex; margin: 0 6px 8px 0; padding: 5px 9px; border-radius: 99px; color: #4d554e; background: #dedfd9; font-size: .59rem; font-weight: 850; letter-spacing: .075em; text-transform: uppercase; }
.status-review { color: #6f4b00; background: #f5df9f; }
.status-approved, .status-live { color: #fff; background: var(--green); }
.status-scheduled { color: #5f4507; background: #f2d78d; }
.status-ended { color: #fff; background: #687068; }
.status-offline { color: #fff; background: #687068; }
.status-rejected { color: #fff; background: var(--red); }
.publication-window { display: block; margin-top: 6px; }
.empty-state { padding: 42px; text-align: center; }
.empty-state h2 { font-family: var(--serif); font-size: 2.4rem; font-weight: 400; }

.editor-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(290px,.55fr); gap: 28px; align-items: start; }
.editor-main { display: grid; gap: 22px; }
.rich-editor-field { display: grid; gap: 7px; }
.rich-editor-field > label { font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px; border: 1px solid #aeb3ac; border-bottom: 0; border-radius: 3px 3px 0 0; background: #ece9e0; }
.rich-toolbar button { min-height: 34px; padding: 5px 10px; border: 1px solid rgba(33,49,38,.24); border-radius: 3px; color: var(--forest); background: #fff; font-size: .68rem; font-weight: 750; cursor: pointer; }
.rich-toolbar button:hover { color: #fff; background: var(--forest); }
.rich-editor-field textarea { border-radius: 0 0 3px 3px; }
.rich-preview { margin-top: 12px; padding: 20px; border: 1px solid var(--line); background: #fff; }
.rich-preview > h2 { margin: 0 0 16px; color: var(--wine); font-family: var(--sans); font-size: .65rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.rich-preview-content { font-family: var(--serif); font-size: 1.08rem; font-weight: 400; letter-spacing: 0; line-height: 1.7; }
.rich-preview-content p:first-child { margin-top: 0; font-size: 1.22rem; }
.rich-preview-content p:last-child, .rich-preview-content ul:last-child, .rich-preview-content ol:last-child { margin-bottom: 0; }
.rich-preview-content .event-body-heading { margin: 1.3em 0 .45em; color: var(--ink); font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; line-height: 1.15; }
.rich-preview-content h2.event-body-heading { font-size: 1.8rem; }
.rich-preview-content h3.event-body-heading { font-size: 1.4rem; }
.rich-preview-content ul, .rich-preview-content ol { padding-left: 1.35em; }
.rich-preview-empty { color: #777d77; font-family: var(--sans); font-size: .78rem !important; }
.event-text-large { font-size: 1.28em; line-height: 1.45; }
.event-text-small { font-size: .78em; line-height: 1.6; }
.editor-side { position: sticky; top: 20px; }
.schedule-fields, .image-fields { display: grid; gap: 16px; }
.schedule-fields { margin-bottom: 26px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.schedule-fields h2, .image-fields h2 { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.owner-line { margin-top: 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.draft-image-stage { overflow: hidden; width: 100%; margin-bottom: 16px; aspect-ratio: 16 / 10; background: url('/images/social-card-700-enolocanda.jpg') center / cover no-repeat; }
.draft-image { width: 100%; height: 100%; object-fit: cover; }
.draft-image-stage.is-portrait .draft-image { object-fit: contain; }
.draft-image[data-image-preview] { transition: opacity .18s ease, box-shadow .18s ease; }
.draft-image[data-image-preview][src^="data:"] { box-shadow: 0 0 0 4px rgba(53,97,74,.18); }
.draft-image-default { opacity: .86; }
.default-image-note { margin: -5px 0 20px; color: #5f675f; font-size: .72rem; }
.check-label { display: flex !important; grid-template-columns: auto 1fr !important; align-items: center; margin-bottom: 20px; }
.check-label input { width: auto !important; min-height: 0 !important; }
.editor-actions { display: grid; gap: 10px; margin-top: 28px; }
.social-fields { margin: 0; padding: 22px; border: 1px solid var(--line); }
.social-fields legend { padding: 0 8px; color: var(--wine); font-family: var(--serif); font-size: 1.35rem; }
.social-fields > p { margin: 0 0 18px; color: #697069; font-size: .75rem; }
.workflow-bar { display: flex; align-items: center; gap: 15px; margin: -10px 0 26px; padding: 14px 18px; background: #dcd8ce; }
.workflow-bar .status { margin: 0; }
.workflow-bar a { color: var(--wine); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.workflow-bar small { margin-left: auto; color: #5f675f; }
.review-note strong { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.review-note p { margin-bottom: 0; }
.moderation-panel { margin-top: 28px; }
.moderation-actions { margin-bottom: 26px; }
.reject-form { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: end; padding-top: 26px; border-top: 1px solid var(--line); }

@media (max-width: 960px) {
  .admin-header { grid-template-columns: 1fr auto; }
  .admin-header nav { grid-column: 1/-1; grid-row: 2; flex-wrap: wrap; }
  .admin-grid, .editor-layout { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .page-heading-actions { align-items: flex-start; flex-direction: column; }
  .workflow-bar { align-items: flex-start; flex-direction: column; }
  .workflow-bar small { margin-left: 0; }
}

@media (max-width: 650px) {
  .admin-header { padding: 12px 16px; }
  .admin-account > span { display: none; }
  .admin-header nav { gap: 12px; }
  .admin-shell { width: calc(100vw - 28px); padding-top: 36px; }
  .panel, .auth-card { padding: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .user-card, .content-row { align-items: flex-start; flex-direction: column; }
  .content-row.is-highlighted { margin: 0 -10px; padding-right: 10px; padding-left: 10px; }
  .user-actions, .row-actions { flex-wrap: wrap; }
  .inline-form { position: fixed; right: 14px; bottom: 14px; top: auto; left: 14px; width: auto; flex-direction: column; }
  .reject-form { grid-template-columns: 1fr; }
  .moderation-actions { align-items: stretch; flex-direction: column; }
  .moderation-actions .button { width: 100%; }
  .rich-toolbar button { flex: 1 1 auto; }
}
