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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Login Screen */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px;
}

.login-screen h1 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
}

.pin-input {
    font-size: 24px;
    padding: 15px 30px;
    border: 2px solid #667eea;
    border-radius: 10px;
    text-align: center;
    width: 200px;
    margin-bottom: 20px;
}

.login-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8em;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Navigation */
.nav {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
}

.nav-btn {
    flex: 1;
    min-width: 120px;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.nav-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Main Content */
.content {
    padding: 30px;
    min-height: 500px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Buttons */
.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    margin: 5px;
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

/* Student Grid */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.student-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.student-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.student-card h3 {
    color: #333;
    margin-bottom: 5px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

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

/* Assessment List */
.assessment-list {
    margin-top: 20px;
}

.assessment-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.assessment-item h4 {
    color: #333;
    margin-bottom: 5px;
}

.assessment-item p {
    color: #666;
    margin: 5px 0;
}

/* Curriculum Tracker */
.curriculum-subject {
    margin-bottom: 30px;
}

.curriculum-subject h3 {
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.descriptor-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #ccc;
}

.descriptor-item.well-above {
    border-left-color: #0056b3;
    background: #cce5ff;
}

.descriptor-item.above {
    border-left-color: #28a745;
    background: #d4edda;
}

.descriptor-item.at-standard {
    border-left-color: #17a2b8;
    background: #d1ecf1;
}

.descriptor-item.below {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.descriptor-item.well-below {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.descriptor-item.not-evident {
    border-left-color: #6c757d;
    background: #e9ecef;
}

.descriptor-code {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.descriptor-text {
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.descriptor-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.status-btn.well-above-btn {
    background: #0056b3;
    color: white;
}

.status-btn.above-btn {
    background: #28a745;
    color: white;
}

.status-btn.at-standard-btn {
    background: #17a2b8;
    color: white;
}

.status-btn.below-btn {
    background: #ffc107;
    color: #333;
}

.status-btn.well-below-btn {
    background: #dc3545;
    color: white;
}

.status-btn.not-evident-btn {
    background: #6c757d;
    color: white;
}

.status-btn.clear-btn {
    background: #6c757d;
    color: white;
}

.descriptor-note {
    background: #fff9e6;
    border-left: 3px solid #ffc107;
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    font-style: italic;
}

.btn-small {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-small:hover {
    background: #5568d3;
}

/* Notes */
.note-item {
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.note-date {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.note-text {
    color: #333;
}

/* Sync Status */
.sync-status {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 15px;
}

.sync-status.synced {
    background: #d4edda;
    color: #155724;
}

.sync-status.syncing {
    background: #fff3cd;
    color: #856404;
}

.sync-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.3em;
    }

    .nav-btn {
        font-size: 14px;
        padding: 12px 15px;
    }

    .content {
        padding: 20px;
    }

    .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .modal-content {
        padding: 20px;
    }
}

/* Curriculum Note Section */
.descriptor-note-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.descriptor-note-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 8px;
    transition: border-color 0.3s;
}

.descriptor-note-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Personal Tab Styles */
.personal-section {
    margin-bottom: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.personal-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.personal-section-header h3 {
    color: #667eea;
    margin: 0;
}

.personal-entries {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.personal-entry {
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.personal-entry-date {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.personal-entry-text {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
}

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

/* Personal section color coding */
.personal-section:nth-child(1) .personal-entry {
    border-left-color: #dc3545; /* Behaviour - red */
}

.personal-section:nth-child(2) .personal-entry {
    border-left-color: #28a745; /* Social - green */
}

.personal-section:nth-child(3) .personal-entry {
    border-left-color: #ffc107; /* Interests - yellow */
}

.personal-section:nth-child(4) .personal-entry {
    border-left-color: #17a2b8; /* Life Events - teal */
}

/* Student Card Actions */
.student-card-actions {
    display: flex;
    gap: 5px;
    margin-top: 15px;
    justify-content: center;
}

.btn-card-action {
    flex: 1;
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-card-action:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

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

.btn-card-delete {
    background: #dc3545;
}

.btn-card-delete:hover {
    background: #c82333;
}

/* Personal Entry Edit Button */
.btn-edit {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    margin-right: 5px;
}

.btn-edit:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

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

/* Update personal entry header to accommodate both buttons */
.personal-entry-header div {
    display: flex;
    gap: 5px;
}

/* Assessment Results Table */
.modal-wide {
    max-width: 800px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.results-table thead {
    background: #667eea;
    color: white;
}

.results-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #5568d3;
}

.results-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

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

.results-table .no-grade {
    color: #999;
    font-style: italic;
}

.results-table .has-grade {
    color: #333;
    font-weight: 600;
}

/* Alternating row colors */
.results-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.results-table tbody tr:nth-child(even):hover {
    background: #e9ecef;
}

/* Assessment Actions */
.assessment-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.hidden {
    display: none !important;
}
