:root {
  --backend-rose: #6f2434;
  --backend-rose-dark: #3f1821;
  --backend-gold: #d1a642;
  --backend-cream: #fffaf3;
  --backend-line: #e6d7cf;
}

* { box-sizing: border-box; }

.backend-main { min-height: 70vh; }
.backend-shell { width: min(calc(100% - 40px), 1160px); margin-inline: auto; }
.backend-hero { padding: clamp(64px, 9vw, 112px) 0 54px; text-align: center; }
.backend-hero h1 { max-width: 920px; margin-inline: auto; }
.backend-hero > p:not(.eyebrow) { max-width: 720px; margin-inline: auto; color: #6f6360; font-size: 1.08rem; }

.backend-card { padding: clamp(28px, 5vw, 54px); border: 1px solid var(--backend-line); border-radius: 28px; background: white; box-shadow: 0 18px 52px rgba(61,40,36,.1); }
.backend-form { display: grid; gap: 24px; }
.backend-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.backend-field { display: grid; align-self: start; align-content: start; gap: 8px; }
.backend-field.full { grid-column: 1 / -1; }
.backend-field label, .backend-field legend { color: #442e31; font-size: .84rem; font-weight: 900; }
.backend-field input, .backend-field textarea, .backend-field select {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #d9c9c3; border-radius: 12px; color: #372c2a; background: #fffdf9; font: inherit;
}
.backend-field textarea { min-height: 130px; resize: vertical; }
.backend-field input:focus, .backend-field textarea:focus, .backend-field select:focus { outline: 3px solid rgba(209,166,66,.25); border-color: var(--backend-gold); }
.backend-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.backend-check { padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--backend-line); border-radius: 12px; background: var(--backend-cream); }
.backend-check input { width: 18px; min-height: 18px; margin-top: 2px; }
.backend-check span { color: #554a47; font-size: .88rem; }
.backend-consent { display: flex; gap: 10px; align-items: flex-start; color: #5f5451; font-size: .86rem; }
.backend-consent input { width: 18px; height: 18px; margin-top: 2px; }
.backend-status { padding: 14px 16px; border-radius: 12px; font-weight: 800; }
.backend-status.success { color: #185c38; background: #e8f7ef; }
.backend-status.error { color: #8b2232; background: #fdecef; }
.backend-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.backend-section { padding: 68px 0; }
.backend-section.tint { background: #f8efe7; }
.backend-section-head { max-width: 760px; margin-bottom: 34px; }
.backend-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.backend-info { padding: 24px; border: 1px solid var(--backend-line); border-radius: 18px; background: white; }
.backend-info h3 { color: var(--backend-rose); font-size: 1.25rem; }
.backend-info p { margin: 0; color: #6c605c; }

.article-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.article-card { overflow: hidden; border: 1px solid var(--backend-line); border-radius: 24px; background: white; box-shadow: 0 14px 42px rgba(61,40,36,.08); }
.article-card > img { width: 100%; height: 300px; object-fit: cover; }
.article-card > div { padding: 28px; }
.article-card h2 { margin-bottom: 12px; font-size: clamp(1.7rem,3vw,2.35rem); }
.article-card h2 a { color: inherit; text-decoration: none; }
.article-card p:not(.eyebrow) { color: #6b5f5b; }
.empty-state { text-align: center; }
.newsletter-card { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(30px,6vw,72px); align-items: center; }
.article-hero { padding: clamp(70px,10vw,130px) 0 48px; max-width: 900px; }
.article-hero h1 { margin-bottom: 24px; }
.article-date { color: #776a66; font-size: .82rem; font-weight: 800; }
.article-cover { overflow: hidden; border-radius: 32px; box-shadow: 0 20px 56px rgba(61,40,36,.14); }
.article-cover img { width: 100%; max-height: 720px; object-fit: cover; }
.article-body { max-width: 760px; margin-inline: auto; }
.article-body p { color: #544a47; font-family: Georgia, "Times New Roman", serif; font-size: 1.16rem; line-height: 1.8; }

.backend-nav-extra { display: flex; align-items: center; gap: 18px; }
.backend-nav-extra a { color: #58333a; font-size: .82rem; font-weight: 900; text-decoration: none; }

.admin-main { padding-bottom: 80px; background: #fbf6f0; }
.admin-stack { display: grid; gap: 26px; }
.admin-topline { padding: 14px 18px; display: flex; justify-content: space-between; gap: 20px; border: 1px solid var(--backend-line); border-radius: 14px; background: white; }
.admin-topline p { margin: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.admin-stats > div { padding: 22px; border-radius: 18px; color: white; background: var(--backend-rose); }
.admin-stats strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 2.2rem; }
.admin-stats span { color: #ecdce0; font-size: .78rem; font-weight: 800; }
.admin-panel { padding: clamp(24px,4vw,44px); border: 1px solid var(--backend-line); border-radius: 24px; background: white; box-shadow: 0 12px 36px rgba(61,40,36,.07); }
.admin-panel > header { max-width: 760px; margin-bottom: 28px; }
.admin-panel-heading { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-panel-heading h2 { margin: 0; font-size: clamp(1.8rem,3vw,2.7rem); }
.admin-body-editor { min-height: 360px !important; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.admin-list { display: grid; gap: 12px; }
.admin-list article { padding: 20px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; border: 1px solid var(--backend-line); border-radius: 16px; }
.admin-list h3 { margin: 6px 0; font-size: 1.35rem; }
.admin-list p { margin: 0; color: #6b5e5a; }
.admin-badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.admin-badge.published { color: #155c38; background: #ddf4e8; }
.admin-badge.draft { color: #745421; background: #f9edca; }
.admin-table-wrap { overflow-x: auto; }
.admin-table-wrap table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.admin-table-wrap th, .admin-table-wrap td { padding: 13px 12px; border-bottom: 1px solid var(--backend-line); text-align: left; vertical-align: top; }
.admin-table-wrap th { color: var(--backend-rose); font-size: .72rem; text-transform: uppercase; }
.admin-table-wrap td a { color: var(--backend-rose); }
.admin-table-wrap td small { display: block; margin-top: 4px; color: #746965; }

.backend-alert { margin: 0 0 24px; padding: 15px 17px; border-radius: 12px; font-weight: 800; }
.backend-alert.success { color: #185c38; background: #e8f7ef; border: 1px solid #bfe7cf; }
.backend-alert.error { color: #8b2232; background: #fdecef; border: 1px solid #f3c2ca; }
.backend-alert.info { color: #5f491a; background: #fff4d2; border: 1px solid #edd38e; }
.backend-help { margin-top: 8px; color: #756964; font-size: .8rem; }
.backend-required { color: #8b2232; }
.admin-login { width: min(calc(100% - 40px), 560px); margin: 70px auto; }
.admin-toolbar { margin-bottom: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.admin-toolbar p { margin: 0; }
.admin-toolbar nav { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-table-wrap td { max-width: 330px; }
.admin-table-wrap .wrap-cell { white-space: normal; min-width: 220px; }
.admin-empty { padding: 22px; color: #6b5e5a; text-align: center; border: 1px dashed var(--backend-line); border-radius: 14px; }
.article-editor-preview { max-width: 320px; border-radius: 14px; }
.article-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.status-pill.published { color: #155c38; background: #ddf4e8; }
.status-pill.draft, .status-pill.new { color: #745421; background: #f9edca; }
.simple-prose { max-width: 760px; margin-inline: auto; color: #544a47; }
.simple-prose p { font-family: Georgia, "Times New Roman", serif; font-size: 1.16rem; line-height: 1.8; }
.setup-checklist { margin: 20px 0; padding-left: 22px; color: #5f5451; }
.setup-checklist li { margin: 8px 0; }
.admin-toolbar p small { display: block; margin-top: 4px; color: #746965; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.admin-analytics-table { margin-top: 24px; }
.rich-editor { overflow: hidden; border: 1px solid #d9c9c3; border-radius: 14px; background: #fffdf9; }
.rich-editor:focus-within { outline: 3px solid rgba(209,166,66,.25); border-color: var(--backend-gold); }
.rich-editor-toolbar { padding: 10px; display: flex; flex-wrap: wrap; gap: 7px; border-bottom: 1px solid var(--backend-line); background: #f8efe7; }
.rich-editor-toolbar button { min-height: 36px; padding: 7px 10px; border: 1px solid #d4c0b7; border-radius: 8px; color: #553039; background: white; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; }
.rich-editor-toolbar button:hover, .rich-editor-toolbar button:focus-visible { color: white; background: var(--backend-rose); border-color: var(--backend-rose); }
.rich-editor-content { min-height: 420px; padding: 22px; color: #3f3432; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; line-height: 1.75; outline: none; }
.rich-editor-content h2, .rich-editor-content h3 { color: var(--backend-rose); }
.rich-editor-content img { display: block; max-width: 100%; height: auto; margin: 22px auto; border-radius: 16px; }
.rich-editor-source { min-height: 420px !important; }
.upload-progress { padding: 15px 17px; border: 1px solid #e0c987; border-radius: 12px; background: #fff8df; }
.upload-progress > div { margin-bottom: 8px; display: flex; justify-content: space-between; gap: 18px; color: #624918; font-size: .82rem; }
.upload-progress progress { width: 100%; height: 14px; accent-color: var(--backend-rose); }
.article-body h2, .article-body h3 { margin-top: 1.7em; color: var(--backend-rose); }
.article-body ul, .article-body ol { color: #544a47; font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; line-height: 1.75; }
.article-body blockquote { margin: 32px 0; padding: 20px 24px; border-left: 4px solid var(--backend-gold); color: #5e4348; background: #fff8ed; font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; }
.article-body img { display: block; width: 100%; height: auto; margin: 34px 0; border-radius: 22px; box-shadow: 0 16px 40px rgba(61,40,36,.12); }

@media (max-width: 620px) {
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 850px) {
  .backend-form-grid, .backend-grid, .article-grid, .newsletter-card { grid-template-columns: 1fr; }
  .backend-field.full { grid-column: auto; }
  .backend-options { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2,1fr); }
  .admin-panel-heading, .admin-topline { align-items: flex-start; flex-direction: column; }
  .admin-list article { grid-template-columns: 1fr; }
}
