/* =====================================================================
   SisCob · Portal de Familias — style.css (base)
   Identidad propia: azul celeste amable, tipografía Plus Jakarta Sans,
   tema claro/oscuro, responsive.
   ===================================================================== */

/* ---------- Tipografía ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800&display=swap');

/* ---------- Íconos Tabler (webfont) ----------
   Si ya los cargás en el header, podés quitar este import. */
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@2.30.0/tabler-icons.min.css');

/* =====================================================================
   VARIABLES — TEMA CLARO (por defecto)
   ===================================================================== */
:root {
    /* Marca: azul celeste amable */
    --brand:          #3b9ae1;   /* celeste principal */
    --brand-dark:     #2b7bc0;   /* hover / acentos */
    --brand-darker:   #1f5f99;   /* textos sobre claro */
    --brand-light:    #e7f3fc;   /* fondos suaves de marca */
    --brand-glow:     rgba(59,154,225,.25);

    /* Superficies y fondo */
    --bg:             #f2f7fb;   /* fondo general (celeste muy tenue) */
    --surface:        #ffffff;   /* tarjetas */
    --surface-alt:    #f4f8fc;   /* zonas alternas / thead */
    --surface-sunken: #eef4f9;   /* inputs, hundidos */

    /* Bordes */
    --border:         #dbe6f0;
    --border-strong:  #c3d4e3;

    /* Texto */
    --text:           #1a2b3c;   /* principal */
    --text-soft:      #566b80;   /* secundario */
    --text-mute:      #8ba0b4;   /* terciario / placeholders */

    /* Estados */
    --success:        #22a06b;
    --success-bg:     #e3f5ee;
    --danger:         #e5484d;
    --danger-bg:      #fdeaea;
    --warning:        #e08e0b;
    --warning-bg:     #fcf3e2;
    --info:           #3b9ae1;
    --info-bg:        #e7f3fc;

    /* Formas y sombras */
    --radius-sm:  8px;
    --radius:     12px;
    --radius-lg:  18px;
    --radius-pill: 999px;
    --shadow-sm:  0 1px 2px rgba(26,43,60,.06);
    --shadow:     0 4px 16px rgba(26,43,60,.08);
    --shadow-lg:  0 12px 32px rgba(26,43,60,.14);
    --shadow-brand: 0 8px 24px var(--brand-glow);

    /* Transiciones */
    --transition: .18s ease;

    /* Tipografía */
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* =====================================================================
   VARIABLES — TEMA OSCURO
   ===================================================================== */
[data-theme="dark"] {
    --brand:          #4faae8;
    --brand-dark:     #6bb8ee;
    --brand-darker:   #9fd0f4;
    --brand-light:    #17293a;
    --brand-glow:     rgba(79,170,232,.28);

    --bg:             #0e1620;
    --surface:        #16212e;
    --surface-alt:    #1b2836;
    --surface-sunken: #111b26;

    --border:         #263646;
    --border-strong:  #35485c;

    --text:           #e8eef4;
    --text-soft:      #a3b4c4;
    --text-mute:      #6b7f92;

    --success:        #3ecf8e;
    --success-bg:     #10281f;
    --danger:         #f2555a;
    --danger-bg:      #2b1416;
    --warning:        #f0a825;
    --warning-bg:     #2b2110;
    --info:           #4faae8;
    --info-bg:        #17293a;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
    --shadow:     0 4px 16px rgba(0,0,0,.35);
    --shadow-lg:  0 12px 32px rgba(0,0,0,.5);
}

/* =====================================================================
   RESET / BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition), color var(--transition);
}

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 1em; }

a { color: var(--brand-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-darker); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* Foco visible (accesibilidad) */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* =====================================================================
   LAYOUT — contenedor y app-shell
   ===================================================================== */
.portal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

.portal-main {
    flex: 1;
    padding: 32px 0;
}

/* =====================================================================
   TOPBAR (header del portal)
   ===================================================================== */
.portal-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.portal-topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text);
    letter-spacing: -.02em;
}
.portal-brand-logo {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem;
    box-shadow: var(--shadow-brand);
}
.portal-topbar-spacer { flex: 1; }

/* Botón de tema (sol/luna) */
.portal-theme-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-soft);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition);
}
.portal-theme-btn:hover { color: var(--brand); border-color: var(--brand); }

/* Menú de usuario */
.portal-user {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 12px 6px 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}
.portal-user:hover { border-color: var(--brand); }
.portal-user-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
}
.portal-user-name { font-weight: 600; font-size: .9rem; color: var(--text); }

/* =====================================================================
   CARD (tarjeta genérica)
   ===================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 22px; }
.card-titlebar {
    padding: 16px 22px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex; align-items: center; gap: 10px;
}

/* =====================================================================
   FORMULARIOS
   ===================================================================== */
.field { margin-bottom: 16px; }
.field-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}
.input {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: .95rem;
    color: var(--text);
    background: var(--surface-sunken);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.input::placeholder { color: var(--text-mute); }
.input:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Input con ícono (ej. usuario, candado) */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group .input-icon {
    position: absolute;
    left: 13px;
    color: var(--text-mute);
    font-size: 1.05rem;
    pointer-events: none;
}
.input-group .input { padding-left: 40px; }

/* =====================================================================
   BOTONES
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    box-shadow: var(--shadow-brand);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); color: #fff; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--surface-alt);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand-dark); }

.btn-ghost {
    background: transparent;
    color: var(--brand-dark);
}
.btn-ghost:hover { background: var(--brand-light); color: var(--brand-darker); }

.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }

/* =====================================================================
   TABLA
   ===================================================================== */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: auto;
}
table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}
table.table thead th {
    position: sticky; top: 0;
    background: var(--surface-alt);
    color: var(--text-soft);
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:nth-child(even) td { background: var(--surface-alt); }
table.table tbody tr:hover td { background: var(--brand-light); }
.table .c { text-align: center; }
.table .r { text-align: right; }
.table .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 700; }

/* =====================================================================
   BADGES / CHIPS DE ESTADO
   ===================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: .78rem;
    font-weight: 700;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info); }

/* =====================================================================
   NOTA / AVISO
   ===================================================================== */
.note {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--info-bg);
    border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
    color: var(--text);
    font-size: .9rem;
}
.note i { color: var(--info); font-size: 1.2rem; flex-shrink: 0; }
.note-warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.note-warning i { color: var(--warning); }

/* =====================================================================
   ESTADO VACÍO
   ===================================================================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-soft);
}
.empty-state i { font-size: 2.6rem; color: var(--text-mute); display: block; margin-bottom: 12px; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.portal-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 20px 0;
    text-align: center;
    color: var(--text-mute);
    font-size: .85rem;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 768px) {
    body { font-size: 14.5px; }
    .portal-main { padding: 20px 0; }
    .portal-topbar-inner { height: 56px; padding: 0 14px; }
    .portal-container { padding: 0 14px; }
    .portal-user-name { display: none; }   /* solo avatar en móvil */
    .card-body { padding: 18px; }
    h1 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .portal-brand span { display: none; }   /* solo logo en pantallas chicas */
    .btn { width: 100%; }                    /* botones full-width en móvil */
    .btn-inline { width: auto; }             /* excepto los marcados inline */
}

/* Respeta usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* =====================================================================
   LOGIN — estilos específicos
   ===================================================================== */
.login-wrap {
    width: 100%;
    max-width: 420px;
    margin: 24px auto;
}
.login-card { border-radius: var(--radius-lg); }
.login-titlebar { text-align: center; flex-direction: column; gap: 2px; }
.login-titlebar-title { font-size: 1.35rem; font-weight: 800; }
.login-titlebar-sub { font-size: .9rem; opacity: .92; font-weight: 500; }

.login-forgot { text-align: center; margin-top: 16px; }
.btn-link {
    background: none;
    border: none;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: var(--brand-dark);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background-color var(--transition);
}
.btn-link:hover { color: var(--brand-darker); background: var(--brand-light); }

.login-note { margin-top: 18px; align-items: flex-start; }
.login-note p { font-size: .86rem; line-height: 1.5; }

.login-help {
    text-align: center;
    margin-top: 18px;
    font-size: .88rem;
    color: var(--text-soft);
}

/* =====================================================================
   BANNER del instituto + menú + título de página
   ===================================================================== */
.portal-banner {
    background: var(--surface);
    text-align: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.portal-banner-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.portal-menu { margin-top: 12px; }

.portal-pagtit {
    text-align: center;
    margin: 24px 0 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

/* Botón "olvidé clave" como link, forzando sobre estilos viejos de button */
.login-forgot .btn-link,
button.btn-link {
    background: none !important;
    border: none !important;
    color: var(--brand-dark);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.login-forgot .btn-link:hover,
button.btn-link:hover {
    color: var(--brand-darker);
    background: var(--brand-light) !important;
    text-decoration: none;
}

@media (max-width: 768px) {
    .portal-pagtit { font-size: 1.25rem; }
    .portal-banner { padding: 10px 12px; }
}

/* Logo del instituto en círculo dentro de la card del login */
.login-logo {
    padding: 26px 22px 10px;
    text-align: center;
    background: var(--surface);
}
.login-logo-circle {
    width: 106px;
    height: 106px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 3px solid var(--brand-light);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* llena el círculo recortando lo que sobra */
}
.login-logo + .login-titlebar {
    border-radius: 0;
}


/* Tarjeta de ayuda del login (instrucciones) */
.login-help-card {
    margin-top: 18px;
    padding: 16px 18px;
    background: var(--info-bg);
    border: 1px solid color-mix(in srgb, var(--info) 25%, transparent);
    border-radius: var(--radius);
}
.login-help-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.login-help-head i { color: var(--info); font-size: 1.2rem; }
.login-help-intro {
    margin: 0 0 10px;
    font-size: .9rem;
    color: var(--text-soft);
}
.login-help-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.login-help-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .88rem;
    color: var(--text);
    line-height: 1.45;
}
.login-help-list li i {
    color: var(--brand);
    font-size: 1.05rem;
    flex-shrink: 0;
    margin-top: 1px;
}
/* Menú de usuario (dropdown) */
.portal-user-wrap { position: relative; }
.portal-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    z-index: 200;
}
.portal-user-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.portal-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
}
.portal-user-item:hover { background: var(--surface-alt); text-decoration: none; }
.portal-user-item i { font-size: 1.1rem; color: var(--text-soft); }
.portal-user-item.is-danger { color: var(--danger); }
.portal-user-item.is-danger i { color: var(--danger); }
.portal-user-item.is-danger:hover { background: var(--danger-bg); }

/* =====================================================================
   Bienvenida del portal (inicial.sys.php)
   ===================================================================== */
.welcome-card {
    max-width: 620px;
    margin: 8px auto 0;
    text-align: center;
}
.welcome-body {
    padding: 40px 28px;
}
.welcome-avatar {
    width: 88px;
    height: 88px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.welcome-avatar i {
    font-size: 3rem;
    color: var(--brand);
}
.welcome-title {
    margin: 0 0 6px;
    font-size: 1.7rem;
    font-weight: 800;
}
.welcome-sub {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: var(--text-soft);
}
.welcome-sub strong { color: var(--brand-dark); }
.welcome-text {
    margin: 0;
    font-size: .95rem;
    color: var(--text-soft);
    line-height: 1.6;
}
.welcome-note {
    max-width: 620px;
    margin: 16px auto 0;
    align-items: flex-start;
}

/* =====================================================================
   LAYOUT CON SIDEBAR (portal de familias)
   ===================================================================== */
.portal-shell {
    display: flex;
    align-items: flex-start;
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* ===== Sidebar ===== */
.portal-sidebar {
    flex: 0 0 250px;
    width: 250px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: sticky;
    top: 82px;
}
.portal-sidebar-logo {
    padding: 18px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}

.portal-sidebar-logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 50%;
    border: 3px solid var(--border);
    padding: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

/* ===== Navegación ===== */
.portal-nav { padding: 10px; }
.portal-nav-group { margin-bottom: 14px; }
.portal-nav-group:last-child { margin-bottom: 0; }
.portal-nav-group-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-mute);
    padding: 6px 10px;
}
.portal-nav-group-title i { font-size: 1rem; color: var(--brand); }

.portal-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text);
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
}
.portal-nav-item i { font-size: 1.15rem; color: var(--text-soft); flex-shrink: 0; }
.portal-nav-item span { flex: 1; }
.portal-nav-item:hover {
    background: var(--brand-light);
    color: var(--brand-darker);
    text-decoration: none;
}
.portal-nav-item:hover i { color: var(--brand); }
.portal-nav-item.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
}
.portal-nav-item.is-active i { color: #fff; }
.portal-nav-item.is-danger { color: var(--danger); }
.portal-nav-item.is-danger i { color: var(--danger); }
.portal-nav-item.is-danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ===== Contenido ===== */
.portal-content {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}
.portal-pagtit {
    margin: 0 0 18px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

/* ===== Botón hamburguesa (oculto en desktop) ===== */
.portal-burger {
    display: none;
    width: 40px; height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* ===== Overlay del sidebar (móvil) ===== */
.portal-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 150;
}

/* =====================================================================
   RESPONSIVE — sidebar como panel deslizable en móvil
   ===================================================================== */
@media (max-width: 860px) {
    .portal-burger { display: inline-flex; }

    .portal-shell {
        padding: 14px;
        gap: 0;
    }
    .portal-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 270px;
        flex: none;
        border-radius: 0;
        border: none;
        border-right: 1px solid var(--border);
        z-index: 200;
        transform: translateX(-100%);
        transition: transform .25s ease;
        overflow-y: auto;
    }
    .portal-sidebar.is-open { transform: translateX(0); }
    .portal-sidebar-overlay.is-open { display: block; }

    .portal-content { width: 100%; }
}
/* =====================================================================
   Ficha de datos de solo lectura (portal — alumno.php, pmt.php, etc.)
   Convierte los inputs .inputro en "datos mostrados", no cajas editables.
   ===================================================================== */

/* La tabla de edit_reg como grilla de ficha */
.card-body table.tabla {
    width: 100%;
    border-collapse: collapse;
}
.card-body table.tabla td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.card-body table.tabla tr:last-child td { border-bottom: none; }

/* Celda del título (label) */
.card-body table.tabla .tdtit,
.card-body table.tabla td:first-child {
    color: var(--text-soft);
    font-weight: 600;
    font-size: .85rem;
    white-space: nowrap;
    width: 1%;
    padding-right: 20px;
}

/* Inputs de solo lectura → dato mostrado (sin caja) */
.card-body input.inputro,
.card-body select.inputro,
.card-body input[readonly] {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px 0;
    color: var(--text);
    font-weight: 700;
    font-size: .98rem;
    width: 100%;
    cursor: default;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
.card-body input.inputro:focus,
.card-body select.inputro:focus,
.card-body input[readonly]:focus {
    outline: none;
    box-shadow: none;
}

/* Zebra suave para leer mejor la ficha */
.card-body table.tabla tr:nth-child(even) td {
    background: var(--surface-alt);
}

/* El portal ocupa toda la altura y empuja el footer abajo */
.portal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.portal-shell {
    flex: 1 0 auto;   /* crece y empuja el footer al fondo */
}
.portal-footer {
    flex-shrink: 0;   /* no se comprime */
}

/* =====================================================================
   Campos editables (inputw) y acciones de formulario (portal)
   Los readonly (.inputro) ya se ven como "dato mostrado" (CSS anterior).
   Los editables (.inputw) se ven como inputs normales.
   ===================================================================== */
.card-body input.inputw,
.card-body input.inputs,
.card-body select {
    padding: 9px 12px;
    font-family: inherit;
    font-size: .95rem;
    color: var(--text);
    background: var(--surface-sunken);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    width: 100%;
    max-width: 340px;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.card-body input.inputw:focus,
.card-body input.inputs:focus,
.card-body select:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Acciones al pie del formulario */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* =====================================================================
   Footer pegado abajo (sticky footer)
   ===================================================================== */
.portal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.portal-shell { flex: 1 0 auto; }
.portal-footer { flex-shrink: 0; }

/* =====================================================================
   Toolbar de filtros (portal) — para reportes con fechas, etc.
   ===================================================================== */
.portal-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 14px 18px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.portal-toolbar-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-soft);
}
.portal-toolbar-spacer { flex: 1 1 auto; }

/* Campo con ícono al lado (fecha + calendario) */
.field-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.field-inline .inputd {
    width: 110px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface-sunken);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    text-align: center;
}
.field-inline .inputd:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* La tabla de shw_ctacte dentro del table-wrap */
.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

/* =====================================================================
   Tabla de cuenta corriente (portal — shw_ctacte con show_array)
   ===================================================================== */
.table-wrap table.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

/* Título (nombre del alumno) que show_array pone arriba */
.table-wrap table.tabla caption,
.table-wrap table.tabla .tablatit,
.table-wrap table.tabla th.tablatit {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 16px;
    text-align: left;
}

/* Encabezados de columna */
.table-wrap table.tabla th,
.table-wrap table.tabla .th {
    background: var(--surface-alt);
    color: var(--text-soft);
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

/* Celdas */
.table-wrap table.tabla td,
.table-wrap table.tabla .td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

/* Zebra + hover */
.table-wrap table.tabla tr:nth-child(even) td {
    background: var(--surface-alt);
}
.table-wrap table.tabla tr:hover td {
    background: var(--brand-light);
}

/* Columnas numéricas (Debe, Haber, Saldo) a la derecha con números tabulares */
.table-wrap table.tabla td:nth-child(3),
.table-wrap table.tabla td:nth-child(4),
.table-wrap table.tabla td:nth-child(5),
.table-wrap table.tabla th:nth-child(3),
.table-wrap table.tabla th:nth-child(4),
.table-wrap table.tabla th:nth-child(5) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Saldo en negrita (columna 5) */
.table-wrap table.tabla td:nth-child(5) {
    font-weight: 700;
}

/* Fila de total (última) destacada */
.table-wrap table.tabla tr:last-child td {
    background: var(--surface-alt);
    font-weight: 700;
    border-top: 2px solid var(--border-strong);
}

/* Columna Acción centrada */
.table-wrap table.tabla td:last-child,
.table-wrap table.tabla th:last-child {
    text-align: center;
}

/* =====================================================================
   Opciones de pago (datosCob.php) — radios estilizados
   ===================================================================== */
.pay-options {
    margin-bottom: 20px;
}
.pay-options-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}
.pay-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pay-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition);
}
.pay-option:hover { border-color: var(--brand); }
.pay-option input { position: absolute; opacity: 0; width: 0; height: 0; }

/* Círculo del radio */
.pay-option-mark {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    flex-shrink: 0;
    position: relative;
    transition: border-color var(--transition);
}
.pay-option-mark::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--brand);
    transform: scale(0);
    transition: transform var(--transition);
}
.pay-option-text {
    font-weight: 600;
    color: var(--text);
}

/* Estado seleccionado */
.pay-option:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-light);
}
.pay-option:has(input:checked) .pay-option-mark {
    border-color: var(--brand);
}
.pay-option:has(input:checked) .pay-option-mark::after {
    transform: scale(1);
}