/* Orden del Día — negro + verde Quimera, mobile-first */
:root {
  --bg: #070a07;
  --bg2: #0d130d;
  --card: #111a11;
  --card2: #16221610;
  --line: #1f2e1f;
  --text: #e7f0e7;
  --muted: #8aa08a;
  --green: #2fe57e;
  --green-dim: #1f9d57;
  --yellow: #ffcc3f;
  --red: #ff5c5c;
  --accent: #2fe57e;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #0f1a0f 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
.screen { min-height: 100vh; }
[hidden] { display: none !important; }

/* ---------- LOGIN ---------- */
.login-screen, .quien-screen {
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-box {
  width: 100%; max-width: 360px; text-align: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 36px 28px; box-shadow: var(--shadow);
}
.login-logo {
  font-weight: 800; letter-spacing: 6px; font-size: 13px;
  color: var(--green); margin-bottom: 18px;
}
.login-box h1 { margin: 0; font-size: 26px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.login-box input {
  width: 100%; padding: 14px 16px; font-size: 18px; text-align: center;
  letter-spacing: 4px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); outline: none; margin-bottom: 14px;
}
.login-box input:focus { border-color: var(--green-dim); }
.login-box button[type=submit] {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 700;
  background: var(--green); color: #062012; border: none; border-radius: 12px;
}
.login-box button[type=submit]:active { transform: translateY(1px); }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 12px 0 0; }

/* ---------- QUIÉN SOS ---------- */
.quien-box { width: 100%; max-width: 560px; text-align: center; }
.quien-box h2 { font-size: 24px; margin: 0 0 4px; }
.quien-sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.quien-chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.persona-chip {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 12px 18px; font-size: 15px; transition: .12s;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 110px;
}
.persona-chip:hover { border-color: var(--green-dim); transform: translateY(-2px); }
.persona-chip .pc-rol { font-size: 11px; color: var(--muted); }

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: rgba(7,10,7,.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.brand-name { font-size: 15px; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
}
.tab.active { background: var(--card); border-color: var(--line); color: var(--green); }
.whoami { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.whoami-name { color: var(--text); font-weight: 600; }
.link-btn { background: none; border: none; color: var(--muted); text-decoration: underline; font-size: 12px; padding: 2px; }
.link-btn:hover { color: var(--green); }

main { padding: 18px 16px 80px; max-width: 1100px; margin: 0 auto; }

/* ---------- FILTROS ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.chip {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.chip.active { color: var(--green); border-color: var(--green-dim); background: #0f1d12; }
.spacer { flex: 1; }
.btn-add {
  background: var(--green); color: #062012; border: none; border-radius: 10px;
  padding: 8px 14px; font-weight: 700; font-size: 13px;
}

/* ---------- GRID MARCAS ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); position: relative;
  border-left: 4px solid var(--line);
}
.card.s-verde   { border-left-color: var(--green); }
.card.s-amarillo{ border-left-color: var(--yellow); }
.card.s-rojo    { border-left-color: var(--red); }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dot {
  width: 26px; height: 26px; border-radius: 50%; border: none; flex-shrink: 0;
  cursor: pointer; position: relative; transition: .12s;
}
.dot.s-verde   { background: var(--green); box-shadow: 0 0 12px rgba(47,229,126,.5); }
.dot.s-amarillo{ background: var(--yellow); box-shadow: 0 0 12px rgba(255,204,63,.45); }
.dot.s-rojo    { background: var(--red); box-shadow: 0 0 12px rgba(255,92,92,.5); }
.dot:active { transform: scale(.9); }
.card-title { font-size: 17px; font-weight: 700; flex: 1; }
.card-area { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }

.cobro { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.cobro b { color: var(--green-dim); font-weight: 700; }

.nota {
  font-size: 13px; color: var(--text); line-height: 1.45; background: var(--bg2);
  border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px;
  white-space: pre-wrap; min-height: 18px; cursor: text;
}
.nota:empty::before { content: 'Sin nota — tocá para escribir'; color: #5a6e5a; }

.tareas { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tarea { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.tk {
  width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg2); flex-shrink: 0; margin-top: 1px; position: relative; cursor: pointer;
}
.tk.haciendo { border-color: var(--yellow); }
.tk.haciendo::after { content: '·'; position: absolute; inset: 0; color: var(--yellow); font-size: 22px; line-height: 14px; text-align: center; }
.tk.hecho { background: var(--green); border-color: var(--green); }
.tk.hecho::after { content: '✓'; position: absolute; inset: 0; color: #062012; font-size: 13px; font-weight: 800; text-align: center; line-height: 18px; }
.tarea-body { flex: 1; }
.tarea-txt { line-height: 1.35; }
.tarea.hecho .tarea-txt { text-decoration: line-through; color: var(--muted); }
.tarea-resp {
  font-size: 11px; color: var(--green-dim); font-weight: 700; background: none;
  border: none; padding: 0; cursor: pointer;
}
.tarea-resp.libre { color: #5a6e5a; }
.tarea-del { background: none; border: none; color: #5a6e5a; font-size: 14px; cursor: pointer; padding: 0 2px; }
.tarea-del:hover { color: var(--red); }

.card-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.add-tarea {
  flex: 1; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 7px 10px; font-size: 12px; outline: none;
}
.add-tarea:focus { border-color: var(--green-dim); }
.card-updated { font-size: 10px; color: #44563f; margin-top: 8px; text-align: right; }
.card-del { position: absolute; top: 8px; right: 10px; background: none; border: none; color: #3a4a36; font-size: 13px; cursor: pointer; }
.card-del:hover { color: var(--red); }

/* ---------- POR PERSONA ---------- */
.persona-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.persona-header h2 { margin: 0; font-size: 22px; }
.persona-header .pill { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.persona-select { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 12px; font-size: 14px; }

.mensaje-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; }
.mensaje-box .mb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mensaje-box .mb-head h3 { margin: 0; font-size: 14px; color: var(--green); }
.btn-copiar { margin-left: auto; background: var(--green); color: #062012; border: none; border-radius: 9px; padding: 7px 14px; font-weight: 700; font-size: 13px; }
.mensaje-txt { width: 100%; min-height: 120px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 12px; font-size: 13px; line-height: 1.5; font-family: inherit; resize: vertical; white-space: pre-wrap; }

.persona-tareas { display: flex; flex-direction: column; gap: 10px; }
.pt-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; border-left: 4px solid var(--line); }
.pt-card.s-verde { border-left-color: var(--green); }
.pt-card.s-amarillo { border-left-color: var(--yellow); }
.pt-card.s-rojo { border-left-color: var(--red); }
.pt-marca { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.pt-tarea { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.4; }
.pt-tarea.hecho .pt-txt { text-decoration: line-through; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px 20px; font-size: 14px; }

/* ---------- RESUMEN ---------- */
.kpis { display: flex; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.kpi { flex: 1; min-width: 90px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.kpi .n { font-size: 34px; font-weight: 800; line-height: 1; }
.kpi .l { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi.verde .n { color: var(--green); }
.kpi.amarillo .n { color: var(--yellow); }
.kpi.rojo .n { color: var(--red); }
.resumen-sec { margin-bottom: 24px; }
.resumen-sec h3 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.res-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; border-left: 4px solid var(--line); }
.res-item.s-rojo { border-left-color: var(--red); }
.res-item .ri-marca { font-weight: 700; }
.res-item .ri-nota { color: var(--muted); font-size: 13px; margin-top: 2px; }
.res-cobro { display: flex; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 7px; font-size: 13px; }
.res-cobro .rc-estado { color: var(--green-dim); font-weight: 700; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #062012; padding: 11px 20px; border-radius: 10px;
  font-weight: 700; font-size: 14px; z-index: 50; box-shadow: var(--shadow);
}

/* ---------- botón ficha + mini resumen en tarjeta ---------- */
.btn-ficha {
  background: #0f1d12; border: 1px solid var(--line); color: var(--green);
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 8px; white-space: nowrap;
}
.btn-ficha:hover { border-color: var(--green-dim); }
.ficha-mini {
  font-size: 12px; color: var(--green-dim); font-weight: 600; margin: 0 0 8px;
  background: #0c160d; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px;
}

/* ---------- FICHA slide-over ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55);
  opacity: 0; transition: opacity .22s; display: flex; justify-content: flex-end;
}
.overlay.open { opacity: 1; }
.ficha-panel {
  width: 100%; max-width: 460px; height: 100%; background: var(--bg2);
  border-left: 1px solid var(--line); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s; overflow: hidden;
}
.overlay.open .ficha-panel { transform: translateX(0); }
.fp-head { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.fp-head .dot { width: 16px; height: 16px; cursor: default; }
.fp-title h2 { margin: 0; font-size: 19px; }
.fp-area { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.fp-close { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.fp-close:hover { color: var(--red); }
.fp-body { flex: 1; overflow-y: auto; padding: 16px; }
.fp-section { font-size: 13px; font-weight: 700; color: var(--green); margin: 18px 0 8px; border-bottom: 1px dashed var(--line); padding-bottom: 5px; }
.fp-label { display: block; font-size: 11px; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
.fp-hint { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .7; }
.fp-input {
  width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 11px; font-size: 14px; font-family: inherit; outline: none;
}
.fp-input:focus { border-color: var(--green-dim); }
.fp-input:disabled { background: #0a100a; color: var(--text); opacity: .92; cursor: default; border-style: dashed; }
.fp-area-txt { min-height: 70px; resize: vertical; line-height: 1.45; }
.fp-row { display: flex; gap: 10px; margin-bottom: 10px; }
.fp-col { flex: 1; }
.fp-col-sm { flex: 0 0 110px; }
.fp-wa {
  display: inline-block; margin-top: 10px; background: #0c2a16; border: 1px solid var(--green-dim);
  color: var(--green); text-decoration: none; padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 700;
}
.fp-foot { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.fp-btn { flex: 1; padding: 11px; border-radius: 10px; border: none; font-weight: 700; font-size: 14px; background: var(--green); color: #062012; }
.fp-btn.fp-ghost, .fp-btn.fp-cancel { background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.fp-btn:active { transform: translateY(1px); }

/* ---------- EQUIPO ---------- */
.equipo-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.eq-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; transition: .12s; border-top: 3px solid var(--line);
}
.eq-card:hover { border-color: var(--green-dim); transform: translateY(-2px); }
.eq-card.eq-urg { border-top-color: var(--red); }
.eq-card.eq-libre { opacity: .62; }
.eq-head { margin-bottom: 8px; }
.eq-name { font-size: 17px; font-weight: 700; }
.eq-rol { font-size: 11px; color: var(--muted); }
.eq-badge { display: inline-block; font-size: 11px; font-weight: 700; color: var(--red); background: #2a0f0f; border: 1px solid #4a1f1f; border-radius: 7px; padding: 2px 8px; margin-bottom: 8px; }
.eq-stats { display: flex; gap: 6px; margin-bottom: 10px; }
.eq-stat { flex: 1; text-align: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 2px; }
.eq-stat .n { display: block; font-size: 21px; font-weight: 800; }
.eq-stat .l { display: block; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.eq-bar { height: 6px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.eq-bar span { display: block; height: 100%; background: var(--green); }
.eq-foot { font-size: 11px; color: var(--muted); margin-top: 7px; }

/* ---------- PERSONA controles ---------- */
.persona-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-btn { background: none; border: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 8px; }
.seg-btn.active { background: #0f1d12; color: var(--green); }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.toggle input { accent-color: var(--green); }
.kpis-sm .kpi { padding: 11px; }
.kpis-sm .kpi .n { font-size: 26px; }

.persona-grupos { display: flex; flex-direction: column; gap: 16px; }
.pgroup { }
.pgroup-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.pgroup-n { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.dot-sm { width: 11px; height: 11px; border-radius: 50%; }
.dot-sm.s-verde { background: var(--green); } .dot-sm.s-amarillo { background: var(--yellow); } .dot-sm.s-rojo { background: var(--red); }
.pt-row {
  display: flex; align-items: flex-start; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 7px; font-size: 14px; line-height: 1.4;
}
.pt-row.s-verde { border-left-color: var(--green); } .pt-row.s-amarillo { border-left-color: var(--yellow); } .pt-row.s-rojo { border-left-color: var(--red); }
.pt-row.hecho .pt-txt { text-decoration: line-through; color: var(--muted); }
.pt-row .pt-txt { flex: 1; }
.pt-chip { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; white-space: nowrap; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .tabs { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .tab { flex: 1; text-align: center; padding: 9px 6px; }
  .whoami { margin-left: auto; }
  .grid { grid-template-columns: 1fr; }
  main { padding: 14px 12px 80px; }
}
