/* ==========================================================================
   EduTrack — Módulo Bullying y convivencia
   Estilos propios (se carga sobre app.css y consejeria.css, que ya aportan
   .tab-nav/.tab-btn/.tab-panel/.list-row/.chip/.field/.btn...).
   ========================================================================== */

/* ── Chip en la ficha del estudiante (verde, mismo estilo que los demás) ── */
.bully-btn { display: inline-flex; align-items: center; gap: 7px; background: #ecfdf5; color: #1f9254;
  font-size: 12.5px; font-weight: 700; padding: 8px 14px; border-radius: 8px; border: none;
  cursor: pointer; transition: background .13s ease; white-space: nowrap; }
.bully-btn:hover { background: #d1fae5; }

/* ── Tabs propias: NO usan .tab-btn/.tab-panel porque Consejería enlaza esos
   selectores de forma global y rompería el cambio de pestaña. ── */
.bully-tab { display: flex; align-items: center; gap: 7px; padding: 0 16px; height: 44px;
  font-size: 13px; font-weight: 500; color: var(--muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer; position: relative;
  margin-bottom: -1px; white-space: nowrap; }
.bully-tab svg { width: 16px; height: 16px; flex: none; }
.bully-tab:hover { color: var(--ink); }
.bully-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.bully-tabpanel { padding: 20px 0; }

/* ── Overlay (modal centrado, reusa .modal-header/.modal-body/.modal-footer) ── */
.bully-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 210;
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.bully-backdrop { position: absolute; inset: 0; }
.bully-panel { position: relative; z-index: 1; background: #fff; border-radius: 14px; width: 100%; max-width: 640px;
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.22); }
.bully-panel #bully-content { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.bully-body { overflow-y: auto; padding: 20px 24px 8px; flex: 1; min-height: 0; display: flex;
  flex-direction: column; gap: 16px; }
.bully-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.bully-grid .full { grid-column: 1 / -1; }

/* ── Checkboxes de tipo de situación ─────────────────────────────── */
.bully-checks { display: flex; flex-direction: column; gap: 6px; }
.bully-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .12s, background .12s; }
.bully-check:hover { background: var(--row-hover); }
.bully-check input { accent-color: var(--brand); width: 16px; height: 16px; }

/* ── Evidencias ──────────────────────────────────────────────────── */
.bully-drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 14px;
  text-align: center; font-size: 12.5px; color: var(--muted); cursor: pointer; transition: border-color .12s; }
.bully-drop:hover { border-color: #c2410c; }
.bully-evi-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bully-evi-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line-soft); border-radius: 8px; font-size: 12.5px; }
.bully-evi-item .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bully-evi-item .s { color: var(--muted); flex: none; }
.bully-evi-x { border: none; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: 6px; width: 22px; height: 22px; flex: none; }
.bully-evi-x:hover { background: #fee2e2; color: #b91c1c; }

/* ── Confirmación ────────────────────────────────────────────────── */
.bully-confirm { text-align: center; padding: 40px 28px; display: flex; flex-direction: column;
  align-items: center; gap: 12px; }
.bully-confirm .ok { width: 56px; height: 56px; border-radius: 50%; background: #ecfdf5;
  display: flex; align-items: center; justify-content: center; color: #1f9254; }
.bully-confirm h3 { font-size: 17px; font-weight: 700; }
.bully-confirm p { font-size: 13px; color: var(--muted); max-width: 380px; }

/* ── Estado chips ────────────────────────────────────────────────── */
.chip-remitido   { background: #fef9c3; color: #854d0e; }
.chip-seguimiento { background: #eff6ff; color: #2563eb; }

/* ── Listado de casos ────────────────────────────────────────────── */
.bully-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 6px;
  cursor: pointer; transition: background .12s; }
.bully-row:hover { background: var(--row-hover); }
.bully-row-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--chip); }
.bully-row-avatar.mono { display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; }
.bully-row-body { flex: 1; min-width: 0; }
.bully-row-title { font-size: 13px; font-weight: 600; }
.bully-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.bully-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.bully-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.bully-tag { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 9999px;
  background: #fff7ed; color: #c2410c; }
.bully-tag-obs { background: #eef2ff; color: #4338ca; }

/* ── Detalle del caso ────────────────────────────────────────────── */
.bully-detail-relato { font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.bully-subhead { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); margin: 4px 0 2px; }
.bully-inv { display: flex; flex-direction: column; gap: 6px; }
.bully-inv-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line-soft); border-radius: 8px; font-size: 13px; }
.bully-inv-item .rol { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 9999px; }
.bully-inv-item .rol.reportado { background: #eef2ff; color: #4338ca; }
.bully-inv-item .rol.presunto  { background: #fef2f2; color: #b91c1c; }
.bully-inv-item .n { flex: 1; min-width: 0; }
.bully-search-box { position: relative; }
.bully-search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; max-height: 220px;
  overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.bully-search-results button { display: block; width: 100%; text-align: left; border: none;
  background: none; padding: 9px 12px; font-size: 13px; cursor: pointer; }
.bully-search-results button:hover { background: var(--row-hover); }
.bully-search-results .muted { font-size: 11.5px; }

/* ── Analíticas ──────────────────────────────────────────────────── */
.b-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
  margin-bottom: 16px; }
.b-kpi { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; }
.b-kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.5px; color: var(--brand); }
.b-kpi .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.b-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.b-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; }
.b-card-head { font-size: 14px; font-weight: 700; }
.b-card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; margin-bottom: 12px; }
.b-bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.b-barcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 4px; min-width: 0; }
.b-bar { width: 100%; max-width: 42px; background: var(--brand); border-radius: 5px 5px 0 0;
  min-height: 2px; transition: height .2s; }
.b-barlab { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.b-barval { font-size: 11px; font-weight: 700; }
.b-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.b-donut { width: 140px; height: 140px; flex: none; }
.b-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.b-legend .lg { display: flex; align-items: center; gap: 8px; }
.b-legend .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.b-legend .n { color: var(--muted); margin-left: auto; padding-left: 10px; }
.b-empty { text-align: center; padding: 40px 0; color: var(--muted); font-size: 14px; }

@media (max-width: 600px) {
  .bully-grid { grid-template-columns: 1fr; }
  .bully-panel { max-width: 100vw; }
}
