:root {
    --bg-color: #1a1d23;
    --card-bg: #21252b;
    --sidebar-bg: #262a33;
    --sidebar-accent: #333945;
    --gold: #c9a232;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #3d4654;
    --cyan: #00a0b2;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 64px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 100;
}

.nav-menu {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 8px;
}

.nav-item {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(226, 232, 240, 0.7);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--gold);
    background-color: var(--sidebar-accent);
}

.tooltip {
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: #1a1d23;
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
    border: 1px solid rgba(80, 92, 110, 0.6);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
}

.tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: rgba(80, 92, 110, 0.6);
}
.tooltip::after {
    content: '';
    position: absolute;
    right: calc(100% - 1px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1a1d23;
}

.profile-icon:hover .tooltip,
.nav-item:hover .tooltip,
#adminToggleBtn:hover .tooltip,
#onlinePanelBtn:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.wrapper {
    margin-left: 64px;
    min-height: 100vh;
}

.wrapper.login-page {
    margin-left: 0;
}

.header {
    height: 80px;
    background-color: rgba(26, 29, 35, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.logo-placeholder {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.divider {
    width: 1px;
    height: 32px;
    background-color: rgba(226, 232, 240, 0.18);
}

.header-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 600;
}

.content {
    padding: 1.5%;
    max-width: 75%;
    margin: 0 auto;
}

.news-card {
    background-color: rgba(33, 37, 43, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(80, 92, 110, 0.6);
    padding: 2%;
    margin-bottom: 16px;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    border-left: 4px solid var(--gold);
    padding-left: 12px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.subsection-title {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.news-item {
    padding: 24px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.18);
}

.news-item:hover .news-title {
    color: var(--gold);
}

.news-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.news-description {
    font-size: 14px;
    color: var(--text-muted);
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

/* Colapso de novedades largas */
.news-body-wrap {
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.news-body-wrap.collapsed {
    max-height: 120px;
}

.news-body-wrap.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 48px;
    background: linear-gradient(transparent, var(--bg-card, #21252b));
    pointer-events: none;
}

.news-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 0 0;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: opacity 0.2s;
}

.news-toggle-btn:hover { opacity: 0.75; }

.news-toggle-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 14px;
    line-height: 1;
}

.news-toggle-btn.expanded .news-toggle-arrow {
    transform: rotate(180deg);
}

.news-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    text-transform: uppercase;
}

.btn-mis-materias {
    display: inline-block;
    padding: 12px 24px;
    margin-bottom: 24px;
    background-color: rgba(201, 162, 50, 0.15);
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn-mis-materias:hover {
    background-color: rgba(201, 162, 50, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 162, 50, 0.2);
}

/* Profile Styles */
.profile-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-bottom: 30px;
}

.profile-photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(201, 162, 50, 0.15) 0%, rgba(201, 162, 50, 0.05) 100%);
    border: 3px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    overflow: hidden;
}

.profile-avatar svg {
    width: 90px;
    height: 90px;
    margin-top: 18px; /* compensa el espacio vacío bajo el ícono de persona */
}

.btn-change-photo {
    padding: 10px 16px;
    background-color: rgba(201, 162, 50, 0.15);
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.btn-change-photo:hover {
    background-color: rgba(201, 162, 50, 0.25);
}

.profile-info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.profile-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-input {
    padding: 12px;
    background-color: rgba(33, 37, 43, 0.6);
    border: 1px solid rgba(80, 92, 110, 0.85);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.profile-input:focus {
    outline: none;
    border-color: var(--gold);
    background-color: rgba(33, 37, 43, 0.8);
    box-shadow: 0 0 0 3px rgba(201, 162, 50, 0.1);
}

.profile-input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.profile-actions {
    display: none; /* oculto por defecto, se muestra con JS cuando hay cambios */
    gap: 12px;
    justify-content: flex-start;
}

.btn-save-profile,
.btn-cancel-profile {
    padding: 12px 0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-sizing: border-box;
    width: 160px;
    text-align: center;
    flex-shrink: 0;
}

/* En el perfil los botones se expanden para ocupar todo el ancho */
.profile-actions .btn-save-profile,
.profile-actions .btn-cancel-profile {
    flex: 1;
    width: auto;
}

.btn-save-profile {
    background-color: rgba(201, 162, 50, 0.2);
    color: var(--gold);
    border: 2px solid var(--gold);
}

.btn-save-profile:hover {
    background-color: rgba(201, 162, 50, 0.3);
    transform: translateY(-2px);
}

.btn-cancel-profile {
    background-color: transparent;
    color: var(--text-muted);
    border: 2px solid rgba(148, 163, 184, 0.3);
}

.btn-cancel-profile:hover {
    border-color: var(--text-muted);
}

.table-block {
    margin-top: 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 2px solid rgba(212, 175, 55, 0.7);
}

.table-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}

.table-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,162,50,0.6) 20%, rgba(201,162,50,0.6) 80%, transparent);
    margin-bottom: 0;
    margin-top: 0;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.content-table {
    border-collapse: collapse;
    max-width: 1400px;
    min-width: 800px;
}

.content-table thead th {
    color: var(--gold);
    font-weight: 600;
    padding: 8px;
}

/* Contact Links */
.contact-description {
    margin-bottom: 24px;
    font-size: 18px;
    color: var(--text-muted);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.whatsapp-link {
    color: #25D366;
    background-color: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.3);
}

.whatsapp-link:hover {
    background-color: rgba(37, 211, 102, 0.2);
    border-color: #25D366;
    transform: translateX(4px);
}

.discord-link {
    color: #5865F2;
    background-color: rgba(88, 101, 242, 0.1);
    border-color: rgba(88, 101, 242, 0.3);
}

.discord-link:hover {
    background-color: rgba(88, 101, 242, 0.2);
    border-color: #5865F2;
    transform: translateX(4px);
}

.content-table td {
    text-align: center;
    width: 180px;
    height: 40px;
    padding: 8px;
    border: 1px solid rgba(226, 232, 240, 0.18);
}

/* Tablet Responsive (iPad, etc) */
@media (min-width: 769px) and (max-width: 1024px) {
    .profile-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .profile-info-section {
        grid-template-columns: 1fr;
    }

    .profile-avatar {
        width: 120px;
        height: 120px;
    }

    .profile-avatar svg {
        width: 65px;
        height: 65px;
    }

    .content {
        padding: 2%;
        max-width: 90%;
    }

    .section-title {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .news-item {
        padding: 16px 0;
    }

    .news-title {
        font-size: 16px;
    }

    .news-description {
        font-size: 13px;
    }

    .table-block {
        margin-top: 20px;
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .table-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .content-table {
        max-width: 100%;
        min-width: auto;
    }

    .content-table td {
        width: auto;
        height: auto;
        padding: 10px;
        font-size: 13px;
    }

    .content-table thead th {
        font-size: 13px;
        padding: 10px;
    }

    .header {
        padding: 0 24px;
    }

    .header-title {
        font-size: 17px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        bottom: 0;
        top: auto;
        height: auto;
        width: 100%;
        flex-direction: row;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
        border-bottom: none;
    }

    .nav-menu {
        width: 100%;
        flex-direction: row;
        gap: 0;
        padding: 0;
        overflow-x: auto;
    }

    .nav-item {
        flex: 1;
        height: 50px;
        font-size: 12px;
        margin-bottom: 0;
    }

    .wrapper {
        margin-left: 0;
        margin-bottom: 50px;
    }

    .header {
        height: auto;
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .header-content {
        width: 100%;
    }

    .logo-placeholder {
        width: 40px;
        height: 40px;
    }

    .header-title {
        font-size: 16px;
    }

    .content {
        padding: 16px;
        max-width: 100%;
        margin: 0;
    }

    .news-card {
        padding: 16px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 24px;
    }

    .subsection-title {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .news-item {
        padding: 16px 0;
    }

    .news-title {
        font-size: 16px;
    }

    .news-description {
        font-size: 12px;
    }

    .profile-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .profile-info-section {
        grid-template-columns: 1fr;
    }

    .profile-photo {
        width: 120px;
        height: 120px;
    }

    .profile-actions {
        flex-direction: column;
    }

    .btn-save-profile,
    .btn-cancel-profile {
        width: 100%;
    }

    .table-block {
        margin-top: 20px;
    }

    .table-title {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .content-table {
        min-width: 100%;
        max-width: 100%;
    }

    .content-table td {
        width: auto;
        height: auto;
        padding: 12px 8px;
        font-size: 12px;
    }

    .content-table thead th {
        font-size: 12px;
        padding: 12px 8px;
    }

    .tooltip {
        display: none;
    }

    .btn-mis-materias {
        font-size: 12px;
        padding: 10px 20px;
        margin-bottom: 16px;
    }

    /* ── Botones admin en la nav bar horizontal de mobile ── */
    #adminToggleBtn,
    #onlinePanelBtn {
        width: 50px !important;
        height: 50px !important;
        border-radius: 10px !important;
        margin: 0 auto !important;
        flex: 1;
        flex-shrink: 0;
    }

    /* ── Grupos de botones admin dentro de cards: wrap en mobile ── */
    #btnAdminGroup {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    /* ── Section-header wrappea cuando hay muchos botones ── */
    .section-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .section-header > div {
        flex-wrap: wrap;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px;
    }

    .header-title {
        font-size: 14px;
    }

    .content {
        padding: 12px;
    }

    .news-card {
        padding: 12px;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 20px;
        border-left-width: 3px;
    }

    .subsection-title {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .news-item {
        padding: 12px 0;
    }

    .news-title {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .news-description {
        font-size: 11px;
        line-height: 1.4;
    }

    .news-footer {
        margin-top: 8px;
    }

    .btn-more {
        font-size: 10px;
    }

    .table-block {
        margin-top: 16px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .table-title {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .content-table td {
        padding: 8px 4px;
        font-size: 10px;
        height: auto;
    }

    .content-table thead th {
        font-size: 10px;
        padding: 8px 4px;
    }

    .btn-mis-materias {
        font-size: 11px;
        padding: 8px 16px;
        margin-bottom: 12px;
    }

    .profile-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .profile-info-section {
        grid-template-columns: 1fr;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-avatar svg {
        width: 55px;
        height: 55px;
    }

    .profile-input {
        font-size: 13px;
        padding: 10px;
    }

    .profile-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-save-profile,
    .btn-cancel-profile {
        width: 100%;
        font-size: 12px;
        padding: 10px 16px;
    }
}

/* LOGIN PAGE */
.form-card {
    background-color: rgba(33, 37, 43, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(80, 92, 110, 0.6);
    padding: 30px;
    width: 100%;
    max-width: 500px;
}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 40px;
}

.login-container {
    width: 100%;
}

.form-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.form-input,
.form-select {
    padding: 12px;
    background-color: rgba(33, 37, 43, 0.6);
    border: 1px solid rgba(80, 92, 110, 0.85);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--gold);
    background-color: rgba(33, 37, 43, 0.8);
    box-shadow: 0 0 0 3px rgba(201, 162, 50, 0.1);
}

.form-input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.form-select {
    cursor: pointer;
}

.form-select option {
    background-color: var(--card-bg);
    color: var(--text-main);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
}

.form-row .form-group {
    margin-bottom: 20px;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: rgba(201, 162, 50, 0.2);
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: rgba(201, 162, 50, 0.3);
    transform: translateY(-2px);
}

.forgot-password {
    text-align: left;
    margin-bottom: 20px;
}

.forgot-password a {
    color: var(--gold);
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.form-link {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-link a {
    color: var(--gold);
    text-decoration: none;
    cursor: pointer;
}

.form-link a:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .login-wrapper {
        padding: 30px;
    }

    .login-container {
        max-width: 100%;
    }
}

@media (min-width: 769px) {
    .form-card {
        padding: 25px;
    }

    .form-title {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .form-subtitle {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-label {
        font-size: 11px;
    }

    .form-input,
    .form-select {
        padding: 10px;
        font-size: 13px;
    }

    .btn-submit {
        padding: 12px;
        font-size: 12px;
        margin-top: 6px;
    }

    .form-link {
        font-size: 11px;
        margin-top: 12px;
    }
}

@media (max-width: 768px) {
    .login-wrapper {
        padding: 20px;
        min-height: auto;
    }

    .form-card {
        max-width: 100%;
        padding: 20px;
    }

    .form-title {
        font-size: 24px;
    }

    .form-subtitle {
        margin-bottom: 32px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-row .form-group {
        margin-bottom: 20px;
    }

    .form-input,
    .form-select {
        font-size: 13px;
        padding: 10px;
    }

    .btn-submit {
        padding: 12px;
        font-size: 13px;
    }
}


/* ══════════════════════════════════════════════════
CONTENT — Accordion, candados, botones de plan, modal de pago
══════════════════════════════════════════════════ */

/* ── Accordion ──────────────────────────────────────────── */
        .accordion-btn {
            width: 100%;
            background: rgba(33,37,43,0.6);
            border: 1px solid rgba(80,92,110,0.85);
            border-radius: 8px;
            padding: 16px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-bottom: 8px;
        }
        .accordion-btn:hover { border-color: rgba(201,162,50,0.5); background: rgba(33,37,43,0.8); }
        .accordion-btn.open  { border-color: rgba(201,162,50,0.5); border-bottom-left-radius:0; border-bottom-right-radius:0; margin-bottom:0; }
        .accordion-btn .acc-title { font-family:'Montserrat',sans-serif; font-size:16px; font-weight:600; color:var(--text-main); }
        .accordion-btn .acc-arrow { color:var(--gold); font-size:18px; transition:transform 0.3s ease; flex-shrink:0; }
        .accordion-btn.open .acc-arrow { transform:rotate(180deg); }
        .accordion-body {
            display: none;
            border: 1px solid rgba(201,162,50,0.3);
            border-top: none;
            border-radius: 0 0 8px 8px;
            padding: 20px;
            margin-bottom: 8px;
            background: rgba(26,29,35,0.4);
            overflow-x: auto;
        }
        .accordion-body.open { display: block; }
        .table-block { border-bottom:none !important; padding-bottom:0 !important; margin-bottom:0 !important; align-items:stretch !important; }
        .table-block .table-divider { display:block; }
        .table-block .table-title   { display:none; }

        /* ── Candado de acceso ──────────────────────────────────── */
        .acceso-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px; height: 32px;
            border-radius: 8px;
            transition: all 0.2s;
        }
        .acceso-icon.locked {
            color: rgba(148,163,184,0.4);
        }
        .acceso-icon.unlocked {
            color: #25D366;
            filter: drop-shadow(0 0 6px rgba(37,211,102,0.4));
        }

        /* ── Botón de pago por fila ─────────────────────────────── */
        .btn-pago {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 7px 18px;
            border-radius: 7px;
            border: 1px solid;
            font-family: 'Inter', sans-serif;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
            letter-spacing: 0.4px;
            text-transform: uppercase;
        }
        .btn-pago:active { transform: translateY(0) !important; }

        /* Sin acceso → rojo */
        .btn-pago--sin-acceso {
            border-color: rgba(224,82,82,0.5);
            background: rgba(224,82,82,0.08);
            color: #e05252;
        }
        .btn-pago--sin-acceso:hover {
            background: rgba(224,82,82,0.18);
            border-color: #e05252;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(224,82,82,0.2);
        }

        /* Con acceso activo → verde */
        .btn-pago--activo {
            border-color: rgba(37,211,102,0.5);
            background: rgba(37,211,102,0.08);
            color: #25D366;
            cursor: default;
            pointer-events: none;
        }

        /* Por vencer (≤7 días) → amarillo */
        .btn-pago--por-vencer {
            border-color: rgba(201,162,50,0.6);
            background: rgba(201,162,50,0.1);
            color: var(--gold);
            cursor: pointer;
            animation: pulse-gold 2s ease-in-out infinite;
        }
        .btn-pago--por-vencer:hover {
            background: rgba(201,162,50,0.2);
            border-color: var(--gold);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(201,162,50,0.2);
            animation: none;
        }
        @keyframes pulse-gold {
            0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,50,0.0); }
            50%       { box-shadow: 0 0 0 4px rgba(201,162,50,0.2); }
        }

        /* ── Modal de pago ──────────────────────────────────────── */
        .modal-overlay {
            position: fixed; inset: 0;
            background: rgba(0,0,0,0.78);
            display: flex; align-items: center; justify-content: center;
            z-index: 1000; padding: 20px;
            animation: fadeIn 0.2s ease;
        }
        @keyframes fadeIn { from{opacity:0} to{opacity:1} }
        .modal-box {
            background: #21252b;
            border: 1px solid rgba(80,92,110,0.9);
            border-radius: 16px;
            padding: 32px;
            width: 100%; max-width: 460px;
            animation: slideUp 0.25s ease;
        }
        @keyframes slideUp { from{transform:translateY(16px);opacity:0} to{transform:translateY(0);opacity:1} }
        .modal-header {
            display: flex; justify-content: space-between; align-items: flex-start;
            margin-bottom: 20px;
        }
        .modal-title { font-family:'Montserrat',sans-serif; font-size:18px; font-weight:700; line-height:1.3; }
        .modal-close {
            background: none; border: none; color: var(--text-muted);
            font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px;
            transition: color 0.2s;
        }
        .modal-close:hover { color: var(--text-main); }
        .modal-materia-info {
            background: rgba(26,29,35,0.6);
            border: 1px solid rgba(80,92,110,0.85);
            border-radius: 8px;
            padding: 14px 16px;
            margin-bottom: 20px;
            font-size: 14px;
            color: var(--text-muted);
        }
        .modal-materia-info strong { color: var(--text-main); }
        .plan-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
        .plan-card {
            border: 2px solid rgba(80,92,110,0.85);
            border-radius: 10px;
            padding: 16px 12px;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
            background: rgba(26,29,35,0.4);
        }
        .plan-card:hover { border-color: rgba(201,162,50,0.5); background: rgba(201,162,50,0.05); }
        .plan-card.selected { border-color: var(--gold); background: rgba(201,162,50,0.1); box-shadow: 0 0 0 1px rgba(201,162,50,0.2); }
        .plan-card .plan-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
        .plan-card .plan-price { font-size: 20px; font-weight: 700; color: var(--gold); }
        .plan-card.selected .plan-label { color: var(--gold); }
        .btn-pagar {
            width: 100%; padding: 14px;
            background: rgba(201,162,50,0.15);
            color: var(--gold);
            border: 2px solid var(--gold);
            border-radius: 10px;
            font-weight: 700; font-size: 15px;
            cursor: pointer; transition: all 0.3s;
            text-transform: uppercase; letter-spacing: 0.5px;
        }
        .btn-pagar:hover { background: rgba(201,162,50,0.28); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201,162,50,0.2); }
        .btn-pagar:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
        .mp-logo { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; color: var(--text-muted); font-size: 11px; }


/* ══════════════════════════════════════════════════════
   FORUMS — Buscador, layout, file input estético
   ══════════════════════════════════════════════════════ */

/* ── Layout principal foros ─────────────────────────── */
.forums-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}



/* ── File input estético ────────────────────────────── */
.file-input-hidden {
    display: none;
}

.file-input-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(26,29,35,0.6);
    border: 1px dashed rgba(80,92,110,0.9);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

.file-input-label:hover {
    border-color: rgba(201,162,50,0.5);
    background: rgba(201,162,50,0.04);
    color: var(--text-main);
}

.file-input-label svg {
    flex-shrink: 0;
    color: var(--gold);
}

.file-input-label .file-label-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-input-label .file-label-main {
    font-weight: 600;
    color: var(--text-main);
    font-size: 13px;
}

.file-input-label .file-label-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.file-input-label.has-file {
    border-color: rgba(201,162,50,0.4);
    background: rgba(201,162,50,0.06);
}

.file-input-label.has-file .file-label-main {
    color: var(--gold);
}

/* ── Responsive foros ───────────────────────────────── */
@media (max-width: 768px) {
    .forums-layout {
        grid-template-columns: 1fr;
    }
    .forums-sidebar {
        position: static;
    }
}


/* ══════════════════════════════════════════════════════
   MESSAGES — Layout responsive
   ══════════════════════════════════════════════════════ */

.messages-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    min-height: 400px;
}

.messages-users-panel {
    border-right: 1px solid var(--border-color);
    padding-right: 16px;
}

.messages-chat-panel {
    display: flex;
    flex-direction: column;
    min-width: 0; /* evita overflow en grid */
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .messages-layout {
        grid-template-columns: 200px 1fr;
        gap: 12px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .messages-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .messages-users-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    /* En mobile la lista de usuarios es horizontal con scroll */
    #userList {
        flex-direction: row !important;
        overflow-x: auto;
        gap: 8px !important;
        padding-bottom: 4px;
    }

    #userList button {
        flex-shrink: 0;
        min-width: 130px;
    }

    #messagesContainer {
        max-height: 300px !important;
    }
}


/* ══════════════════════════════════════════════════════
   CONTENT — Cards simétricas (todos los dispositivos)
   ══════════════════════════════════════════════════════ */

.content-table { display: none !important; }

/* Header de columnas */
.materia-cards-header {
    display: grid;
    grid-template-columns: 1fr 110px 60px 150px;
    gap: 12px;
    padding: 8px 16px 10px;
    border-bottom: 1px solid rgba(201,162,50,0.2);
}

.materia-cards-header span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.materia-cards-header span:nth-child(2),
.materia-cards-header span:nth-child(3),
.materia-cards-header span:nth-child(4) {
    text-align: center;
}

/* Fila card */
.materia-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(80,92,110,0.55);
    transition: background 0.15s;
}

.materia-card-info {
    flex: 1;
    min-width: 0;
}

.materia-card-btn {
    flex-shrink: 0;
}

.materia-card:last-of-type { border-bottom: none; }
.materia-card:hover { background: rgba(201,162,50,0.03); }

.materia-card-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Col 1: nombre + código */
.materia-card-nombre-col { min-width: 0; }

.materia-card-nombre {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
}

.materia-card-codigo {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

/* Col 2: tipo */
.materia-card-tipo-col { align-items: center; }

/* Col 3: año */
.materia-card-anio-col { align-items: center; }

.materia-card-anio {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Col 4: botón */
.materia-card-btn-col { align-items: stretch; }

.materia-card .btn-pago {
    width: 100%;
    justify-content: center;
}

/* Mobile pequeño */
@media (max-width: 480px) {
    .materia-cards-header,
    .materia-card {
        grid-template-columns: 1fr 90px 130px;
        padding: 11px 10px;
        gap: 8px;
    }
    .materia-card-anio-col,
    .materia-cards-header span:nth-child(3) {
        display: none;
    }
    .materia-card-nombre { font-size: 12px; }
    .materia-card .btn-pago { font-size: 11px; padding: 6px 8px; }
}


/* ── Badges de tipo (Materia / Seminario) ───────────────────────────────────── */
.badge-tipo {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-materia {
    background: rgba(0,160,178,0.1);
    color: var(--cyan);
    border: 1px solid rgba(0,160,178,0.25);
}

.badge-seminario {
    background: rgba(201,162,50,0.1);
    color: var(--gold);
    border: 1px solid rgba(201,162,50,0.25);
}


/* ── Campo readonly (email no editable) ─────────────────────────────────────── */
.profile-input[readonly] {
    opacity: 0.55;
    cursor: not-allowed;
    border-color: rgba(80, 92, 110, 0.5);
    background: rgba(26,29,35,0.4);
}

.profile-input[readonly]:focus {
    border-color: rgba(80, 92, 110, 0.5);
    box-shadow: none;
}


/* ── Botón cerrar sesión ─────────────────────────────────────────────────────── */
.nav-item-logout {
    margin-top: auto;
    color: rgba(224, 82, 82, 0.85) !important;
}

.nav-item-logout:hover {
    color: #ff6b6b !important;
    background-color: rgba(224, 82, 82, 0.15) !important;
}

/* En desktop: empujar el botón al fondo del sidebar */
.sidebar .nav-menu {
    height: 100%;
}

.nav-item-logout {
    margin-top: auto;
}

/* En mobile: el botón queda al final (derecha) */
@media (max-width: 768px) {
    .nav-item-logout {
        margin-top: 0;
        margin-left: auto;
    }
}


/* ── Checkbox estilizado para novedades ──────────────────────────────────────── */
.news-checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.news-checkbox-custom {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid rgba(80, 92, 110, 0.8);
    background: rgba(26, 29, 35, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.news-checkbox-label:hover .news-checkbox-custom {
    border-color: var(--gold);
    background: rgba(201, 162, 50, 0.08);
}

.news-checkbox:checked + .news-checkbox-custom {
    background: rgba(201, 162, 50, 0.15);
    border-color: var(--gold);
}

.news-checkbox:checked + .news-checkbox-custom::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid var(--gold);
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}


/* ── Barra de selección múltiple de novedades ───────────────────────────────── */
#multiBar {
    box-sizing: border-box;
    width: 100%;
}

@media (max-width: 480px) {
    #multiBar {
        gap: 6px;
        padding: 8px 10px;
    }
    #multiBar .btn-mis-materias {
        font-size: 11px !important;
        padding: 5px 10px !important;
    }
}


/* ══════════════════════════════════════════════════════
   MATERIA — Catálogo de contenido
   ══════════════════════════════════════════════════════ */

.contenido-seccion {
    margin-bottom: 36px;
}

.contenido-seccion-header {
    margin-bottom: 20px;
}

.contenido-seccion-titulo {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
    line-height: 1;
}

.contenido-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.contenido-card {
    background: rgba(33,37,43,0.6);
    border: 1px solid rgba(80,92,110,0.4);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.contenido-card:hover {
    border-color: rgba(201,162,50,0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.contenido-card-preview {
    position: relative;
    width: 100%;
    height: 90px;
    background: rgba(26,29,35,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(80,92,110,0.25);
}

.contenido-card:hover .contenido-card-preview svg {
    opacity: 0.75;
    transform: scale(1.08);
    transition: all 0.2s;
}

.contenido-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(224,82,82,0.85);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.contenido-edit-btn {
    position: absolute;
    top: 6px;
    right: 36px;
    background: rgba(94,130,220,0.85);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.contenido-card:hover .contenido-delete-btn,
.contenido-card:hover .contenido-edit-btn {
    opacity: 1;
}

.contenido-card-label {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
    background: rgba(26,29,35,0.5);
}

/* ══════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════ */

#lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
}

.lb-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 80px 80px;
    box-sizing: border-box;
}

.lb-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
}

.lb-content img {
    max-height: 80vh;
    max-width: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.lb-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: 2px solid rgba(201,162,50,0.6);
    color: var(--gold);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.lb-close:hover {
    background: rgba(201,162,50,0.15);
    border-color: var(--gold);
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(33,37,43,0.8);
    border: 1px solid rgba(80,92,110,0.6);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    line-height: 1;
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-nav:hover:not(:disabled) {
    background: rgba(201,162,50,0.15);
    border-color: rgba(201,162,50,0.5);
    color: var(--gold);
}

.lb-nav:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.lb-title {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.lb-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 768px) {
    .contenido-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
    .lb-container { padding: 60px 40px 80px; }
    .lb-nav { width: 38px; height: 38px; font-size: 22px; }
    .lb-prev { left: 8px; }
    .lb-next { right: 8px; }
}

@media (max-width: 480px) {
    .contenido-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}


/* ── Botón carrito — con contorno igual al nav-item ─────────────────────────── */
.btn-carrito {
    position: relative;
    background: rgba(45, 200, 212, 0.07);
    border: 1px solid rgba(45, 200, 212, 0.35);
    border-radius: 10px;
    cursor: pointer;
    color: #2dc8d4;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-carrito svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.btn-carrito:hover {
    background: rgba(45, 200, 212, 0.15);
    border-color: #2dc8d4;
    transform: translateY(-1px);
}

.btn-carrito:hover svg {
    transform: scale(1.12);
}

.btn-carrito:active {
    transform: translateY(0);
    box-shadow: none;
}

@media (min-width: 769px) {
    .btn-carrito {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }
    .btn-carrito svg {
        width: 24px;
        height: 24px;
    }
}

@media (min-width: 1200px) {
    .btn-carrito {
        width: 54px;
        height: 54px;
        border-radius: 13px;
    }
    .btn-carrito svg {
        width: 26px;
        height: 26px;
    }
}

/* ── Content Protection ───────────────────────────────────────────── */
img.contenido-thumb,
#lbImg,
img[id^="newsImg_"] {
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;   /* impide drag y click derecho directo sobre la img */
    -webkit-touch-callout: none;
}

/* Impedir selección de texto en toda la página salvo inputs */
body {
    -webkit-user-select: none;
    user-select: none;
}
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

/* Ocultar imágenes al imprimir */
@media print {
    img, canvas, video, .contenido-card-preview, #lightbox {
        display: none !important;
        visibility: hidden !important;
    }
    body::before {
        content: 'La impresión de este contenido no está autorizada — mvboards.com';
        font-size: 24px;
        display: block;
        text-align: center;
        padding: 40px;
    }
}
