@font-face {
    font-family: 'Anton';
    src: url('../../font/Anton-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Hero';
    src: url('../../font/Hero-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --accent: #f68e1e;
    --accent-dark: #c96a05;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f3f4f6;
    --danger: #dc2626;
    --ok: #15803d;
    --font: 'Hero', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: inherit; }
img { display: block; max-width: 100%; }
code { background: #f1f1f1; padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- Layout ---------- */

.adm { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.adm-side {
    background: #121212;
    color: #d4d4d4;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 0 16px;
}
.adm-logo {
    display: block;
    padding: 0 22px 22px;
    font-family: var(--display);
    font-size: 30px;
    letter-spacing: .5px;
    color: #fff;
    text-decoration: none;
    line-height: 1;
}
.adm-logo span { color: var(--accent); margin-left: 4px; }
.adm-logo small { display: block; font-family: var(--font); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #8a8a8a; margin-top: 6px; }
.adm-nav { display: flex; flex-direction: column; flex: 1; }
.adm-nav a {
    padding: 11px 22px;
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
}
.adm-nav a:hover { background: #1e1e1e; color: #fff; }
.adm-nav a.is-active { border-left-color: var(--accent); background: #1e1e1e; color: #fff; font-weight: 700; }
.adm-user { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 22px 0; border-top: 1px solid #2a2a2a; font-size: 14px; }
.adm-user small { display: block; color: #8a8a8a; font-size: 12px; }
.adm-user button { background: none; border: 1px solid #3a3a3a; color: #ddd; padding: 6px 12px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.adm-user button:hover { border-color: var(--accent); color: #fff; }

.adm-main { padding: 26px 32px 60px; min-width: 0; }
.adm-top h1 { margin: 0 0 20px; font-family: var(--display); font-weight: 400; font-size: 32px; letter-spacing: .5px; }

/* ---------- Componentes ---------- */

.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.panel-narrow { max-width: 520px; }
.panel-title { margin: 0 0 14px; font-family: var(--display); font-size: 17px; font-weight: 400; text-transform: uppercase; letter-spacing: 1px; color: #374151; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert-success { background: #ecfdf3; border-color: #a7f3c0; color: #065f2c; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px;
    border: 1px solid #d1d5db; border-radius: 7px;
    background: #fff; color: var(--ink);
    font: inherit; font-weight: 700; font-size: 14px;
    text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: #9ca3af; background: #f9fafb; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-live { background: #dcfce7; color: #166534; }
.badge-draft { background: #f3f4f6; color: #4b5563; }
.badge-scheduled { background: #e0f2fe; color: #075985; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.star { color: var(--accent); margin-left: 4px; }

/* ---------- Formularios ---------- */

.field { display: block; margin-bottom: 16px; }
.field > span, .field > .label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: #374151; }
.field small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number],
input[type=datetime-local], select, textarea {
    width: 100%;
    font: inherit;
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(246, 142, 30, .18); }
textarea { resize: vertical; line-height: 1.5; }
.input-title { font-family: var(--display); font-size: 28px; line-height: 1.15; letter-spacing: .3px; }
.input-body { font-size: 17px; line-height: 1.65; min-height: 320px; }
.input-xs { width: 70px !important; }
input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid #d1d5db; border-radius: 7px; background: #fff; cursor: pointer; }
.hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin: 10px 0 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.check-feature { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 10px 12px; }
.check-danger { color: var(--danger); }

.form-stack .field:last-of-type { margin-bottom: 20px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: end; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form input[type=text] { width: auto; flex: 1; min-width: 160px; }
.inline-form .count { color: var(--muted); font-size: 13px; min-width: 60px; }

.md-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid #d1d5db; border-bottom: 0; border-radius: 7px 7px 0 0; background: #f9fafb; }
.md-toolbar + textarea { border-radius: 0 0 7px 7px; }
.md-toolbar button { border: 1px solid transparent; background: none; padding: 5px 10px; border-radius: 5px; font: inherit; font-size: 13px; cursor: pointer; }
.md-toolbar button:hover { background: #fff; border-color: #d1d5db; }

/* ---------- Editor de notas ---------- */

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.editor-side { position: sticky; top: 20px; }
.side-actions { display: grid; gap: 8px; }
.mobile-save { display: none; }

.main-photo { aspect-ratio: 3 / 2; background: #f3f4f6; border-radius: 8px; overflow: hidden; margin-bottom: 10px; display: grid; place-items: center; }
.main-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { color: #9ca3af; font-size: 14px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input, .dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.dropzone {
    position: relative;
    display: block;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 26px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: #fff7ed; }
.dropzone strong { display: block; font-size: 15px; margin-bottom: 4px; }
.dropzone span { color: var(--muted); font-size: 13px; }

.gallery-edit, .gallery-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery-edit { margin-bottom: 16px; }
.gallery-preview:not(:empty) { margin-top: 14px; }
.gallery-item img, .gallery-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }
.gallery-item input[type=text] { font-size: 13px; padding: 6px 8px; }
.gallery-item .check { margin: 6px 0 0; font-size: 13px; }
.gallery-preview figure { margin: 0; font-size: 12px; color: var(--muted); word-break: break-all; }

/* ---------- Listado ---------- */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.stat strong { display: block; font-family: var(--display); font-weight: 400; font-size: 32px; letter-spacing: .5px; }
.stat span { color: var(--muted); font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters input, .filters select { width: auto; }
.filters input[type=search] { min-width: 220px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafafa; }
.table .num { text-align: right; }
.thumb { width: 76px; }
.thumb img, .thumb-ph { width: 64px; height: 44px; object-fit: cover; border-radius: 5px; background: #e5e7eb; display: block; }
.title-cell a { font-weight: 700; text-decoration: none; }
.title-cell a:hover { color: var(--accent-dark); }
.title-cell small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-weight: 700; font-size: 14px; }
.pagination .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Login ---------- */

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: #121212; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 12px; padding: 34px 30px 26px; }
.login-logo { display: block; text-align: center; font-family: var(--display); font-size: 40px; letter-spacing: .5px; text-decoration: none; margin-bottom: 18px; }
.login-logo span { color: var(--accent); margin-left: 4px; }
.login-card h1 { font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: .5px; margin: 0 0 6px; text-align: center; }
.login-card > .muted { text-align: center; margin: 0 0 18px; font-size: 14px; }
.login-card form { margin-top: 18px; }
.login-back { display: block; text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); text-decoration: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .editor { grid-template-columns: minmax(0, 1fr); }
    .editor-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
    .mobile-save {
        display: block;
        position: sticky;
        bottom: 0;
        z-index: 5;
        padding: 12px 0;
        background: linear-gradient(to bottom, rgba(243, 244, 246, 0), var(--bg) 35%);
    }
    .mobile-save .btn { padding: 13px 16px; font-size: 15px; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
}
@media (max-width: 820px) {
    .adm { grid-template-columns: minmax(0, 1fr); }
    .adm-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; }
    .adm-logo { padding: 0; font-size: 22px; }
    .adm-logo small { display: none; }
    .adm-nav { flex-direction: row; flex-wrap: wrap; flex-basis: 100%; order: 3; gap: 2px; }
    .adm-nav a { padding: 7px 10px; border-left: 0; border-radius: 6px; font-size: 14px; }
    .adm-user { margin-left: auto; border: 0; padding: 0; }
    .adm-main { padding: 20px 16px 50px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .filters, .filters input[type=search] { width: 100%; min-width: 0; }
}
