/* Panel del profesor PFTR. */
:root {
    --p-primary: #0f6e56;
    --p-accent: #1d9e75;
    --p-bg: #f3f6f5;
    --p-border: #e0e6e3;
    --p-text: #1e2621;
    --p-muted: #66756e;
    --p-danger: #c1121f;
    --p-ok: #1a7f37;
    /* Tokens del módulo compartido de gestión (mapeados a la marca del profesor). */
    --g-primary: var(--p-primary);
    --g-accent: var(--p-accent);
    --g-bg: var(--p-bg);
    --g-border: var(--p-border);
    --g-text: var(--p-text);
    --g-muted: var(--p-muted);
    --g-danger: var(--p-danger);
    --g-ok: var(--p-ok);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: 'Poppins', sans-serif; background: var(--p-bg); color: var(--p-text); min-height: 100vh; }

/* --- Login --- */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: linear-gradient(135deg, #0f6e56 0%, #1d9e75 100%);
}
.login-card { background: #fff; border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,0.25); }
.login-head { text-align: center; margin-bottom: 24px; }
.login-head i { font-size: 2.2rem; color: var(--p-primary); }
.login-head h1 { font-size: 1.4rem; margin: 12px 0 4px; }
.login-head p { color: var(--p-muted); font-size: 0.85rem; }
.foot-hint { text-align: center; color: var(--p-muted); font-size: 0.8rem; margin-top: 16px; }
.volver-inicio { display: block; text-align: center; margin-top: 16px; color: var(--p-muted); text-decoration: none; font-size: 0.88rem; }
.volver-inicio:hover { color: var(--p-primary); }
.volver-inicio i { margin-right: 6px; }

form label { display: block; font-size: 0.85rem; font-weight: 500; margin: 12px 0 6px; }
form input, form textarea, form select {
    width: 100%; padding: 11px 13px; border: 1px solid var(--p-border); border-radius: 9px;
    font-family: inherit; font-size: 0.95rem; background: #fff;
}
form input:focus, form textarea:focus, form select:focus { outline: 2px solid var(--p-accent); border-color: transparent; }

.btn-primary {
    background: var(--p-primary); color: #fff; border: none; border-radius: 9px;
    padding: 12px 20px; font-weight: 600; font-size: 0.95rem; cursor: pointer; margin-top: 4px;
}
.btn-primary:hover { background: var(--p-accent); }

.error-msg { color: var(--p-danger); font-size: 0.88rem; margin-top: 12px; min-height: 1em; }
.inline-msg { font-size: 0.88rem; margin-left: 12px; }
.inline-msg.ok { color: var(--p-ok); }
.inline-msg.err { color: var(--p-danger); }
.loading, .empty { color: var(--p-muted); font-size: 0.9rem; padding: 14px; text-align: center; }

/* --- Header / layout --- */
.prof-header { background: var(--p-primary); color: #fff; padding: 14px 26px; display: flex; justify-content: space-between; align-items: center; }
.prof-brand { font-weight: 600; font-size: 1.1rem; }
.prof-user { display: flex; align-items: center; gap: 20px; font-size: 0.9rem; }
.prof-user a { color: #ffd700; text-decoration: none; }

.prof-main { max-width: 1040px; margin: 0 auto; padding: 30px 20px 60px; }
.prof-panel { background: #fff; border: 1px solid var(--p-border); border-radius: 14px; padding: 24px; margin-bottom: 24px; }
.prof-panel h2 { font-size: 1.15rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.prof-panel h2 i { color: var(--p-accent); }

/* --- Cursos --- */
.cursos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.curso-card { border: 1px solid var(--p-border); border-radius: 12px; padding: 16px; }
.curso-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.curso-card .meta { font-size: 0.85rem; color: var(--p-muted); display: flex; gap: 14px; }
.curso-card .meta b { color: var(--p-text); }
.badge { font-size: 0.72rem; padding: 2px 9px; border-radius: 99px; background: #e6f4ea; color: var(--p-ok); }
.badge.off { background: #f0f0f0; color: var(--p-muted); }

/* --- Mensajes --- */
.mensajes-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
@media (max-width: 720px) { .mensajes-layout { grid-template-columns: 1fr; } }
.conv-list { border: 1px solid var(--p-border); border-radius: 12px; overflow: hidden; max-height: 420px; overflow-y: auto; }
.conv-item { padding: 12px 14px; border-bottom: 1px solid var(--p-border); cursor: pointer; }
.conv-item:hover { background: var(--p-bg); }
.conv-item.active { background: #e6f4ea; }
.conv-item .conv-name { font-weight: 500; font-size: 0.92rem; display: flex; justify-content: space-between; align-items: center; }
.conv-item .conv-sub { font-size: 0.78rem; color: var(--p-muted); }
.conv-item .dot { background: var(--p-danger); color: #fff; border-radius: 99px; font-size: 0.7rem; padding: 1px 7px; }

.conv-detail { border: 1px solid var(--p-border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; min-height: 300px; }
.thread { flex: 1; display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; margin-bottom: 12px; }
.msg { max-width: 80%; }
.msg .who { font-size: 0.72rem; color: var(--p-muted); margin-bottom: 2px; }
.msg .bubble { padding: 8px 12px; border-radius: 12px; font-size: 0.9rem; line-height: 1.4; background: #eef1f0; word-wrap: break-word; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg.mine .bubble { background: #d7efe4; }
.reply-form { display: flex; gap: 8px; }
.reply-form input { flex: 1; }
.reply-form button { background: var(--p-primary); color: #fff; border: none; border-radius: 9px; padding: 0 16px; cursor: pointer; }

/* --- Anuncios --- */
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid-form .full { grid-column: 1 / -1; }
.grid-form label { margin-top: 0; }
@media (max-width: 620px) { .grid-form { grid-template-columns: 1fr; } }
.anuncios-list { margin-top: 18px; }
.anuncio-row { border: 1px solid var(--p-border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.anuncio-row .an-title { font-weight: 500; }
.anuncio-row .an-meta { font-size: 0.78rem; color: var(--p-muted); }
.anuncio-row .an-body { font-size: 0.9rem; color: var(--p-text); margin-top: 4px; }

/* --- Roster --- */
.sel-label { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 0.9rem; }
.sel-label select { width: auto; min-width: 220px; }
.table-wrap { overflow-x: auto; }
.prof-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.prof-table th, .prof-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--p-border); }
.prof-table th { color: var(--p-muted); font-weight: 500; font-size: 0.82rem; }
.bar { height: 7px; background: #e7ece9; border-radius: 99px; overflow: hidden; width: 110px; display: inline-block; vertical-align: middle; }
.bar > span { display: block; height: 100%; background: var(--p-accent); }

/* --- Navegación por pestañas del panel --- */
.prof-tabs {
    display: flex; gap: 8px; margin-bottom: 22px;
    border-bottom: 1px solid var(--p-border); flex-wrap: wrap;
}
.prof-tab-btn {
    background: none; border: none; border-bottom: 3px solid transparent;
    padding: 12px 20px; font-family: inherit; font-size: 0.98rem; font-weight: 500;
    color: var(--p-muted); cursor: pointer; display: inline-flex; align-items: center;
    gap: 9px; margin-bottom: -1px; transition: color .15s ease, border-color .15s ease;
}
.prof-tab-btn:hover { color: var(--p-text); }
.prof-tab-btn.active { color: var(--p-primary); border-bottom-color: var(--p-primary); font-weight: 600; }

/* Texto tenue (usado también por el módulo de gestión). */
.hint { color: var(--p-muted); font-size: 0.88rem; margin-bottom: 16px; }

/* --- Tarjeta de curso con CTA de gestión --- */
.curso-card { display: flex; flex-direction: column; gap: 10px; }
.curso-card .card-cta { margin-top: auto; }
.curso-card .btn-gestionar {
    display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center;
    background: var(--p-primary); color: #fff; border: none; border-radius: 9px;
    padding: 10px 14px; font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.curso-card .btn-gestionar:hover { background: var(--p-accent); }

/* Encabezado de sección con acción a la derecha. */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin-bottom: 0; }
