/* =====================================================================
   Profesor Web · estilos globales (Bootstrap 5 + ajustes propios)
   ===================================================================== */
:root {
    --pw-tinta: #1d2340;
    --pw-tinta-2: #2b3366;
    --pw-acento: #f4a23c;
    --pw-acento-2: #ffcf8a;
    --pw-verde: #1f9d6b;
    --pw-rojo: #d6455d;
    --pw-amarillo: #f1b82d;
    --pw-azul: #3f62e0;
    --pw-fondo: #f4f5fb;
    --pw-borde: #e3e6f2;
    --pw-texto: #283046;
    --pw-suave: #6b7393;
    --pw-radio: 14px;
    --pw-sombra: 0 6px 24px rgba(29, 35, 64, .08);
    --pw-sidebar: 260px;
}

html, body { height: 100%; }
body {
    font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--pw-fondo);
    color: var(--pw-texto);
    font-size: 15.5px;
}
h1, h2, h3, h4, .pw-titulo { font-family: "Poppins", "Nunito", sans-serif; font-weight: 600; letter-spacing: -.01em; }
a { color: var(--pw-azul); }

/* ---------- Estructura con menú lateral ---------- */
.pw-shell { display: flex; min-height: 100vh; }
.pw-sidebar {
    width: var(--pw-sidebar); flex: 0 0 var(--pw-sidebar);
    background: linear-gradient(180deg, var(--pw-tinta) 0%, #151a33 100%);
    color: #cfd4ee; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; z-index: 1040;
}
.pw-marca { display: flex; align-items: center; gap: .7rem; padding: 1.3rem 1.25rem 1rem; color: #fff; text-decoration: none; }
.pw-marca:hover { color: #fff; }
.pw-logo {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: var(--pw-acento); color: var(--pw-tinta); font-size: 1.35rem;
}
.pw-marca b { font-family: "Poppins", sans-serif; font-size: 1.1rem; display: block; line-height: 1.1; }
.pw-marca small { color: #9aa2cc; font-size: .75rem; }

.pw-curso {
    margin: .25rem 1rem 1rem; padding: .8rem .9rem; border-radius: 12px;
    background: rgba(255,255,255,.06); font-size: .82rem; line-height: 1.35;
}
.pw-curso .etq { color: var(--pw-acento-2); text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; font-weight: 700; }
.pw-curso strong { color: #fff; display: block; font-size: .92rem; }

.pw-menu { list-style: none; margin: 0; padding: 0 .75rem 1rem; }
.pw-menu .grupo { padding: 1rem .6rem .35rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #7d86b5; font-weight: 700; }
.pw-menu a {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px;
    color: #d6dbf5; text-decoration: none; font-weight: 600; font-size: .92rem; transition: background .15s, color .15s;
}
.pw-menu a i { font-size: 1.05rem; opacity: .85; width: 1.2rem; text-align: center; }
.pw-menu a:hover { background: rgba(255,255,255,.08); color: #fff; }
.pw-menu a.activo { background: var(--pw-acento); color: var(--pw-tinta); }
.pw-menu a.activo i { opacity: 1; }
.pw-menu a.salir { color: #ff9fae; }

.pw-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pw-topbar {
    position: sticky; top: 0; z-index: 1030; background: rgba(244,245,251,.85); backdrop-filter: blur(8px);
    display: flex; align-items: center; gap: .75rem; padding: .85rem 1.5rem; border-bottom: 1px solid var(--pw-borde);
}
.pw-topbar .saludo { font-weight: 700; }
.pw-topbar .saludo small { display: block; color: var(--pw-suave); font-weight: 600; font-size: .78rem; }
.pw-avatar {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    background: var(--pw-tinta-2); color: #fff; font-weight: 700;
}
.pw-contenido { padding: 1.5rem; flex: 1 1 auto; }
.pw-pie { padding: 1rem 1.5rem; color: var(--pw-suave); font-size: .8rem; text-align: center; }

.pw-toggle { display: none; border: 0; background: var(--pw-tinta); color: #fff; width: 40px; height: 40px; border-radius: 10px; }
.pw-velo { display: none; }

@media (max-width: 991.98px) {
    .pw-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    body.menu-abierto .pw-sidebar { transform: none; }
    body.menu-abierto .pw-velo { display: block; position: fixed; inset: 0; background: rgba(10,12,30,.45); z-index: 1035; }
    .pw-toggle { display: inline-grid; place-items: center; }
    .pw-contenido { padding: 1rem; }
    .pw-topbar { padding: .7rem 1rem; }
}

/* ---------- Diseño público (login / estudiantes) ---------- */
.pw-publico { min-height: 100vh; display: flex; flex-direction: column; }
.pw-publico-barra { background: var(--pw-tinta); color: #fff; padding: .8rem 1.5rem; display: flex; align-items: center; gap: .75rem; }
.pw-publico-barra a { color: #fff; text-decoration: none; }
.pw-publico-cuerpo { flex: 1; padding: 1.5rem; }

/* ---------- Tarjetas ---------- */
.pw-card { background: #fff; border: 1px solid var(--pw-borde); border-radius: var(--pw-radio); box-shadow: var(--pw-sombra); }
.pw-card-body { padding: 1.4rem; }
.pw-encabezado { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.pw-encabezado h1 { font-size: 1.55rem; margin: 0; }
.pw-encabezado p { margin: .15rem 0 0; color: var(--pw-suave); }
.pw-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: #eef1ff; color: var(--pw-tinta-2); font-weight: 700; font-size: .8rem; }

.btn { border-radius: 10px; font-weight: 700; }
.btn-pw { background: var(--pw-tinta-2); color: #fff; }
.btn-pw:hover { background: var(--pw-tinta); color: #fff; }
.btn-acento { background: var(--pw-acento); color: var(--pw-tinta); }
.btn-acento:hover { background: #e48f22; color: var(--pw-tinta); }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5a; color: #fff; }
.form-control, .form-select { border-radius: 10px; border-color: var(--pw-borde); padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--pw-azul); box-shadow: 0 0 0 .2rem rgba(63,98,224,.15); }
.form-label { font-weight: 700; font-size: .88rem; color: var(--pw-suave); }

/* ---------- Avisos (toasts) ---------- */
.pw-avisos { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.pw-aviso { background: #fff; border-left: 5px solid var(--pw-azul); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: .85rem 1rem; display: flex; gap: .7rem; align-items: flex-start; animation: entra .25s ease; }
.pw-aviso.success { border-color: var(--pw-verde); }
.pw-aviso.danger { border-color: var(--pw-rojo); }
.pw-aviso.warning { border-color: var(--pw-amarillo); }
.pw-aviso .cerrar { margin-left: auto; border: 0; background: none; font-size: 1.1rem; color: var(--pw-suave); }
@keyframes entra { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* =====================================================================
   MODERNIZACIÓN AUTOMÁTICA DE LAS PÁGINAS ANTIGUAS
   (tablas de diseño, botones con colores en línea, GridView, etc.)
   ===================================================================== */
.pw-legado { overflow-wrap: anywhere; }
.pw-legado table { max-width: 100%; }
.pw-legado img { max-width: 100%; height: auto; }
.pw-legado input[type=text], .pw-legado input[type=password], .pw-legado input[type=email], .pw-legado input[type=number],
.pw-legado input[type=date], .pw-legado input[type=file], .pw-legado select, .pw-legado textarea {
    border: 1px solid var(--pw-borde); border-radius: 9px; padding: .45rem .7rem; background: #fff; max-width: 100%;
    font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.pw-legado input[type=text]:focus, .pw-legado input[type=password]:focus, .pw-legado select:focus, .pw-legado textarea:focus {
    outline: 0; border-color: var(--pw-azul); box-shadow: 0 0 0 .2rem rgba(63,98,224,.15);
}
.pw-legado input[type=submit]:not(.btn), .pw-legado input[type=button]:not(.btn), .pw-legado button:not(.btn):not(.cerrar):not(.flatpickr-day) {
    border: 0 !important; border-radius: 10px !important; padding: .55rem 1.1rem !important; height: auto !important;
    min-height: 40px; font-weight: 700 !important; font-family: inherit !important; font-size: .95rem !important;
    background-color: var(--pw-tinta-2); color: #fff; cursor: pointer; margin: .2rem .15rem;
    box-shadow: 0 3px 10px rgba(29,35,64,.12); transition: transform .1s, filter .15s; width: auto !important; max-width: 100%;
}
.pw-legado input[type=submit]:not(.btn):hover, .pw-legado input[type=button]:not(.btn):hover { filter: brightness(1.08); }
.pw-legado input[type=submit]:active, .pw-legado input[type=button]:active { transform: translateY(1px); }
.pw-legado input[type=submit][disabled], .pw-legado input[type=button][disabled] { opacity: .5; cursor: not-allowed; }
/* Colores antiguos -> paleta nueva */
.pw-legado [style*="background-color:Maroon" i], .pw-legado [style*="background-color:#990000" i] { background-color: var(--pw-rojo) !important; color: #fff !important; }
.pw-legado input[style*="background-color:#003300" i], .pw-legado input[style*="background-color:DarkGreen" i] { background-color: var(--pw-verde) !important; color: #fff !important; }
.pw-legado input[style*="background-color:#000066" i], .pw-legado input[style*="background-color:Navy" i] { background-color: var(--pw-tinta-2) !important; color: #fff !important; }
.pw-legado input[style*="background-color:#FFFF66" i], .pw-legado input[style*="background-color:#FFCC00" i], .pw-legado input[style*="background-color:Yellow" i] { background-color: var(--pw-amarillo) !important; color: var(--pw-tinta) !important; }
/* Títulos grandes de las páginas antiguas */
.pw-legado span[style*="font-size:X-Large" i], .pw-legado span[style*="font-size:XX-Large" i] {
    font-family: "Poppins", sans-serif !important; font-size: 1.5rem !important; color: var(--pw-tinta) !important; display: inline-block; margin: .2rem 0 .8rem;
}
.pw-legado td[bgcolor], .pw-legado table[bgcolor] { background: transparent !important; }
.pw-legado span[style*="color:#000099" i], .pw-legado span[style*="color:#0000CC" i] { color: var(--pw-tinta-2) !important; }

/* GridView -> tabla moderna (site.js agrega la clase pw-grid) */
.pw-tabla { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1px solid var(--pw-borde); background: #fff; margin: .6rem 0 1rem; }
table.pw-grid { width: 100%; border-collapse: collapse !important; color: var(--pw-texto) !important; font-size: .92rem; }
table.pw-grid th { background: var(--pw-tinta) !important; color: #fff !important; padding: .7rem .8rem !important; font-weight: 700; text-align: left; white-space: nowrap; border: 0 !important; }
table.pw-grid th a { color: #fff !important; }
table.pw-grid td { padding: .6rem .8rem !important; border: 0 !important; border-top: 1px solid var(--pw-borde) !important; vertical-align: middle; }
table.pw-grid tr, table.pw-grid tr td { background-color: transparent !important; color: inherit !important; font-weight: normal; }
table.pw-grid tr:nth-child(even) td { background: #fafbff !important; }
table.pw-grid tr:hover td { background: #f0f3ff !important; }
table.pw-grid input[type=image] { width: 34px !important; height: 34px !important; border-radius: 8px; object-fit: cover; }
table.pw-grid input[type=text] { min-width: 60px; }

/* Calendario (flatpickr) */
.flatpickr-calendar { border-radius: 12px; }

/* ---------- Utilidades ---------- */
.pw-foto { width: 100%; max-width: 260px; aspect-ratio: 1/1; object-fit: cover; border-radius: 18px; border: 4px solid #fff; box-shadow: var(--pw-sombra); background: #e9ecf8; }
.pw-vacio { text-align: center; color: var(--pw-suave); padding: 2.5rem 1rem; }
.pw-vacio i { font-size: 2.4rem; display: block; margin-bottom: .5rem; opacity: .6; }
.cursor-pointer { cursor: pointer; }
kbd { background: var(--pw-tinta); border-radius: 6px; }
@media print {
    .pw-sidebar, .pw-topbar, .pw-pie, .pw-avisos { display: none !important; }
    .pw-contenido { padding: 0; }
}

.pw-mini-foto { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #e9ecf8; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
