:root {
  --ink: #0b0d0e;
  --panel: #111315;
  --muted: #60666a;
  --line: #d9dddf;
  --surface: #f5f6f6;
  --orange: #ff5a0a;
  --green: #247a38;
  --white: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface); }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 {
  font-family: "Arial Narrow", Impact, sans-serif;
  font-stretch: condensed;
  text-transform: uppercase;
  letter-spacing: -.025em;
}
h1 { margin-bottom: 8px; font-size: clamp(38px, 4vw, 64px); line-height: .93; }
h2 { margin-bottom: 18px; font-size: 30px; line-height: 1; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 12px; color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); font-size: 12px; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--ink);
}
.auth-panel {
  width: min(440px, 100%);
  padding: 48px;
  background: var(--white);
  border-top: 5px solid var(--orange);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .36);
}
.auth-panel h1 { font-size: 48px; }
.auth-panel .field { margin-top: 20px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 182px minmax(0, 1fr); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 182px;
  display: flex;
  flex-direction: column;
  padding: 26px 14px 18px;
  color: #dfe2e3;
  background: var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 32px; color: var(--white); }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--orange);
  font: 900 23px/1 Impact, sans-serif;
  transform: skew(-8deg);
}
.brand strong { font-size: 15px; line-height: 1; letter-spacing: .05em; }
.brand small { display: block; margin-top: 5px; color: var(--orange); font-size: 8px; letter-spacing: .16em; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 0 12px;
  border-left: 2px solid transparent;
  color: #aeb3b5;
  font-size: 13px;
  font-weight: 700;
}
.sidebar nav a span { width: 18px; color: #7f8689; font-size: 17px; text-align: center; }
.sidebar nav a:hover, .sidebar nav a.active { color: var(--white); background: #191c1e; border-left-color: var(--orange); }
.sidebar nav a.active span { color: var(--orange); }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid #292d2f; font-size: 11px; }
.sidebar-foot span { display: block; overflow: hidden; margin-bottom: 8px; color: #aeb3b5; text-overflow: ellipsis; }
.sidebar-foot button { padding: 0; border: 0; color: var(--orange); background: transparent; cursor: pointer; font-weight: 800; }

.admin-main { grid-column: 2; min-width: 0; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 0 38px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.topbar a { color: var(--ink); font-weight: 800; }
.menu-toggle { display: none; }
.content { padding: 46px 52px 80px; }
.flash {
  margin: 20px 52px -20px;
  padding: 13px 16px;
  color: #174c25;
  background: #eaf6ed;
  border-left: 3px solid var(--green);
  font-size: 13px;
  font-weight: 700;
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.page-head h1 { margin-bottom: 6px; }
.page-head p:last-child { margin-bottom: 0; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.button-primary { color: var(--white); background: var(--orange); border-color: var(--orange); }
.button-primary:hover { background: #e84d00; }
.button-wide { width: 100%; margin-top: 24px; }

.metric-strip { display: grid; grid-template-columns: repeat(5, 1fr); margin: 6px 0 56px; border-block: 1px solid var(--line); background: var(--white); }
.metric-strip a { min-height: 112px; display: flex; flex-direction: column; justify-content: center; padding: 18px 24px; border-right: 1px solid var(--line); }
.metric-strip a:last-child { border-right: 0; }
.metric-strip a:hover { box-shadow: inset 0 -3px var(--orange); }
.metric-strip strong { font: 400 38px/1 "Arial Narrow", Impact, sans-serif; }
.metric-strip span { margin-top: 9px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 70px; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--orange); }
.steps li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.steps li > span { color: var(--orange); font: 400 32px/1 "Arial Narrow", Impact, sans-serif; }
.steps p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.status-panel { align-self: start; padding: 28px; color: var(--white); background: var(--ink); }
.status-panel .status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #38bd5c; }
.status-panel p { margin: 18px 0 24px; color: #abb0b2; font-size: 13px; line-height: 1.6; }
.status-panel a { color: var(--orange); font-size: 12px; font-weight: 800; }

.searchbar { max-width: 720px; display: flex; margin-bottom: 18px; }
.searchbar input { flex: 1; min-width: 0; height: 44px; padding: 0 15px; border: 1px solid var(--line); border-right: 0; background: var(--white); outline: none; }
.searchbar input:focus { border-color: var(--ink); }
.searchbar button { width: 90px; border: 0; color: var(--white); background: var(--ink); cursor: pointer; font-weight: 800; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th { padding: 14px 16px; color: var(--muted); background: #fafafa; border-bottom: 1px solid var(--line); font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .1em; }
td { height: 62px; padding: 12px 16px; border-bottom: 1px solid #eceeef; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fffaf7; }
td strong { display: block; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.row-action { color: var(--orange); font-weight: 800; white-space: nowrap; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 2px; background: #eceeef; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.badge-published, .badge-closed { color: #176126; background: #e6f6e9; }
.badge-draft, .badge-waiting { color: #855000; background: #fff0d5; }
.badge-new { color: #a33c00; background: #ffeadf; }
.badge-archived, .badge-spam { color: #666; background: #ededed; }
.badge-in-progress { color: #174c83; background: #e3f0ff; }
.empty { padding: 50px 20px; color: var(--muted); text-align: center; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(10, 12, 13, .38); }
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 31;
  width: min(760px, 100%);
  overflow-y: auto;
  padding: 28px 30px 110px;
  background: var(--white);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .18);
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; }
.drawer-close, .dialog-close { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); background: var(--white); font-size: 22px; cursor: pointer; }
.field { display: block; min-width: 0; margin-bottom: 17px; }
.field > span { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 800; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cfd3d5;
  border-radius: 2px;
  color: var(--ink);
  background: var(--white);
  outline: none;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255, 90, 10, .1); }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 9px; margin: 4px 0 22px; font-size: 12px; font-weight: 700; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px; background: var(--surface); border: 1px solid #cfd3d5; border-bottom: 0; }
.editor-toolbar button { min-width: 34px; min-height: 30px; padding: 0 8px; border: 1px solid var(--line); background: var(--white); cursor: pointer; font-size: 11px; }
.rich-editor { min-height: 230px; padding: 15px; border: 1px solid #cfd3d5; font-size: 14px; line-height: 1.65; outline: none; }
.rich-editor:focus { border-color: var(--orange); }
.rich-source { display: none; }
.seo-box { margin: 22px 0; padding: 18px; background: var(--surface); border-left: 3px solid var(--orange); }
.seo-box summary { margin-bottom: 18px; cursor: pointer; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.drawer-actions { position: fixed; right: 0; bottom: 0; z-index: 32; width: min(760px, 100%); display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 14px 30px; background: var(--white); border-top: 1px solid var(--line); }
.drawer-actions .field { margin: 0; }
.contact-summary { display: grid; gap: 10px; margin-bottom: 30px; padding: 20px; background: var(--ink); color: var(--white); }
.contact-summary a { color: var(--orange); font-size: 22px; font-weight: 900; }
.contact-summary span { color: #aeb3b5; }
.contact-summary p { margin: 8px 0 0; padding-top: 14px; border-top: 1px solid #333; color: #dfe2e3; line-height: 1.6; }

.settings-form { max-width: 820px; }
.settings-form section { margin-bottom: 26px; padding: 28px; background: var(--white); border: 1px solid var(--line); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-grid article { min-width: 0; padding: 10px; background: var(--white); border: 1px solid var(--line); }
.media-grid article > div { height: 150px; display: grid; place-items: center; margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.media-grid img { width: 100%; height: 100%; object-fit: contain; }
.media-grid strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.media-grid p { height: 30px; margin: 6px 0; overflow: hidden; color: var(--muted); font-size: 10px; }
.media-grid button { padding: 0; border: 0; color: var(--orange); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.upload-dialog { width: min(460px, calc(100% - 30px)); padding: 0; border: 0; box-shadow: 0 24px 80px rgba(0, 0, 0, .3); }
.upload-dialog::backdrop { background: rgba(0, 0, 0, .48); }
.upload-dialog form { position: relative; padding: 38px; }
.dialog-close { position: absolute; top: 16px; right: 16px; }
.alert, .flash { font-size: 12px; }
.alert { margin: 18px 0; padding: 12px; border-left: 3px solid; }
.alert-error { color: #8a2100; background: #fff0eb; border-color: var(--orange); }
.alert-success { color: #174c25; background: #eaf6ed; border-color: var(--green); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  .admin-main { grid-column: 1; }
  .menu-toggle { display: block; margin-right: auto; border: 0; background: transparent; font-size: 22px; }
  .topbar { padding: 0 20px; }
  .content { padding: 32px 20px 60px; }
  .flash { margin: 16px 20px -12px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip a { border-bottom: 1px solid var(--line); }
  .welcome-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 620px) {
  .topbar span { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head .button { width: 100%; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip a { min-height: 94px; padding: 14px; }
  .metric-strip strong { font-size: 30px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .drawer { padding-inline: 20px; }
  .drawer-actions { grid-template-columns: 1fr; padding-inline: 20px; }
  .drawer-actions .field span { display: none; }
  .auth-panel { padding: 34px 24px; }
}
/* Editor visual y biblioteca multimedia */
.rich-field { margin-top: 4px; }
.rich-field-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.rich-field-head > span { font-size: 11px; font-weight: 800; }
.editor-mode { display: inline-flex; padding: 3px; background: #eceeef; border-radius: 4px; }
.editor-mode button { min-height: 30px; padding: 0 12px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.editor-mode button.is-active { color: var(--ink); background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.editor-toolbar { position: sticky; top: 0; z-index: 3; align-items: center; gap: 5px; padding: 9px; background: #f2f3f3; }
.editor-toolbar button { min-width: 36px; min-height: 32px; border-radius: 2px; font-weight: 700; }
.editor-toolbar button:hover, .editor-toolbar button:focus-visible { border-color: var(--orange); color: var(--orange); outline: none; }
.toolbar-separator { width: 1px; height: 22px; margin: 0 2px; background: var(--line); }
.rich-editor { min-height: 360px; max-height: 62vh; overflow-y: auto; background: var(--white); font-size: 15px; line-height: 1.7; }
.rich-editor:empty::before { color: #969b9e; content: attr(data-placeholder); pointer-events: none; }
.rich-editor h2, .rich-editor h3 { margin: 1.35em 0 .55em; font-family: inherit; text-transform: none; letter-spacing: normal; line-height: 1.25; }
.rich-editor h2 { font-size: 25px; }
.rich-editor h3 { font-size: 20px; }
.rich-editor p, .rich-editor ul, .rich-editor ol, .rich-editor blockquote { margin: 0 0 1em; }
.rich-editor blockquote { padding: 12px 18px; border-left: 3px solid var(--orange); background: #fff7f2; }
.rich-editor a { color: #bd4100; text-decoration: underline; }
.rich-editor.is-dragging { border-color: var(--orange); background: #fff7f2; box-shadow: inset 0 0 0 2px var(--orange); }
.rich-source { width: 100%; min-height: 420px; padding: 16px; resize: vertical; border: 1px solid #cfd3d5; color: #e7eaeb; background: #151819; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2; }
.rich-field[data-editor-view="visual"] .rich-source { display: none; }
.rich-field[data-editor-view="html"] .rich-editor, .rich-field[data-editor-view="html"] .editor-toolbar { display: none; }
.rich-field[data-editor-view="html"] .rich-source { display: block; }
.editor-hint { display: block; min-height: 18px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.editor-hint[data-state="loading"], .media-inline-status[data-state="loading"], .media-upload-status[data-state="loading"] { color: #9a5300; }
.editor-hint[data-state="success"], .media-inline-status[data-state="success"], .media-upload-status[data-state="success"] { color: var(--green); }
.editor-hint[data-state="error"], .media-inline-status[data-state="error"], .media-upload-status[data-state="error"] { color: #a72800; }
.content-media { margin: 24px 0; text-align: center; }
.content-media img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.content-media figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; }

.media-field { margin: 4px 0 20px; padding: 16px; border: 1px solid var(--line); background: #fafafa; }
.media-field-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.media-field-head > div { display: grid; gap: 3px; }
.media-field-head strong { font-size: 12px; }
.media-field-head span { color: var(--muted); font-size: 10px; }
.media-library-button { min-height: 36px; padding-inline: 12px; border-color: var(--line); background: var(--white); font-size: 11px; }
.media-dropzone { position: relative; min-height: 210px; display: grid; place-items: center; overflow: hidden; border: 2px dashed #c7ccce; background: var(--white); cursor: pointer; outline: none; transition: border-color .15s ease, background .15s ease; }
.media-dropzone:hover, .media-dropzone:focus-visible, .media-dropzone.is-dragging { border-color: var(--orange); background: #fff7f2; }
.media-dropzone img { width: 100%; height: 250px; display: block; object-fit: contain; background: var(--white); }
.media-drop-copy { display: grid; justify-items: center; gap: 5px; padding: 30px; text-align: center; }
.media-drop-copy strong { font-size: 14px; }
.media-drop-copy span, .media-drop-copy small { color: var(--muted); font-size: 11px; }
.media-replace { position: absolute; right: 10px; bottom: 10px; min-height: 34px; padding: 0 12px; border: 0; color: var(--white); background: rgba(11, 13, 14, .88); cursor: pointer; font-size: 11px; font-weight: 800; }
.media-inline-status, .media-upload-status { min-height: 18px; margin: 7px 0 0; font-size: 11px; }
.media-alt-field { margin: 12px 0 0; }
.media-url-details { margin-top: 10px; }
.media-url-details summary { color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700; }
.media-url-input { width: 100%; min-height: 40px; margin-top: 8px; padding: 9px 11px; border: 1px solid #cfd3d5; font-size: 11px; }

.media-picker-dialog { width: min(1120px, calc(100% - 36px)); height: min(760px, calc(100vh - 36px)); max-width: none; max-height: none; padding: 0; border: 0; background: var(--white); box-shadow: 0 24px 90px rgba(0, 0, 0, .34); }
.media-picker-dialog::backdrop { background: rgba(6, 8, 9, .66); }
.media-picker-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.media-picker-shell > header { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 28px 20px; border-bottom: 1px solid var(--line); }
.media-picker-shell > header h2 { margin-bottom: 0; }
.media-picker-shell > header .eyebrow { margin-bottom: 8px; }
.media-picker-body { min-height: 0; display: grid; grid-template-columns: 330px minmax(0, 1fr); }
.media-upload-panel { padding: 24px; overflow-y: auto; background: #f6f7f7; border-right: 1px solid var(--line); }
.media-upload-panel h3, .media-library-panel h3 { margin: 0 0 16px; font-size: 14px; }
.media-upload-drop { min-height: 190px; display: grid; place-items: center; align-content: center; gap: 7px; margin-bottom: 18px; padding: 24px; border: 2px dashed #bfc5c7; background: var(--white); cursor: pointer; text-align: center; }
.media-upload-drop:hover, .media-upload-drop.is-dragging { border-color: var(--orange); background: #fff7f2; }
.media-upload-drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.media-upload-drop strong { max-width: 100%; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.media-upload-drop span, .media-upload-drop small { color: var(--muted); font-size: 10px; }
.media-library-panel { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 24px; }
.media-library-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.media-library-head input { width: min(300px, 48%); min-height: 40px; padding: 0 12px; border: 1px solid #cfd3d5; outline: none; }
.media-library-head input:focus { border-color: var(--orange); }
.media-library-grid { min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; gap: 12px; overflow-y: auto; padding: 2px 4px 20px 2px; }
.media-choice { min-width: 0; padding: 8px; border: 1px solid var(--line); background: var(--white); cursor: pointer; text-align: left; }
.media-choice:hover, .media-choice:focus-visible { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255, 90, 10, .12); outline: none; }
.media-choice > span { height: 110px; display: grid; place-items: center; margin-bottom: 8px; overflow: hidden; background: var(--surface); }
.media-choice img { width: 100%; height: 100%; object-fit: contain; }
.media-choice strong, .media-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-choice strong { font-size: 11px; }
.media-choice small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.media-library-empty { grid-column: 1 / -1; padding: 40px 10px; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  .rich-field-head, .media-field-head, .media-library-head { align-items: stretch; flex-direction: column; }
  .editor-mode { align-self: flex-start; }
  .media-library-button, .media-library-head input { width: 100%; }
  .rich-editor { min-height: 300px; }
  .media-picker-dialog { width: calc(100% - 14px); height: calc(100vh - 14px); }
  .media-picker-shell > header { padding: 18px; }
  .media-picker-body { grid-template-columns: 1fr; overflow-y: auto; }
  .media-upload-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .media-library-panel { min-height: 520px; }
  .media-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
}
