:root {
  --blue: #315cf6;
  --blue-dark: #173bb6;
  --green: #275515;
  --green-bright: #26a449;
  --yellow: #f8d648;
  --orange: #ed712e;
  --red: #e93323;
  --ink: #171717;
  --ink-soft: #4d4d49;
  --paper: #f5f3eb;
  --white: #fff;
  --line: #d7d5cb;
  --line-dark: #aaa89e;
  --sidebar: 244px;
  --shadow: 4px 4px 0 var(--ink);
  --font: 'ARS Maquette Pro', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .58; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 500; left: 12px; top: 12px; padding: 10px 14px; background: var(--yellow); border: 2px solid var(--ink); transform: translateY(-180%); font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }

/* Login */
.login-view { display: grid; min-height: 100vh; padding: 28px; place-items: center; background: var(--blue); background-image: linear-gradient(135deg, transparent 0 68%, rgba(21, 44, 136, .42) 68%); }
.login-panel { display: grid; width: min(100%, 960px); min-height: 580px; grid-template-columns: 1.02fr .98fr; border: 3px solid var(--ink); box-shadow: 12px 12px 0 rgba(23, 23, 23, .7); }
.login-brand { position: relative; display: flex; overflow: hidden; min-height: 100%; padding: 50px; color: var(--white); background: var(--green); flex-direction: column; justify-content: center; }
.login-brand::before, .login-brand::after { position: absolute; content: ''; border-radius: 50%; background: var(--orange); }
.login-brand::before { width: 360px; height: 360px; left: -205px; top: -205px; box-shadow: 300px 520px 0 var(--yellow); }
.login-brand::after { width: 130px; height: 130px; right: -65px; top: 74px; background: var(--red); }
.brand-kicker { z-index: 1; margin-bottom: 18px; color: var(--yellow); font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.login-brand strong { z-index: 1; font-size: clamp(42px, 5vw, 67px); line-height: .88; letter-spacing: -.065em; }
.brand-stamp { z-index: 1; align-self: flex-start; margin-top: 28px; padding: 6px 11px 4px; color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); box-shadow: var(--shadow); font-size: 16px; font-weight: 700; transform: rotate(-3deg); }
.login-card { display: flex; padding: clamp(35px, 6vw, 70px); background: var(--white); flex-direction: column; justify-content: center; }
.login-card h1 { margin: 0; font-size: clamp(32px, 4vw, 46px); line-height: 1; letter-spacing: -.045em; }
.login-card > .muted { margin: 14px 0 30px; }
.field { position: relative; display: grid; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--white); border: 2px solid var(--line-dark); border-radius: 0; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 2px solid rgba(49, 92, 246, .2); }
textarea { min-height: 98px; resize: vertical; }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }
.password-toggle { position: absolute; right: 5px; top: 5px; width: 48px; height: 36px; font-size: 10px; }
.login-card .button-large { width: 100%; margin-top: 5px; justify-content: space-between; }
.login-note { margin: 25px 0 0; color: #71716a; font-size: 11px; }
.share-settings-panel { display: grid; max-width: 760px; gap: 18px; }
.share-settings-panel .image-preview { min-height: 260px; }
.share-settings-panel .image-preview img { width: 100%; max-height: 420px; object-fit: contain; }
.form-error { margin: -5px 0 16px; padding: 10px 12px; color: #79140d; background: #ffe3df; border-left: 4px solid var(--red); font-size: 13px; }

/* Shell and navigation */
.admin-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 80; inset: 0 auto 0 0; display: flex; width: var(--sidebar); color: var(--white); background: var(--ink); border-right: 3px solid var(--ink); flex-direction: column; }
.sidebar-brand { display: flex; min-height: 87px; padding: 19px 20px; border-bottom: 1px solid #444; align-items: center; justify-content: space-between; }
.brand-link { display: flex; text-decoration: none; align-items: center; gap: 10px; }
.brand-link span { font-weight: 700; letter-spacing: -.04em; }
.brand-link small { padding: 3px 5px 2px; color: var(--ink); background: var(--yellow); font-size: 9px; font-weight: 700; transform: rotate(-3deg); }
.sidebar-close { display: none; color: var(--white); }
.primary-nav { overflow-y: auto; padding: 19px 12px; }
.nav-label { margin: 15px 12px 7px; color: #888; font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.primary-nav a { display: flex; min-height: 43px; margin: 3px 0; padding: 9px 12px; border: 2px solid transparent; text-decoration: none; align-items: center; gap: 11px; }
.primary-nav a:hover { color: var(--yellow); background: #292929; }
.primary-nav a.active { color: var(--ink); background: var(--yellow); border-color: var(--ink); box-shadow: 3px 3px 0 var(--blue); font-weight: 700; }
.nav-icon { display: grid; width: 23px; height: 23px; border: 1px solid currentColor; place-items: center; font-size: 12px; font-weight: 700; }
.nav-count { margin-left: auto; min-width: 21px; padding: 1px 5px; text-align: center; color: var(--white); background: var(--red); border-radius: 20px; font-size: 10px; }
.sidebar-foot { display: grid; margin-top: auto; padding: 15px 18px 20px; border-top: 1px solid #444; gap: 7px; }
.site-link, .logout-button { display: flex; width: 100%; min-height: 36px; padding: 7px 5px; color: #d8d8d8; background: transparent; border: 0; text-decoration: none; justify-content: space-between; }
.logout-button { justify-content: flex-start; gap: 10px; }
.site-link:hover, .logout-button:hover { color: var(--yellow); }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 50; top: 0; display: flex; min-height: 88px; padding: 15px clamp(20px, 4vw, 52px); background: rgba(245, 243, 235, .96); border-bottom: 2px solid var(--ink); backdrop-filter: blur(8px); align-items: center; gap: 18px; }
.topbar h1 { margin: 0; font-size: 23px; line-height: 1; letter-spacing: -.025em; }
.topbar-eyebrow { margin: 0 0 5px; color: var(--ink-soft); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.topbar-actions { display: flex; margin-left: auto; align-items: center; gap: 18px; }
.connection-status { display: flex; color: var(--ink-soft); font-size: 11px; align-items: center; gap: 6px; }
.connection-status span { width: 7px; height: 7px; background: var(--green-bright); border-radius: 50%; box-shadow: 0 0 0 3px rgba(38, 164, 73, .16); }
.connection-status.offline span { background: var(--red); box-shadow: 0 0 0 3px rgba(233, 51, 35, .16); }
.menu-button { display: none; }
.content { width: min(100%, 1580px); margin: 0 auto; padding: clamp(28px, 4vw, 52px); }
.view { animation: view-in .2s ease-out; }
@keyframes view-in { from { opacity: .25; transform: translateY(5px); } }

/* Common controls */
.button { display: inline-flex; min-height: 42px; padding: 9px 16px; border: 2px solid var(--ink); align-items: center; justify-content: center; gap: 9px; font-size: 13px; font-weight: 700; text-decoration: none; }
.button-primary { color: var(--white); background: var(--blue); box-shadow: 3px 3px 0 var(--ink); }
.button-primary:hover { background: var(--blue-dark); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.button-secondary { background: var(--white); }
.button-secondary:hover { color: var(--white); background: var(--ink); }
.button-ghost { background: transparent; border-color: transparent; }
.button-ghost:hover { background: #e7e4d9; border-color: var(--line); }
.button-danger { color: var(--white); background: var(--red); box-shadow: 3px 3px 0 var(--ink); }
.button-large { min-height: 50px; padding: 12px 18px; }
.button-block { width: 100%; }
.icon-button { display: inline-grid; width: 40px; height: 40px; padding: 0; background: transparent; border: 2px solid transparent; place-items: center; font-weight: 700; }
.icon-button:hover { border-color: currentColor; }
.text-button { padding: 3px 0; color: var(--blue-dark); background: transparent; border: 0; border-bottom: 1px solid currentColor; font-size: 12px; font-weight: 700; }
.danger-text { color: var(--red) !important; }
.section-heading, .hero-heading { display: flex; margin-bottom: 26px; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading h2, .hero-heading h2 { margin: 0; font-size: clamp(30px, 3.4vw, 47px); line-height: 1; letter-spacing: -.05em; }
.section-heading .muted, .hero-heading .muted { margin: 9px 0 0; }
.panel { background: var(--white); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.panel-heading { display: flex; min-height: 72px; padding: 18px 20px; border-bottom: 2px solid var(--ink); align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading h3 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.panel-heading p { margin-bottom: 3px; }
.filter-bar { display: flex; margin-bottom: 18px; padding: 12px; background: #e8e5db; border: 2px solid var(--ink); align-items: center; gap: 9px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { min-height: 40px; border: 1px solid var(--line-dark); }
.filter-bar > label:not(.search-field) { width: min(220px, 100%); }
.search-field { position: relative; display: flex; min-width: 220px; flex: 1; align-items: center; }
.search-field > span:not(.sr-only) { position: absolute; left: 12px; z-index: 1; font-size: 19px; }
.search-field input { padding-left: 37px; }
.reset-filter { margin: 0 5px; }
.char-count { position: absolute; right: 8px; bottom: 7px; color: var(--ink-soft); background: var(--white); font-size: 10px; }

/* Dashboard */
.metric-grid { display: grid; margin-bottom: 28px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.metric-card { position: relative; overflow: hidden; min-height: 150px; padding: 19px; border: 2px solid var(--ink); box-shadow: var(--shadow); }
.metric-card::after { position: absolute; width: 85px; height: 85px; right: -35px; bottom: -35px; content: ''; background: rgba(255, 255, 255, .23); border: 2px solid var(--ink); border-radius: 50%; }
.metric-card p { margin: 0; font-size: 12px; font-weight: 700; }
.metric-card strong { display: block; margin: 15px 0 8px; font-size: clamp(31px, 4vw, 47px); line-height: .8; letter-spacing: -.055em; }
.metric-card small { font-size: 10px; }
.metric-blue { color: var(--white); background: var(--blue); }
.metric-yellow { background: var(--yellow); }
.metric-green { color: var(--white); background: var(--green); }
.metric-orange { background: var(--orange); }
.skeleton-card { min-height: 150px; background: linear-gradient(100deg, #ddd9ce 35%, #eeece5 48%, #ddd9ce 62%); background-size: 300% 100%; animation: skeleton 1.2s infinite; }
@keyframes skeleton { to { background-position-x: -150%; } }
.dashboard-grid { display: grid; margin-bottom: 26px; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 22px; }
.activity-list { min-height: 270px; padding: 5px 20px; }
.activity-item { display: grid; padding: 15px 0; border-bottom: 1px solid var(--line); grid-template-columns: 37px 1fr auto; gap: 12px; align-items: center; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { display: grid; width: 34px; height: 34px; background: var(--yellow); border: 1px solid var(--ink); place-items: center; font-weight: 700; }
.activity-item p { margin: 0; }
.activity-item small, .activity-time { color: var(--ink-soft); font-size: 10px; }
.quick-actions { display: grid; padding: 12px; gap: 8px; }
.quick-actions button { display: grid; min-height: 68px; padding: 10px; text-align: left; background: var(--paper); border: 1px solid var(--line-dark); grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; }
.quick-actions button:hover { border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); transform: translate(-1px, -1px); }
.quick-actions b { display: grid; width: 35px; height: 35px; color: var(--white); background: var(--blue); place-items: center; }
.quick-actions span { display: grid; }
.quick-actions small { color: var(--ink-soft); font-size: 10px; }
.loading-block { position: relative; }
.loading-block::after { position: absolute; inset: 25px; content: ''; background: linear-gradient(100deg, #ebe9e2 35%, #f7f6f1 48%, #ebe9e2 62%); background-size: 300% 100%; animation: skeleton 1.2s infinite; }

/* Tables and lists */
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-soft); background: #eceae2; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:hover { background: #faf8f1; }
tbody tr:last-child td { border-bottom: 0; }
.table-title { display: grid; min-width: 210px; grid-template-columns: 54px 1fr; align-items: center; gap: 11px; }
.table-title img, .thumb-placeholder { width: 54px; height: 43px; background: var(--green); border: 1px solid var(--ink); object-fit: cover; }
.table-title strong { display: -webkit-box; overflow: hidden; max-width: 390px; font-size: 13px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.table-title small { color: var(--ink-soft); font-size: 10px; }
.status-badge { display: inline-flex; padding: 4px 8px; border: 1px solid var(--ink); align-items: center; gap: 5px; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.status-badge::before { width: 6px; height: 6px; content: ''; background: currentColor; border-radius: 50%; }
.status-published { color: #155b27; background: #dff1df; }
.status-draft { color: #76580b; background: #fff2b4; }
.status-trash { color: #7d2119; background: #ffe4df; }
.tag { display: inline-block; padding: 3px 7px; color: var(--white); background: var(--blue); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.row-actions { display: flex; white-space: nowrap; gap: 4px; }
.row-actions button { width: 31px; height: 31px; padding: 0; background: var(--white); border: 1px solid var(--line-dark); font-size: 12px; font-weight: 700; }
.row-actions button:hover { color: var(--white); background: var(--ink); border-color: var(--ink); }
.reorder-actions { display: flex; gap: 3px; }
.reorder-actions button { width: 27px; height: 27px; padding: 0; background: transparent; border: 1px solid var(--line-dark); }
.bulk-bar { display: flex; min-height: 50px; padding: 9px 16px; color: var(--white); background: var(--blue-dark); align-items: center; gap: 18px; }
.bulk-bar button { color: var(--white); background: transparent; border: 0; border-bottom: 1px solid currentColor; font-size: 11px; }
.pagination { display: flex; min-height: 62px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: center; justify-content: flex-end; gap: 4px; }
.pagination button { min-width: 35px; height: 35px; background: var(--white); border: 1px solid var(--line-dark); }
.pagination button[aria-current="page"] { color: var(--white); background: var(--blue); border-color: var(--ink); font-weight: 700; }
.pagination .page-summary { margin-right: auto; color: var(--ink-soft); font-size: 11px; }
.empty-state { display: grid; min-height: 260px; padding: 35px; text-align: center; place-items: center; align-content: center; }
.empty-state b { display: grid; width: 55px; height: 55px; margin-bottom: 13px; color: var(--white); background: var(--blue); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--yellow); place-items: center; font-size: 25px; }
.empty-state h3 { margin: 4px; }
.empty-state p { margin: 4px 0 17px; color: var(--ink-soft); }
.error-state b { background: var(--red); }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(250px, .6fr); gap: 22px; align-items: start; }
.taxonomy-note { padding: 28px; background: var(--yellow); }
.taxonomy-note .big-hash { display: block; font-size: 77px; font-weight: 700; line-height: .8; }
.taxonomy-note h3 { font-size: 27px; line-height: 1; letter-spacing: -.04em; }

/* Posts, featured, media */
.post-admin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.post-card { overflow: hidden; background: var(--white); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.post-card-image { position: relative; aspect-ratio: 4 / 3; background: var(--green); border-bottom: 2px solid var(--ink); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card-image .status-badge { position: absolute; top: 9px; left: 9px; }
.post-card-body { padding: 13px; }
.post-card-body p { display: -webkit-box; overflow: hidden; min-height: 42px; margin: 0 0 10px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.post-card-foot { display: flex; padding-top: 10px; border-top: 1px solid var(--line); align-items: center; justify-content: space-between; }
.post-card-foot small { color: var(--ink-soft); }
.featured-layout { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, .82fr); gap: 24px; align-items: start; }
.featured-picker .search-field { margin: 14px; }
.featured-list { overflow-y: auto; max-height: 540px; padding: 0 14px 14px; }
.featured-option { display: grid; width: 100%; margin-top: 9px; padding: 8px; text-align: left; background: var(--white); border: 2px solid var(--line); grid-template-columns: 70px 1fr 22px; gap: 10px; align-items: center; }
.featured-option:hover, .featured-option.selected { border-color: var(--blue); background: #edf0ff; }
.featured-option img, .featured-option .thumb-placeholder { width: 70px; height: 55px; object-fit: cover; }
.featured-option span { display: grid; }
.featured-option small { color: var(--ink-soft); }
.featured-radio { width: 16px; height: 16px; border: 2px solid var(--ink); border-radius: 50%; }
.selected .featured-radio { border: 4px solid var(--blue); background: var(--yellow); }
.featured-editor { position: sticky; top: 112px; }
.featured-editor > .field { margin: 18px; }
.featured-editor > .button { width: calc(100% - 36px); margin: 0 18px 18px; }
.featured-preview { position: relative; min-height: 290px; margin: 18px; overflow: hidden; color: var(--white); background: var(--green); border: 2px solid var(--ink); }
.featured-preview img { width: 100%; height: 210px; object-fit: cover; }
.featured-preview div { padding: 14px; color: var(--ink); background: var(--yellow); }
.featured-preview p { margin: 0; font-weight: 700; }
.empty-preview { display: grid; place-items: center; }
.media-toolbar .view-switch { display: flex; margin-left: auto; }
.view-switch button { width: 40px; height: 40px; background: var(--white); border: 1px solid var(--line-dark); }
.view-switch button.active { color: var(--white); background: var(--ink); }
.media-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.media-grid.list-view { display: block; }
.media-item { position: relative; overflow: hidden; background: var(--white); border: 2px solid var(--ink); }
.media-item-image { aspect-ratio: 1 / 1; background: #dedbd0; border-bottom: 1px solid var(--ink); }
.media-item-image img { width: 100%; height: 100%; object-fit: cover; }
.media-item-info { padding: 9px; }
.media-item-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.media-item-info small { color: var(--ink-soft); font-size: 9px; }
.media-item-actions { position: absolute; top: 6px; right: 6px; display: flex; opacity: 0; gap: 4px; }
.media-item:hover .media-item-actions, .media-item:focus-within .media-item-actions { opacity: 1; }
.media-item-actions button { width: 31px; height: 31px; padding: 0; color: var(--white); background: var(--ink); border: 1px solid var(--white); }
.list-view .media-item { display: grid; margin-bottom: 8px; grid-template-columns: 76px 1fr; }
.list-view .media-item-image { width: 76px; aspect-ratio: 1; border: 0; border-right: 1px solid var(--ink); }
.list-view .media-item-info { align-self: center; }

/* Analytics and audit */
.date-filters label:not(.search-field) { display: flex; width: auto; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; }
.analytics-grid { display: grid; margin-bottom: 25px; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); gap: 22px; }
.chart-panel { min-height: 400px; }
.chart-legend { display: flex; font-size: 10px; gap: 13px; }
.chart-legend span::before { display: inline-block; width: 8px; height: 8px; margin-right: 5px; content: ''; background: var(--blue); }
.chart-legend span:nth-child(2)::before { background: var(--orange); }
.svg-chart { min-height: 310px; padding: 20px; }
.svg-chart svg { display: block; width: 100%; height: 270px; overflow: visible; }
.chart-grid-line { stroke: #d9d6cd; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#chart-gradient); }
.chart-dot { fill: var(--yellow); stroke: var(--ink); stroke-width: 1.5; }
.chart-label { fill: var(--ink-soft); font-family: var(--font); font-size: 10px; }
.bar-chart { display: flex; min-height: 310px; padding: 25px; flex-direction: column; justify-content: center; gap: 18px; }
.bar-item { display: grid; grid-template-columns: 84px 1fr 35px; align-items: center; gap: 9px; font-size: 11px; }
.bar-track { height: 18px; background: #e5e2d9; border: 1px solid var(--line-dark); }
.bar-fill { height: 100%; min-width: 2px; background: var(--blue); }
.bar-item:nth-child(2) .bar-fill { background: var(--green-bright); }
.bar-item:nth-child(3) .bar-fill { background: var(--orange); }
.audit-list { padding: 4px 20px; }
.audit-item { display: grid; padding: 17px 0; border-bottom: 1px solid var(--line); grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.audit-item:last-child { border: 0; }
.audit-mark { display: grid; width: 38px; height: 38px; background: var(--yellow); border: 1px solid var(--ink); place-items: center; font-weight: 700; }
.audit-item p { margin: 0; }
.audit-meta { text-align: right; color: var(--ink-soft); font-size: 10px; }

/* Dialogs and feedback */
.admin-dialog { width: min(94vw, 760px); max-height: min(90vh, 900px); padding: 0; color: var(--ink); background: var(--paper); border: 3px solid var(--ink); box-shadow: 10px 10px 0 rgba(0, 0, 0, .45); }
.admin-dialog::backdrop { background: rgba(23, 23, 23, .74); backdrop-filter: blur(2px); }
.editor-dialog { width: min(95vw, 920px); }
.admin-dialog form { margin: 0; }
.dialog-header { display: flex; min-height: 80px; padding: 17px 22px; background: var(--yellow); border-bottom: 3px solid var(--ink); align-items: center; justify-content: space-between; }
.dialog-header h2 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.dialog-content { overflow-y: auto; max-height: calc(90vh - 160px); padding: 22px; }
.dialog-footer { display: flex; min-height: 74px; padding: 14px 22px; background: var(--white); border-top: 2px solid var(--ink); align-items: center; justify-content: flex-end; gap: 9px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 17px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-section-title { grid-column: 1 / -1; margin: 10px 0 15px; padding-top: 15px; border-top: 1px solid var(--line); font-size: 13px; }
.url-preview-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.inline-actions { display: flex; margin-top: 5px; gap: 7px; }
.image-preview { position: relative; display: grid; min-height: 190px; overflow: hidden; color: var(--ink-soft); background: #dfdcd2; border: 2px dashed var(--line-dark); place-items: center; }
.image-preview img { width: 100%; max-height: 290px; object-fit: cover; }
.image-preview.loading::after { position: absolute; inset: 0; display: grid; content: 'Processando…'; color: var(--white); background: rgba(23, 23, 23, .68); place-items: center; font-weight: 700; }
.confirm-dialog { width: min(92vw, 450px); padding: 30px; text-align: center; background: var(--white); }
.confirm-mark { display: grid; width: 58px; height: 58px; margin: 0 auto 18px; color: var(--white); background: var(--red); border: 2px solid var(--ink); box-shadow: var(--shadow); place-items: center; font-size: 31px; font-weight: 700; transform: rotate(-4deg); }
.confirm-dialog h2 { margin: 0; font-size: 28px; }
.confirm-dialog p { color: var(--ink-soft); }
.confirm-actions { display: flex; margin-top: 25px; justify-content: center; gap: 10px; }
.upload-dialog { width: min(94vw, 680px); }
.drop-zone { display: grid; min-height: 260px; padding: 35px; text-align: center; background: var(--white); border: 3px dashed var(--blue); place-items: center; align-content: center; cursor: pointer; }
.drop-zone.dragging { background: #e9edff; border-style: solid; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone small { margin-top: 7px; color: var(--ink-soft); }
.upload-symbol { display: grid; width: 55px; height: 55px; margin-bottom: 12px; color: var(--white); background: var(--blue); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--yellow); place-items: center; font-size: 28px; }
.upload-queue { display: grid; margin-top: 12px; gap: 7px; }
.upload-file { display: grid; padding: 9px 11px; background: var(--white); border: 1px solid var(--line); grid-template-columns: 1fr auto; gap: 10px; }
.toast-region { position: fixed; z-index: 300; top: 18px; right: 18px; display: grid; width: min(390px, calc(100vw - 36px)); gap: 9px; }
.toast { display: grid; min-height: 59px; padding: 12px 14px; color: var(--white); background: var(--ink); border: 2px solid var(--white); box-shadow: 4px 4px 0 var(--blue); grid-template-columns: 25px 1fr auto; align-items: center; gap: 9px; animation: toast-in .18s ease-out; }
.toast.success { box-shadow: 4px 4px 0 var(--green-bright); }
.toast.error { box-shadow: 4px 4px 0 var(--red); }
.toast.warning { box-shadow: 4px 4px 0 var(--yellow); }
.toast p { margin: 0; font-size: 12px; }
.toast button { color: var(--white); background: transparent; border: 0; font-size: 20px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }
.button.is-loading, button.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.button.is-loading::after, button.is-loading::after { position: absolute; width: 17px; height: 17px; content: ''; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 0 rgba(0, 0, 0, .2); }
  .sidebar-close, .menu-button { display: inline-grid; }
  .sidebar-scrim { position: fixed; z-index: 70; inset: 0; display: block; background: rgba(0, 0, 0, .55); }
  .workspace { margin-left: 0; }
  .dashboard-grid, .analytics-grid, .featured-layout { grid-template-columns: 1fr; }
  .featured-editor { position: static; }
  .post-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .login-view { padding: 14px; }
  .login-panel { min-height: 0; grid-template-columns: 1fr; box-shadow: 7px 7px 0 rgba(23, 23, 23, .65); }
  .login-brand { min-height: 190px; padding: 25px; }
  .login-brand strong { font-size: 42px; }
  .brand-kicker { margin-bottom: 11px; }
  .brand-stamp { position: absolute; right: 25px; bottom: 25px; }
  .login-brand::before { width: 180px; height: 180px; left: -120px; top: -110px; }
  .login-brand::after { width: 80px; height: 80px; right: -40px; top: 15px; }
  .login-card { padding: 30px 24px; }
  .topbar { min-height: 72px; padding: 11px 15px; }
  .topbar h1 { font-size: 18px; }
  .connection-status, #quick-create { display: none; }
  .content { padding: 28px 15px 45px; }
  .section-heading, .hero-heading { align-items: stretch; flex-direction: column; }
  .section-heading .button, .hero-heading .button { align-self: flex-start; }
  .section-heading h2, .hero-heading h2 { font-size: 35px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 126px; padding: 14px; }
  .filter-bar { align-items: stretch; }
  .filter-bar > label, .filter-bar > label:not(.search-field), .filter-bar .search-field { width: 100%; }
  .reset-filter { align-self: center; }
  .split-layout { grid-template-columns: 1fr; }
  .post-admin-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .post-card-body { padding: 9px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .media-toolbar .view-switch { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field-wide { grid-column: auto; }
  .dialog-header { padding: 14px 16px; }
  .dialog-content { padding: 16px; }
  .dialog-footer { padding: 10px 12px; }
  .dialog-footer .button { padding-inline: 10px; }
  .table-title { min-width: 180px; }
  th, td { padding: 11px 10px; }
  .bulk-bar { overflow-x: auto; }
  .toast-region { top: 10px; right: 10px; width: calc(100vw - 20px); }
}

@media (max-width: 430px) {
  .metric-grid, .post-admin-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 115px; }
  .metric-card strong { margin: 10px 0 5px; }
  .panel-heading { padding: 14px; }
  .featured-preview { margin: 12px; }
  .featured-editor > .field { margin: 12px; }
  .featured-editor > .button { width: calc(100% - 24px); margin: 0 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .topbar, .filter-bar, .button, .row-actions, .toast-region { display: none !important; }
  .workspace { margin: 0; }
  .content { width: 100%; padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
}
