/* Student Profile Modal - Shared Styles */

/* Base .modal-overlay styles are in shared/layout.css */

/* Ensure student modal appears above lesson detail modal (z-index: 2000) */
#studentModal {
    z-index: 10100;
}

.modal-container {
    background-color: white;
    border-radius: 8px;
    width: 1100px;
    height: 750px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* ===== STUDENT NAVIGATION ===== */
.sm-nav-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sm-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    background: #fff;
    color: #555;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.sm-nav-btn:hover {
    background: #f3f4f6;
    border-color: #ccc;
    color: #333;
}

.sm-name-dropdown-wrap {
    position: relative;
}

.sm-name-clickable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    white-space: nowrap;
}
.sm-name-clickable:hover {
    color: #059669;
}

.sm-name-caret {
    font-size: 14px;
    color: #999;
    margin-left: 4px;
    display: none;
}
.sm-name-clickable:hover .sm-name-caret {
    color: #059669;
}

.sm-student-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 1000;
    padding: 4px 0;
}
.sm-student-dropdown.sm-dropdown-open {
    display: block;
}

.sm-dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
}
.sm-dropdown-item:hover {
    background: #f3f4f6;
}
.sm-dropdown-item.sm-dropdown-current {
    color: #059669;
    font-weight: 600;
    background: #f0fdf4;
}

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

.modal-notebook-btn {
    padding: 6px 14px;
    background-color: #6366f1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-notebook-btn:hover {
    background-color: #4f46e5;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #333;
}

/* ===== NOTEBOOK PREVIEW MODAL ===== */
.notebook-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 10200;
    justify-content: center;
    align-items: center;
}

.notebook-preview-overlay.active {
    display: flex;
}

.notebook-preview-container {
    background-color: #f5f5f5;
    border-radius: 10px;
    width: 99vw;
    height: 98vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.notebook-preview-header {
    padding: 6px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.notebook-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notebook-preview-title .preview-icon {
    font-size: 15px;
}

.notebook-preview-title .preview-badge {
    font-size: 10px;
    font-weight: 600;
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notebook-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notebook-preview-expand-btn {
    padding: 4px 10px;
    background: #fff;
    color: #333;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notebook-preview-expand-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.notebook-preview-close-btn {
    background: #fff;
    border: 1px solid #d0d0d0;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 6px;
}

.notebook-preview-close-btn:hover {
    color: #333;
    background: #f0f0f0;
    border-color: #bbb;
}

.notebook-preview-iframe {
    flex: 1;
    width: 100%;
    border: none;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    padding: 0 32px;
    gap: 8px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1;
}

.modal-tab {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    position: relative;
    top: 1px;
}

.modal-tab:hover {
    color: #333;
    background-color: #f0f0f0;
}

.modal-tab.active {
    color: #059669;
    font-weight: 500;
    border-bottom-color: #059669;
    background-color: white;
}

#studentModal .modal-body {
    padding: 0 32px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #eee;
}

#studentModal .modal-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0;
}

#studentModal .modal-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Student Info Styles */
.student-info-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    flex: 1;
    overflow: hidden;
    padding-bottom: 20px;
}

.student-info-left {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.student-info-left-header {
    flex-shrink: 0;
    padding-bottom: 16px;
}

.student-info-left-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.student-profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #999;
    margin: 0 auto 16px auto;
    overflow: hidden;
}

.student-profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.info-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 15px;
    color: #333;
    font-weight: 400;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.info-value[contenteditable="true"] {
    background-color: white;
    border-color: #059669;
    outline: none;
}

.info-value[contenteditable="true"]:focus {
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.student-info-right {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    padding-right: 8px;
    flex: 1;
    min-height: 0;
}

.info-section {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
}

.contact-info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

.contact-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.contact-value {
    font-size: 14px;
    color: #333;
    font-weight: 400;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.contact-value[contenteditable="true"] {
    background-color: white;
    border-color: #059669;
    outline: none;
}

.contact-value[contenteditable="true"]:focus {
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.info-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.scrollable-student-info {
    max-height: 500px;
    overflow-y: auto;
}

.student-name-header {
    text-align: center;
    margin-bottom: 16px;
}

.student-name-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.student-name-title[contenteditable="true"] {
    background-color: white;
    border-color: #059669;
    outline: none;
}

.student-name-title[contenteditable="true"]:focus {
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.student-id-subtitle {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.student-id-subtitle[contenteditable="true"] {
    background-color: white;
    border-color: #059669;
    outline: none;
}

.student-id-subtitle[contenteditable="true"]:focus {
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.info-section-header-with-edit {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.edit-toggle-btn {
    padding: 4px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background-color: #059669;
    color: white;
    transition: all 0.2s;
}

.edit-toggle-btn:hover {
    background-color: #047857;
}

.edit-toggle-btn.saving {
    background-color: #2563eb;
}

.edit-toggle-btn.saving:hover {
    background-color: #1d4ed8;
}

.editable-field {
    transition: all 0.2s;
}

.editable-field[contenteditable="true"] {
    background-color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #059669;
    outline: none;
}

.editable-field[contenteditable="true"]:focus {
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Collapsible Sections */
.collapsible-section {
    background-color: #f8f9fa;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
    flex-shrink: 0;
    border-bottom: 1px solid #d0d0d0;
}

.collapsible-section:last-child {
    border-bottom: none;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.collapsible-header:hover {
    background-color: #e9ecef;
}

.collapsible-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.collapsible-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.collapsible-content.active {
    max-height: 1000px;
    padding: 0 20px 20px 20px;
}

/* Schedule Content */
.schedule-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.schedule-day {
    background-color: white;
    padding: 12px;
    border-radius: 6px;
}

.schedule-day-header {
    font-size: 13px;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.schedule-period {
    font-size: 13px;
    color: #333;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.schedule-period:last-child {
    border-bottom: none;
}

.schedule-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
}

.schedule-period {
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

.schedule-class {
    font-size: 14px;
    color: #333;
    padding: 8px 12px;
    background-color: white;
    border-radius: 4px;
}

/* Student Preferences Styles */
.preferences-content-wrapper {
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.preferences-textarea-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

.preferences-textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    resize: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.preferences-textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.preferences-textarea[readonly] {
    background-color: #f8f9fa;
    cursor: default;
    border-color: #e9ecef;
}

.preferences-button-container {
    display: flex;
    justify-content: flex-end;
}

.preferences-edit-btn {
    padding: 4px 14px;
    font-size: 12px;
    background-color: #059669;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.preferences-edit-btn:hover {
    background-color: #047857;
}

.preferences-edit-btn.saving {
    background-color: #2563eb;
}

.preferences-edit-btn.saving:hover {
    background-color: #1d4ed8;
}

.survey-item {
    margin-bottom: 16px;
}

.survey-item:last-child {
    margin-bottom: 0;
}

.survey-question {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.survey-answer {
    font-size: 14px;
    color: #333;
    padding: 8px 12px;
    background-color: white;
    border-radius: 4px;
}

.student-info-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #e0e0e0;
    background-color: white;
    flex-shrink: 0;
    margin-top: auto;
}

.notebook-btn, .edit-btn, .schedule-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.notebook-btn {
    background-color: #6366f1;
    color: white;
}

.notebook-btn:hover {
    background-color: #4f46e5;
}

.edit-btn {
    background-color: #059669;
    color: white;
}

.edit-btn:hover {
    background-color: #047857;
}

.edit-btn.save-mode {
    background-color: #f59e0b;
}

.edit-btn.save-mode:hover {
    background-color: #d97706;
}

.schedule-btn {
    background-color: #3b82f6;
    color: white;
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
}

.schedule-btn:hover {
    background-color: #2563eb;
}

.student-info-left .schedule-btn {
    margin-bottom: 4px;
}

.student-preferences-text {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 12px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
    min-height: 300px;
}

.student-preferences-text[contenteditable="true"] {
    background-color: #fffef0;
    border-color: #059669;
    outline: none;
}

.student-preferences-text[contenteditable="true"]:focus {
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Academic Overview Styles */
.academic-classes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.academic-class-item {
    background-color: white;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e0e0e0;
}

.class-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.class-name-teacher {
    flex: 1;
}

.class-name-academic {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.class-teacher {
    font-size: 12px;
    color: #666;
}

.class-grade {
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

.class-grade.excellent {
    background-color: #d1fae5;
    color: #065f46;
}

.class-grade.good {
    background-color: #dbeafe;
    color: #1e40af;
}

.class-grade.needs-improvement {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Teacher Notes Styles */
.teacher-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.teacher-note-item {
    background-color: white;
    border-radius: 6px;
    padding: 10px;
    border-left: 3px solid #059669;
}

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

.note-teacher {
    font-size: 12px;
    font-weight: 600;
    color: #059669;
}

.note-date {
    font-size: 11px;
    color: #999;
}

.note-content {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

/* Clickable row cursor */
.roster-table tbody tr {
    cursor: pointer;
}

/* Empty state for tabs */
.empty-tab-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-tab-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-tab-state-text {
    font-size: 16px;
    font-weight: 500;
}

/* Teacher Notes Tab Styles */
.teacher-notes-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
    padding: 0 0 20px 0;
}

.note-input-section {
    padding: 12px 20px 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.note-input-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.note-heading-text {
    flex: 1;
}

.note-heading-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.note-heading-subtitle {
    font-size: 13px;
    color: #666;
    font-weight: 400;
}

.note-heading-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.note-textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
    background-color: white;
}

.note-input-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.note-controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mic-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #6366f1;
    background-color: white;
    color: #6366f1;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mic-button:hover {
    background-color: #6366f1;
    color: white;
    transform: scale(1.05);
}

.mic-button.recording {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.recording-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    color: #ef4444;
    font-size: 11px;
    font-weight: 500;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    white-space: nowrap;
}

.recording-indicator.active {
    display: flex;
}

.note-heading-buttons {
    position: relative;
}

.recording-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.save-note-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    background-color: #059669;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    height: 36px;
    white-space: nowrap;
}

.save-note-btn:hover {
    background-color: #047857;
}

.save-note-btn:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
}

/* Notes Panel Bottom (mirrors Memory Profile bottom) */
.notes-panel-bottom {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.notes-panel {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100%;
    overflow: hidden;
}

.notes-navigator {
    display: flex;
    flex-direction: column;
    border-right: 2px solid #e0e0e0;
    overflow: hidden;
    background-color: #f8f9fa;
}

.notes-nav-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.notes-nav-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notes-nav-list {
    flex: 1;
    overflow-y: auto;
}

.notes-nav-group {
    border-bottom: 1px solid #e0e0e0;
}

.notes-nav-group-header {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #eef0f2;
}

.notes-nav-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid #eef0f2;
}

.notes-nav-item:hover {
    background-color: #e9ecef;
}

.notes-nav-item.active {
    background-color: #d1fae5;
    border-left: 3px solid #059669;
    padding-left: 13px;
}

.notes-nav-item-preview {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-nav-item-meta {
    font-size: 11px;
    color: #999;
}

.notes-nav-item-edited {
    font-size: 10px;
    color: #059669;
    font-style: italic;
}

/* Notes Reading Pane */
.notes-reading-pane {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    background-color: white;
}

.notes-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.notes-pane-timestamps {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notes-pane-created {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.notes-pane-edited {
    font-size: 11px;
    color: #059669;
    font-style: italic;
}

.notes-pane-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.notes-pane-content {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    background-color: #f8f9fa;
    border-left: 4px solid #059669;
    padding: 16px;
    border-radius: 4px;
}

.notes-pane-history {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.notes-pane-history-title {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.note-edit-btn {
    background: none;
    border: none;
    color: #059669;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.note-edit-btn:hover {
    background-color: #d1fae5;
}

.note-delete-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.note-delete-btn:hover {
    background-color: #fee2e2;
}

.note-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
}

.note-content-editable {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: white;
    border: 1px solid #059669;
    border-radius: 6px;
    resize: vertical;
    margin-top: 8px;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.note-content-editable:focus {
    outline: none;
    border-color: #047857;
}

.note-history-item {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 13px;
}

.note-history-item:last-child {
    margin-bottom: 0;
}

.note-history-timestamp {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    margin-bottom: 4px;
}

.note-history-content {
    color: #555;
    line-height: 1.5;
    white-space: pre-wrap;
}

.no-notes-message {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* Memory Profile Tab Styles */
.memory-profile-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

.memory-profile-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 16px;
}

.memory-profile-left {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.memory-profile-left-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 12px;
}

.memory-overview-heading {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.memory-profile-left-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.memory-overview-summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.overview-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.overview-bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.overview-bullet-list li {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    padding: 2px 0 2px 12px;
    position: relative;
}

.overview-bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #059669;
}

.memory-profile-right {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    padding-right: 8px;
    flex: 1;
    min-height: 0;
}

/* Memory Profile inherits base collapsible-section border-bottom */

.memory-profile-right .collapsible-header {
    padding: 10px 16px;
}

.memory-profile-right .collapsible-title {
    font-size: 12px;
}

.memory-profile-right .collapsible-content {
    padding: 0 16px;
}

.memory-profile-right .collapsible-content.active {
    max-height: 500px;
    padding: 0 16px 10px 16px;
    overflow-y: auto;
}

.score-high { background-color: #d1fae5; color: #065f46; }
.score-mid { background-color: #fef3c7; color: #92400e; }
.score-low { background-color: #fee2e2; color: #991b1b; }

/* Previous Assignments (collapsible toggle items) */
.mp-assignments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mp-assignment-item {
    border-bottom: 1px solid #e0e0e0;
}

.mp-assignment-item:last-child {
    border-bottom: none;
}

.mp-assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background-color 0.15s;
    border-radius: 4px;
    padding: 8px 6px;
}

.mp-assignment-header:hover {
    background-color: #e9ecef;
}

.mp-assignment-header.open {
    background-color: #eef7f2;
}

.mp-assignment-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.mp-assignment-arrow {
    font-size: 10px;
    color: #666;
    flex-shrink: 0;
    width: 12px;
}

.mp-assignment-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-assignment-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 8px;
}

.mp-assignment-score {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

.mp-assignment-date {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.mp-assignment-detail {
    padding: 8px 6px 12px 24px;
}

.mp-assignment-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mp-assignment-lesson {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.mp-assignment-difficulty {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    background-color: #f3f4f6;
}

.mp-assignment-summary {
    background-color: #f8f9fa;
    border-left: 3px solid #059669;
    padding: 10px 12px;
    border-radius: 4px;
}

.mp-assignment-summary-label {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.mp-assignment-summary-text {
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

/* External Data in Memory Profile */
.mp-extdata-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mp-extdata-loading,
.mp-extdata-empty {
    font-size: 12px;
    color: #999;
    padding: 4px 0;
}

.mp-extdata-dataset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 12px;
    background-color: #fff;
}

.mp-extdata-dataset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mp-extdata-dataset-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.mp-extdata-dataset-desc {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
}

.mp-extdata-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mp-extdata-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-extdata-field-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    min-width: 100px;
    flex-shrink: 0;
}

.mp-extdata-field-value {
    font-size: 13px;
    color: #333;
}

.mp-extdata-no-value {
    color: #ccc;
}

.mp-extdata-field-input {
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background-color: #f8f9fa;
    flex: 1;
    min-width: 0;
    font-family: Arial, sans-serif;
}

.mp-extdata-field-input:focus {
    outline: none;
    border-color: #059669;
}

textarea.mp-extdata-field-input {
    resize: vertical;
    line-height: 1.5;
}

.mp-extdata-diff-notes {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #eee;
}

.mp-extdata-diff-label {
    font-weight: 700;
}

.mp-extdata-no-cols {
    font-size: 12px;
    color: #999;
}

.memory-guidelines-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    resize: vertical;
    transition: all 0.2s;
}

.memory-guidelines-textarea:read-only {
    cursor: default;
    background-color: #f8f9fa;
}

.memory-guidelines-textarea:not(:read-only) {
    background-color: white;
    border-color: #059669;
    outline: none;
}

.memory-guidelines-textarea:not(:read-only):focus {
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.memory-header-edit-btn {
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    background-color: #059669;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.memory-header-edit-btn:hover {
    background-color: #047857;
}

.memory-header-edit-btn.saving {
    background-color: #2563eb;
}

.memory-header-edit-btn.saving:hover {
    background-color: #1d4ed8;
}

.memory-section-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.memory-upload-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    background-color: #6366f1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.memory-upload-btn:hover {
    background-color: #4f46e5;
}

.legal-uploads-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.legal-upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.legal-upload-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
}

.legal-upload-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    transition: color 0.2s;
}

.legal-upload-remove:hover {
    color: #ef4444;
}

/* ===== Memory System: Synthesized Profile + Observation Timeline ===== */

.mp-synthesize-btn {
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    background-color: #059669;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.mp-synthesize-btn:hover {
    background-color: #047857;
}

.mp-synthesize-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.mp-empty-state {
    padding: 32px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
    line-height: 1.6;
}

.mp-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Toggleable sections in memory profile left column */
.mp-toggle-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 6px;
    user-select: none;
}
.mp-toggle-header:hover { color: #059669; }
.mp-toggle-header .mp-section-label { margin-bottom: 0; }
.mp-toggle-icon {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}
.mp-toggle-header.collapsed .mp-toggle-icon {
    transform: rotate(-90deg);
}
.mp-toggle-body {
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.mp-toggle-body.collapsed {
    display: none;
}

.mp-profile-summary {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    padding: 10px 12px;
    background-color: #f8f9fa;
    border-left: 3px solid #059669;
    border-radius: 4px;
    margin-bottom: 4px;
}

/* Trait Cards */
.mp-trait-card {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mp-trait-card:last-child {
    border-bottom: none;
}

.mp-trait-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mp-trait-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.mp-confidence-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mp-confidence-high {
    background-color: #d1fae5;
    color: #065f46;
}

.mp-confidence-medium {
    background-color: #fef3c7;
    color: #92400e;
}

.mp-confidence-low {
    background-color: #f3f4f6;
    color: #666;
}

.mp-trait-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #555;
}

.mp-trait-evidence,
.mp-growth-evidence {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    font-style: italic;
}

/* Growth Area Cards */
.mp-growth-card {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mp-growth-card:last-child {
    border-bottom: none;
}

.mp-growth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mp-growth-area {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.mp-trend-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: capitalize;
}

.mp-trend-improving {
    background-color: #d1fae5;
    color: #065f46;
}

.mp-trend-declining {
    background-color: #fee2e2;
    color: #991b1b;
}

.mp-trend-stable {
    background-color: #f3f4f6;
    color: #666;
}

.mp-growth-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #555;
}

/* Suggestion Cards */
.mp-suggestion-card {
    padding: 10px 12px;
    background-color: #f0fdf4;
    border-left: 3px solid #059669;
    border-radius: 4px;
    margin-bottom: 8px;
}

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

.mp-suggestion-text {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

.mp-suggestion-reason {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

.mp-profile-footer {
    font-size: 11px;
    color: #999;
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

/* Observation Timeline */
.mp-obs-count {
    font-size: 11px;
    font-weight: 400;
    color: #999;
    margin-left: 6px;
}

.mp-obs-empty {
    font-size: 12px;
    color: #999;
    padding: 12px 0;
    line-height: 1.5;
}

/* Recent Flags / Patterns Noticed strip — sits above lesson list */
.mp-flags-timeline {
    background: #fffbf2;
    border: 1px solid #f3e6c9;
    border-left: 3px solid #c98a00;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
.mp-flags-timeline-head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #8a5a00;
    margin-bottom: 2px;
}
.mp-flags-timeline-sub {
    font-size: 11px;
    color: #8a7f6a;
    line-height: 1.45;
    margin-bottom: 8px;
}
.mp-flag-row {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px solid #f3e6c9;
}
.mp-flag-row:first-of-type { border-top: 0; }
.mp-flag-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
}
.mp-flag-dot-red    { background: #c2410c; }
.mp-flag-dot-yellow { background: #c98a00; }
.mp-flag-dot-green  { background: #2f6844; }
.mp-flag-body { flex: 1; min-width: 0; }
.mp-flag-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.mp-flag-lesson {
    font-size: 12px;
    font-weight: 600;
    color: #111;
}
.mp-flag-date {
    font-size: 10.5px;
    color: #999;
}
.mp-flag-reason {
    font-size: 11.5px;
    color: #555;
    margin-top: 2px;
    line-height: 1.45;
}
.mp-flag-source {
    font-size: 10px;
    color: #b08a40;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.mp-obs-card {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mp-obs-card:last-child {
    border-bottom: none;
}

.mp-obs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mp-obs-lesson {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.mp-obs-date {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
}

.mp-obs-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.mp-obs-section {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.mp-obs-score {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

.mp-obs-feedback {
    font-size: 12px;
    line-height: 1.4;
    color: #666;
}

.mp-obs-show-more {
    padding: 10px 0;
    text-align: center;
}

.mp-obs-show-more a {
    font-size: 12px;
    color: #059669;
    text-decoration: none;
    font-weight: 600;
}

.mp-obs-show-more a:hover {
    text-decoration: underline;
}

/* Submissions Tab Styles */
.submissions-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Snapshot header */
.submissions-snapshot {
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.submissions-snapshot-scores {
    overflow-x: auto;
}

.submissions-score-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.submissions-score-grid th {
    background-color: #f0f1f3;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e8e8e8;
    padding: 6px 4px;
    font-size: 10px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
    white-space: nowrap;
}

.submissions-score-grid td {
    border-right: 1px solid #f0f0f0;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    height: 34px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    min-width: 48px;
}

.submissions-score-grid td.sg-high { color: #065f46; background-color: #ecfdf5; }
.submissions-score-grid td.sg-mid { color: #92400e; background-color: #fffbeb; }
.submissions-score-grid td.sg-low { color: #991b1b; background-color: #fef2f2; }
.submissions-score-grid td.sg-missing { color: #dc2626; background-color: #fff5f5; font-weight: 400; font-family: Arial, sans-serif; }
.submissions-score-grid td.sg-avg { background-color: #f0f1f3; min-width: 46px; }
.submissions-score-grid td.sg-avg.sg-high { color: #065f46; background-color: #d1fae5; }
.submissions-score-grid td.sg-avg.sg-mid { color: #92400e; background-color: #fef3c7; }
.submissions-score-grid td.sg-avg.sg-low { color: #991b1b; background-color: #fee2e2; }
.submissions-score-grid th.sg-avg-header { background-color: #e8e9ec; }

.submissions-snapshot-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-top: 1px solid #e0e0e0;
}

.submissions-snapshot-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.submissions-snapshot-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.submissions-snapshot-stat-value.stat-good { color: #059669; }
.submissions-snapshot-stat-value.stat-warn { color: #d97706; }
.submissions-snapshot-stat-value.stat-bad { color: #dc2626; }

.submissions-snapshot-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.submissions-snapshot-trend {
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
}

.submissions-date-filter {
    display: flex;
    align-items: center;
    gap: 6px;
}

.submissions-date-filter label {
    font-size: 10px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.submissions-date-filter select {
    padding: 3px 8px;
    font-size: 11px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: white;
    color: #333;
    cursor: pointer;
}

.submissions-columns {
    display: grid;
    grid-template-columns: 240px 280px 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Left column: Lessons by unit */
.submissions-lessons-col {
    display: flex;
    flex-direction: column;
    border-right: 2px solid #e0e0e0;
    overflow: hidden;
    background-color: #f8f9fa;
}

.submissions-col-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.submissions-col-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submissions-lessons-toggle {
    display: flex;
    background-color: #e9ecef;
    border-radius: 6px;
    padding: 3px;
    gap: 2px;
}

.submissions-lessons-toggle-btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.submissions-lessons-toggle-btn:hover {
    color: #333;
}

.submissions-lessons-toggle-btn.active {
    background-color: white;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.submissions-missing-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    background-color: #dc2626;
    border-radius: 8px;
}

.submissions-notebook-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: #6366f1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.submissions-notebook-btn:hover {
    background-color: #4f46e5;
}

.submissions-col-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.submissions-lessons-list {
    flex: 1;
    overflow-y: auto;
}

.submissions-unit-group {
    border-bottom: 1px solid #e0e0e0;
}

.submissions-unit-header {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #eef0f2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.submissions-unit-header:hover {
    background-color: #e4e7ea;
}

.submissions-unit-toggle {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.submissions-unit-header.collapsed .submissions-unit-toggle {
    transform: rotate(-90deg);
}

.submissions-unit-lessons {
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.3s ease;
}

.submissions-unit-header.collapsed + .submissions-unit-lessons {
    max-height: 0;
}

.submissions-lesson-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid #eef0f2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submissions-lesson-item:hover {
    background-color: #e9ecef;
}

.submissions-lesson-item.active {
    background-color: #d1fae5;
    border-left: 3px solid #059669;
    padding-left: 13px;
}

.submissions-lesson-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.submissions-lesson-item.active .submissions-lesson-name {
    font-weight: 600;
}

.submissions-lesson-date {
    font-size: 11px;
    color: #999;
}

.submissions-missing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #dc2626;
    flex-shrink: 0;
}

/* Flag indicator on a Submissions lesson row — uses .mp-flag-dot-* colors */
.submissions-flag-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 2px;
}

/* Middle column: Assignments for selected lesson */
.submissions-assignments-col {
    display: flex;
    flex-direction: column;
    border-right: 2px solid #e0e0e0;
    overflow: hidden;
    background-color: white;
}

.submissions-assignments-list {
    flex: 1;
    overflow-y: auto;
}

.submissions-assignment-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid #eef0f2;
}

.submissions-assignment-item:hover {
    background-color: #f8f9fa;
}

.submissions-assignment-item.active {
    background-color: #d1fae5;
    border-left: 3px solid #059669;
    padding-left: 13px;
}

.submissions-assignment-type {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.submissions-assignment-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.submissions-assignment-item.active .submissions-assignment-title {
    font-weight: 600;
}

.submissions-assignment-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
}

.status-submitted { background-color: #d1fae5; color: #065f46; }
.status-complete { background-color: #dbeafe; color: #1e40af; }
.status-missing { background-color: #fee2e2; color: #991b1b; }
.status-late { background-color: #fef3c7; color: #92400e; }
.status-in-progress { background-color: #f3e8ff; color: #6b21a8; }

.submissions-assignment-meta {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

.submissions-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    padding: 20px;
    text-align: center;
}

.submissions-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.submissions-empty-text {
    font-size: 13px;
}

/* Right column: AI feedback / detail pane */
.submissions-detail-col {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    background-color: white;
}

.submissions-detail-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.submissions-detail-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.submissions-detail-date {
    font-size: 12px;
    color: #666;
}

.submissions-detail-status-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
}

.submissions-detail-score {
    font-size: 14px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
    margin-left: auto;
}

.submissions-detail-section {
    margin-bottom: 20px;
}

.submissions-detail-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.submissions-detail-ai-box {
    background-color: #f8f9fa;
    border-left: 4px solid #059669;
    padding: 16px;
    border-radius: 4px;
}

.submissions-detail-ai-text {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.submissions-detail-response-box {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
}

.submissions-detail-response-label {
    font-size: 11px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.submissions-detail-response-text {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    white-space: pre-wrap;
}

/* Messages Tab Styles */
.messages-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

.messages-display {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin: 0 0 0 0;
}

/* Message Bubble Styles */
.message-item {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: messageSlideIn 0.2s ease-out;
}

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

.message-item.sent {
    align-self: flex-end;
}

.message-item.received {
    align-self: flex-start;
}

.message-item.system {
    align-self: center;
    max-width: 85%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-item.sent .message-bubble {
    background-color: #059669;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-item.received .message-bubble {
    background-color: white;
    color: #333;
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

.message-item.system .message-bubble {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    text-align: center;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.message-item.system .message-bubble:hover {
    background-color: #ffeaa7;
    border-color: #f39c12;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Lesson System Message Structure */
.lesson-system-box {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 16px;
    cursor: default;
}

.lesson-system-box:hover {
    background-color: #fff3cd;
    transform: none;
}

.lesson-system-box::after {
    display: none;
}

.lesson-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f39c12;
}

.lesson-icon {
    font-size: 24px;
}

.lesson-title-section {
    flex: 1;
}

.lesson-date {
    font-size: 11px;
    color: #856404;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lesson-title {
    font-size: 15px;
    font-weight: 700;
    color: #856404;
    margin-top: 2px;
}

.lesson-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lesson-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background-color: #f39c12;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.lesson-view-btn:hover {
    background-color: #e67e22;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.lesson-assignments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.assignment-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background-color: white;
    border: 1px solid #f39c12;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #856404;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.assignment-chip:hover {
    background-color: #ffeaa7;
    border-color: #e67e22;
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.assignment-chip.completed {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.assignment-chip.completed:hover {
    background-color: #c3e6cb;
}

.assignment-chip.assigned {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.assignment-chip.assigned:hover {
    background-color: #f5c6cb;
}

.assignment-chip-icon {
    font-size: 14px;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
}

.message-timestamp {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.7;
}

.message-item.sent .message-timestamp {
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
}

.message-item.received .message-timestamp {
    text-align: left;
    color: #666;
}

/* Message Attachments */
.message-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    font-size: 13px;
}

.message-item.sent .attachment-item {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.attachment-icon {
    font-size: 16px;
}

.attachment-name {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-size {
    font-size: 11px;
    opacity: 0.7;
}

/* Linked Content in Messages */
.message-linked-content {
    margin-top: 8px;
    padding: 10px 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border-left: 3px solid #059669;
    border-radius: 6px;
}

.message-item.sent .message-linked-content {
    background-color: rgba(255, 255, 255, 0.2);
    border-left-color: white;
}

.linked-content-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.linked-content-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.linked-content-description {
    font-size: 12px;
    opacity: 0.85;
}

/* Message Input Container */
.message-input-container {
    background-color: white;
    border-top: 1px solid #e0e0e0;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.message-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.message-textarea {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s;
}

.message-textarea:focus {
    outline: none;
    border-color: #059669;
}

.message-send-btn {
    width: 42px;
    height: 42px;
    background-color: #059669;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.message-send-btn:hover {
    background-color: #047857;
}

.message-send-btn:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
}

/* AI Mode for Send Button */
.message-send-btn.ai-mode {
    background-color: #6366f1;
}

.message-send-btn.ai-mode:hover {
    background-color: #4f46e5;
}

/* Microphone Button */
.message-mic-btn {
    width: 42px;
    height: 42px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 20px;
}

.message-mic-btn:hover {
    background-color: #e9ecef;
    border-color: #059669;
}

.message-mic-btn.recording {
    background-color: #dc3545;
    border-color: #dc3545;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

/* Recording Indicator for Messages */
.recording-indicator-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 13px;
    color: #856404;
    font-weight: 500;
}

.recording-dot-pulse {
    width: 10px;
    height: 10px;
    background-color: #dc3545;
    border-radius: 50%;
    animation: blink-pulse 1s infinite;
}

@keyframes blink-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Message Actions Row */
.message-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.message-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: #666;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.message-action-btn:hover {
    background-color: #e9ecef;
    color: #059669;
    border-color: #059669;
}

.message-action-btn svg {
    flex-shrink: 0;
}

/* Content Link Dropdown */
.message-action-dropdown {
    position: relative;
}

.content-link-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 220px;
    margin-bottom: 8px;
    z-index: 100;
}

.content-link-dropdown.open {
    display: block;
}

.dropdown-header {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e0e0;
}

.content-link-dropdown .dropdown-item {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    color: #333;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-link-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #059669;
}

.content-link-dropdown .dropdown-item:first-of-type {
    border-radius: 8px 8px 0 0;
}

.content-link-dropdown .dropdown-item:last-of-type {
    border-radius: 0 0 8px 8px;
}

/* Triple Dot Menu */
.message-menu-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
    color: #666;
    padding: 0;
}

.message-menu-btn:hover {
    background-color: #e9ecef;
    color: #059669;
    border-color: #059669;
}

.message-menu-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 200px;
    margin-bottom: 8px;
    z-index: 100;
}

.message-menu-dropdown.open {
    display: block;
}

.message-menu-dropdown .dropdown-item {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    color: #333;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-menu-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #059669;
}

.message-menu-dropdown .dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.message-menu-dropdown .dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Attachment Preview Area */
.attachment-preview-area {
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background-color: white;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 13px;
}

.preview-file-icon {
    font-size: 16px;
}

.preview-file-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-file-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

.preview-file-remove:hover {
    color: #dc2626;
}

/* Linked Content Preview */
.linked-content-preview {
    padding: 12px;
    background-color: #e0e7ff;
    border: 1px solid #6366f1;
    border-radius: 6px;
}

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

.linked-preview-type {
    font-size: 11px;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.linked-preview-remove {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}

.linked-preview-remove:hover {
    color: #4f46e5;
}

.linked-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.linked-preview-description {
    font-size: 12px;
    color: #666;
}

/* Empty State for Messages */
.messages-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
    padding: 40px;
}

.messages-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.messages-empty-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.messages-empty-subtext {
    font-size: 14px;
}

/* Attendance Tab Styles */
.attendance-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    height: 100%;
}

/* LEFT COLUMN: Two-tab section */
.attendance-left-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* RIGHT COLUMN: Split 50/50 (Calendar top, Graph bottom) */
.attendance-right-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

/* Calendar Section (Top 50%) */
.attendance-calendar-section {
    flex: 1;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px 10px 8px 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    gap: 0;
    align-items: stretch;
}

/* Trend Section (Bottom 50%) */
.attendance-trend-section {
    flex: 1;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Attendance Sub-tabs */
.attendance-subtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    background-color: #e0e0e0;
    padding: 4px;
    border-radius: 6px;
}

.attendance-subtab {
    flex: 1;
    padding: 8px 6px;
    background-color: transparent;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.attendance-subtab:hover {
    background-color: #d0d0d0;
    color: #333;
}

.attendance-subtab.active {
    background-color: white;
    color: #059669;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Attendance Views (toggle between summary and history) */
.attendance-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.attendance-view.active {
    display: flex;
}

.attendance-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Attendance Percentage Display */
.attendance-percentage-display {
    text-align: center;
    padding: 8px 0;
    margin-bottom: 6px;
    background-color: white;
    border-radius: 6px;
}

/* Key Metrics (Present % and Late %) */
.key-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.metric-card {
    background-color: white;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-value {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.metric-present .metric-value {
    color: #10b981;
}

.metric-late .metric-value {
    color: #f59e0b;
}

/* Pie Chart Container */
.pie-chart-container {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 12px;
}

#attendancePieChart {
    max-width: 160px;
    max-height: 160px;
}

/* Data Disclaimer */
.data-disclaimer {
    text-align: center;
    font-size: 9px;
    color: #999;
    margin-top: 8px;
    font-style: italic;
}

/* Attendance Breakdown */
.attendance-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: white;
    border-radius: 6px;
    gap: 10px;
}

.breakdown-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.breakdown-dot.present-dot {
    background-color: #10b981;
}

.breakdown-dot.absent-dot {
    background-color: #ef4444;
}

.breakdown-dot.late-dot {
    background-color: #f59e0b;
}

.breakdown-dot.excused-dot {
    background-color: #3b82f6;
}

.breakdown-label {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

.breakdown-value {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.percentage-value {
    font-size: 28px;
    font-weight: 800;
    color: #059669;
    line-height: 1;
    margin-bottom: 4px;
}

.percentage-label {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* Attendance History */
.attendance-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.history-record {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px;
    padding: 8px 10px;
    background-color: white;
    border-radius: 4px;
    align-items: center;
}

.history-date {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.history-status-select {
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
}

.history-status-select:hover {
    border-color: #059669;
}

.history-status-select:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.history-status-select.status-present {
    color: #10b981;
    font-weight: 600;
}

.history-status-select.status-absent {
    color: #ef4444;
    font-weight: 600;
}

.history-status-select.status-late {
    color: #f59e0b;
    font-weight: 600;
}

.history-status-select.status-excused {
    color: #3b82f6;
    font-weight: 600;
}

/* ===== CALENDAR SECTION - REBUILT FROM SCRATCH ===== */

/* Calendar Header (Month/Year + Navigation) */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 6px 0;
    padding: 0 0 4px 0;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.calendar-month-year {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin: 0;
    padding: 0;
}

.calendar-nav-btn {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #666;
    transition: background-color 0.2s;
    margin: 0;
    padding: 0;
}

.calendar-nav-btn:hover {
    background-color: #059669;
    border-color: #059669;
    color: white;
}

/* Calendar Container - White background box */
.calendar-container {
    background-color: white;
    border-radius: 6px;
    padding: 6px 6px 4px 6px;
    margin: 0;
    display: block;
    overflow: hidden;
    flex: 0 0 auto;
    height: fit-content;
}

/* Weekday labels (Sun, Mon, etc.) */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin: 0 0 2px 0;
    padding: 0;
}

.calendar-weekday {
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 0;
    margin: 0;
    line-height: 1;
}

/* Calendar Grid - ALWAYS 6 rows x 7 columns */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 28px);
    gap: 2px;
    margin: 0;
    padding: 0;
    line-height: 1;
    align-content: start;
}

/* Individual day cells */
.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: transform 0.15s;
    line-height: 1;
    height: 28px;
}

.calendar-day:hover:not(.other-month) {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.calendar-day.other-month {
    color: #ddd;
    background-color: transparent;
}

.calendar-day.today {
    border: 2px solid #059669;
    font-weight: 700;
}

.calendar-day.weekend {
    background-color: #f0f0f0;
}

/* Attendance status colors */
.calendar-day.status-present {
    background-color: #10b981;
    color: white;
}

.calendar-day.status-absent {
    background-color: #ef4444;
    color: white;
}

.calendar-day.status-late {
    background-color: #f59e0b;
    color: white;
}

.calendar-day.status-excused {
    background-color: #3b82f6;
    color: white;
}

.calendar-day:not(.other-month):hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Calendar Status Popup */
.calendar-status-popup {
    position: fixed;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 10100;
    min-width: 120px;
    overflow: hidden;
}

.calendar-status-popup.active {
    display: block;
}

.popup-date-header {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #333;
    text-align: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.trend-graph-header {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.trend-graph-container {
    background-color: white;
    border-radius: 8px;
    padding: 16px;
    flex: 1;
    min-height: 0;
    position: relative;
}

.trend-graph-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.legend-line {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.legend-line.student {
    background-color: #ef4444;
}

.legend-line.class-avg {
    background-color: #9ca3af;
}

#attendanceTrendCanvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Week Tooltip for Trend Graph */
.week-tooltip {
    position: absolute;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px;
    min-width: 180px;
    display: none;
    z-index: 10100;
    pointer-events: none;
}

.week-tooltip.active {
    display: block;
}

.tooltip-header {
    font-size: 11px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.tooltip-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tooltip-day {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
}

.tooltip-day-label {
    flex: 0 0 50px;
    font-weight: 600;
    color: #666;
}

.tooltip-status-badge {
    flex: 1;
    padding: 2px 6px;
    border-radius: 3px;
    text-align: center;
    font-weight: 600;
    font-size: 9px;
    text-transform: uppercase;
}

.tooltip-status-badge.present {
    background-color: #10b981;
    color: white;
}

.tooltip-status-badge.absent {
    background-color: #ef4444;
    color: white;
}

.tooltip-status-badge.late {
    background-color: #f59e0b;
    color: white;
}

.tooltip-status-badge.excused {
    background-color: #3b82f6;
    color: white;
}

.tooltip-status-badge.none {
    background-color: #f3f4f6;
    color: #999;
}

.status-popup-item {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-popup-item:hover {
    background-color: #f0f0f0;
}

.status-popup-item .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-popup-item.present-option .status-dot {
    background-color: #10b981;
}

.status-popup-item.present-option:hover {
    background-color: #d1fae5;
    color: #059669;
}

.status-popup-item.absent-option .status-dot {
    background-color: #ef4444;
}

.status-popup-item.absent-option:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

.status-popup-item.late-option .status-dot {
    background-color: #f59e0b;
}

.status-popup-item.late-option:hover {
    background-color: #fef3c7;
    color: #d97706;
}

.status-popup-item.excused-option .status-dot {
    background-color: #3b82f6;
}

.status-popup-item.excused-option:hover {
    background-color: #dbeafe;
    color: #2563eb;
}

.status-popup-item.clear-option {
    border-top: 1px solid #e0e0e0;
    color: #999;
}

.status-popup-item.clear-option:hover {
    background-color: #f8f9fa;
    color: #666;
}

/* ===== ANALYTICS TAB ===== */

.analytics-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Stats Banner */
.analytics-stats-banner {
    display: flex;
    gap: 16px;
    padding: 14px 20px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    flex-shrink: 0;
    align-items: center;
}

.analytics-stat-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.analytics-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.analytics-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.analytics-semester-label {
    margin-left: auto;
}

.analytics-semester-text {
    font-size: 11px;
    color: #999;
    font-style: italic;
}

/* Main two-column layout */
.analytics-main {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Left column: charts */
.analytics-charts-col {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.analytics-chart-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    background-color: #f8f9fa;
}

.analytics-chart-tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.analytics-chart-tab:hover {
    color: #333;
    background-color: #eef0f2;
}

.analytics-chart-tab.active {
    color: #059669;
    border-bottom-color: #059669;
    background-color: white;
}

.analytics-chart-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
}

.analytics-chart-panel.active {
    display: flex;
}

.analytics-chart-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.analytics-chart-header {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.analytics-chart-subheader {
    font-size: 11px;
    color: #999;
    margin-bottom: 10px;
}

.analytics-chart-container {
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    flex: 1;
    min-height: 0;
    position: relative;
}

.analytics-chart-legend {
    display: flex;
    gap: 16px;
    padding-top: 8px;
    justify-content: center;
}

.analytics-legend-item {
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.analytics-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Right column: tabbed panel */
.analytics-right-col {
    display: flex;
    flex-direction: column;
    border-left: 2px solid #e0e0e0;
    overflow: hidden;
}

.analytics-right-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    background-color: #f8f9fa;
}

.analytics-right-tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.analytics-right-tab:hover {
    color: #333;
    background-color: #eef0f2;
}

.analytics-right-tab.active {
    color: #059669;
    border-bottom-color: #059669;
    background-color: white;
}

.analytics-right-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.analytics-right-panel.active {
    display: flex;
}

/* AI insights panel */
.analytics-insights-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.analytics-insights-header {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.analytics-insight-section {
    margin-bottom: 14px;
}

.analytics-insight-title {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.analytics-insight-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analytics-insight-list li {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    padding: 2px 0 2px 12px;
    position: relative;
}

.analytics-insight-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #059669;
}

.analytics-insight-list li strong {
    color: #333;
    font-weight: 600;
}

/* ===== Data Tab ===== */
/* ===== Dynamic Contact Fields ===== */
.sm-no-fields {
    padding: 24px 12px;
    color: #999;
    font-size: 13px;
    text-align: center;
}
.sm-add-field-row {
    grid-column: 1 / -1;
    border: none !important;
}
.sm-add-field-btn {
    background: none;
    border: 1px dashed #ccc;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s;
}
.sm-add-field-btn:hover {
    border-color: #059669;
    background: #f0fdf4;
}
.sm-field-menu {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 4px 0;
    min-width: 200px;
    z-index: 500;
    max-height: 300px;
    overflow-y: auto;
}
.sm-field-menu-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    font-size: 13px;
    color: #333;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.sm-field-menu-item:hover:not(:disabled) { background: #f8f9fa; }
.sm-field-menu-item.disabled { color: #ccc; cursor: default; }
.sm-field-menu-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

/* ===== Analytics v2 (an2) ===== */

.an2-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px 40px;
    overflow-y: auto;
    max-height: 100%;
}

.an2-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}
.an2-toolbar-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.an2-toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.an2-toolbar-sub {
    font-size: 11px;
    color: #9ca3af;
}
.an2-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.an2-refresh-btn:hover { background: #047857; }
.an2-refresh-btn:disabled { opacity: 0.55; cursor: wait; }
.an2-refresh-btn.busy .an2-refresh-icon {
    display: inline-block;
    animation: an2-spin 0.9s linear infinite;
}
@keyframes an2-spin { to { transform: rotate(360deg); } }
.an2-refresh-icon { font-size: 14px; line-height: 1; }

.an2-empty-banner {
    background: linear-gradient(#f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 14px 16px;
}
.an2-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #065f46;
}
.an2-empty-sub {
    font-size: 12px;
    color: #047857;
    margin-top: 4px;
}

.an2-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.an2-metric-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
}
.an2-metric-value {
    font-size: 26px;
    font-weight: 700;
    color: #059669;
    line-height: 1.1;
}
.an2-metric-label {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 4px;
}
.an2-metric-sub {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

.an2-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.an2-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.an2-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.an2-section-sub {
    font-size: 11px;
    color: #9ca3af;
}

.an2-chart-wrap {
    width: 100%;
    height: 240px;
}
.an2-chart-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.an2-chart-legend {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: #6b7280;
}
.an2-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.an2-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.an2-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.an2-bar-row {
    display: grid;
    grid-template-columns: 160px 1fr 48px 36px;
    gap: 10px;
    align-items: center;
    font-size: 12px;
}
.an2-bar-label {
    color: #333;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.an2-bar-track {
    height: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
}
.an2-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.25s;
}
.an2-bar-value {
    font-weight: 700;
    color: #333;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.an2-bar-count {
    font-size: 11px;
    color: #9ca3af;
    text-align: right;
}
.an2-bars-empty {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    padding: 14px;
}

.an2-projection-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: center;
    padding: 10px 6px 4px;
}
.an2-projection-value {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.an2-projection-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #555;
}
.an2-projection-meta strong {
    color: #333;
    font-weight: 700;
}
.an2-projection-empty {
    font-size: 12px;
    color: #9ca3af;
    padding: 10px 6px;
}

.an2-insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.an2-insight-block {
    background: #fafafa;
    border: 1px solid #eeeeee;
    border-radius: 6px;
    padding: 12px 14px;
}
.an2-insight-block.an2-insight-risk {
    background: #fffaf0;
    border-color: #fed7aa;
}
.an2-insight-title {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}
.an2-insight-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.an2-insight-list li {
    font-size: 13px;
    color: #333;
    line-height: 1.45;
    padding-left: 16px;
    position: relative;
}
.an2-insight-list li::before {
    content: "\2022";
    position: absolute;
    left: 2px;
    color: #059669;
    font-weight: 700;
}
.an2-insight-list li.an2-insight-empty {
    color: #9ca3af;
    font-style: italic;
}
.an2-insight-list li.an2-insight-empty::before {
    content: "";
}

@media (max-width: 1100px) {
    .an2-metrics { grid-template-columns: repeat(2, 1fr); }
    .an2-insights-grid { grid-template-columns: 1fr; }
}

