/* Monitor de Menciones — estilos de login y app del cliente */
:root {
	--brand: #2f3a4a;
	--accent: #b3363c;
	--page: #f5f5f5;
	--surface: #ffffff;
	--ink: #1d2430;
	--muted: #667085;
	--line: #e4e7ec;
	--pos: #2f8f4e;
	--neu: #8a94a3;
	--neg: #c2413b;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--page); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
[hidden] { display: none !important; }

/* ---------- Botones y campos ---------- */
.ghm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none; transition: filter .15s, background .15s; }
.ghm-btn--primary { background: var(--brand); color: #fff; }
.ghm-btn--primary:hover { filter: brightness(1.08); }
.ghm-btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ghm-btn--ghost:hover { background: #f9fafb; }
.ghm-btn--danger { background: var(--surface); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.ghm-btn--danger:hover { background: color-mix(in srgb, var(--accent) 7%, #fff); }
.ghm-btn--small { padding: 7px 12px; font-size: 13px; }
.ghm-btn--block { width: 100%; }
.ghm-btn:disabled { opacity: .55; cursor: default; }
.ghm-btn:focus-visible, .ghm-chip-btn:focus-visible, select:focus-visible, input:focus-visible, .ghm-tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ghm-link { color: var(--muted); text-decoration: none; font-size: 14px; }
.ghm-link:hover { color: var(--brand); text-decoration: underline; }

input[type=text], input[type=password], input[type=search], input[type=date], select {
	font: 400 14px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; min-height: 40px; width: 100%;
}
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

.ghm-alert { border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; font-size: 14px; }
.ghm-alert--error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }

/* ---------- Login ---------- */
.ghm-login-page { min-height: 100vh; background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 9%, var(--page)) 0%, var(--page) 55%); }
.ghm-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.ghm-login__card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; box-shadow: 0 12px 32px rgba(16, 24, 40, .10); padding: 36px 32px 28px; border-top: 4px solid var(--brand); }
.ghm-login__brand { display: flex; justify-content: center; margin-bottom: 24px; }
.ghm-login__brand img { max-height: 72px; width: auto; }
.ghm-login__wordmark { font-weight: 700; font-size: 20px; color: var(--brand); }
.ghm-login h1 { font-size: 20px; text-align: center; }
.ghm-login__sub { text-align: center; color: var(--muted); margin: 6px 0 24px; font-size: 14px; }
.ghm-form { display: grid; gap: 16px; }
.ghm-field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: #344054; }
.ghm-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.ghm-check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Barra superior ---------- */
.ghm-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.ghm-top__inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; min-height: 64px; }
.ghm-top__brand { display: flex; align-items: center; text-decoration: none; font-weight: 700; color: var(--brand); }
.ghm-top__brand img { height: 34px; width: auto; }
.ghm-tabs { display: flex; gap: 4px; align-self: stretch; }
.ghm-tabs a { display: flex; align-items: center; padding: 0 14px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ghm-tabs a:hover { color: var(--ink); }
.ghm-tabs a.is-active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.ghm-top__user { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 14px; }
.ghm-top__name { color: var(--ink); font-weight: 500; }
.ghm-client-switch { width: auto; min-height: 34px; padding: 5px 8px; }

/* ---------- Contenido ---------- */
.ghm-main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; }
.ghm-head { margin-bottom: 18px; }
.ghm-head h1 { font-size: 24px; font-weight: 700; }

.ghm-filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.ghm-f { display: grid; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); min-width: 150px; }
.ghm-f--grow { flex: 1 1 220px; }
.ghm-presets div { display: flex; gap: 6px; flex-wrap: wrap; }
.ghm-chip-btn { border: 1px solid var(--line); background: #f9fafb; color: var(--ink); border-radius: 999px; padding: 8px 12px; font: 500 13px var(--font); cursor: pointer; min-height: 40px; }
.ghm-chip-btn:hover { border-color: var(--brand); color: var(--brand); }

.ghm-meta { color: var(--muted); font-size: 14px; margin: 0 2px 10px; min-height: 20px; }
.ghm-loading { color: var(--muted); padding: 32px; text-align: center; }

.ghm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.ghm-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; display: grid; gap: 4px; box-shadow: var(--shadow); border-top: 3px solid var(--brand); }
.ghm-kpi--pos { border-top-color: var(--pos); }
.ghm-kpi--neu { border-top-color: var(--neu); }
.ghm-kpi--neg { border-top-color: var(--neg); }
.ghm-kpi__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.ghm-kpi__value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ghm-kpi__sub { font-size: 13px; color: var(--muted); }
.ghm-note { font-size: 13px; color: var(--muted); margin: 4px 2px 18px; }

.ghm-soon, .ghm-empty { background: var(--surface); border: 1px dashed #d0d5dd; border-radius: var(--radius); padding: 36px 24px; text-align: center; }
.ghm-soon h2, .ghm-empty h2 { font-size: 17px; margin-bottom: 6px; }
.ghm-soon p, .ghm-empty p { color: var(--muted); max-width: 560px; margin: 0 auto 16px; }

/* ---------- Tarjetas de mención ---------- */
.ghm-list { display: grid; gap: 12px; }
.ghm-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--neu); border-radius: var(--radius); padding: 16px 18px 14px; box-shadow: var(--shadow); transition: opacity .25s, transform .25s; }
.ghm-card--pos { border-left-color: var(--pos); }
.ghm-card--neg { border-left-color: var(--neg); }
.ghm-card--none { border-left-color: var(--line); }
.ghm-card.is-discarded { opacity: .72; }
.ghm-card.is-saving { opacity: .55; pointer-events: none; }
.ghm-card.is-leaving { opacity: 0; transform: translateX(12px); }
.ghm-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ghm-card__author { font-weight: 600; color: var(--ink); }
.ghm-card__kw { margin-left: auto; background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); border-radius: 999px; padding: 2px 10px; font-weight: 500; font-size: 12px; }
.ghm-card__title { font-size: 16px; font-weight: 600; margin: 2px 0 6px; }
.ghm-card__title a { color: var(--ink); text-decoration: none; }
.ghm-card__title a:hover { color: var(--brand); text-decoration: underline; }
.ghm-card__text { margin: 0 0 10px; color: #344054; font-size: 14px; }

.ghm-src { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: #f2f4f7; color: #344054; }
.ghm-src--noticias { background: #eef4ff; color: #3538cd; }
.ghm-src--facebook { background: #e8f0fe; color: #1a56db; }
.ghm-src--web { background: #f0f9ff; color: #026aa2; }
.ghm-src--blogs { background: #fdf2fa; color: #c11574; }
.ghm-src--x { background: #f2f4f7; color: #101828; }

.ghm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ghm-chip { font-size: 12px; background: #f2f4f7; color: #475467; border-radius: 999px; padding: 3px 10px; }
.ghm-chip--place { background: color-mix(in srgb, var(--brand) 9%, #fff); color: var(--brand); }
.ghm-chip--tag { background: #fff7ed; color: #b54708; }

.ghm-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.ghm-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ghm-inline select { width: auto; min-height: 34px; padding: 5px 8px; font-size: 13px; }
.ghm-spacer { flex: 1; }
.ghm-pending { font-size: 12px; color: #b54708; background: #fffaeb; border-radius: 999px; padding: 3px 10px; }
.ghm-corrected { font-size: 12px; color: var(--muted); }
.ghm-more { display: block; margin: 18px auto 0; }

/* ---------- Avisos ---------- */
.ghm-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #101828; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 50; transition: opacity .4s, transform .4s; }
.ghm-toast.is-error { background: var(--neg); }
.ghm-toast.is-out { opacity: 0; transform: translate(-50%, 8px); }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
	.ghm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ghm-top__inner { flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px 0; }
	.ghm-tabs { order: 3; width: 100%; overflow-x: auto; }
	.ghm-tabs a { padding: 12px 12px; }
	.ghm-top__name { display: none; }
}
@media (max-width: 560px) {
	.ghm-main { padding: 20px 16px 48px; }
	.ghm-f { min-width: calc(50% - 7px); flex: 1 1 calc(50% - 7px); }
	.ghm-presets, .ghm-f--grow { flex-basis: 100%; }
	.ghm-kpi__value { font-size: 24px; }
	.ghm-card__kw { margin-left: 0; }
	.ghm-login__card { padding: 28px 22px 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
