@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--accent: #4f46e5;
	--accent-ink: #fff;
	--accent-soft: color-mix(in srgb, var(--accent) 9%, #fff);
	--accent-line: color-mix(in srgb, var(--accent) 28%, #fff);
	--accent-strong: color-mix(in srgb, var(--accent) 82%, #000);
	--ring: color-mix(in srgb, var(--accent) 22%, transparent);

	--bg: #f6f6f7;
	--surface: #fff;
	--surface-2: #fafafa;
	--line: #e8e8eb;
	--line-strong: #d9d9de;
	--ink: #18181b;
	--ink-2: #3f3f46;
	--muted: #71717a;
	--faint: #a1a1aa;

	--ok: #15803d;
	--ok-soft: #ecfdf3;
	--warn: #b45309;
	--warn-soft: #fffbeb;
	--danger: #dc2626;
	--danger-soft: #fef2f2;
	--info: #2563eb;
	--info-soft: #eff6ff;

	--radius-sm: 7px;
	--radius: 10px;
	--radius-lg: 14px;
	--shadow-xs: 0 1px 2px rgba(24, 24, 27, .05);
	--shadow-sm: 0 1px 3px rgba(24, 24, 27, .06), 0 1px 2px rgba(24, 24, 27, .04);
	--shadow-md: 0 8px 24px -6px rgba(24, 24, 27, .12), 0 2px 6px rgba(24, 24, 27, .05);
	--shadow-lg: 0 24px 60px -12px rgba(24, 24, 27, .28);
	--sidebar: 260px;
	--topbar: 60px;
	font-size: 14.5px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.repeat-row.just-moved { animation: flash .9s ease-out; }

body.panel {
	margin: 0;
	font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-feature-settings: "cv11", "ss01";
	color: var(--ink);
	background: var(--bg);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { color: var(--ink); letter-spacing: -.015em; }
h1 { font-size: 1.6rem; line-height: 1.25; font-weight: 650; margin: 0 0 1.2rem; letter-spacing: -.025em; }
h2 { font-size: 1.02rem; font-weight: 620; margin: 0 0 .9rem; }
h3 { font-size: .92rem; font-weight: 620; margin: 0 0 .6rem; }
p { margin: 0 0 .8rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
::selection { background: var(--accent-line); }

.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.icon.sm { width: 15px; height: 15px; vertical-align: -3px; }
.icon.lg { width: 22px; height: 22px; }

/* ——— Estructura ——— */

.shell { min-height: 100vh; padding-left: var(--sidebar); }

.sidebar {
	position: fixed;
	inset: 0 auto 0 0;
	z-index: 40;
	width: var(--sidebar);
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border-right: 1px solid var(--line);
}
.brand {
	display: flex;
	align-items: center;
	gap: .7rem;
	height: var(--topbar);
	padding: 0 1.1rem;
	color: var(--ink);
	border-bottom: 1px solid transparent;
}
.brand:hover { color: var(--ink); }
.brand-mark {
	width: 32px;
	height: 32px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	overflow: hidden;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	font-size: .95rem;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.brand-text { min-width: 0; line-height: 1.2; }
.brand-name { display: block; font-weight: 650; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.brand-sub { display: block; font-size: .74rem; color: var(--muted); }

.sidenav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; }
.nav-group + .nav-group { margin-top: 1.1rem; }
.nav-label { padding: 0 .65rem .35rem; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.sidenav a {
	position: relative;
	display: flex;
	align-items: center;
	gap: .7rem;
	height: 36px;
	padding: 0 .65rem;
	margin-bottom: 2px;
	border-radius: 8px;
	color: var(--ink-2);
	font-weight: 500;
	font-size: .92rem;
	transition: background .12s, color .12s;
}
.sidenav a .icon { color: var(--faint); transition: color .12s; }
.sidenav a:hover { background: #f4f4f5; color: var(--ink); }
.sidenav a:hover .icon { color: var(--ink-2); }
.sidenav a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.sidenav a.active .icon { color: var(--accent); }
.nav-count {
	margin-left: auto;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	display: inline-grid;
	place-items: center;
	background: var(--accent);
	color: var(--accent-ink);
	font-size: .72rem;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.sidebar-foot { padding: .75rem; border-top: 1px solid var(--line); }
.user-card { position: relative; }
.user-card > summary {
	list-style: none;
	display: flex;
	align-items: center;
	gap: .65rem;
	padding: .45rem .5rem;
	border-radius: 9px;
	cursor: pointer;
}
.user-card > summary::-webkit-details-marker { display: none; }
.user-card > summary:hover, .user-card[open] > summary { background: #f4f4f5; }
.avatar {
	width: 32px;
	height: 32px;
	border-radius: 999px;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	background: linear-gradient(135deg, var(--accent-soft), var(--accent-line));
	color: var(--accent-strong);
	font-weight: 650;
	font-size: .8rem;
}
.user-meta { min-width: 0; flex: 1; line-height: 1.25; }
.user-meta strong { display: block; font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: .75rem; color: var(--muted); }
.user-card > summary > .icon { color: var(--faint); }
.menu {
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(100% + 6px);
	padding: .35rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
}
.menu a, .menu button {
	display: flex;
	align-items: center;
	gap: .6rem;
	width: 100%;
	padding: .5rem .6rem;
	border: 0;
	border-radius: 7px;
	background: none;
	color: var(--ink-2);
	font: inherit;
	font-size: .88rem;
	text-align: left;
	cursor: pointer;
}
.menu a:hover, .menu button:hover { background: #f4f4f5; color: var(--ink); }
.menu .icon { color: var(--muted); }
.menu form { margin: 0; }

.topbar {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: .75rem;
	height: var(--topbar);
	padding: 0 2rem;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid transparent;
	transition: border-color .15s, background .15s;
}
.topbar.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--surface) 86%, transparent); }
.crumbs { display: flex; align-items: center; gap: .4rem; min-width: 0; color: var(--muted); font-size: .88rem; }
.crumbs .icon { color: var(--faint); }
.crumbs strong { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.nav-toggle { display: none; }

.main { padding: .75rem 2rem 3rem; max-width: 1320px; }
.main > h1:first-child, .main > .alert + h1 { margin-top: .4rem; }

/* ——— Bloques ——— */

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 1.35rem 1.4rem;
	margin-bottom: 1.1rem;
	box-shadow: var(--shadow-xs);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .table-wrap, .table-wrap { overflow-x: auto; }
.card.narrow, .narrow { max-width: 780px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.05rem 1.3rem .85rem; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: .98rem; }
.card-head .sub { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: .1rem; letter-spacing: 0; }
.card-head a { font-size: .85rem; font-weight: 500; display: inline-flex; align-items: center; gap: .2rem; }
.card-foot { padding: .8rem 1.3rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.section-title { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.4rem 0 .8rem; }
.section-title:first-child { margin-top: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .4rem 0 1.4rem; }
.page-head h1 { margin: 0; }
.page-head .lead { color: var(--muted); margin: .3rem 0 0; font-size: .92rem; }
.page-head .btn-row { margin-left: auto; }
.small-head { margin: 0 0 .8rem; align-items: center; }
.small-head h2 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: .9rem; }
.grid-4 { display: grid; grid-template-columns: 1.4fr 1fr 1fr .6fr; gap: .9rem; }
.grid-5 { display: grid; grid-template-columns: 1.4fr 1fr 1fr .6fr .6fr; gap: .9rem; }
.grid-2.tight { gap: .9rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; }
.span-2 { grid-column: 1 / -1; }

/* ——— Formularios ——— */

label { display: block; margin-bottom: 1rem; font-weight: 550; font-size: .87rem; color: var(--ink-2); }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 450; color: var(--ink); cursor: pointer; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=search], input[type=tel], input[type=date], input[type=datetime-local], select, textarea {
	display: block;
	width: 100%;
	margin-top: .38rem;
	padding: .55rem .75rem;
	min-height: 38px;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	font: inherit;
	font-size: .92rem;
	font-weight: 400;
	background: var(--surface);
	color: var(--ink);
	box-shadow: var(--shadow-xs);
	transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #c4c4cc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
select {
	appearance: none;
	padding-right: 2.2rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .7rem center;
}
select[multiple] { background-image: none; padding-right: .75rem; }
textarea { min-height: 90px; line-height: 1.55; resize: vertical; }
textarea.code, textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82rem; background: #fcfcfd; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
input[type=file] { font: inherit; font-size: .85rem; }
.color-row { display: flex; align-items: center; gap: .5rem; margin-top: .38rem; }
.color-row input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
.color-row label.check { margin: 0; }

.input-title { font-size: 1.3rem !important; font-weight: 600 !important; letter-spacing: -.015em; padding: .7rem .85rem !important; }
.big-label { font-size: .92rem; }
.slug-row { display: flex; align-items: center; gap: .2rem; margin-top: .38rem; border: 1px solid var(--line-strong); border-radius: 8px; padding-left: .75rem; background: var(--surface-2); box-shadow: var(--shadow-xs); }
.slug-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.slug-row input { margin: 0; border: 0; box-shadow: none !important; border-radius: 0 8px 8px 0; min-height: 36px; }
.slug-row .muted { white-space: nowrap; font-weight: 400; font-size: .84rem; max-width: 50%; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 500; margin: -.7rem 0 .9rem; display: flex; align-items: center; gap: .3rem; }
label:has(+ .field-error) input, label:has(+ .field-error) select, label:has(+ .field-error) textarea { border-color: #fca5a5; }
.hint { color: var(--muted); font-size: .82rem; font-weight: 400; margin: -.55rem 0 1rem; line-height: 1.45; }
label .hint { margin: .35rem 0 0; }
.form-foot { margin-top: 1.2rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.sticky-foot {
	position: sticky;
	bottom: 0;
	z-index: 5;
	display: flex;
	gap: .6rem;
	align-items: center;
	justify-content: flex-end;
	margin: 1rem -2rem -3rem;
	padding: .85rem 2rem;
	background: color-mix(in srgb, var(--surface) 90%, transparent);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-top: 1px solid var(--line);
}
.sticky-foot .muted { margin-right: auto; font-size: .85rem; }
label.short { max-width: 240px; }
.input-sm { padding: .35rem .6rem !important; min-height: 32px !important; font-size: .85rem !important; margin-top: .4rem; }

/* ——— Botones ——— */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .45rem;
	height: 38px;
	padding: 0 .95rem;
	border: 1px solid transparent;
	border-radius: 8px;
	font: inherit;
	font-size: .9rem;
	font-weight: 550;
	line-height: 1;
	cursor: pointer;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background .12s, border-color .12s, box-shadow .12s, color .12s, transform .06s;
}
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn .icon { width: 16px; height: 16px; vertical-align: 0; }
.btn-primary {
	background: var(--accent);
	color: var(--accent-ink);
	box-shadow: 0 1px 2px rgba(24, 24, 27, .12), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { background: #f8f8f9; color: var(--ink); border-color: #c9c9d0; }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: rgba(24, 24, 27, .05); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 .7rem; font-size: .84rem; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn-stack { display: grid; gap: .5rem; margin: .9rem 0; }
button.link { background: none; border: 0; padding: 0; color: var(--accent-strong); cursor: pointer; font: inherit; }
button.link:hover { color: var(--accent); }
.danger, button.link.danger, a.danger { color: var(--danger) !important; }
form.inline { display: inline; }

/* ——— Avisos ——— */

.alert {
	display: flex;
	align-items: flex-start;
	gap: .65rem;
	padding: .8rem 1rem;
	border-radius: var(--radius);
	margin: .4rem 0 1.1rem;
	border: 1px solid;
	font-size: .9rem;
	box-shadow: var(--shadow-xs);
}
.alert .icon { margin-top: 1px; }
.alert-ok { background: var(--ok-soft); border-color: #bbf7d0; color: #14532d; }
.alert-error { background: var(--danger-soft); border-color: #fecaca; color: #7f1d1d; }
.alert-info { background: var(--info-soft); border-color: #bfdbfe; color: #1e3a8a; }
.alert-warn { background: var(--warn-soft); border-color: #fde68a; color: #78350f; }
.notice { display: flex; gap: .6rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; margin-bottom: 1rem; }
.notice .icon { color: var(--muted); margin-top: 1px; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny-text { font-size: .75rem; }
.strong { font-weight: 600; color: var(--ink); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt { margin-top: 1.6rem; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ——— Tablas ——— */

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.table th, .table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .76rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 1.3rem; }
.table th:last-child, .table td:last-child { padding-right: 1.3rem; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: #fbfbfc; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * { margin-left: .9rem; font-size: .86rem; font-weight: 500; }
.table .actions a, .table .actions button.link { color: var(--ink-2); }
.table .actions a:hover, .table .actions button.link:hover { color: var(--accent); }
.table tr.inactive td { opacity: .55; }
.table td a.strong, .table td > a:first-child:not(.btn) { color: var(--ink); font-weight: 550; }
.table td a.strong:hover, .table td > a:first-child:not(.btn):hover { color: var(--accent); }
.table .row-sub { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.thumb-col { width: 76px; }
.thumb-col img, .thumb-col .thumb-empty { width: 60px; height: 42px; object-fit: cover; border-radius: 6px; display: block; background: #f4f4f5; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); }
.empty { padding: 3rem 1.5rem; text-align: center; color: var(--muted); }
.empty .icon { width: 28px; height: 28px; color: var(--faint); margin-bottom: .5rem; }
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: .2rem; }

.list-rows { list-style: none; margin: 0; padding: 0; }
.list-rows li { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.3rem; border-bottom: 1px solid var(--line); }
.list-rows li:last-child { border-bottom: 0; }
.list-rows li.is-new { background: #fffcf0; }
.list-rows .row-main { flex: 1; min-width: 0; }
.list-rows .row-main a { color: var(--ink); font-weight: 550; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-rows .row-main a:hover { color: var(--accent); }
.list-rows .row-meta { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-rows .row-side { color: var(--muted); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-rows .empty-row { justify-content: center; color: var(--muted); padding: 2rem; }

/* ——— Etiquetas ——— */

.badge {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	height: 22px;
	padding: 0 .55rem;
	border-radius: 999px;
	font-size: .74rem;
	font-weight: 550;
	background: #f4f4f5;
	color: var(--ink-2);
	white-space: nowrap;
	vertical-align: middle;
	box-shadow: inset 0 0 0 1px rgba(24, 24, 27, .06);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge-published, .badge-ok { background: var(--ok-soft); color: #15803d; box-shadow: inset 0 0 0 1px #bbf7d0; }
.badge-scheduled { background: var(--info-soft); color: #1d4ed8; box-shadow: inset 0 0 0 1px #bfdbfe; }
.badge-draft { background: var(--warn-soft); color: #a16207; box-shadow: inset 0 0 0 1px #fde68a; }
.badge-trash, .badge-off { background: var(--danger-soft); color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.badge-new { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-line); }
.badge-read { background: #f4f4f5; color: #52525b; }
.badge-archived, .badge-expired { background: #f5f3ff; color: #6d28d9; box-shadow: inset 0 0 0 1px #ddd6fe; }
.badge-spam { background: #fff7ed; color: #c2410c; box-shadow: inset 0 0 0 1px #fed7aa; }
.badge-admin { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-line); }

/* ——— Pestañas y filtros ——— */

.tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 0; color: var(--muted); font-weight: 500; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .count { font-size: .72rem; font-weight: 600; color: var(--muted); background: #f4f4f5; border-radius: 99px; padding: .05rem .45rem; font-variant-numeric: tabular-nums; }
.tabs a.active .count { background: var(--accent-soft); color: var(--accent-strong); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: #efeff1; border-radius: 9px; margin-bottom: 1.1rem; flex-wrap: wrap; }
.segmented a { display: inline-flex; align-items: center; gap: .4rem; height: 30px; padding: 0 .8rem; border-radius: 7px; color: var(--ink-2); font-size: .86rem; font-weight: 500; }
.segmented a:hover { color: var(--ink); }
.segmented a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.segmented .count { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .segmented, .toolbar .tabs { margin-bottom: 0; }
.filters { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar .filters { margin-bottom: 0; }
.filters input, .filters select { width: auto; margin: 0; min-width: 200px; height: 36px; min-height: 36px; padding-top: 0; padding-bottom: 0; }
.filters select { min-width: 170px; }
.filters .check { display: inline-flex; align-items: center; gap: .45rem; margin: 0 .25rem; white-space: nowrap; font-weight: 500; }
.filters .check input { width: 16px; min-width: 0; height: 16px; min-height: 0; margin: 0; }
body:has(.page-head .btn-primary) .topbar-quick { display: none; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; width: 16px; height: 16px; }
.search-input input { padding-left: 2.1rem; }

.pager { display: flex; align-items: center; justify-content: center; gap: .25rem; margin: 1.3rem 0 .4rem; flex-wrap: wrap; }
.pager a, .pager span { display: inline-flex; align-items: center; gap: .3rem; min-width: 34px; height: 34px; padding: 0 .65rem; justify-content: center; border-radius: 8px; color: var(--ink-2); font-size: .87rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.pager a:hover { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line); }
.pager .current { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line-strong); }
.pager .gap { color: var(--faint); min-width: 20px; padding: 0; }
.pager .icon { width: 16px; height: 16px; vertical-align: 0; }

/* ——— Inicio ——— */

.welcome { margin: .4rem 0 1.5rem; }
.welcome h1 { margin: 0 0 .25rem; }
.welcome p { color: var(--muted); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.stat {
	position: relative;
	display: block;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 1.05rem 1.15rem 1.1rem;
	color: var(--ink);
	box-shadow: var(--shadow-xs);
	transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stat:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.stat-label { color: var(--muted); font-size: .84rem; font-weight: 500; }
.stat-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat-icon .icon { width: 17px; height: 17px; }
.stat strong { display: block; font-size: 1.85rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .stat-sub { display: block; margin-top: .35rem; font-size: .78rem; color: var(--ok); font-weight: 550; }
.stat-alert { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.stat-alert strong { color: var(--accent-strong); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.dash-grid .wide { grid-column: 1 / -1; }
.dash-grid .card { margin: 0; }
.plain-list { margin: 0; padding-left: 1.1rem; }
.plain-list li { margin: .3rem 0; }

/* ——— Editor de notas y propiedades ——— */

.post-form { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.2rem; align-items: start; }
.editor-side { position: sticky; top: calc(var(--topbar) + 12px); display: grid; gap: 1.1rem; }
.editor-side .card { margin: 0; }
.editor-main .card:last-child { margin-bottom: 0; }
.editor-side .btn-stack .btn { width: 100%; }
.side-meta { display: grid; gap: .45rem; font-size: .84rem; color: var(--muted); margin: 0 0 .9rem; }
.side-meta div { display: flex; justify-content: space-between; gap: .5rem; }
.side-meta strong { color: var(--ink); font-weight: 550; }
.cat-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .15rem .3rem; border-radius: 6px; }
.cat-row:hover { background: #f8f8f9; }
.cat-row label { margin: 0; padding: .2rem 0; }
.cat-row .small { color: var(--faint); }
.cat-list { max-height: 300px; overflow-y: auto; margin: 0 -.3rem .6rem; padding-right: .2rem; }
.danger-zone { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .86rem; }
.danger-zone.btn-row { gap: 1.2rem; }

.image-preview { background: repeating-conic-gradient(#f4f4f5 0% 25%, #fafafa 0% 50%) 50% / 16px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); min-height: 96px; margin-bottom: .65rem; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--faint); font-size: .82rem; }
.image-preview img { max-width: 100%; max-height: 260px; display: block; }
.image-preview.tiny { min-height: 52px; width: 72px; border-radius: 8px; }
.image-preview.tiny img { max-height: 52px; }
.image-preview.dark { background: #27272a; }
.image-field .btn-row { gap: .4rem; }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: .4rem; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 1.8rem; text-align: center; color: var(--muted); margin-bottom: 1.1rem; background: var(--surface); font-size: .9rem; transition: border-color .15s, background .15s; }
.dropzone .icon { width: 26px; height: 26px; color: var(--faint); }
.dropzone strong { color: var(--ink); font-weight: 600; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.upload-status { padding: .65rem 1rem; border-radius: var(--radius); background: var(--info-soft); border: 1px solid #bfdbfe; color: #1e3a8a; margin-bottom: 1rem; font-size: .88rem; }
.upload-status.error { background: var(--danger-soft); border-color: #fecaca; color: #7f1d1d; }

.media-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.media-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-xs); transition: box-shadow .15s, border-color .15s; }
.media-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.media-card img { width: 100%; height: 140px; object-fit: cover; display: block; background: #f4f4f5; }
.media-card figcaption { padding: .7rem .75rem .75rem; }
.media-card input { margin: .35rem 0; font-size: .82rem; padding: .3rem .55rem; min-height: 32px; }
.media-card input.saved { border-color: #86efac; box-shadow: 0 0 0 3px rgba(34, 197, 94, .15); }

.banner-list { display: grid; gap: .55rem; }
.banner-item { position: relative; display: flex; gap: 1rem; align-items: center; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: box-shadow .15s, border-color .15s; }
.banner-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.banner-item img { width: 150px; height: 64px; object-fit: contain; background: repeating-conic-gradient(#f4f4f5 0% 25%, #fafafa 0% 50%) 50% / 12px 12px; border-radius: 7px; }
.banner-item .banner-code { width: 150px; height: 64px; display: flex; align-items: center; justify-content: center; background: #f4f4f5; border-radius: 7px; font-weight: 600; font-size: .8rem; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.banner-info { flex: 1; min-width: 0; }
.banner-info .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-item.just-moved { animation: flash 1s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--ring); border-color: var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.move-btns { display: inline-flex; flex-direction: column; gap: 3px; }
.move-btn { display: grid; place-items: center; width: 28px; height: 24px; padding: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; color: var(--muted); transition: background .12s, border-color .12s, color .12s, transform .08s; }
.move-btn .icon { width: 14px; height: 14px; vertical-align: 0; }
.move-btn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); }
.move-btn:active:not(:disabled) { transform: scale(.92); }
.move-btn:disabled { opacity: .35; cursor: default; }
.order-toast { position: fixed; right: 1.4rem; bottom: 1.4rem; display: flex; align-items: center; gap: .5rem; background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .88rem; font-weight: 500; opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 1000; }
.order-toast.error { background: var(--danger); }
.order-toast.show { opacity: 1; transform: none; }

.repeat { display: grid; gap: .7rem; margin-bottom: .8rem; }
.repeat-row { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem .95rem .2rem; margin: 0 0 .75rem; background: var(--surface-2); }
.repeat .repeat-row { margin: 0; }
.repeat-row label { margin-bottom: .7rem; }
.repeat-row.is-child { margin-left: 2rem; border-style: dashed; }
.repeat-row { display: flex; align-items: flex-end; gap: .9rem; }
.repeat-row > div:first-child { flex: 1; min-width: 0; }
.repeat-row .row-tools { display: flex; align-items: center; gap: .35rem; justify-content: flex-end; padding-bottom: .75rem; flex-shrink: 0; }
.repeat-row .row-tools .move-btn { width: 30px; height: 28px; }
.repeat-row .row-tools .danger { margin-left: .5rem; }
.block-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.block-head .badge { text-transform: none; }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(24, 24, 27, .45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 1.5rem; animation: fade .15s ease-out; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); width: min(1100px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.modal-head strong { font-weight: 650; font-size: 1rem; }
.modal-tools { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.modal-tools input { margin: 0; width: 230px; height: 32px; min-height: 32px; }
.modal .upload-status { margin: .9rem 1.2rem 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .7rem; padding: 1.2rem; overflow-y: auto; background: var(--surface-2); }
.media-grid button { padding: 0; border: 0; border-radius: 9px; background: #f4f4f5; cursor: pointer; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); transition: box-shadow .12s, transform .12s; }
.media-grid button:hover, .media-grid button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent), var(--shadow-md); transform: translateY(-1px); }
.media-grid button.picked { box-shadow: 0 0 0 3px var(--accent); opacity: .55; }
.media-grid img { width: 100%; height: 104px; object-fit: cover; display: block; }
.modal-foot { padding: .8rem 1.2rem; text-align: center; border-top: 1px solid var(--line); }
.modal-foot:has(> [hidden]:only-child) { display: none; }

/* ——— Inmobiliaria ——— */

.grid-price { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: .9rem; }
.grid-4.even { grid-template-columns: repeat(4, 1fr); }
.grid-units { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: .6rem; }
.plan-grid { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; align-items: start; }
.term-box h3 { margin-bottom: .45rem; }
.check-grid { max-height: 240px; overflow-y: auto; padding: .3rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.check-grid label.check { margin: 0; padding: .3rem .5rem; font-size: .87rem; border-radius: 6px; }
.check-grid label.check:hover { background: #f4f4f5; }
.gallery-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: .9rem; }
.gallery-item { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: grab; position: relative; box-shadow: var(--shadow-xs); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; pointer-events: none; }
.gallery-item.dragging { opacity: .4; }
.gallery-item.just-moved { animation: flash .9s ease-out; }
.gallery-item .cover-pick { display: flex; align-items: center; gap: .35rem; margin: 0; padding: .45rem .55rem 0; font-weight: 450; font-size: .78rem; }
.gallery-item:has(input[name="cover"]:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.gallery-item:has(input[name="cover"]:checked) .cover-pick { font-weight: 650; color: var(--accent-strong); }
.gallery-tools { display: flex; gap: .25rem; padding: .4rem .55rem .55rem; }
.gallery-tools .move-btn { width: 28px; height: 26px; }
.gallery-tools .move-btn.danger { margin-left: auto; }
.star { display: inline-grid; place-items: center; background: none; border: 0; line-height: 1; color: #d4d4d8; cursor: pointer; padding: .2rem; border-radius: 6px; transition: color .12s, transform .12s; }
.star .icon { width: 19px; height: 19px; }
.star.on { color: #f59e0b; }
.star.on .icon { fill: currentColor; }
.star:hover { transform: scale(1.12); color: #f59e0b; }
.check-col { width: 38px; }
.leads-table tr.is-new td, .table tr.is-new td { background: #fffcf0; }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.msg-col { max-width: 420px; color: var(--ink-2); }
.bulk-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .9rem 0; }
.bulk-bar select { width: auto; margin: 0; height: 32px; min-height: 32px; padding-top: 0; padding-bottom: 0; }
.grid-lead { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 1.1rem; align-items: start; }
.lead-message { white-space: normal; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1rem 0; line-height: 1.65; }
.btn-whatsapp { background: #22c55e; color: #fff; box-shadow: 0 1px 2px rgba(24, 24, 27, .12); }
.btn-whatsapp:hover { background: #16a34a; color: #fff; }

/* ——— Ingreso ——— */

body.bare { background: var(--bg); }
.login-wrap {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.4rem;
	padding: 1.5rem;
	background:
		radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
		var(--bg);
}
.login-card { width: 100%; max-width: 400px; padding: 2rem 2rem 1.6rem; border-radius: 18px; box-shadow: var(--shadow-md); margin: 0; }
.login-card h1 { font-size: 1.3rem; text-align: center; margin: 0 0 .3rem; }
.login-card .lead { text-align: center; color: var(--muted); font-size: .9rem; margin: 0 0 1.5rem; }
.login-logo { display: block; max-width: 200px; max-height: 64px; margin: 0 auto 1.4rem; object-fit: contain; }
.login-card .brand-mark { width: 48px; height: 48px; border-radius: 13px; font-size: 1.3rem; margin: 0 auto 1.2rem; }
.login-card .btn-block { height: 42px; margin-top: .4rem; }
.login-foot { color: var(--faint); font-size: .78rem; }
.message-card { max-width: 560px; }

.tox-tinymce { border-radius: var(--radius) !important; border-color: var(--line-strong) !important; box-shadow: var(--shadow-xs); }
.tox .tox-toolbar__primary, .tox .tox-editor-header { background: var(--surface-2) !important; }

/* ——— Pantallas chicas ——— */

.scrim { display: none; }

@media (max-width: 1100px) {
	.post-form { grid-template-columns: 1fr; }
	.editor-side { position: static; }
	.grid-2, .grid-3, .grid-4, .grid-5, .dash-grid { grid-template-columns: 1fr; }
	.grid-price, .grid-4.even, .grid-units, .grid-lead { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
	.repeat-row { flex-direction: column; align-items: stretch; gap: 0; }
	.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
	.stat { padding: .9rem 1rem; }
	.shell { padding-left: 0; }
	.sidebar { transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
	body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
	body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(24, 24, 27, .35); }
	.nav-toggle { display: inline-flex; }
	.topbar { padding: 0 1rem; }
	.main { padding: .5rem 1rem 2.5rem; }
	.sticky-foot { margin: 1rem -1rem -2.5rem; padding: .75rem 1rem; }
	.topbar .hide-sm { display: none; }
	.filters input, .filters select { min-width: 0; width: 100%; }
	.filters, .toolbar .filters { width: 100%; }
	.filters > * { flex: 1 1 160px; }
	.banner-item { flex-wrap: wrap; }
	.grid-price, .grid-4.even, .grid-units, .grid-lead, .plan-grid { grid-template-columns: 1fr; }
	.msg-col, .hide-sm { display: none; }
	h1 { font-size: 1.4rem; }
}

/* Comentarios: el texto se ve también en el celular; se responde desde la lista */
.comment-col { max-width: 520px; min-width: 220px; color: var(--ink-2); }
.comment-reply { margin-top: 8px; }
.comment-reply summary { cursor: pointer; color: var(--accent); font-weight: 500; width: max-content; }
.comment-reply textarea { display: block; width: 100%; margin: 8px 0; }
