/* ========================================
   BeTech - Sistema de Seguimiento
   Estilos Globales
   ======================================== */

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta principal */
    --cyan: #08D4F0;
    --cyan-dark: #07b3cb;
    --cyan-light: #d0f4fa;
    --green: #8AE600;
    --green-dark: #6fba00;
    --green-light: #e6fac4;
    --orange: #F39108;
    --orange-dark: #cc7a07;
    --orange-light: #fde8cc;

    /* Color principal sólido */
    --gradient-main: #08D4F0;
    --gradient-warm: #08D4F0;
    --gradient-accent: #08D4F0;
    --gradient-full: #08D4F0;
    --gradient-btn: #07b3cb;

    /* Semánticos (mapeados a la paleta) */
    --primary: #08D4F0;
    --primary-dark: #07b3cb;
    --primary-light: #d0f4fa;
    --success: #8AE600;
    --success-light: #e6fac4;
    --warning: #F39108;
    --warning-light: #fde8cc;
    --danger: #e53e3e;
    --danger-light: #fee2e2;
    --info: #08D4F0;
    --info-light: #d0f4fa;

    /* Grises */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;

    /* Sombras y bordes */
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(8,212,240,0.12), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(8,212,240,0.15), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   Componentes Comunes
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(8,212,240,0.35);
}

.btn-outline {
    background: transparent;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

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

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-tutor {
    background: var(--cyan-light);
    color: var(--cyan-dark);
    border: 1px solid rgba(8,212,240,0.3);
}

.badge-directivo {
    background: var(--orange-light);
    color: var(--orange-dark);
    border: 1px solid rgba(243,145,8,0.3);
}

.text-muted {
    color: var(--gray-500);
    font-size: 14px;
}

/* ========================================
   Página de Autenticación
   ======================================== */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #08D4F0;
    position: relative;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    padding: 40px;
    width: 100%;
    max-width: 460px;
    animation: fadeIn 0.4s ease;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 28px;
    color: var(--primary);
}

.logo p {
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--white);
    color: var(--cyan-dark);
    box-shadow: var(--shadow);
    border-bottom: 2px solid var(--cyan);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(8, 212, 240, 0.15);
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.auth-form .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 8px;
}

.error-msg {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
}

.success-msg {
    color: var(--success);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
}

.demo-credentials {
    margin-top: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px dashed var(--gray-300);
}

.demo-credentials h4 {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 10px;
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
}

.credential-item code {
    color: var(--gray-600);
    background: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* ========================================
   Navbar
   ======================================== */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--primary);
    min-height: 60px;
    gap: 12px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand h2 {
    font-size: 20px;
    color: var(--primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-user span {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

/* ========================================
   Dashboard Layout
   ======================================== */

.dashboard {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
}

.sidebar h3 {
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}

.search-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(8, 212, 240, 0.15);
}

.filter-group {
    margin-bottom: 16px;
}

.sidebar-dashboard-btn {
    width: 100%;
    margin-bottom: 12px;
}

/* Professor List */
.professor-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.professor-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.professor-item:hover {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.professor-item.active {
    background: var(--cyan-light);
    border-color: var(--cyan);
}

.professor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

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

.professor-info h4 {
    font-size: 14px;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.professor-info p {
    font-size: 12px;
    color: var(--gray-500);
}

.professor-count {
    font-size: 11px;
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* ========================================
   Main Content
   ======================================== */

.main-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
}

.panel {
    animation: fadeIn 0.3s ease;
}

/* Welcome Panel */
.welcome-panel {
    text-align: center;
    padding: 60px 20px;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.welcome-panel h2 {
    font-size: 24px;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.welcome-panel p {
    color: var(--gray-500);
    font-size: 15px;
    margin-bottom: 32px;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.executive-grid {
    max-width: 1100px;
    margin: 26px auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    text-align: left;
}

.executive-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px;
}

.executive-card h3 {
    font-size: 15px;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.executive-card.executive-card-full {
    grid-column: 1 / -1;
}

.status-pill-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.status-pill {
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status-pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.status-pill-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
}

.status-pill-meta {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--gray-600);
}

.status-good {
    background: #eaf8d7;
    border-color: #cce7a4;
}

.status-warn {
    background: #fff2d9;
    border-color: #f2d99a;
}

.status-critical {
    background: #f7e8dd;
    border-color: #e4c1a3;
}

.status-nodata {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-height: 150px;
}

.mini-bar-item {
    flex: 1;
    min-width: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.mini-bar {
    width: 100%;
    max-width: 54px;
    min-height: 16px;
    background: linear-gradient(180deg, #7ddfd0 0%, #51bfae 100%);
    border-radius: 6px 6px 3px 3px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

.mini-bar span {
    font-size: 11px;
    font-weight: 700;
    color: #1f3d39;
}

.mini-bar-item small {
    font-size: 11px;
    color: var(--gray-500);
}

.mini-chart-horizontal {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.mini-horizontal-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mini-horizontal-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-600);
}

.mini-horizontal-meta strong {
    color: var(--gray-700);
}

.mini-horizontal-track {
    height: 10px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.mini-horizontal-fill {
    height: 100%;
    background: linear-gradient(90deg, #7de18f 0%, #58c26f 100%);
    border-radius: inherit;
    min-width: 0;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 30px;
    box-shadow: var(--shadow);
    text-align: center;
    min-width: 150px;
    border-top: 3px solid var(--primary);
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary);
}

.panel-header h2 {
    font-size: 22px;
    color: var(--gray-800);
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Prof Average Rating */
.prof-avg-rating {
    text-align: center;
    padding: 12px 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.prof-avg-rating .avg-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.prof-avg-rating .avg-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Resume Form
   ======================================== */

.resume-form-container {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.resume-form-container h3 {
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.rubric-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.rubric-section-header h4 {
    font-size: 15px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.rubric-section-header p {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.rubric-items-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rubric-item-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 10px;
}

.rubric-item-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.rubric-item-header label {
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 600;
}

.rubric-score-select {
    width: 64px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    font-weight: 600;
}

.rubric-item-description {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.45;
}

.rubric-summary-info {
    margin-top: 10px;
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* ========================================
   Resume Cards
   ======================================== */

.resume-list h3 {
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.resume-cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.resume-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    border-left: 4px solid var(--primary);
}

.resume-card:hover {
    box-shadow: 0 4px 12px rgba(8,212,240,0.15);
    transform: translateY(-2px);
}

.resume-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.resume-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.resume-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.resume-tutor {
    font-size: 12px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 10px;
    border-radius: 10px;
}

.resume-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-stars {
    color: var(--warning);
    font-size: 16px;
}

.rating-label {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.rating-5 { background: var(--green-light); color: var(--green-dark); }
.rating-4 { background: var(--cyan-light); color: var(--cyan-dark); }
.rating-3 { background: var(--orange-light); color: var(--orange-dark); }
.rating-2 { background: #fde2cc; color: #b36b06; }
.rating-1 { background: #fee2e2; color: #c53030; }

.resume-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.resume-field {
    padding: 10px;
    background: var(--gray-50);
    border-radius: 6px;
}

.resume-field-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.resume-field.full-width {
    grid-column: 1 / -1;
}

.resume-field-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.resume-field-value {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.5;
}

.rubric-inline-score {
    font-size: 10px;
    font-weight: 700;
    color: #3b5760;
    background: #e3f3f9;
    border: 1px solid #cde3ec;
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}

.resume-rubric-text {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--gray-600);
}

.resume-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.resume-rubric-view {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 14px;
}

.resume-rubric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.resume-rubric-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 8px;
}

.resume-rubric-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.resume-rubric-item-top strong {
    font-size: 12px;
    color: var(--gray-700);
}

.resume-rubric-item p {
    font-size: 11px;
    line-height: 1.4;
    color: var(--gray-600);
}

.rubric-score-badge {
    font-size: 11px;
    font-weight: 700;
    color: #47626a;
    background: #e4f4f9;
    border: 1px solid #cfe8f0;
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: none;
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--white);
}

/* ========================================
   Evolution Chart (Simple CSS bars)
   ======================================== */

.evolution-chart {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--primary);
}

.evolution-chart h3 {
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 160px;
    padding: 0 12px;
}

.chart-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 50px;
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease;
    position: relative;
}

.chart-bar-value {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
}

.chart-bar-label {
    font-size: 10px;
    color: var(--gray-500);
    margin-top: 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

/* Filter row */
.filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-row select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--gray-600);
    background: var(--white);
    cursor: pointer;
}

.filter-row select:focus {
    outline: none;
    border-color: var(--cyan);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--gray-800);
    color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    z-index: 1000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
    opacity: 0;
    animation-fill-mode: forwards;
    max-width: calc(100vw - 48px);
    word-break: break-word;
}

/* ========================================
   Modal Overlay
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

.modal-content h3 {
    font-size: 18px;
    color: var(--gray-800);
    margin-bottom: 20px;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding: 8px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    padding: 4px 0;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--cyan);
    cursor: pointer;
}

.toast.toast-success {
    background: var(--primary);
    color: var(--white);
}

.toast.toast-error {
    background: var(--danger);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* ========================================
   Hamburger Menu Button
   ======================================== */

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-btn:hover {
    background: var(--gray-100);
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 89;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
}

/* Utility: visually hidden helper */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Responsive — Tablet (≤1024px)
   ======================================== */

@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 260px 1fr;
    }

    .sidebar {
        padding: 16px;
    }

    .main-content {
        padding: 16px;
    }

    .stat-card {
        padding: 16px 20px;
        min-width: 120px;
    }

    .stat-card .stat-number {
        font-size: 26px;
    }
}

/* ========================================
   Responsive — Mobile (≤768px)
   ======================================== */

@media (max-width: 768px) {
    /* Navbar */
    .navbar {
        padding: 0 16px;
        min-height: 56px;
    }

    .nav-brand h2 {
        font-size: 17px;
    }

    .nav-user span {
        display: none;
    }

    .hamburger-btn {
        display: block;
    }

    /* Dashboard layout: full width */
    .dashboard {
        grid-template-columns: 1fr;
    }

    /* Sidebar: slide-in drawer */
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        max-height: none;
        z-index: 90;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid var(--gray-200);
        background: var(--white);
        padding: 20px 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

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

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-overlay.visible {
        opacity: 1;
    }

    /* Professor list stays vertical on mobile drawer */
    .professor-list {
        flex-direction: column;
    }

    .professor-item {
        padding: 14px 12px;
        min-height: 48px;
    }

    /* Main content */
    .main-content {
        max-height: none;
        padding: 16px;
    }

    /* Welcome panel */
    .welcome-panel {
        padding: 40px 16px;
    }

    .welcome-icon {
        font-size: 48px;
    }

    .welcome-panel h2 {
        font-size: 20px;
    }

    /* Stats */
    .stats-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .stat-card {
        min-width: auto;
        padding: 16px;
    }

    .executive-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 16px;
    }

    .executive-card.executive-card-full {
        grid-column: auto;
    }

    .mini-chart {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .mini-bar-item {
        min-width: 56px;
    }

    /* Panel header */
    .panel-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .panel-header h2 {
        font-size: 18px;
    }

    .panel-header .btn {
        align-self: flex-start;
    }

    .panel-header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    /* Prof avg rating */
    .prof-avg-rating {
        align-self: flex-start;
    }

    /* Filter row */
    .filter-row {
        flex-direction: column;
        gap: 8px;
    }

    .filter-row select {
        min-height: 44px;
    }

    /* Resume form */
    .form-row {
        grid-template-columns: 1fr;
    }

    .resume-form-container {
        padding: 16px;
    }

    .rubric-items-container {
        grid-template-columns: 1fr;
    }

    .resume-rubric-grid {
        grid-template-columns: 1fr;
    }

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

    .form-actions .btn {
        justify-content: center;
        min-height: 44px;
    }

    /* Resume cards */
    .resume-card {
        padding: 16px;
    }

    .resume-card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .resume-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .resume-card-body {
        grid-template-columns: 1fr;
    }

    /* Chart */
    .chart-bars {
        height: 120px;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .chart-bar-item {
        min-width: 36px;
    }

    .evolution-chart {
        padding: 16px;
    }

    /* Form inputs — touch friendly */
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px; /* prevents iOS zoom */
    }

    .search-input {
        min-height: 44px;
        font-size: 16px;
    }

    /* Buttons — touch target */
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    /* Toast */
    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        text-align: center;
    }

    /* Auth page */
    .auth-card {
        padding: 24px 20px;
        margin: 12px;
    }

    .logo h1 {
        font-size: 24px;
    }

    .demo-credentials {
        padding: 12px;
    }

    .credential-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ========================================
   Responsive — Small Mobile (≤480px)
   ======================================== */

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

    .nav-brand h2 {
        font-size: 15px;
    }

    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .main-content {
        padding: 12px;
    }

    .welcome-panel {
        padding: 30px 12px;
    }

    .stat-card .stat-number {
        font-size: 24px;
    }

    .resume-card {
        padding: 12px;
    }

    .resume-field {
        padding: 8px;
    }

    .resume-field-value {
        font-size: 12px;
    }

    .chart-bars {
        height: 100px;
    }
}
