:root {
    --bg: #f4f6fb;
    --navy: #08356d;
    --navy-2: #0a2b57;
    --line: #d6dfef;
    --text: #0f1f3d;
    --muted: #62708b;
    --ok: #0b7d5b;
    --warn: #995700;
    --danger: #9f1a1a;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: var(--bg);
}

/* Oculta barras de scroll en toda la aplicación */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

a {
    color: inherit;
}

.container {
    width: min(1240px, 96%);
    margin: 0 auto;
}

.app-shell {
    height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--navy), var(--navy-2));
    color: #fff;
    padding: 16px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar-brand {
    display: grid;
    justify-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 18px;
    width: 100%;
}

.sidebar-logo {
    width: 85%;
    max-width: none;
    height: auto;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
    padding: 0;
    filter: drop-shadow(0 7px 14px rgba(0, 0, 0, 0.42));
}

.sidebar-brand span {
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
    margin-bottom: auto;
}

.sidebar-nav a {
    text-decoration: none;
    padding: 10px 10px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav hr {
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 7px 0;
}

.sidebar-footer-text {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    line-height: 1.4;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
}

.main-pane {
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 8px 14px;
}

.auth-topbar {
    padding: 10px 0;
}

.auth-head {
    display: flex;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 4px 9px rgba(0, 0, 0, 0.28));
}

.brand-title {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
}

.brand-sub {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.sidebar-toggle {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #cad7ee;
    background: #fff;
    color: var(--navy);
    font-size: 1.05rem;
    cursor: pointer;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 5px 9px;
    background: #fff;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    background: var(--navy);
}

.user-meta {
    display: grid;
    line-height: 1.1;
}

.user-meta strong {
    font-size: 0.85rem;
}

.user-meta span {
    font-size: 0.74rem;
    color: var(--muted);
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #ced9ef;
    background: #fff;
    color: var(--text);
    border-radius: 9px;
    padding: 8px 10px;
    cursor: pointer;
}

.logout-icon {
    font-size: 0.95rem;
}

main.container {
    padding: 14px 0 24px;
}

.dashboard-header {
    margin: 8px 0 12px;
}

.dashboard-header h2 {
    margin: 0 0 5px;
    color: var(--navy);
}

.dashboard-header p {
    margin: 0;
    color: var(--muted);
}

.warning {
    color: var(--warn);
    font-weight: 600;
}

.warning-detail {
    color: #7a4200;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.86rem;
}

.success {
    color: var(--ok);
    font-weight: 600;
}

.dashboard-grid,
.dashboard-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px 16px;
    margin-bottom: 10px;
}

.card {
    background: transparent;
    border: 0;
    padding: 8px 0;
}

.card h3 {
    margin: 0 0 6px;
}

.metric {
    margin: 0;
    color: var(--navy);
    font-size: 1.9rem;
    font-weight: 700;
}

.subtle {
    color: var(--muted);
}

.card-wide {
    grid-column: span 2;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.event-list {
    display: grid;
    gap: 8px;
}

.event-item {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 7px 0;
}

.event-date {
    text-align: center;
}

.event-date strong {
    display: block;
}

.event-date span {
    font-size: 0.82rem;
    color: var(--muted);
}

.event-title {
    margin: 0;
    font-weight: 700;
}

.check-timeline {
    border-left: 2px solid #cdd9ef;
    margin-left: 7px;
    padding-left: 18px;
    display: grid;
    gap: 10px;
}

.check-step {
    position: relative;
}

.check-dot {
    width: 15px;
    height: 15px;
    border-radius: 999px;
    border: 2px solid #9db0d3;
    background: #fff;
    position: absolute;
    left: -26px;
    top: 3px;
}

.check-step.done .check-dot {
    background: #1d4ea0;
    border-color: #1d4ea0;
    box-shadow: inset 0 0 0 2px #fff;
}

.check-label {
    margin: 0;
    font-weight: 600;
}

.auth-shell {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
}

.auth-shell-enhanced {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 120px);
    padding: 28px 0;
}

.auth-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-bg-shapes .shape {
    position: absolute;
    display: block;
    border: 1px solid rgba(8, 53, 109, 0.14);
    background: linear-gradient(145deg, rgba(15, 85, 170, 0.08), rgba(15, 85, 170, 0.02));
    border-radius: 18px;
    animation: shape-float 14s linear infinite;
}

.auth-bg-shapes .s1 {
    width: 180px;
    height: 180px;
    left: 10%;
    top: 62%;
    border-radius: 50%;
    animation-duration: 16s;
}

.auth-bg-shapes .s2 {
    width: 140px;
    height: 140px;
    left: 22%;
    top: 14%;
    transform: rotate(24deg);
    animation-duration: 13s;
}

.auth-bg-shapes .s3 {
    width: 260px;
    height: 90px;
    right: 12%;
    top: 24%;
    transform: rotate(-11deg);
    animation-duration: 17s;
}

.auth-bg-shapes .s4 {
    width: 120px;
    height: 120px;
    right: 25%;
    top: 68%;
    border-radius: 50%;
    animation-duration: 12s;
}

.auth-bg-shapes .s5 {
    width: 220px;
    height: 72px;
    left: 46%;
    top: 8%;
    transform: rotate(8deg);
    animation-duration: 15s;
}

.auth-bg-shapes .s6 {
    width: 100px;
    height: 100px;
    right: 6%;
    top: 52%;
    border-radius: 12px;
    transform: rotate(35deg);
    animation-duration: 18s;
}

@keyframes shape-float {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    15% {
        opacity: 1;
    }
    50% {
        opacity: 0.65;
        transform: translateY(-8px) scale(1.02);
    }
    85% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
}

.auth-card,
.form-card {
    width: min(920px, 100%);
    background: transparent;
    border: 0;
    padding: 0;
}

.auth-card {
    width: min(460px, 100%);
}

.auth-card-pro {
    position: relative;
    z-index: 2;
    width: min(510px, 100%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(8, 53, 109, 0.12);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 18px 40px rgba(7, 30, 70, 0.08);
    backdrop-filter: blur(4px);
}

.auth-card-pro h2 {
    margin: 0 0 7px;
    color: var(--navy);
}

.auth-card-pro p {
    margin: 0 0 14px;
    color: var(--muted);
}

.auth-card form {
    display: grid;
    gap: 9px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"] {
    width: 100%;
    border: 1px solid #c6d4eb;
    border-radius: 8px;
    padding: 10px;
    color: var(--text);
    background: #fff;
}

textarea {
    width: 100%;
    border: 1px solid #c6d4eb;
    border-radius: 8px;
    padding: 10px;
    color: var(--text);
    background: #fff;
    font: inherit;
    resize: vertical;
}

input:focus {
    outline: none;
    border-color: #2a5fbe;
    box-shadow: 0 0 0 3px rgba(42, 95, 190, 0.15);
}

textarea:focus {
    outline: none;
    border-color: #2a5fbe;
    box-shadow: 0 0 0 3px rgba(42, 95, 190, 0.15);
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.separator {
    margin: 10px 0;
    text-align: center;
    color: var(--muted);
}

.btn-primary,
.btn-primary-link,
.btn-google {
    border: 1px solid transparent;
    background: var(--navy);
    color: #fff;
    border-radius: 8px;
    padding: 9px 13px;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}

.btn-google {
    width: 100%;
    background: #fff;
    color: var(--text);
    border-color: #c9d5ea;
    text-align: center;
}

.btn-google-rich {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    font-weight: 600;
}

.google-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
}

.btn-secondary-link {
    border: 1px solid #cad7ec;
    color: var(--navy);
    border-radius: 8px;
    padding: 9px 13px;
    text-decoration: none;
}

.form-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.form-section {
    border-top: 1px solid var(--line);
    padding: 11px 0;
}

.form-section h3 {
    margin: 0 0 8px;
    color: var(--navy);
}

.field-lock-note {
    margin: -2px 0 8px;
    font-size: 0.82rem;
    color: #8f5c00;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.form-grid label {
    display: block;
    margin-bottom: 4px;
}

.check-row {
    display: flex;
    align-items: end;
    padding-bottom: 8px;
}

.table-wrap {
    background: transparent;
    border: 0;
    padding: 0;
    overflow: hidden;
}

.table-actions {
    margin: 4px 0 8px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: #eef3ff;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #dee6f4;
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
}

.row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.table-link {
    color: #154aa7;
    text-decoration: none;
    font-weight: 600;
}

.table-btn {
    border: 1px solid #c8d7ef;
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 6px 9px;
    cursor: pointer;
}

.table-btn.danger {
    border-color: #e8b3b3;
    color: var(--danger);
}

.small-input {
    width: 78px;
}

.text-danger {
    color: var(--danger);
}

.mobile-table-accordion {
    display: none;
}

.mobile-row {
    border: 1px solid #d7e1f2;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.mobile-row summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    font-weight: 600;
    background: #f5f8ff;
}

.mobile-row summary::-webkit-details-marker {
    display: none;
}

.mobile-row-body {
    padding: 10px 12px;
    display: grid;
    gap: 8px;
}

.mobile-field {
    border-top: 1px dashed #dce5f3;
    padding-top: 8px;
}

.mobile-label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.mobile-value {
    margin-top: 3px;
}

.student-records {
    display: grid;
    gap: 10px;
}

.course-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
}

.course-summary div {
    display: grid;
    gap: 2px;
}

.course-summary span {
    font-size: 0.78rem;
    color: var(--muted);
}

.course-summary strong {
    color: var(--navy);
    font-size: 1.05rem;
}

.sidebar-backdrop {
    display: none;
}

.student-record {
    border-bottom: 1px solid var(--line);
    padding: 0 0 6px;
}

.record-separator {
    position: relative;
    height: 14px;
    margin: 0 0 4px;
}

.record-separator::before {
    content: "";
    position: absolute;
    left: 0;
    right: 14px;
    top: 6px;
    border-top: 4px solid var(--navy);
}

.record-separator::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--navy);
}

.student-record summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
}

.student-record summary::-webkit-details-marker {
    display: none;
}

.student-title {
    margin: 0;
    font-weight: 700;
    font-size: 0.96rem;
}

.student-subtitle {
    margin: 1px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.status-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 7px;
}

.status-chip {
    font-size: 0.74rem;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #cad8f2;
    background: #f4f7ff;
    color: #2b4c87;
    white-space: nowrap;
}

.status-chip.done {
    border-color: #008000;
    background: #008000;
    color: #fff;
}

.status-chip.pending {
    border-color: #cad8f2;
    background: #f4f7ff;
    color: #2b4c87;
}

.student-body {
    padding: 0 0 6px;
}

.record-section {
    margin-bottom: 6px;
}

.record-section h4 {
    margin: 0 0 5px;
    font-size: 0.88rem;
    color: var(--navy);
}

.compact-grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 4px 12px;
}

.compact-grid dt {
    margin: 0;
    font-size: 0.73rem;
    color: var(--muted);
    font-weight: 600;
}

.compact-grid dd {
    margin: 0 0 3px;
    font-size: 0.88rem;
}

.info-content-text {
    white-space: pre-line;
    line-height: 1.6;
}

.payments-table {
    border: 1px solid #dde6f3;
    border-radius: 8px;
    overflow: hidden;
}

.payments-head,
.payments-row {
    display: grid;
    grid-template-columns: 1.6fr 0.7fr 0.8fr;
    gap: 8px;
    padding: 6px 8px;
    font-size: 0.82rem;
}

.payments-head {
    background: #eef3ff;
    font-weight: 700;
    color: var(--navy);
}

.payments-row {
    border-top: 1px solid #e3ebf6;
}

.payments-row span:last-child {
    font-weight: 600;
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 260px;
        height: 100vh;
        overflow-y: auto;
        padding: 10px;
        transform: translateX(-104%);
        transition: transform 0.22s ease;
        z-index: 90;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }

    .sidebar-logo {
        width: 61%;
        max-width: 150px;
        height: auto;
    }

    .sidebar-brand {
        grid-template-columns: 1fr;
        justify-items: center;
        align-items: stretch;
        margin-bottom: 8px;
    }

    .sidebar-nav {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .main-pane {
        height: auto;
        overflow: visible;
    }

    .sidebar-toggle {
        display: inline-grid;
        place-items: center;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(5, 19, 48, 0);
        pointer-events: none;
        transition: background 0.2s ease;
        z-index: 80;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        background: rgba(5, 19, 48, 0.42);
        pointer-events: auto;
    }
}

@media (max-width: 760px) {
    .card-wide {
        grid-column: span 1;
    }

    .dashboard-split {
        grid-template-columns: 1fr;
    }

    .topbar-right {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .admin-table {
        display: none;
    }

    .mobile-table-accordion {
        display: block;
        margin-top: 8px;
    }

    .student-record summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .payments-head,
    .payments-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .auth-bg-shapes .shape {
        opacity: 0.45;
    }

}

@media (prefers-reduced-motion: reduce) {
    .auth-bg-shapes .shape {
        animation: none;
        opacity: 0.22;
    }
}
