/* ==========================================================================
   TEACHER NOTES - Pokój Nauczycielski (KM10)
   Style dla notatek nauczycielskich, formularza, @wzmianek, teczki ucznia.
   ========================================================================== */

/* --- Layout & Header --- */
.tn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.tn-header h2 {
    color: #333;
    margin: 0;
    font-size: 1.4rem;
}

/* --- Buttons --- */
.tn-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: opacity 0.2s;
}
.tn-btn:hover { opacity: 0.85; }
.tn-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tn-btn-primary { background: #2980b9; color: #fff; }
.tn-btn-secondary { background: #ecf0f1; color: #333; }
.tn-btn-danger { background: #e74c3c; color: #fff; }

.tn-btn-sm {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: opacity 0.2s;
}
.tn-btn-sm:hover { opacity: 0.8; }
.tn-btn-view { background: #3498db; color: #fff; }
.tn-btn-edit { background: #f39c12; color: #fff; }
.tn-btn-delete { background: #e74c3c; color: #fff; }

/* --- Filters bar --- */
.tn-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}
.tn-select, .tn-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    color: #333;
}
.tn-select:focus, .tn-input:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 2px rgba(41,128,185,0.15);
}
.tn-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
}

/* --- Note cards --- */
.tn-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-left: 4px solid #95a5a6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}
.tn-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.tn-card.tn-cat-incident   { border-left-color: #e74c3c; }
.tn-card.tn-cat-meeting    { border-left-color: #2980b9; }
.tn-card.tn-cat-observation { border-left-color: #8e44ad; }
.tn-card.tn-cat-phone_call { border-left-color: #16a085; }
.tn-card.tn-cat-student_talk { border-left-color: #2c3e50; }
.tn-card.tn-cat-praise     { border-left-color: #f1c40f; }
.tn-card.tn-cat-intervention { border-left-color: #c0392b; }
.tn-card.tn-cat-other      { border-left-color: #95a5a6; }

.tn-card-header {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.tn-card-date {
    margin-left: auto;
    font-size: 0.82rem;
    color: #7f8c8d;
}
.tn-card-title {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    color: #2c3e50;
}
.tn-card-excerpt {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}
.tn-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.tn-card-students { display: flex; gap: 6px; flex-wrap: wrap; }
.tn-card-author { font-size: 0.82rem; color: #7f8c8d; }

.tn-card-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* --- Badges --- */
.tn-cat-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: #95a5a6;
    white-space: nowrap;
}
.tn-cat-badge.tn-cat-incident   { background: #e74c3c; }
.tn-cat-badge.tn-cat-meeting    { background: #2980b9; }
.tn-cat-badge.tn-cat-observation { background: #8e44ad; }
.tn-cat-badge.tn-cat-phone_call { background: #16a085; }
.tn-cat-badge.tn-cat-student_talk { background: #2c3e50; }
.tn-cat-badge.tn-cat-praise     { background: #d4ac0d; color: #333; }
.tn-cat-badge.tn-cat-intervention { background: #c0392b; }
.tn-cat-badge.tn-cat-other      { background: #95a5a6; }

.tn-priority-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}
.tn-priority-normal    { background: #ecf0f1; color: #7f8c8d; }
.tn-priority-important { background: #fdebd0; color: #e67e22; }
.tn-priority-urgent    { background: #fadbd8; color: #e74c3c; }

.tn-resolved-badge {
    font-size: 0.78rem;
    padding: 2px 8px;
    background: #d5f5e3;
    color: #27ae60;
    border-radius: 10px;
    font-weight: 600;
}
.tn-attach-badge {
    font-size: 0.78rem;
    color: #7f8c8d;
}

.tn-student-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #eaf2f8;
    color: #2980b9;
    border-radius: 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s;
}
.tn-student-tag:hover { background: #d4e6f1; }

/* --- Status messages --- */
.tn-loading, .tn-empty, .tn-error {
    text-align: center;
    padding: 40px 20px;
    font-size: 1rem;
    color: #7f8c8d;
}
.tn-error { color: #e74c3c; }
.tn-hint { font-size: 0.82rem; color: #999; font-style: italic; }

/* --- Detail view --- */
.tn-detail {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #dee2e6;
}
.tn-detail h3 {
    color: #2c3e50;
    margin: 16px 0 12px;
}
.tn-detail-header {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
}
.tn-detail-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.88rem;
    color: #7f8c8d;
    margin-bottom: 12px;
}
.tn-detail-students {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.tn-detail-content {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 16px;
    white-space: pre-wrap;
}
.tn-detail-attachments {
    margin-bottom: 16px;
}
.tn-detail-attachments h4 { margin: 0 0 8px; color: #333; }
.tn-attachment-link {
    display: inline-block;
    margin-right: 12px;
    margin-bottom: 6px;
    color: #2980b9;
    text-decoration: none;
    font-size: 0.9rem;
}
.tn-attachment-link:hover { text-decoration: underline; }

.tn-edit-history {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #dee2e6;
}
.tn-edit-history h4 { margin: 0 0 8px; color: #333; }
.tn-history-item {
    padding: 6px 0;
    font-size: 0.85rem;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}
.tn-detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* --- Form --- */
.tn-form-wrap {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #dee2e6;
}
.tn-form-wrap h3 {
    color: #333;
    margin: 16px 0;
}
.tn-form-row {
    margin-bottom: 16px;
}
.tn-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.92rem;
}
.tn-form .tn-input,
.tn-form .tn-select {
    width: 100%;
    box-sizing: border-box;
}
.tn-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    color: #333;
    background: #fff;
}
.tn-textarea:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 2px rgba(41,128,185,0.15);
}
.tn-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* --- @Mention dropdown --- */
.tn-mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 100;
}
.tn-mention-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: background 0.1s;
}
.tn-mention-item:hover,
.tn-mention-item.active {
    background: #eaf2f8;
}
.tn-mention-class {
    color: #999;
    font-size: 0.82rem;
}

/* --- Student chips (selected) --- */
.tn-student-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #d5e8d4;
    color: #2c3e50;
    border-radius: 14px;
    font-size: 0.85rem;
    margin: 2px 4px 2px 0;
}
.tn-student-chip button {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

/* --- Student picker grid --- */
.tn-picker-grid {
    margin-top: 10px;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    background: #fafafa;
}
.tn-picker-class-group {
    margin-bottom: 10px;
}
.tn-picker-class-group strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
    font-size: 0.88rem;
}
.tn-picker-students {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.tn-picker-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
    cursor: pointer;
    color: #333;
    background: #fff;
    border: 1px solid #dee2e6;
    transition: background 0.1s;
}
.tn-picker-label:hover { background: #eaf2f8; }
.tn-picker-label.selected { background: #d5e8d4; border-color: #27ae60; }

/* --- Paste preview --- */
.tn-paste-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.tn-paste-preview:empty { display: none; }

/* --- Attachment items --- */
.tn-attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.88rem;
}
.tn-attachment-pending { color: #999; font-style: italic; }

/* --- Student Folder --- */
.tn-folder {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #dee2e6;
}
.tn-folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}
.tn-folder-header h3 {
    color: #2c3e50;
    margin: 0;
}
.tn-class-label {
    font-weight: 400;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.tn-folder-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 6px;
}
.tn-stat-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    color: #fff;
    font-weight: 600;
}
.tn-stat-total {
    margin-left: auto;
    font-size: 0.88rem;
    color: #555;
}
.tn-folder-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

/* --- Timeline --- */
.tn-timeline {
    position: relative;
    padding-left: 24px;
}
.tn-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}
.tn-timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: box-shadow 0.2s;
}
.tn-timeline-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.tn-timeline-item.expanded { border-color: #2980b9; }

.tn-timeline-dot {
    position: absolute;
    left: -20px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #95a5a6;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dee2e6;
}
.tn-timeline-dot.tn-cat-incident   { background: #e74c3c; }
.tn-timeline-dot.tn-cat-meeting    { background: #2980b9; }
.tn-timeline-dot.tn-cat-observation { background: #8e44ad; }
.tn-timeline-dot.tn-cat-phone_call { background: #16a085; }
.tn-timeline-dot.tn-cat-student_talk { background: #2c3e50; }
.tn-timeline-dot.tn-cat-praise     { background: #f1c40f; }
.tn-timeline-dot.tn-cat-intervention { background: #c0392b; }
.tn-timeline-dot.tn-cat-other      { background: #95a5a6; }

.tn-timeline-content { cursor: pointer; }
.tn-timeline-header {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.tn-timeline-body {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.tn-timeline-body p {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #333;
    margin: 0 0 10px;
}
.tn-timeline-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

/* ========================================================================
   PUBLISH TO PARENTS - Modal, podgląd, przyciski (KM10 F2)
   ======================================================================== */

.tn-btn-publish {
    background: #2980b9;
    color: #fff;
    border: none;
}
.tn-btn-publish:hover {
    background: #2471a3;
}
.tn-published-badge {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78em;
    vertical-align: middle;
}
.tn-btn-unpublish {
    background: #e67e22;
    color: #fff;
    border: none;
}
.tn-btn-unpublish:hover {
    background: #d35400;
}

.tn-publish-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tn-publish-modal {
    background: #fff;
    color: #2c3e50;
    border-radius: 12px;
    max-width: 750px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.tn-publish-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.tn-publish-modal-header h3 {
    margin: 0;
    font-size: 1.15em;
    color: #2c3e50;
}
.tn-btn-close {
    background: none;
    border: none;
    font-size: 1.4em;
    cursor: pointer;
    color: #7f8c8d;
    padding: 4px 8px;
    border-radius: 4px;
}
.tn-btn-close:hover {
    background: #f0f0f0;
}
.tn-publish-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.tn-publish-info {
    margin: 0 0 16px;
    padding: 10px 14px;
    background: #eaf6ff;
    border-radius: 6px;
    border-left: 4px solid #2980b9;
    font-size: 0.95em;
    color: #2c3e50;
}
.tn-publish-select {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}
.tn-publish-select h4 {
    margin: 0 0 8px;
    font-size: 0.95em;
    color: #2c3e50;
}
.tn-publish-select-actions {
    margin-bottom: 8px;
}
.tn-publish-checkbox {
    display: block;
    padding: 6px 8px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    color: #2c3e50;
    transition: background 0.1s;
}
.tn-publish-checkbox:hover {
    background: #eef2f7;
}
.tn-publish-checkbox input[type="checkbox"] {
    margin-right: 6px;
    transform: scale(1.15);
}
.tn-publish-child-hint {
    color: #7f8c8d;
    font-size: 0.9em;
}
.tn-publish-details {
    margin-bottom: 12px;
}
.tn-publish-details summary {
    cursor: pointer;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    font-size: 0.92em;
    color: #2c3e50;
    font-weight: 500;
}
.tn-publish-details summary:hover {
    background: #e8e8e8;
}
.tn-publish-details[open] summary {
    margin-bottom: 12px;
}
.tn-publish-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}
.tn-publish-tab {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
    background: #f9f9f9;
    color: #2c3e50;
    cursor: pointer;
    font-size: 0.88em;
    transition: background 0.15s;
}
.tn-publish-tab.active {
    background: #2980b9;
    color: #fff;
    border-color: #2980b9;
}
.tn-publish-panel {
    display: none;
}
.tn-publish-panel.active {
    display: block;
}
.tn-publish-meta {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #f8f9fa;
    color: #34495e;
    border-radius: 6px;
    font-size: 0.9em;
    line-height: 1.6;
}
.tn-publish-preview-section {
    margin-bottom: 12px;
}
.tn-publish-preview-section h4 {
    margin: 0 0 6px;
    font-size: 0.9em;
    color: #34495e;
    font-weight: 600;
}
.tn-publish-preview-text {
    padding: 12px;
    background: #fffef5;
    border: 1px solid #f0e6c0;
    border-radius: 6px;
    line-height: 1.6;
    font-size: 0.95em;
    white-space: pre-wrap;
    color: #2c3e50;
}
.tn-publish-edit-title {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 0.95em;
    color: #2c3e50;
    background: #fffef5;
    font-family: inherit;
}
.tn-publish-edit-title:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 2px rgba(41,128,185,0.15);
}
.tn-publish-edit-content {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 0.95em;
    line-height: 1.6;
    color: #2c3e50;
    background: #fffef5;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}
.tn-publish-edit-content:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 2px rgba(41,128,185,0.15);
}
.tn-publish-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.tn-publish-success {
    text-align: center;
    padding: 30px 20px;
    color: #2c3e50;
}
.tn-publish-success h3 {
    color: #27ae60;
    margin-bottom: 10px;
}
.tn-publish-empty,
.tn-publish-error {
    text-align: center;
    padding: 30px 20px;
    color: #2c3e50;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .tn-filters {
        flex-direction: column;
    }
    .tn-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .tn-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .tn-folder-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================================
   PARENT NOTES OVERLAY (wioska → pokój nauczycielski)
   ============================================================================ */
#pn-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #f5f6fa;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    animation: pnFadeIn 0.2s ease;
}
@keyframes pnFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.pn-overlay-topbar {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}
.pn-overlay-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.pn-overlay-back {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s;
}
.pn-overlay-back:hover {
    background: rgba(255,255,255,0.1);
}
.pn-overlay-title {
    font-weight: 600;
    font-size: 1.1em;
}
.pn-overlay-body {
    flex: 1;
    overflow-y: auto;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
}
.pn-overlay-body .pn-page-header {
    text-align: center;
    margin-bottom: 24px;
}
.pn-overlay-body .pn-page-title {
    font-size: 1.4em;
    margin-bottom: 4px;
    color: #2c3e50;
}
.pn-overlay-body .pn-page-subtitle {
    font-size: 0.9em;
    color: #7f8c8d;
}
.pn-overlay-body .pn-note-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 14px;
    border-left: 4px solid #95a5a6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.15s;
}
.pn-overlay-body .pn-note-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.pn-overlay-body .pn-note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 0.85em;
}
.pn-overlay-body .pn-note-cat {
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.9em;
}
.pn-overlay-body .pn-note-date {
    margin-left: auto;
    color: #999;
    font-size: 0.88em;
}
.pn-overlay-body .pn-note-title {
    font-size: 1.05em;
    margin-bottom: 6px;
    color: #2c3e50;
}
.pn-overlay-body .pn-note-children {
    margin-bottom: 8px;
}
.pn-overlay-body .pn-note-content {
    line-height: 1.65;
    font-size: 0.95em;
    color: #34495e;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
}
.pn-overlay-body .pn-note-author {
    font-size: 0.82em;
    color: #999;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}
.pn-overlay-body .pn-loading,
.pn-overlay-body .pn-empty,
.pn-overlay-body .pn-error {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 1.05em;
}
.pn-overlay-body .pn-error {
    color: #e74c3c;
}

/* ===== STATS DASHBOARD (KM10 F3) ===== */
.tn-stats h2 { margin: 16px 0 20px; color: #333; }
.tn-stats h3 { font-size: 1rem; color: #555; margin: 24px 0 12px; border-bottom: 1px solid #eee; padding-bottom: 6px; }

.tn-stats-summary {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.tn-stat-box {
    flex: 1; min-width: 120px;
    background: #f5f6fa; border-radius: 8px; padding: 16px; text-align: center;
    border: 1px solid #e8e8e8;
}
.tn-stat-box strong { display: block; font-size: 1.8rem; color: #333; margin-bottom: 2px; }
.tn-stat-box span { font-size: 0.82rem; color: #777; }
.tn-stat-box-green { background: #e8f5e9; border-color: #c8e6c9; }
.tn-stat-box-green strong { color: #2e7d32; }

.tn-stats-bars { margin-bottom: 12px; }
.tn-stats-bar-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.tn-stats-bar-label {
    width: 140px; flex-shrink: 0; font-size: 0.85rem; color: #555; text-align: right;
}
.tn-stats-student-label {
    color: #2980b9; cursor: pointer; text-decoration: underline;
}
.tn-stats-student-label:hover { color: #1a5276; }
.tn-stats-bar-track {
    flex: 1; height: 20px; background: #f0f0f0; border-radius: 4px; overflow: hidden;
}
.tn-stats-bar-fill {
    height: 100%; border-radius: 4px; transition: width 0.4s ease;
}
.tn-stats-bar-count {
    width: 60px; flex-shrink: 0; font-size: 0.85rem; color: #555; font-weight: 600;
}

.tn-stats-chart {
    display: flex; align-items: flex-end; gap: 16px; height: 160px;
    padding: 12px 0; margin-bottom: 12px;
}
.tn-stats-chart-col {
    flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%;
    justify-content: flex-end;
}
.tn-stats-chart-bar {
    width: 100%; max-width: 48px; border-radius: 4px 4px 0 0; transition: height 0.4s ease;
}
.tn-stats-chart-val {
    font-size: 0.75rem; font-weight: 600; color: #333; margin-top: 4px;
}
.tn-stats-chart-label {
    font-size: 0.7rem; color: #999; margin-top: 2px;
}
