/* Agenda · Igarashi — tema rojo oscuro (un solo look) */
:root {
  --bg: #0a0a0c; --bg-2: #0f0f12; --panel: #131317; --panel-2: #191920; --line: #26262e; --line-2: #33333d;
  --fg: #f2f2f5; --muted: #9b9ba8; --dim: #6c6c78;
  --red: #ff2d3d; --red-2: #ff5563; --red-soft: rgba(255, 45, 61, .14); --red-glow: 0 0 0 1px rgba(255,45,61,.35), 0 0 22px rgba(255,45,61,.18);
  --ok: #3ddc97; --warn: #ffb547; --warn-soft: rgba(255,181,71,.13); --danger: #ff4d5e;
  --claude: #e8a76b; --claude-soft: rgba(232,167,107,.13);
  --radius: 12px; --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body::before { /* rejilla sutil de fondo */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
input[type="checkbox"] { accent-color: var(--red); width: 18px; height: 18px; flex: none; }
input[type="color"] { height: 41px; padding: 4px; }
select option { background: var(--panel); }
textarea { resize: vertical; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.error { color: var(--danger); margin: 0; font-size: 14px; }

.btn { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 10px; padding: 9px 14px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, background .15s, box-shadow .15s; }
.btn:hover { border-color: var(--dim); }
.btn.primary { background: linear-gradient(180deg, var(--red-2), var(--red)); color: #fff; border-color: transparent; font-weight: 700; box-shadow: 0 4px 18px rgba(255,45,61,.25); }
.btn.primary:hover { box-shadow: 0 4px 24px rgba(255,45,61,.45); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 7px 11px; font-size: 18px; line-height: 1; }
.btn.big { padding: 12px 16px; font-size: 16px; justify-content: center; }
.btn.danger { color: var(--danger); }

/* ACCESO */
.auth { position: relative; z-index: 1; min-height: 100%; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 390px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px 24px; display: grid; gap: 14px; box-shadow: var(--red-glow); position: relative; }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 18px 18px 0 0; background: linear-gradient(90deg, transparent, var(--red), transparent); }
.auth-card h1 { margin: 0; font-size: 24px; letter-spacing: .02em; }
.auth-card p { margin: 0; }
.auth-card label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.auth-logo { width: 54px; height: 54px; border-radius: 14px; border: 1px solid var(--red); display: grid; place-items: center; box-shadow: var(--red-glow); background: var(--bg); }
.auth-logo span, .logo-mark { font-family: var(--mono); font-weight: 800; color: var(--red-2); text-shadow: 0 0 12px rgba(255,45,61,.7); }
.auth-logo span { font-size: 26px; }

/* ESTRUCTURA */
.ag { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100dvh; }
.ag-top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: rgba(10,10,12,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.ag-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--red) 30%, var(--red) 70%, transparent); opacity: .7; }
.ag-brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--red); display: grid; place-items: center; font-size: 17px; background: var(--bg); box-shadow: 0 0 14px rgba(255,45,61,.25); }
.ag-brand-txt { font-family: var(--mono); font-weight: 800; letter-spacing: .14em; font-size: 14px; display: grid; line-height: 1.1; }
.ag-brand-txt small { color: var(--red-2); font-weight: 600; letter-spacing: .08em; font-size: 10.5px; }
.ag-nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.ag-nav::-webkit-scrollbar { display: none; }
.ag-tab { border: 0; background: none; padding: 9px 13px; border-radius: 9px; cursor: pointer; white-space: nowrap; color: var(--muted); font-weight: 600; position: relative; }
.ag-tab:hover { color: var(--fg); background: var(--panel); }
.ag-tab.active { color: var(--fg); background: var(--red-soft); }
.ag-tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--red); box-shadow: 0 0 8px var(--red); }
.ag-top-actions { display: flex; gap: 6px; align-items: center; position: relative; }
.ag-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.6); display: grid; min-width: 250px; padding: 6px; }
.menu-user { margin: 4px 10px 6px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.ag-menu-item { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.ag-menu-item:hover { background: var(--panel-2); }
.ag-menu-item.danger { color: var(--danger); }
.ag-main { flex: 1; overflow-y: auto; padding: 20px 18px 90px; }
.ag-view { max-width: 1200px; margin: 0 auto; display: grid; gap: 18px; }
.v-title { font-size: 24px; margin: 0; letter-spacing: -.01em; }
.kicker { margin: 0 0 2px; font-family: var(--mono); color: var(--red-2); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.block { display: grid; gap: 10px; }
.block-head { display: flex; align-items: center; gap: 10px; }
.h2 { font-size: 13px; margin: 0; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.h2::before { content: ""; width: 8px; height: 8px; background: var(--red); box-shadow: 0 0 8px var(--red); border-radius: 2px; }
.block.danger .h2 { color: var(--danger); }
.block.claude .h2 { color: var(--claude); }
.block.claude .h2::before { background: var(--claude); box-shadow: 0 0 8px var(--claude); }
.count { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 99px; font-weight: 700; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: rgba(61,220,151,.12); color: var(--ok); }

/* HÉROE de Hoy */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.hstat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; display: grid; min-width: 92px; }
.hstat strong { font-family: var(--mono); font-size: 22px; line-height: 1.1; }
.hstat span { font-size: 12px; color: var(--muted); }
.hstat.bad { border-color: rgba(255,77,94,.5); } .hstat.bad strong { color: var(--danger); }
.hstat.warn strong { color: var(--warn); }
.hstat.hot { border-color: rgba(232,167,107,.5); } .hstat.hot strong { color: var(--claude); }

/* Chips y filtros */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--c, var(--red)) 20%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--red)) 55%, transparent); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.ftab { border: 1px solid var(--line-2); background: var(--panel); border-radius: 99px; padding: 6px 13px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ftab:hover { border-color: var(--dim); }
.filters .ftab.active { background: color-mix(in srgb, var(--c, var(--red)) 30%, var(--panel)); border-color: var(--c, var(--red)); font-weight: 700; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Metas */
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.goal { text-align: left; cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; transition: border-color .15s; }
.goal:hover { border-color: var(--line-2); }
.goal.short { border-color: rgba(255,181,71,.45); }
.goal-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-width: 0; }
.goal-num { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.goal p { margin: 0; color: var(--muted); }
.goal.short p { color: var(--warn); }
.bar { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); }
.bar-fill { display: block; height: 100%; width: 0; background: var(--c, var(--red)); box-shadow: 0 0 10px var(--c, var(--red)); }

/* Tarjetas de post */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 10px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--red)); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 7px; min-width: 0; }
.pcard.late { border-color: rgba(255,77,94,.55); border-left-color: var(--c, var(--red)); background: linear-gradient(90deg, rgba(255,77,94,.06), var(--panel) 40%); }
.pcard.st-publicado { opacity: .72; }
.pcard.st-cancelado { opacity: .45; }
.pcard.st-cancelado .pcard-title { text-decoration: line-through; }
.pcard-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.pcard-time { font-family: var(--mono); font-weight: 700; }
.kind { font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-2); text-transform: uppercase; letter-spacing: .04em; }
.nets { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.tag-claude { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; font-weight: 700; }
.tag-claude.wait { background: var(--bg-2); border: 1px dashed var(--claude); color: var(--claude); }
.tag-claude.ready { background: var(--claude-soft); color: var(--claude); border: 1px solid var(--claude); }
.pcard-title { text-align: left; background: none; border: 0; padding: 0; font-weight: 700; font-size: 15px; cursor: pointer; overflow-wrap: anywhere; }
.pcard-title:hover { color: var(--red-2); }
.late-txt { margin: 0; color: var(--danger); font-size: 12px; font-weight: 700; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.pcard-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.st-sel { width: auto; padding: 4px 8px; font-size: 13px; }
.pcard .small { margin: 0; }

/* Calendario */
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-head select { width: auto; margin-left: auto; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.ag-day { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: grid; gap: 8px; align-content: start; min-height: 150px; min-width: 0; }
.ag-day.today { border-color: var(--red); box-shadow: var(--red-glow); }
.day-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.ag-day.today .day-head span { color: var(--red-2); }
.ag-day .pcard { padding: 8px; }
.ag-day .pcard-actions .btn:not(.primary), .ag-day .nets { display: none; }
.day-empty { margin: 0; text-align: center; color: var(--dim); }

/* Negocios / promos */
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.bcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 9px; align-content: start; min-width: 0; position: relative; overflow: hidden; }
.bcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c, var(--red)); box-shadow: 0 0 14px var(--c, var(--red)); }
.bcard.archived { opacity: .55; }
.bcard h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.bcard p { margin: 0; overflow-wrap: anywhere; }
.bcard-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.bcard-head > div { flex: 1; min-width: 0; }
.bemoji { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; font-weight: 800; background: color-mix(in srgb, var(--c, var(--red)) 22%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--red)) 50%, transparent); flex: none; }
.quote { color: var(--fg); border-left: 2px solid var(--c, var(--red)); padding-left: 8px; font-style: italic; }
.pfill { display: grid; gap: 4px; }
.code { font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg-2); border: 1px dashed var(--line-2); }
.kpis { display: flex; gap: 20px; }
.kpis > div { display: grid; }
.kpis strong { font-family: var(--mono); font-size: 20px; }
.kpis.big { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.amt { width: 120px; padding: 5px 9px; font-size: 13px; }
.warn-txt { color: var(--warn); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

/* Ficha de identidad */
.id-sheet { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; border-top: 3px solid var(--c, var(--red)); }
.id-row { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.id-row:last-child { border-bottom: 0; }
.id-k { color: var(--muted); font-size: 12.5px; font-weight: 700; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.id-v { white-space: pre-wrap; overflow-wrap: anywhere; }
.id-row.missing .id-v { color: var(--warn); font-style: italic; }
.ident-mini { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--bg-2); }
.ident-mini summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); }
.ident-mini p { margin: 6px 0 0; white-space: pre-wrap; }

/* Resultados */
.grid2.wide { gap: 16px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--panel); border: 1px solid var(--line); }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { font-size: 11.5px; color: var(--muted); font-weight: 700; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.tbl tr.best td { color: var(--red-2); font-weight: 700; }

.empty { background: var(--panel); border: 1px dashed var(--line-2); border-radius: 16px; padding: 28px 22px; display: grid; gap: 10px; justify-items: start; }
.empty h3 { margin: 0; }
.empty p { margin: 0; max-width: 62ch; }

/* Diálogo */
.ag-dlg { border: 1px solid var(--line-2); padding: 0; border-radius: 18px; width: min(740px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--panel); color: var(--fg); box-shadow: 0 30px 80px rgba(0,0,0,.7), var(--red-glow); }
.ag-dlg::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(3px); }
.ag-dlg-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.ag-dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 8px; }
.ag-dlg-head h2 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-dlg-body { padding: 16px; overflow-y: auto; flex: 1; }
.ag-dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ag-dlg-foot .btn.danger { margin-right: auto; }
.form { display: grid; gap: 12px; }
.form .sub { margin: 8px 0 0; font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--red-2); }
.fld { display: grid; gap: 5px; min-width: 0; }
.fld-l { font-size: 13px; font-weight: 700; }
.fld-h { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks.col { flex-direction: column; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.warn-box { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 10px; margin: 0; font-size: 14px; }
.res { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 0; }
.res legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.res .fld:last-child { grid-column: 1 / -1; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* Revisor */
.review { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg-2); display: grid; gap: 6px; }
.review-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.score { font-family: var(--mono); font-weight: 800; padding: 2px 9px; border-radius: 99px; font-size: 13px; }
.score.ok { background: rgba(61,220,151,.14); color: var(--ok); }
.score.medio { background: var(--warn-soft); color: var(--warn); }
.score.alto { background: var(--red-soft); color: var(--danger); }
.review-list { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; }
.rv-alto { color: var(--danger); } .rv-medio { color: var(--warn); } .rv-ok { color: var(--ok); }
.before summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); }
.before .review-list { margin-top: 6px; color: var(--fg); }

/* Claude */
.claude-box { border: 1px solid rgba(232,167,107,.45); border-radius: 12px; padding: 12px; background: linear-gradient(180deg, var(--claude-soft), transparent 70%); display: grid; gap: 10px; }
.claude-head { display: flex; align-items: center; gap: 8px; }
.claude-mark { color: var(--claude); font-size: 18px; text-shadow: 0 0 10px rgba(232,167,107,.6); }
.claude-note { margin: 0; font-size: 14px; color: var(--claude); white-space: pre-wrap; }
.claude-draft { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.5 system-ui, sans-serif; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }

.ag-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel-2); color: var(--fg); border: 1px solid var(--red); padding: 10px 16px; border-radius: 12px; z-index: 100; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.6), var(--red-glow); }

/* Tablet vertical y celular */
@media (max-width: 1050px) {
  .week { grid-template-columns: 1fr; }
  .ag-day { min-height: 0; }
  .ag-day .pcard-actions .btn:not(.primary) { display: inline-flex; }
  .ag-day .nets { display: inline; }
}
@media (max-width: 760px) {
  .ag-top { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .ag-nav { order: 3; flex-basis: 100%; }
  .ag-top-actions { margin-left: auto; }
  .ag-main { padding: 14px 12px 90px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .cards, .bgrid { grid-template-columns: 1fr; }
  .id-row { grid-template-columns: 1fr; gap: 2px; }
  .hero-stats { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); }
  .ag-dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .ag-dlg-inner { max-height: 100dvh; height: 100%; }
}
