/**
 * Portal Styles - Cogito Coach
 * Modular CSS for the teacher/parent dashboard
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;

    /* Module colors */
    --cc-color: #667eea;
    --aa-color: #ed8936;
    --dc-color: #48bb78;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-update {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--primary);
    color: white;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s;
}

.btn-update:hover {
    background: var(--primary-dark);
}

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: var(--primary);
    color: white;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-dark);
}

/* ============================================
   USER MENU
   ============================================ */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 180px;
    overflow: hidden;
    z-index: 200;
}

.user-dropdown.show { display: block; }

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: var(--gray-50);
}

.user-dropdown .divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

.user-dropdown a.danger { color: var(--danger); }

/* ============================================
   LAYOUT: SIDEBAR + MAIN
   ============================================ */
.layout {
    display: flex;
    min-height: calc(100vh - 57px);
}

.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding: 0 20px;
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.sidebar-nav a.active {
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-nav a .icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav a .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* View containers */
.view { display: none; }
.view.active { display: block; }

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stat-card.highlight .label,
.stat-card.highlight .value { color: white; }

/* ============================================
   FILTERS
   ============================================ */
.filters {
    background: var(--gray-50);
    padding: 12px 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
}

/* Standalone filters (outside table) */
.filters:not(.table-container .filters) {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-bottom: none;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--gray-700);
    background: white;
    cursor: pointer;
}

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

/* ============================================
   TABLES
   ============================================ */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.table-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-count {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 400;
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
}

.search-box input {
    border: none;
    outline: none;
    width: 180px;
}

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

th {
    text-align: left;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

th:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

th .sort-icon {
    margin-left: 4px;
    opacity: 0.4;
}

th.sorted .sort-icon {
    opacity: 1;
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

tr:last-child td { border-bottom: none; }
tr:hover { background: var(--gray-50); }

/* Table state rows */
.loading-row,
.empty-row,
.error-row {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
    font-size: 0.95rem;
}

.loading-row {
    color: var(--gray-400);
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

.loading-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.loading-dots::after {
    content: '';
    animation: pulse 1.5s ease-in-out infinite;
}

.empty-row a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.empty-row a:hover {
    text-decoration: underline;
}

.error-row {
    color: var(--danger);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
    background: white;
    border-radius: 12px;
    margin: 20px 0;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* No data message in cards */
.no-data-msg {
    text-align: center;
    padding: 20px;
    color: var(--gray-400);
    font-size: 0.9rem;
    font-style: italic;
}

/* ============================================
   BADGES
   ============================================ */
.module-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.module-badge.cc { background: rgba(102, 126, 234, 0.12); color: var(--cc-color); }
.module-badge.aa { background: rgba(237, 137, 54, 0.12); color: var(--aa-color); }
.module-badge.dc { background: rgba(72, 187, 120, 0.12); color: var(--dc-color); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-completed { background: #c6f6d5; color: #276749; }
.status-active { background: #feebc8; color: #c05621; }
.status-pending { background: #e2e8f0; color: #4a5568; }

.score {
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}
.score.high { background: #c6f6d5; color: #276749; }
.score.medium { background: #feebc8; color: #c05621; }
.score.low { background: #fed7d7; color: #c53030; }

.student-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.student-link:hover {
    text-decoration: underline;
}

/* ============================================
   MODULE FILTER PILLS
   ============================================ */
.module-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.module-pill {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid var(--gray-200);
    background: white;
    transition: all 0.2s;
}

.module-pill:hover {
    border-color: var(--gray-300);
}

.module-pill.active {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary);
}

.module-pill.cc { --pill-color: var(--cc-color); }
.module-pill.aa { --pill-color: var(--aa-color); }
.module-pill.dc { --pill-color: var(--dc-color); }

.module-pill.cc.active { border-color: var(--cc-color); background: rgba(102, 126, 234, 0.08); color: var(--cc-color); }
.module-pill.aa.active { border-color: var(--aa-color); background: rgba(237, 137, 54, 0.08); color: var(--aa-color); }
.module-pill.dc.active { border-color: var(--dc-color); background: rgba(72, 187, 120, 0.08); color: var(--dc-color); }

/* ============================================
   CHARTS
   ============================================ */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chart-card h3 {
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   ANALYTICS TABS
   ============================================ */
.analytics-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0;
}

.analytics-tab {
    padding: 12px 20px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.analytics-tab:hover { color: var(--primary); }

.analytics-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.analytics-content { display: none; }
.analytics-content.active { display: block; }

/* ============================================
   INFO CARDS
   ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.info-card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card .metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.info-card .metric {
    text-align: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.info-card .metric .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.info-card .metric .label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ============================================
   BLOOM LEVELS & DIMENSIONS
   ============================================ */
.bloom-level {
    display: inline-block;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
}
.bloom-level.level-1, .bloom-level.level-2 { background: #fed7d7; color: #c53030; }
.bloom-level.level-3 { background: #feebc8; color: #c05621; }
.bloom-level.level-4 { background: #c6f6d5; color: #276749; }
.bloom-level.level-5, .bloom-level.level-6 { background: #bee3f8; color: #2b6cb0; }

.bloom-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-left: 4px;
}

.dim-coverage {
    font-weight: 600;
    font-size: 0.9rem;
}
.dim-coverage.good { color: var(--success); }
.dim-coverage.weak { color: var(--danger); }

/* ============================================
   SKILL GAP BARS
   ============================================ */
.skill-gap-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill-gap-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-name {
    width: 140px;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.skill-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.skill-pct {
    width: 40px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.settings-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.setting-row:last-child { border-bottom: none; }

.setting-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ============================================
   BILLING / PLANS
   ============================================ */
.plan-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.plan-card.current {
    border: 2px solid var(--primary);
}

.plan-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.plan-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.plan-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--gray-500);
}

.plan-features {
    margin: 20px 0;
    text-align: left;
    list-style: none;
}

.plan-features li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlide 0.3s ease-out;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
}

.modal-close:hover { color: var(--gray-700); }

.modal-body {
    padding: 24px;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section:last-child { margin-bottom: 0; }

.modal-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   STUDENT LIST (Modal)
   ============================================ */
.student-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.student-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.student-option:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.student-option.selected {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.08);
}

.student-option input[type="radio"] {
    display: none;
}

.student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.student-info {
    flex: 1;
}

.student-info .name { font-weight: 500; }
.student-info .email { font-size: 0.8rem; color: var(--gray-500); }
.student-info .meta { font-size: 0.8rem; color: var(--gray-500); margin-top: 2px; }

.student-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.student-option.selected .student-checkbox {
    border-color: var(--primary);
    background: var(--primary);
}

.student-option.selected .student-checkbox::after {
    content: '\2713';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* ============================================
   ADD STUDENT FORM (Modal)
   ============================================ */
.add-student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.add-student-header h3 {
    margin-bottom: 0;
}

.add-student-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.add-student-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.new-student-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group { flex: 1; }

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* New Student Card (in modal) */
.new-student-card {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.new-student-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.new-student-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
}

.remove-student-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--gray-200);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.new-student-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.new-student-fields .field-row {
    display: flex;
    gap: 8px;
}

.new-student-fields input,
.new-student-fields select {
    padding: 8px 10px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

.new-student-fields input:focus,
.new-student-fields select:focus {
    outline: none;
    border-color: var(--primary);
}

.new-student-fields .field-row input { flex: 1; }
.new-student-fields .field-row select { width: 100px; flex-shrink: 0; }

/* Simple student name in checkbox list */
.student-name {
    font-weight: 500;
    color: var(--gray-800);
}

/* ============================================
   FOCUS TAGS
   ============================================ */
.focus-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 12px;
    font-size: 0.8rem;
}

/* ============================================
   PROGRESS BY STUDENT
   ============================================ */

/* Header row with selectors and actions */
.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.student-header .selectors {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-header .actions {
    display: flex;
    gap: 8px;
}

.filter-select.large {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 10px 16px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* Chart header with title and legend */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-title {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.chart-legend {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 3px;
    vertical-align: middle;
}

.legend-swatch.cc { background: var(--primary); }
.legend-swatch.aa { background: var(--aa-color); }

.chart-dates {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 4px;
}

/* Module cards grid */
.module-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .module-cards { grid-template-columns: 1fr; }
}

/* Module card */
.module-card {
    padding: 16px;
}

.module-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.module-card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.trend-indicator {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
}

.trend-indicator.up { color: var(--success); }
.trend-indicator.down { color: var(--danger); }
.trend-indicator.flat { color: var(--gray-400); }

/* Mini stats grid */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.mini-stat {
    background: var(--gray-50);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
}

.mini-stat .value {
    font-size: 1.2rem;
    font-weight: 700;
}

.mini-stat .value.cc { color: var(--primary); }
.mini-stat .value.aa { color: var(--aa-color); }

.mini-stat .label {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* Level box (current bloom level / dimensions) */
.level-box {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.level-box.cc {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
}

.level-box.aa {
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.08), rgba(221, 107, 32, 0.08));
}

.level-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.level-badge {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.level-badge.cc { background: var(--primary); }
.level-badge.aa { background: var(--aa-color); }
.level-badge.small { font-size: 0.75rem; }

.level-title {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Class range bar */
.range-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.range-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.range-min, .range-max {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.range-track {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    position: relative;
}

.range-fill {
    position: absolute;
    height: 100%;
    opacity: 0.25;
    border-radius: 3px;
}

.range-fill.cc { background: var(--primary); }
.range-fill.aa { background: var(--aa-color); }

.range-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: -1px;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.range-dot.cc { background: var(--primary); }
.range-dot.aa { background: var(--aa-color); }

.percentile-text {
    font-size: 0.65rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: 4px;
}

/* Mini bars (bloom levels, dimensions) */
.mini-bars-section {
    margin-bottom: 12px;
}

.mini-bars-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.mini-bars {
    display: flex;
    gap: 3px;
    height: 32px;
    align-items: flex-end;
}

.mini-bar {
    flex: 1;
    border-radius: 2px;
}

.mini-bar.primary { background: var(--primary); }
.mini-bar.warning { background: var(--warning); }
.mini-bar.danger { background: var(--danger); }

.mini-bars-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--gray-400);
    margin-top: 2px;
}

/* Dimension rows */
.dim-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dim-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dim-name {
    width: 55px;
    font-size: 0.65rem;
    color: var(--gray-600);
}

.dim-track {
    flex: 1;
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
}

.dim-fill {
    height: 100%;
    border-radius: 3px;
}

.dim-fill.success { background: var(--success); }
.dim-fill.warning { background: var(--warning); }
.dim-fill.danger { background: var(--danger); }

/* Next step recommendation */
.next-step {
    font-size: 0.75rem;
    color: var(--gray-600);
    padding: 8px;
    background: var(--gray-50);
    border-radius: 6px;
    border-left: 2px solid;
}

.next-step.cc { border-left-color: var(--primary); }
.next-step.aa { border-left-color: var(--aa-color); }

/* Mini table (recent sessions in progress view) */
.mini-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}

.mini-table th {
    text-align: left;
    padding: 6px 8px;
    color: var(--gray-500);
    font-weight: 500;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
}

.mini-table th.center { text-align: center; }

.mini-table td {
    padding: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.mini-table td.center { text-align: center; }
.mini-table td.muted { color: var(--gray-400); }
.mini-table td.success { color: var(--success); font-weight: 500; }
.mini-table td.bold { font-weight: 600; }

.mini-table tr:last-child td { border-bottom: none; }

/* Mini badges for compact tables */
.badge-mini {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge-mini.cc { background: rgba(102, 126, 234, 0.1); color: var(--primary); }
.badge-mini.aa { background: rgba(237, 137, 54, 0.1); color: var(--aa-color); }

.badge-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.badge-status.not-started { background: var(--gray-100); color: var(--gray-500); }
.badge-status.in-progress { background: rgba(52, 211, 153, 0.1); color: var(--success); }
.badge-status.completed { background: rgba(102, 126, 234, 0.1); color: var(--primary); }

/* Utility spacing */
.mb-sm { margin-bottom: 12px; }
.mb-md { margin-bottom: 16px; }
.mt-md { margin-top: 16px; }

/* ============================================
   MOBILE NAV (in dropdown)
   ============================================ */
.mobile-nav-items {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .mobile-nav-items {
        display: block;
    }

    .main { padding: 16px; }
    .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .header { padding: 12px 16px; }
    .user-name { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   THINKING ANALYSIS
   ============================================ */
.thinking-analysis-cta {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.thinking-analysis-cta button {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.thinking-analysis-cta .cta-note {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
}

/* Modal Large */
.modal.modal-lg {
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal.modal-lg .modal-body {
    overflow-y: auto;
    flex: 1;
}

/* Analysis Loading */
.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.hourglass-spinner {
    width: 50px;
    height: 50px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23667eea' d='M20 10h60v10H60l-10 30 10 30h20v10H20v-10h20l10-30-10-30H20V10z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 50 50' to='180 50 50' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") center/contain no-repeat;
    margin-bottom: 16px;
}

.analysis-loading p {
    color: var(--gray-600);
    font-weight: 500;
}

.analysis-loading .loading-note {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: normal;
    margin-top: 4px;
}

/* Analysis Content */
.analysis-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.analysis-header h3 {
    color: var(--gray-800);
    margin-bottom: 4px;
}

.analysis-meta {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.analysis-summary {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.analysis-section {
    margin-bottom: 24px;
}

.analysis-section h4 {
    color: var(--gray-700);
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pattern Cards */
.patterns-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pattern-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px;
}

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

.pattern-name {
    font-weight: 600;
    color: var(--gray-800);
}

.confidence-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.confidence-badge.high { background: rgba(72, 187, 120, 0.15); color: var(--success); }
.confidence-badge.medium { background: rgba(237, 137, 54, 0.15); color: var(--warning); }
.confidence-badge.low { background: rgba(113, 128, 150, 0.15); color: var(--gray-500); }

.pattern-desc { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 8px; }
.pattern-evidence { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 8px; }
.pattern-implication { font-size: 1rem; font-weight: 600; color: var(--primary); font-style: normal; }

/* Strengths */
.strengths-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.strength-item {
    background: rgba(72, 187, 120, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
}

.strength-name {
    font-weight: 600;
    color: var(--success);
    display: block;
}

.strength-evidence {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Growth Cards */
.growth-card {
    background: rgba(237, 137, 54, 0.08);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
}

.growth-card:last-child { margin-bottom: 0; }

.growth-card strong { color: var(--warning); }
.growth-card p { color: var(--gray-600); font-size: 0.9rem; margin-top: 6px; }
.suggested-prompts { font-size: 0.85rem; color: var(--gray-500); font-style: italic; }

/* Recommendations */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.rec-card {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 14px;
}

.rec-card h5 {
    color: var(--primary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.rec-card p, .rec-card ul {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin: 0;
}

.rec-card ul {
    padding-left: 16px;
}

.rec-card li { margin-bottom: 4px; }

/* Limitations */
.analysis-limitations {
    background: var(--gray-100);
    border-radius: 6px;
    padding: 12px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.analysis-error {
    text-align: center;
    padding: 40px;
    color: var(--danger);
}

.analysis-not-ready {
    text-align: center;
    padding: 40px 20px;
}

.analysis-not-ready .not-ready-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.analysis-not-ready h3 {
    color: var(--gray-700);
    margin-bottom: 12px;
}

.analysis-not-ready p {
    color: var(--gray-500);
    max-width: 400px;
    margin: 0 auto 12px;
    line-height: 1.5;
}

.analysis-not-ready .not-ready-cta {
    color: var(--primary);
    font-weight: 500;
}
