:root {
    --red: #ed2b22;
    --ink: #111416;
    --muted: #667074;
    --line: #dde2e4;
    --panel: #ffffff;
    --bg: #f3f5f5;
    --sidebar: #080a0b;
    font-family: 'Manrope', 'Avenir Next', Arial, sans-serif;
}

* { box-sizing: border-box; }
body {margin: 0;}
body .main-container { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, .button-link { min-height: 38px; border: 1px solid var(--line); background: white; padding: 0 13px; font: inherit; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.admin-sidebar { min-height: 100vh; padding: 24px 18px; background: var(--sidebar); color: white; position: sticky; top: 0; }
.admin-sidebar summary { cursor: pointer; list-style: none; }
.admin-sidebar summary::-webkit-details-marker { display: none; }
.admin-sidebar > details > summary { font-size: 18px; font-weight: 800; text-transform: lowercase; }
.admin-sidebar a, .admin-sidebar summary { min-height: 34px; display: flex; align-items: center; gap: 10px; color: #c6cdcf; font-size: 13px; }
.sidebar-menu { border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 7px; }
.sidebar-menu summary { justify-content: space-between; user-select: none; }
.sidebar-menu summary span { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-menu summary > .fa-chevron-down { color: #687174; font-size: 10px; transition: transform .2s, color .2s; }
.sidebar-menu[open] summary > .fa-chevron-down { color: var(--red); transform: rotate(180deg); }
.sidebar-menu a { margin-left: 0; padding-left: 26px; }
.sidebar-menu a.is-active, .sidebar-menu a[aria-current="page"] { color: white; background: rgba(237, 43, 34, .18); border-left: 3px solid var(--red); padding-left: 23px; font-weight: 800; }
.admin-sidebar nav > a { min-height: 34px; }
.admin-sidebar p { margin: 28px 0 10px; color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; }
.admin-sidebar nav details { margin-bottom: 8px; }
.admin-sidebar nav details a { margin-left: 0; }
.admin-shell { min-width: 0; }
.admin-header { height: 76px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); }
.admin-header div { display: flex; align-items: center; gap: 10px; }
.admin-header span { width: 14px; height: 14px; border-radius: 50%; background: var(--user-colour); }
.admin-header small { color: var(--muted); }
main { padding: 34px; }
.admin-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.admin-hero.compact h1 { font-size: clamp(30px, 3.2vw, 48px); }
.admin-hero p { margin: 0 0 10px; color: var(--red); font-size: 11px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; }
.admin-hero h1 { max-width: 780px; margin: 0; font-size: clamp(32px, 4vw, 58px); line-height: .98; letter-spacing: 0; }
.admin-hero a { flex: 0 0 auto; min-height: 42px; display: inline-flex; align-items: center; gap: 10px; padding: 0 15px; background: var(--ink); color: white; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.traffic-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid article, .panel { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 16px 34px rgba(15, 20, 22, .05); }
.metric-grid article { padding: 20px; }
.metric-grid small { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.metric-grid strong { display: block; margin-top: 12px; font-size: 34px; }
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { padding: 22px; }
.panel header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel h2 { margin: 0; font-size: 20px; }
.row { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); }
.row strong, .row small { display: block; }
.row small, .muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.row span { color: var(--red); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-actions a, .row-actions button { min-height: 32px; border: 1px solid var(--line); background: #f8faf9; padding: 0 10px; color: var(--ink); font-size: 12px; font-weight: 900; }
.user-summary { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-summary i { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: var(--user-colour); box-shadow: 0 0 0 4px rgba(237,43,34,.08); }
.builder-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.builder-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, .6fr); margin-bottom: 18px; }
.admin-form { display: grid; gap: 16px; }
.admin-form label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.admin-form input[type="text"], .admin-form input[type="email"], .admin-form input[type="date"], .admin-form input[type="file"], .admin-form textarea, .admin-form select { width: 100%; min-height: 42px; border: 1px solid var(--line); background: #f8faf9; padding: 10px 12px; color: var(--ink); font: inherit; font-size: 14px; }
.admin-form textarea { resize: vertical; line-height: 1.45; }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { outline: 3px solid rgba(237,43,34,.16); border-color: var(--red); }
.admin-form small { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.45; text-transform: none; }
.admin-form .check-row { display: flex; align-items: center; gap: 10px; text-transform: none; }
.admin-form .check-row input { width: 17px; height: 17px; }
.trumbowyg-box, .trumbowyg-editor { margin: 0; border-color: var(--line); background: #f8faf9; }
.trumbowyg-button-pane { background: white; border-bottom-color: var(--line); }
.trumbowyg-editor { min-height: 220px; color: var(--ink); font: inherit; line-height: 1.55; }
.image-field-preview { display: grid; gap: 12px; }
.image-field-preview img { width: min(100%, 320px); border: 1px solid var(--line); background: #f8faf9; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.section-builder { margin-top: 18px; }
.section-builder > header span { color: var(--red); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.section-card { border-top: 1px solid var(--line); padding: 22px 0; }
.section-card > header { align-items: flex-start; margin-bottom: 18px; }
.section-card h3 { margin: 4px 0 0; font-size: 22px; }
.section-card small { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.entry-card { border-top: 1px solid var(--line); padding: 22px 0; }
.entries-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.entry-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.entry-card h3 { margin: 5px 0 0; font-size: 22px; }
.entry-card small { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.entry-card span { color: var(--red); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.entry-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.entry-card div { min-width: 0; }
.entry-card dt { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.entry-card dd { margin: 5px 0 0; color: var(--ink); line-height: 1.5; overflow-wrap: anywhere; }
.traffic-card { border-top: 1px solid var(--line); padding: 18px 0; }
.traffic-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.traffic-card strong, .traffic-card small { display: block; }
.traffic-card small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.traffic-card span { color: var(--red); font-size: 11px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.traffic-card p { margin: 0 0 7px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.activity-card { border-top: 1px solid var(--line); padding: 18px 0; }
.activity-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.activity-card strong, .activity-card small { display: block; }
.activity-card small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.activity-card span { color: var(--red); font-size: 11px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.activity-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.activity-card dt { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.activity-card dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.form-setting-card { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding: 16px 0; }
.form-setting-card strong, .form-setting-card small { display: block; }
.form-setting-card small { color: var(--muted); font-size: 13px; margin-top: 4px; }
.form-setting-card label { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.form-setting-card input { width: 18px; height: 18px; accent-color: var(--red); }
.notice { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--line); background: white; }
.notice.success { border-color: rgba(38,145,88,.28); background: rgba(38,145,88,.08); color: #17683c; }
.notice.error { border-color: rgba(237,43,34,.28); background: rgba(237,43,34,.08); color: #9d1c16; }
.notice ul { margin: 8px 0 0; padding-left: 18px; }
code { background: #edf0f0; padding: 2px 5px; }
.login-body { display: grid; grid-template-columns: 1fr; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 20%, #31393b, #080a0b 62%); }
.login-shell { width: min(100%, 460px); padding: 0; }
.login-panel { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.95); padding: clamp(28px, 5vw, 46px); box-shadow: 0 34px 90px rgba(0,0,0,.32); }
.login-brand { display: block; width: 178px; margin-bottom: 30px; filter: invert(1); }
.login-panel p { margin: 0 0 10px; color: var(--red); font-size: 11px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; }
.login-panel h1 { margin: 0 0 28px; font-size: 34px; line-height: 1; letter-spacing: 0; }
.login-panel label { display: grid; gap: 9px; margin-bottom: 16px; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.login-panel input[type="text"], .login-panel input[type="email"], .login-panel input[type="password"] { width: 100%; min-height: 46px; border: 1px solid var(--line); background: #f8faf9; padding: 0 13px; font: inherit; }
.login-panel input:focus { outline: 3px solid rgba(237,43,34,.16); border-color: var(--red); }
.login-panel .check-row { display: flex; align-items: center; gap: 10px; text-transform: none; font-weight: 700; }
.login-panel .check-row input { width: 16px; height: 16px; }
.login-panel button { width: 100%; min-height: 48px; border-color: var(--red); background: var(--red); color: white; text-transform: uppercase; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.login-options .check-row { margin: 0; }
.login-options a, .auth-return { color: var(--red); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.auth-return { display: inline-flex; justify-content: center; width: 100%; margin-top: 16px; }
.login-panel .auth-copy { margin: -14px 0 22px; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: 0; line-height: 1.5; text-transform: none; }
.login-panel .auth-error { padding: 12px 13px; background: rgba(237,43,34,.12); color: #a91f18; line-height: 1.45; letter-spacing: 0; text-transform: none; }
.login-panel .auth-status { padding: 12px 13px; background: rgba(38,145,88,.1); color: #17683c; line-height: 1.45; letter-spacing: 0; text-transform: none; }

@media (max-width: 979px) {
    body .main-container { grid-template-columns: 1fr; }
    .admin-sidebar { position: relative; min-height: auto; }
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .workspace-grid { grid-template-columns: 1fr; }
    .entries-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .admin-header, main { padding-inline: 20px; }
    .admin-header { height: auto; min-height: 76px; gap: 16px; align-items: flex-start; padding-block: 18px; flex-direction: column; }
    .admin-hero { align-items: flex-start; flex-direction: column; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field-grid { grid-template-columns: 1fr; }
    .entry-card dl { grid-template-columns: 1fr; }
    .activity-card dl { grid-template-columns: 1fr; }
}

@media (max-width: 479px) {
    .metric-grid { grid-template-columns: 1fr; }
    .panel header, .row { align-items: flex-start; flex-direction: column; }
}
