:root {
    --forest: #234334;
    --forest-dark: #172f24;
    --beige: #e9dfc8;
    --cream: #faf8f2;
    --white: #fff;
    --page: #f4f6f3;
    --text: #292d2a;
    --muted: #6c746f;
    --border: #dfe5e0;
    --danger: #a33b3b;
    --success: #2e7550;
    --title: 'Cormorant Garamond', serif;
    --body: 'Inter', sans-serif;
    --button: 'Manrope', sans-serif;
    --shadow: 0 14px 45px rgba(23,47,36,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--body); color: var(--text); background: var(--page); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
.admin-topbar { position: sticky; top: 0; z-index: 1000; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 0 max(24px, calc((100vw - 1320px)/2)); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.admin-brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--forest); }
.admin-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--forest); color: #fff; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font: 600 1.2rem/1 var(--title); }
.admin-brand small { margin-top: .25rem; color: var(--muted); font-size: .64rem; }
.admin-nav { display: flex; align-items: center; gap: .5rem; }
.admin-nav a { display: inline-flex; align-items: center; gap: .45rem; padding: .72rem .85rem; border-radius: 10px; text-decoration: none; color: var(--muted); font: 500 .76rem/1 var(--button); transition: .2s ease; }
.admin-nav a:hover { color: var(--forest); background: var(--cream); }
.admin-menu-button { display: none; border: 0; background: transparent; color: var(--forest); font-size: 1.2rem; }
.admin-shell { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 45px 0 80px; }
.admin-alert { border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1.3rem; font-size: .84rem; }
.admin-alert.success { background: #e8f4ed; color: #236443; border: 1px solid #bfe0cc; }
.admin-alert.error { background: #faeaea; color: #8b3131; border: 1px solid #eac1c1; }
.admin-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.admin-page-heading h1 { font: 600 clamp(2.2rem, 4vw, 3.2rem)/1 var(--title); color: var(--forest); margin: .4rem 0 .65rem; }
.admin-page-heading p { color: var(--muted); font-size: .9rem; }
.admin-eyebrow { color: var(--forest); text-transform: uppercase; letter-spacing: .15em; font: 600 .68rem/1 var(--button); opacity: .65; }
.compact-heading { align-items: flex-start; }
.admin-back-link { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.2rem; text-decoration: none; color: var(--muted); font-size: .76rem; }
.admin-button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; padding: .78rem 1.15rem; border: 1px solid transparent; border-radius: 11px; text-decoration: none; cursor: pointer; font: 600 .77rem/1 var(--button); transition: .2s ease; }
.admin-button.primary { background: var(--forest); color: #fff; }
.admin-button.primary:hover { background: var(--forest-dark); transform: translateY(-1px); }
.admin-button.secondary { background: #fff; border-color: var(--border); color: var(--forest); }
.admin-button.full { width: 100%; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-bottom: 1.5rem; }
.admin-stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.4rem; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 5px 20px rgba(23,47,36,.035); }
.admin-stat-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; background: rgba(35,67,52,.09); color: var(--forest); font-size: 1.15rem; }
.admin-stat-icon.success { background: #e8f4ed; color: var(--success); }
.admin-stat-icon.muted { background: #f0eee7; color: #7c7460; }
.admin-stat-card small, .admin-stat-card strong { display: block; }
.admin-stat-card small { color: var(--muted); font-size: .72rem; margin-bottom: .25rem; }
.admin-stat-card strong { font: 600 2rem/1 var(--title); color: var(--forest); }
.admin-panel-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 6px 25px rgba(23,47,36,.035); }
.admin-panel-header { padding: 1.4rem 1.5rem; border-bottom: 1px solid var(--border); }
.admin-panel-header h2, .editor-card h2 { font: 600 1.45rem/1.1 var(--title); color: var(--forest); }
.admin-panel-header p { color: var(--muted); font-size: .77rem; margin-top: .35rem; }
.admin-table-wrap { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.admin-table th, .admin-table td { text-align: left; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--muted); font: 600 .67rem/1 var(--button); text-transform: uppercase; letter-spacing: .08em; background: #fbfcfb; }
.admin-table td { font-size: .8rem; }
.admin-table tr:last-child td { border-bottom: 0; }
.align-right { text-align: right !important; }
.post-cell { display: flex; align-items: center; gap: .85rem; min-width: 310px; }
.post-cell img, .post-thumb-placeholder { width: 58px; height: 48px; flex: 0 0 auto; border-radius: 9px; object-fit: cover; }
.post-thumb-placeholder { display: grid; place-items: center; background: var(--cream); color: var(--forest); }
.post-cell strong, .post-cell small { display: block; }
.post-cell strong { color: var(--text); max-width: 370px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.post-cell small { color: var(--muted); margin-top: .25rem; font-size: .67rem; }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .42rem .68rem; font: 600 .64rem/1 var(--button); }
.status-badge.published { background: #e8f4ed; color: #276747; }
.status-badge.draft { background: #f1efe8; color: #716c5f; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.table-actions a, .table-actions button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--forest); cursor: pointer; text-decoration: none; }
.table-actions button:hover { color: var(--danger); border-color: #e4bcbc; }
.delete-post-form { display: inline; }
.admin-empty { padding: 70px 20px; text-align: center; }
.admin-empty > i { font-size: 2rem; color: var(--forest); opacity: .45; margin-bottom: 1rem; }
.admin-empty h3 { font: 600 1.65rem/1.1 var(--title); color: var(--forest); }
.admin-empty p { color: var(--muted); font-size: .84rem; margin: .6rem 0 1.4rem; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.3rem; align-items: start; }
.editor-main-column, .editor-sidebar { display: grid; gap: 1.3rem; }
.editor-card { padding: 1.45rem; }
.editor-card h2 { margin-bottom: 1.2rem; }
.sticky-card { position: sticky; top: 96px; }
.form-field { display: grid; gap: .45rem; margin-bottom: 1.15rem; }
.form-field:last-child { margin-bottom: 0; }
.form-field label, .editor-label-row label { font: 600 .72rem/1 var(--button); color: var(--text); }
.form-field input, .form-field textarea, .form-field select, .slug-field { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); outline: none; transition: .2s ease; }
.form-field input, .form-field select { height: 45px; padding: 0 .85rem; }
.form-field textarea { padding: .8rem; resize: vertical; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus, .slug-field:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(35,67,52,.08); }
.form-field small, .editor-label-row small, .editor-card > small { color: var(--muted); font-size: .67rem; }
.slug-field { display: flex; align-items: center; overflow: hidden; }
.slug-field span { align-self: stretch; display: flex; align-items: center; padding: 0 .75rem; background: var(--cream); border-right: 1px solid var(--border); color: var(--muted); font-size: .72rem; }
.slug-field input { border: 0; box-shadow: none !important; }
.editor-label-row { display: flex; justify-content: space-between; margin-bottom: .8rem; }
.editor-label-row label, .editor-label-row small { display: block; }
.editor-label-row small { margin-top: .3rem; }
.rich-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .55rem; border: 1px solid var(--border); border-bottom: 0; border-radius: 11px 11px 0 0; background: #fafbfa; }
.rich-toolbar button { min-width: 34px; height: 34px; padding: 0 .5rem; border: 0; border-radius: 7px; background: transparent; color: var(--text); cursor: pointer; font-size: .73rem; font-weight: 600; }
.rich-toolbar button:hover { background: var(--cream); color: var(--forest); }
.rich-toolbar span { width: 1px; height: 22px; margin: 0 .25rem; background: var(--border); }
.rich-editor { min-height: 460px; padding: 1.25rem; border: 1px solid var(--border); border-radius: 0 0 11px 11px; background: #fff; outline: none; line-height: 1.8; overflow-wrap: anywhere; }
.rich-editor:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(35,67,52,.06); }
.rich-editor p { margin-bottom: 1rem; }
.rich-editor h2 { font: 600 2rem/1.1 var(--title); color: var(--forest); margin: 1.8rem 0 .8rem; }
.rich-editor h3 { font: 600 1.55rem/1.1 var(--title); color: var(--forest); margin: 1.5rem 0 .7rem; }
.rich-editor blockquote { margin: 1.2rem 0; padding: 1rem 1.2rem; border-left: 3px solid var(--beige); background: var(--cream); }
.rich-editor ul, .rich-editor ol { margin: 0 0 1rem 1.5rem; }
.editor-action-stack { display: grid; gap: .65rem; margin-top: 1.2rem; }
.checkbox-field { display: flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .76rem; color: var(--text); }
.checkbox-field input { width: 17px; height: 17px; accent-color: var(--forest); }
.checkbox-field.danger { margin-top: .85rem; color: var(--danger); }
.cover-upload { display: block; cursor: pointer; margin-bottom: .55rem; }
.cover-upload input { position: absolute; opacity: 0; pointer-events: none; }
.cover-preview { min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1rem; border: 1px dashed #bfc9c1; border-radius: 13px; background: var(--cream) center/cover no-repeat; color: var(--muted); text-align: center; font-size: .72rem; overflow: hidden; }
.cover-preview i { font-size: 1.5rem; color: var(--forest); opacity: .6; }
.cover-preview.has-image i, .cover-preview.has-image span { display: none; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.settings-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.form-row { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 1rem; }
.settings-check { margin-top: .8rem; }
.settings-divider { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.settings-help { color: var(--muted); font-size: .75rem; margin: -.6rem 0 1rem; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(circle at top left, rgba(233,223,200,.7), transparent 38%), var(--page); }
.auth-card { width: min(460px, 100%); padding: 2.2rem; background: #fff; border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.auth-card-wide { width: min(520px, 100%); }
.auth-brand { display: inline-block; margin-bottom: 2rem; color: var(--forest); text-decoration: none; font: 600 1.45rem/1 var(--title); }
.auth-kicker { display: block; color: var(--forest); text-transform: uppercase; letter-spacing: .15em; font: 600 .65rem/1 var(--button); opacity: .65; }
.auth-card h1 { font: 600 2.65rem/1 var(--title); color: var(--forest); margin: .6rem 0 .7rem; }
.auth-card > p { color: var(--muted); font-size: .84rem; margin-bottom: 1.5rem; }
.auth-form { margin-top: 1.2rem; }
.auth-back { display: block; margin-top: 1.3rem; text-align: center; color: var(--muted); text-decoration: none; font-size: .72rem; }
.auth-note { margin-top: 1.3rem; padding: .9rem; border-radius: 10px; background: var(--cream); color: var(--muted); font-size: .7rem; }

@media (max-width: 980px) {
    .admin-menu-button { display: block; }
    .admin-nav { position: fixed; top: 76px; right: -100%; width: min(340px, 88vw); height: calc(100vh - 76px); padding: 1.5rem; flex-direction: column; align-items: stretch; background: #fff; box-shadow: -20px 20px 40px rgba(0,0,0,.1); transition: right .3s ease; }
    .admin-nav.open { right: 0; }
    .admin-nav a { padding: 1rem; font-size: .84rem; }
    .editor-layout { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-actions { grid-column: auto; }
}
@media (max-width: 720px) {
    .admin-shell { width: min(100% - 24px, 1320px); padding-top: 28px; }
    .admin-topbar { padding: 0 14px; }
    .admin-brand small { display: none; }
    .admin-page-heading { align-items: flex-start; flex-direction: column; }
    .admin-stats-grid { grid-template-columns: 1fr; }
    .editor-card { padding: 1rem; }
    .rich-editor { min-height: 380px; }
    .form-row { grid-template-columns: 1fr; }
    .auth-card { padding: 1.5rem; }
}
