/* Menu → Teachers (admins) */
.tm-modal { width: 940px; max-width: 96vw; max-height: 88vh; overflow-y: auto; }
.tm-head { display: flex; align-items: center; justify-content: space-between; }
.tm-head h3 { margin-bottom: 8px; }
.tm-x { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.tm-x:hover { color: var(--text); }
.tm-intro { font-size: 13px; margin-bottom: 14px; }

/* Tabs: Teachers / Students */
.tm-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tm-tab { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border-l); background: var(--bg-panel); color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.tm-tab:hover:not(.active) { background: var(--bg-hover); color: var(--text); }
.tm-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tm-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tm-add input { flex: 1 1 180px; padding: 9px 12px; background: var(--bg-input); border: 1px solid var(--border-l); border-radius: 8px; color: var(--text); font-size: 13.5px; outline: none; }
.tm-add input:focus { border-color: var(--accent); }
.tm-primary { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.tm-primary:disabled { opacity: .6; cursor: wait; }
.tm-note { padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6; margin-bottom: 12px; background: var(--bg-input); color: var(--text); border: 1px solid var(--border-l); word-break: break-word; }
.tm-note.ok  { border-color: rgba(52,211,153,.5); }
.tm-note.err { border-color: rgba(248,113,113,.6); color: #fca5a5; }
.tm-note code { background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 5px; font-family: 'Syne Mono', monospace; color: #7dd3fc; }
.tm-hint { color: var(--muted); font-size: 12px; }
.tm-mini { padding: 6px 10px; border-radius: 7px; border: 1px solid var(--border-l); background: var(--bg-panel); color: var(--text); font-size: 12px; cursor: pointer; }
.tm-mini:hover { background: var(--bg-hover); }
.tm-empty { color: var(--muted); font-size: 13px; padding: 12px; text-align: center; }
.tm-empty.err { color: #fca5a5; }

/* Grupos pendientes de alumnos válidos */
.tm-pending { background: rgba(251,191,36,.10); border: 1px solid rgba(251,191,36,.35); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.tm-pending-head { font-weight: 700; font-size: 13px; color: #fbbf24; margin-bottom: 2px; }
.tm-pending-hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.tm-pending-list { display: flex; flex-direction: column; gap: 4px; }
.tm-pending-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 5px 8px; background: var(--bg-input); border-radius: 7px; flex-wrap: wrap; }
.tm-pending-name { font-weight: 600; color: var(--text); }
.tm-pending-teacher { color: #9ba7b4; }
.tm-pending-date { color: var(--muted); margin-left: auto; white-space: nowrap; }

.tm-badge { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.tm-badge.owner { background: rgba(250,204,21,.18); color: #fde047; }
.tm-badge.admin { background: rgba(125,211,252,.18); color: #7dd3fc; }
.tm-badge.off   { background: rgba(248,113,113,.18); color: #fca5a5; }
.tm-badge.inst  { background: rgba(134,239,172,.18); color: #86efac; }

/* Teachers table */
.tm-table-wrap { overflow-x: auto; }
.tm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tm-table thead th {
  text-align: left; padding: 8px 10px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  border-bottom: 1px solid var(--border-l); white-space: nowrap; cursor: pointer; user-select: none;
}
.tm-table thead th:hover { color: var(--text); }
.tm-table thead th.sorted { color: var(--accent); }
.tm-table thead th[data-dir="asc"]::after  { content: ' ↑'; }
.tm-table thead th[data-dir="desc"]::after { content: ' ↓'; }
.tm-table tbody tr.tm-row { border-bottom: 1px solid var(--border); cursor: context-menu; }
.tm-table tbody tr.tm-row:hover { background: var(--bg-hover); }
.tm-table tbody tr.tm-row.is-off { opacity: .6; }
.tm-table td { padding: 9px 10px; color: var(--text); vertical-align: middle; }
.tm-td-name { font-weight: 600; white-space: nowrap; }
.tm-td-email { color: var(--muted); word-break: break-all; min-width: 260px; }
.tm-td-num { text-align: center; }
.tm-td-usage { color: #c9d1d9; font-size: 12.5px; }
.tm-usage-none { color: var(--muted); }
.tm-usage-btn { padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border-l); background: var(--bg-panel); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tm-usage-btn:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }

/* Usage detail modal (opened by the "View details" button) */
.tm-usage-modal { width: 560px; max-width: 92vw; max-height: 84vh; overflow-y: auto; }
.tm-usage-stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.tm-usage-stat { flex: 1; min-width: 140px; background: var(--bg-input); border: 1px solid var(--border-l); border-radius: 10px; padding: 12px 14px; text-align: center; }
.tm-usage-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.tm-usage-stat-value { font-size: 20px; font-weight: 800; color: var(--accent); font-family: 'Syne Mono', monospace; }
.tm-usage-stat-value.small { font-size: 15px; }
.tm-usage-stat-of { font-size: 11px; color: var(--muted); font-weight: 600; }
.tm-usage-stat-sub { font-size: 10.5px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.tm-usage-breakdown { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #c9d1d9; }
.tm-usage-month { font-weight: 600; }
.tm-usage-today { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.tm-usage-daylist-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 16px 0 6px; }
.tm-usage-daylist { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; padding-right: 4px; }
.tm-usage-day-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: #c9d1d9; background: var(--bg-input); border: 1px solid var(--border-l); border-radius: 7px; padding: 7px 12px; }
.tm-usage-day-date { font-family: 'Syne Mono', monospace; font-weight: 700; color: var(--text); flex-shrink: 0; }
.tm-usage-day-nums { flex: 1; text-align: center; color: var(--muted); }
.tm-usage-day-cost { font-family: 'Syne Mono', monospace; color: var(--accent); font-weight: 700; flex-shrink: 0; }
.tm-usage-day-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 10px 0; }

/* Students tab */
.ts-search { margin-bottom: 12px; }
.ts-search input { width: 100%; padding: 9px 12px; background: var(--bg-input); border: 1px solid var(--border-l); border-radius: 8px; color: var(--text); font-size: 13.5px; outline: none; }
.ts-search input:focus { border-color: var(--accent); }

/* Danger item inside the shared .ctx-menu (Disable) */
.ctx-item.tm-ctx-danger { color: #fca5a5; }
.ctx-item.tm-ctx-danger:hover { background: rgba(248,113,113,.14); }
