:root {
    --primary: #1e3a8a;
    --primary-hover: #1d4ed8;
    --accent: #0ea5e9;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #dc2626;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* LOGIN */
#login-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 100%);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    padding: 40px 35px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-card h1 { color: var(--primary); font-size: 1.8rem; margin-bottom: 8px; }
.login-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }

.form-group { text-align: left; margin-bottom: 15px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea, .input-std {
    width: 100%;
    padding: 11px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.96rem;
}

.btn {
    padding: 11px 18px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn:hover { background-color: var(--primary-hover); }
.btn-full { width: 100%; }
.btn-small { font-size: 0.8rem; padding: 4px 10px; cursor: pointer; border-radius: 4px; border: 1px solid #cbd5e1; background: #fff; }

.error-msg {
    color: #991b1b;
    background: #fee2e2;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-top: 14px;
    display: none;
    border-left: 4px solid var(--danger);
}

/* HEADER */
header {
    background-color: var(--primary);
    color: white;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.user-badge { background: rgba(255,255,255,0.15); padding: 6px 14px; border-radius: 20px; font-size: 0.9rem; }
.btn-logout {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 8px;
}

/* CONTENEDORES Y TARJETAS */
.container { max-width: 1000px; margin: 35px auto; padding: 0 20px; width: 100%; }
.header-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.module-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07);
    border-top: 5px solid var(--accent);
    cursor: pointer;
    transition: transform 0.2s;
}
.module-card:hover { transform: translateY(-5px); }
.module-icon { font-size: 2.5rem; margin-bottom: 14px; }
.module-card h3 { color: var(--primary); font-size: 1.25rem; margin-bottom: 8px; }
.badge-active {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #d1fae5;
    color: #065f46;
}

/* PADRÓN Y ACTIVIDADES */
.padron-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.box-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07);
    margin-top: 20px;
}

.activity-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 22px;
    margin-top: 18px;
    border-left: 5px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.tag-tipo {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #e0f2fe;
    color: #0369a1;
    margin-bottom: 6px;
}
.tag-final { background: #fef3c7; color: #92400e; }

.btn-back {
    background: #e2e8f0;
    color: var(--text-main);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 16px;
}

.list-row { padding: 14px; border-bottom: 1px solid #e2e8f0; }
.list-row-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

.written-box {
    background: #f8fafc;
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    margin-top: 8px;
    border-radius: 6px;
    font-size: 0.94rem;
    white-space: pre-wrap;
    color: var(--text-main);
}

.grade-box-instructor {
    background: #f1f5f9;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.grade-box-instructor input {
    padding: 7px 10px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
}

.feedback-student-card {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-left: 4px solid var(--success);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    color: #065f46;
}

.exam-checklist {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    max-height: 180px;
    overflow-y: auto;
}
.exam-checklist label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 0.92rem;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 600px;
    margin-top: 12px;
    border-radius: 10px;
}
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.preview-img {
    max-width: 100%;
    max-height: 360px;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid #cbd5e1;
}

.upload-zone {
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    padding: 18px;
    border-radius: 10px;
    margin-top: 14px;
}