:root {
  --ink: #26352f;
  --muted: #68776f;
  --green: #58715f;
  --green-dark: #3f5748;
  --paper: #f3f1eb;
  --white: #fff;
  --line: #dce2dd;
  --danger: #a43e3e;
  --shadow: 0 16px 48px rgba(38, 53, 47, .12);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Poppins, sans-serif; }
button, input, textarea { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.brand { color: var(--ink); font: 800 20px Raleway, sans-serif; letter-spacing: .16em; text-decoration: none; }
.brand span { color: var(--green); font-weight: 600; letter-spacing: .04em; }
.eyebrow { margin: 0 0 8px; color: var(--green); font: 700 11px Raleway, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.intro { color: var(--muted); line-height: 1.7; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 40px; border-radius: 10px; background: var(--white); box-shadow: var(--shadow); }
.login-card h1 { margin: 24px 0 8px; font: 800 30px/1.15 Raleway, sans-serif; }
.login-form { display: grid; gap: 10px; margin-top: 26px; }
.login-form .button { margin-top: 12px; }
.back-link { display: inline-block; margin-top: 24px; color: var(--muted); font-size: 13px; }

label, .label-row { color: var(--ink); font: 700 11px Raleway, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.label-row { display: flex; justify-content: space-between; align-items: center; }
.label-row span, .hint { color: var(--muted); font: 400 11px Poppins, sans-serif; letter-spacing: 0; text-transform: none; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 12px 14px; background: #fbfcfa; color: var(--ink); outline: none; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(88, 113, 95, .25); outline-offset: 2px; border-color: var(--green); }

.button { border: 0; border-radius: 5px; padding: 11px 18px; cursor: pointer; font: 700 12px Raleway, sans-serif; letter-spacing: .05em; }
.button:disabled { cursor: wait; opacity: .55; }
.button-primary { background: var(--green); color: var(--white); }
.button-primary:hover { background: var(--green-dark); }
.button-ghost { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.button-danger { background: var(--danger); color: var(--white); }

.admin-header { min-height: 72px; display: flex; justify-content: space-between; align-items: center; padding: 14px max(24px, calc((100vw - 1120px) / 2)); background: var(--white); border-bottom: 1px solid var(--line); }
.admin-shell { width: min(1120px, calc(100% - 40px)); margin: 48px auto 80px; }
.admin-toolbar, .editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-toolbar h1 { margin: 0; font: 800 34px Raleway, sans-serif; }
.admin-toolbar h1 span { color: var(--muted); font-size: 18px; }

.alert { margin: 22px 0; padding: 13px 16px; border-radius: 5px; font-size: 13px; }
.alert-error { background: #f9e8e6; color: #792c2c; }
.alert-success { background: #e5f2e8; color: #2f603c; }

.news-list { display: grid; gap: 10px; margin-top: 28px; }
.news-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.news-row img { width: 72px; height: 90px; object-fit: cover; object-position: top; border-radius: 4px; }
.news-row h2 { margin: 0 0 8px; font: 700 16px/1.35 Raleway, sans-serif; }
.news-row time { color: var(--muted); font-size: 12px; }
.row-actions { display: flex; gap: 14px; }
.text-button { border: 0; padding: 8px 0; background: none; color: var(--green-dark); cursor: pointer; font-weight: 600; }
.text-danger { color: var(--danger); }
.empty-state { padding: 32px; text-align: center; color: var(--muted); background: var(--white); }

.editor { margin-top: 44px; padding: 30px; border-radius: 10px; background: var(--white); box-shadow: var(--shadow); }
.editor-heading h2 { margin: 0; font: 800 27px Raleway, sans-serif; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 34px; margin-top: 28px; }
#newsForm { display: grid; gap: 11px; align-content: start; }
#newsForm .button { margin-top: 10px; justify-self: start; }
.preview-panel { min-width: 0; }
.preview-card { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--white); box-shadow: 0 8px 26px rgba(38, 53, 47, .1); }
.preview-card img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: top; background: var(--paper); }
.preview-body { padding: 20px; }
.preview-body h3 { margin: 0 0 10px; font: 700 17px/1.35 Raleway, sans-serif; }
.preview-body p { color: var(--muted); font-size: 13px; line-height: 1.7; white-space: pre-line; }
.preview-foot { display: flex; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--green); font: 700 11px Raleway, sans-serif; text-transform: uppercase; }
.preview-foot a { text-decoration: none; }
.preview-panel > .button { width: 100%; margin-top: 16px; }

.confirm-dialog { width: min(430px, calc(100% - 32px)); border: 0; border-radius: 9px; padding: 28px; color: var(--ink); box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(20, 31, 26, .58); }
.confirm-dialog h2 { margin: 0; font: 800 24px Raleway, sans-serif; }
.confirm-dialog p { color: var(--muted); line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

@media (max-width: 760px) {
  .login-card { padding: 28px 22px; }
  .admin-shell { width: min(100% - 24px, 1120px); margin-top: 28px; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .news-row { grid-template-columns: 58px 1fr; }
  .news-row img { width: 58px; height: 72px; }
  .row-actions { grid-column: 2; }
  .editor { padding: 22px 16px; }
  .editor-grid { grid-template-columns: 1fr; }
  .admin-header { padding: 12px; }
}
