/* ==========================================================================
   Higgs News - Dashboard administrativo
   ========================================================================== */
:root {
    --adm-bg: #f4f6fa;
    --adm-surface: #ffffff;
    --adm-border: #e4e7ec;
    --adm-text: #1d2433;
    --adm-muted: #667085;
    --adm-side: #0f172a;
    --adm-side-text: #cbd5e1;
    --adm-accent: #1a73e8;
    --adm-hover: #f2f4f7;
    --adm-c1: #1a73e8;
    --adm-c2: #f59e0b;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: .92rem;
    --bs-primary: #1a73e8;
    --bs-primary-rgb: 26, 115, 232;
    --bs-link-color: #1a73e8;
    --bs-link-color-rgb: 26, 115, 232;
}
[data-bs-theme="dark"] {
    --adm-bg: #0b0f17;
    --adm-surface: #141a24;
    --adm-border: #263041;
    --adm-text: #e6e9ef;
    --adm-muted: #98a2b3;
    --adm-side: #070a10;
    --adm-hover: #1c2431;
    --adm-c1: #6ea8fe;
    --adm-c2: #fbbf24;
    --bs-body-bg: #0b0f17;
    --bs-link-color: #6ea8fe;
    --bs-link-color-rgb: 110, 168, 254;
}
body.adm { background: var(--adm-bg); color: var(--adm-text); }
a { text-decoration: none; }
.btn-primary { --bs-btn-bg: #1a73e8; --bs-btn-border-color: #1a73e8; --bs-btn-hover-bg: #1765cc; --bs-btn-hover-border-color: #1765cc; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--adm-muted); border: 0; background: transparent; }
.btn-icon:hover { background: var(--adm-hover); color: var(--adm-text); }
.min-w-0 { min-width: 0; }

/* Sidebar */
.adm-sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; background: var(--adm-side); color: var(--adm-side-text); display: flex; flex-direction: column; z-index: 1040; transition: transform .25s; }
.adm-brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.25rem; font-weight: 700; font-size: 1.08rem; color: #fff; }
.adm-login .adm-brand { color: var(--adm-text); }
.adm-mark { width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; color: #fff; font-weight: 800;
    background: conic-gradient(from 210deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4); }
.adm-menu { flex: 1; overflow-y: auto; padding: .5rem .75rem; }
.adm-menu a, .adm-sidebar-foot a { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; margin-bottom: 2px; border-radius: 8px; color: var(--adm-side-text); font-weight: 500; }
.adm-menu a:hover, .adm-sidebar-foot a:hover { background: rgba(255,255,255,.06); color: #fff; }
.adm-menu a.active { background: var(--adm-accent); color: #fff; }
.adm-menu i { font-size: 1.05rem; }
.adm-sidebar-foot { padding: .75rem; border-top: 1px solid rgba(255,255,255,.08); }
.adm-backdrop { display: none; }

.adm-main { margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; }
.adm-topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .75rem; padding: .7rem 1.5rem; background: color-mix(in srgb, var(--adm-surface) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--adm-border); }
.adm-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.adm-content { padding: 1.5rem; flex: 1; }
.adm-user { display: flex; align-items: center; gap: .5rem; border: 0; }
.adm-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #1a73e8, #7c3aed); color: #fff; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }

@media (max-width: 991.98px) {
    .adm-sidebar { transform: translateX(-100%); }
    .adm-sidebar.open { transform: none; }
    .adm-sidebar.open + .adm-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
    .adm-main { margin-left: 0; }
    .adm-content { padding: 1rem; }
    .adm-topbar { padding: .6rem 1rem; }
}

/* Cards */
.adm-card { background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: 14px; padding: 1.25rem; }
.adm-card-head { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.adm-card-head h2, .adm-card-subtitle { font-size: .98rem; font-weight: 650; margin: 0; }
.adm-card-subtitle { margin-bottom: 1rem; }
.adm-sticky { position: sticky; top: 80px; }

/* KPIs */
.adm-kpi { display: block; height: 100%; background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: 14px; padding: 1rem; color: var(--adm-text); transition: transform .15s, box-shadow .15s; --k: #1a73e8; }
a.adm-kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,.08); color: var(--adm-text); }
.adm-kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; color: var(--k); background: color-mix(in srgb, var(--k) 13%, transparent); margin-bottom: .6rem; }
.adm-kpi-value { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.adm-kpi-label { font-size: .78rem; color: var(--adm-muted); }
.kpi-success { --k: #16a34a; } .kpi-primary { --k: #1a73e8; } .kpi-warning { --k: #d97706; } .kpi-info { --k: #0891b2; }
.kpi-purple { --k: #7c3aed; } .kpi-teal { --k: #0d9488; } .kpi-danger { --k: #dc2626; }

/* Grafica SVG */
.adm-chart { height: 280px; position: relative; }
.adm-chart svg { width: 100%; height: 100%; overflow: visible; }
.adm-chart .grid line { stroke: var(--adm-border); stroke-dasharray: 3 4; }
.adm-chart .axis text { fill: var(--adm-muted); font-size: 11px; }
.adm-chart .bar { fill: var(--adm-c1); opacity: .85; }
.adm-chart .bar:hover { opacity: 1; }
.adm-chart .line { fill: none; stroke: var(--adm-c2); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.adm-chart .dot { fill: var(--adm-surface); stroke: var(--adm-c2); stroke-width: 2; }
.adm-chart-tip { position: absolute; pointer-events: none; background: var(--adm-text); color: var(--adm-surface); font-size: .78rem; padding: .4rem .6rem; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.adm-legend { display: flex; gap: 1.25rem; font-size: .8rem; color: var(--adm-muted); margin: -.5rem 0 .75rem; }
.adm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

.adm-bar { margin-bottom: .85rem; }
.adm-bar-track { height: 8px; background: var(--adm-hover); border-radius: 99px; overflow: hidden; margin-top: .3rem; }
.adm-bar-track div { height: 100%; border-radius: 99px; }

.adm-list { list-style: none; margin: 0; padding: 0; }
.adm-list li { padding: .6rem 0; border-top: 1px solid var(--adm-border); }
.adm-list li:first-child { border-top: 0; padding-top: 0; }
.adm-list a { color: var(--adm-text); font-weight: 500; line-height: 1.35; display: block; }
.adm-list a:hover { color: var(--adm-accent); }
.adm-list small { color: var(--adm-muted); font-size: .75rem; }

/* Tablas */
.adm-table { --bs-table-bg: transparent; }
.adm-table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--adm-muted); font-weight: 600; background: var(--adm-hover); border-bottom: 1px solid var(--adm-border); padding: .65rem .75rem; white-space: nowrap; }
.adm-table td { padding: .65rem .75rem; border-color: var(--adm-border); }
.adm-table tbody tr:hover { background: color-mix(in srgb, var(--adm-hover) 60%, transparent); }
.adm-table-head { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--adm-border); min-height: 52px; }
.adm-row-title { color: var(--adm-text); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.adm-row-title:hover { color: var(--adm-accent); }
.adm-thumb { width: 52px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--adm-hover); }
.adm-thumb-empty { display: grid; place-items: center; color: var(--adm-muted); }
.adm-cat { font-size: .78rem; font-weight: 600; padding: .2rem .55rem; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); white-space: nowrap; }
.btn-flag { padding: .1rem .3rem; color: var(--adm-border); border: 0; }
.btn-flag.on { color: #f59e0b; }
.btn-flag.flag-red.on { color: #dc2626; }
.btn-flag:hover { color: var(--adm-muted); }

.adm-pills { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; }
.adm-pills a { display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .8rem; border-radius: 999px; color: var(--adm-muted); font-weight: 500; font-size: .85rem; border: 1px solid transparent; }
.adm-pills a span { font-size: .72rem; background: var(--adm-hover); padding: 0 .45rem; border-radius: 99px; }
.adm-pills a:hover { background: var(--adm-surface); border-color: var(--adm-border); }
.adm-pills a.active { background: var(--adm-surface); border-color: var(--adm-border); color: var(--adm-text); box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.adm-filters { padding: .85rem 1rem; }

/* Editor */
.adm-editor { border: 1px solid var(--adm-border); border-radius: 10px; overflow: hidden; background: var(--adm-surface); }
.adm-editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: .35rem; border-bottom: 1px solid var(--adm-border); background: var(--adm-hover); }
.adm-editor-bar button { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 6px; color: var(--adm-text); }
.adm-editor-bar button:hover, .adm-editor-bar button.active { background: var(--adm-surface); }
.adm-editor-area { min-height: 340px; max-height: 70vh; overflow-y: auto; padding: 1rem 1.25rem; outline: none; line-height: 1.7; font-size: 1rem; }
.adm-editor-area:empty::before { content: "Escribe aqui el cuerpo de la noticia…"; color: var(--adm-muted); }
.adm-editor-area img { max-width: 100%; height: auto; border-radius: 8px; }
.adm-editor-area blockquote { border-left: 3px solid var(--adm-accent); padding-left: 1rem; color: var(--adm-muted); }
.adm-editor-html { border: 0; border-radius: 0; min-height: 340px; }

/* Etiquetas */
.adm-tags { display: flex; flex-wrap: wrap; gap: .35rem; padding: .35rem; border: 1px solid var(--adm-border); border-radius: 8px; background: var(--adm-surface); }
.adm-tags:focus-within { border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); }
.adm-tags .tag { display: inline-flex; align-items: center; gap: .3rem; background: color-mix(in srgb, var(--adm-accent) 12%, transparent); color: var(--adm-accent); padding: .15rem .5rem; border-radius: 6px; font-size: .82rem; font-weight: 500; }
.adm-tags .tag button { border: 0; background: none; color: inherit; padding: 0; line-height: 1; }
.adm-tags-input { flex: 1; min-width: 120px; border: 0; outline: none; background: transparent; color: var(--adm-text); padding: .2rem; }
.adm-tag-pill { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--adm-border); border-radius: 999px; padding: .25rem .4rem .25rem .8rem; font-size: .85rem; }

/* Imagen */
.adm-image-drop { border: 2px dashed var(--adm-border); border-radius: 12px; min-height: 160px; display: grid; place-items: center; cursor: pointer; overflow: hidden; position: relative; color: var(--adm-muted); text-align: center; }
.adm-image-drop.drag { border-color: var(--adm-accent); background: color-mix(in srgb, var(--adm-accent) 6%, transparent); }
.adm-image-drop img { width: 100%; max-height: 260px; object-fit: cover; }
.adm-image-drop.loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%231a73e8' stroke-width='5' stroke-dasharray='90 60'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center no-repeat; }

.adm-docs pre { background: var(--adm-hover); padding: .75rem; border-radius: 8px; white-space: pre-wrap; word-break: break-all; }

/* Login */
.adm-login { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
    background: radial-gradient(circle at 20% 10%, rgba(26,115,232,.15), transparent 40%), radial-gradient(circle at 80% 90%, rgba(234,67,53,.12), transparent 40%), var(--adm-bg); }
.adm-login-card { width: 100%; max-width: 400px; background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: 18px; padding: 2rem; box-shadow: 0 20px 50px rgba(16,24,40,.08); }

/* ==========================================================================
   Control de la redaccion
   ========================================================================== */
:root { --adm-c3: #0d9488; --adm-c4: #7c3aed; }
[data-bs-theme="dark"] { --adm-c3: #2dd4bf; --adm-c4: #a78bfa; }
.adm-chart-money .bar { fill: var(--adm-c3); }
.adm-chart-money .line { stroke: var(--adm-c4); }
.adm-chart-money .dot { stroke: var(--adm-c4); }
.adm-kpi-sub { font-size: .72rem; color: var(--adm-muted); margin-top: .15rem; }
.adm-delta { font-size: .72rem; font-weight: 600; padding: .1rem .4rem; border-radius: 99px; white-space: nowrap; }
.adm-delta.up { color: #16a34a; background: rgba(22,163,74,.1); }
.adm-delta.down { color: #dc2626; background: rgba(220,38,38,.1); }

.adm-avatar { position: relative; }
.adm-avatar-lg { width: 56px; height: 56px; font-size: 1.15rem; }
.adm-online { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--adm-surface); }
.adm-avatar-lg .adm-online { width: 15px; height: 15px; }
.adm-profile-stat { display: flex; align-items: center; gap: .5rem; padding: .35rem .9rem; border-left: 1px solid var(--adm-border); }
.adm-profile-stat strong { font-size: 1.5rem; font-weight: 750; }
.adm-profile-stat span { font-size: .72rem; color: var(--adm-muted); line-height: 1.2; }

.adm-today { background: linear-gradient(135deg, color-mix(in srgb, var(--adm-accent) 7%, var(--adm-surface)), var(--adm-surface)); }
.adm-today-item { display: flex; flex-direction: column; border-left: 1px solid var(--adm-border); padding-left: 1rem; }
.adm-today-item span { font-size: .74rem; color: var(--adm-muted); text-transform: uppercase; letter-spacing: .03em; }
.adm-today-item strong { font-size: 1.45rem; font-weight: 750; line-height: 1.2; }
.adm-today-item small { font-size: .72rem; color: var(--adm-muted); }
@media (max-width: 991.98px) { .adm-today-item { border-left: 0; padding-left: calc(var(--bs-gutter-x) * .5); } }

.adm-range { padding: .75rem 1rem; }
.adm-range input[type="date"] { width: 150px; }
.adm-goal-row td:first-child { box-shadow: inset 3px 0 0 #16a34a; }
.adm-table tfoot td { background: var(--adm-hover); border-top: 2px solid var(--adm-border); }

.adm-stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--adm-hover); }
.adm-minibar { height: 4px; border-radius: 99px; background: var(--adm-hover); margin-top: .3rem; min-width: 90px; }
.adm-minibar div { height: 100%; border-radius: 99px; background: var(--adm-c3); }

.adm-rank { padding-left: 1.2rem; margin: 0; }
.adm-rank li { display: flex; gap: .5rem; justify-content: space-between; align-items: flex-start; padding: .45rem 0; border-top: 1px solid var(--adm-border); }
.adm-rank li:first-child { border-top: 0; }
.adm-rank a { color: var(--adm-text); font-weight: 500; font-size: .88rem; line-height: 1.35; }
.adm-rank a:hover { color: var(--adm-accent); }

.adm-timeline { list-style: none; padding: 0; margin: 0; max-height: 460px; overflow-y: auto; }
.adm-timeline li { display: flex; gap: .7rem; padding: .5rem 0; position: relative; }
.adm-timeline li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 34px; bottom: -6px; width: 2px; background: var(--adm-border); }
.adm-tl-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; flex-shrink: 0; }

.adm-online-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .7rem .2rem .2rem; border: 1px solid var(--adm-border); border-radius: 99px; color: var(--adm-text); font-size: .85rem; font-weight: 500; background: var(--adm-surface); }
.adm-online-chip .adm-avatar { width: 26px; height: 26px; font-size: .65rem; }
