/* ==========================================================================
   EduTrack — Consejería (estilos propios del módulo, cargados sobre app.css)
   ========================================================================== */

/* ── Variables propias del módulo ────────────────────────────────── */
:root { --success: #1f9254; }

/* ── btn-sm (no existe en app.css) ──────────────────────────────── */
.btn-sm { height: 32px; font-size: 13px; padding: 0 12px; }

/* ── Tab nav ─────────────────────────────────────────────────────── */
.tab-nav      { display: flex; border-bottom: 1px solid var(--line); padding: 0 4px;
  background: #fff; margin-bottom: 4px; }
.tab-btn      { 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; }
.tab-btn svg  { width: 16px; height: 16px; flex: none; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-badge    { background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 9999px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 4px; }

/* ── Tab panels ──────────────────────────────────────────────────── */
.tab-panel    { padding: 20px 0; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-title  { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.panel-sub    { font-size: 13px; margin-top: 2px; }
.panel-search { flex: none; }
.search-input { height: 34px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; font-size: 13px; outline: none; width: 220px; }
.search-input:focus { border-color: #999; }

/* ── Filter bar ─────────────────────────────────────────────────── */
.filter-bar   { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-select { height: 32px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; font-size: 13px; color: var(--ink); background: #fff; cursor: pointer; }

/* ── Students grid ───────────────────────────────────────────────── */
.students-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; }
.student-card  { border: 1px solid var(--line); border-radius: 14px; padding: 18px 14px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; transition: box-shadow .15s, border-color .15s; }
.student-card:hover { border-color: #bbb; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.student-avatar { width: 62px; height: 62px; border-radius: 50%; object-fit: cover;
  background: var(--chip); flex: none; }
.student-name  { font-size: 13px; font-weight: 600; line-height: 1.3; }
.student-meta  { font-size: 12px; color: var(--muted); }
.students-empty { grid-column: 1 / -1; text-align: center; padding: 48px 0; color: var(--muted); }

/* ── List container ──────────────────────────────────────────────── */
.list-container { display: flex; flex-direction: column; gap: 0; }
.list-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; }
.list-row:hover { background: var(--row-hover); }
.list-row-body  { flex: 1; min-width: 0; }
.list-row-cod   { font-size: 11px; color: var(--muted); margin-bottom: 1px; }
.list-row-title { font-size: 13px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.list-row-sub   { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.list-row-meta  { display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  flex: none; }
.list-row-date  { font-size: 11px; color: var(--muted); white-space: nowrap; }
.list-empty     { text-align: center; padding: 48px 0; color: var(--muted); font-size: 14px; }
.del-row-btn    { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border: none; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer;
  padding: 0; transition: background .12s, color .12s; }
.del-row-btn:hover { background: #fee2e2; color: #b91c1c; }
.obs-avatar      { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.obs-avatar-mono { display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .5px; }

/* ── Status chips ────────────────────────────────────────────────── */
.chip         { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 9999px; }
.chip-borrador   { background: #f0f0f0; color: #555; }
.chip-interno    { background: #eff6ff; color: #2563eb; }
.chip-enviado    { background: #ecfdf5; color: var(--success); }
.chip-cerrado    { background: #f5f5f5; color: #888; }
.chip-pendiente  { background: #fef9c3; color: #854d0e; }
.chip-proceso    { background: #eff6ff; color: #2563eb; }
.chip-atendido   { background: #ecfdf5; color: var(--success); }

/* ── Overlay / Modal ─────────────────────────────────────────────── */
.overlay          { position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: flex-start; justify-content: flex-end; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.overlay-panel    { position: relative; z-index: 1; width: min(520px, 100vw); height: 100vh;
  background: #fff; overflow-y: auto; box-shadow: -4px 0 32px rgba(0,0,0,.12);
  display: flex; flex-direction: column; }
#overlay-content  { flex: 1; }

/* ── Modal sections ──────────────────────────────────────────────── */
.modal-header     { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); position: sticky;
  top: 0; background: #fff; z-index: 10; }
.modal-title      { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.modal-close      { width: 32px; height: 32px; border: none; background: var(--chip);
  border-radius: 8px; cursor: pointer; font-size: 18px; display: flex; align-items: center;
  justify-content: center; color: var(--muted); flex: none; }
.modal-close:hover { background: #e0e0e0; color: var(--ink); }
.modal-body       { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer     { padding: 16px 20px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0;
  background: #fff; }

/* ── Student profile ─────────────────────────────────────────────── */
.student-profile  { display: flex; align-items: center; gap: 14px; }
.profile-avatar   { width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  background: var(--chip); flex: none; }
.profile-info h3  { font-size: 15px; font-weight: 700; }
.profile-info p   { font-size: 13px; color: var(--muted); margin-top: 2px; }

.action-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-btn       { display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; font-size: 12px; font-weight: 500; color: var(--ink);
  transition: background .12s, border-color .12s; text-align: center; }
.action-btn:hover { background: var(--row-hover); border-color: #bbb; }
.action-btn svg   { width: 22px; height: 22px; color: var(--brand); }

/* ── Forms ───────────────────────────────────────────────────────── */
.field            { display: flex; flex-direction: column; gap: 5px; }
.field-label      { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.field input,
.field select,
.field textarea   { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; outline: none; background: #fff; width: 100%; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: #999; }
.field input[readonly] { background: #f9f9f9; color: var(--muted); cursor: default; }
.field textarea   { resize: vertical; min-height: 80px; }
.radio-group      { display: flex; flex-direction: column; gap: 6px; }
.radio-option     { display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; padding: 5px 0; }
.radio-option input[type="radio"],
.radio-option input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; }
.guide-note       { font-size: 12px; color: var(--ink-3); background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; line-height: 1.5; }
.divider          { border: none; border-top: 1px solid var(--line-soft); }
.toggle-row       { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 13px; }
.toggle-row input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }

/* ── Historico inline ────────────────────────────────────────────── */
.historico-list   { display: flex; flex-direction: column; gap: 6px; }
.hist-row         { border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; }
.hist-row-header  { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hist-row-cat     { font-weight: 600; }
.hist-row-body    { color: var(--muted); font-size: 12px; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Detail grid ─────────────────────────────────────────────────── */
.detail-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-item      { display: flex; flex-direction: column; gap: 2px; }
.detail-label     { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.detail-value     { font-size: 13px; }
.detail-full      { grid-column: 1 / -1; }

/* ── Spinner ─────────────────────────────────────────────────────── */
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .65s linear infinite; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .overlay-panel { width: 100vw; }
  .students-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .action-grid { grid-template-columns: 1fr 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* Chips de salón (Mis Estudiantes) */
.hr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hr-chip  { border: 1px solid var(--line); background: #fff; color: var(--ink-3, #555); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.hr-chip:hover  { border-color: var(--brand); color: var(--brand); }
.hr-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
