.scores-modern{background:#fff;border-radius:24px;box-shadow:0 8px 30px rgba(0,0,0,0.05);padding:20px 24px;color:#1e293b}
body.dark-theme .scores-modern{background:#1e293b;color:#e2e8f0}
.scores-breadcrumb{font-size:1.1rem;color:#64748b;margin-bottom:16px;display:flex;flex-wrap:wrap;gap:4px}
.scores-breadcrumb .sep{margin:0 6px;color:#94a3b8}
.scores-breadcrumb span{font-weight:500}
body.dark-theme .scores-breadcrumb{color:#94a3b8}
body.dark-theme .scores-breadcrumb .sep{color:#64748b}
.scores-header{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:16px;margin-bottom:16px}
.scores-filters{display:flex;gap:16px;flex-wrap:wrap}
.scores-filters .filter-group{display:flex;align-items:center;gap:6px}
.scores-filters .filter-group label{font-weight:500;font-size:.85rem;color:#334155}
body.dark-theme .scores-filters .filter-group label{color:#cbd5e1}
.scores-filters .filter-group select{padding:6px 12px;border-radius:20px;border:1.5px solid #e2e8f0;background:#fff;font-size:.85rem;color:#1e293b}
body.dark-theme .scores-filters .filter-group select{background:#0f172a;border-color:#334155;color:#e2e8f0}
.scores-actions-top{display:flex;gap:10px;flex-wrap:wrap}
.scores-actions-top .btn{padding:8px 16px;border-radius:40px;font-weight:600;border:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px;font-size:.85rem;transition:all .2s}
.btn.calc-final{background:#106061;color:#fff}
.btn.calc-final:hover{background:#0b4a4a}
.btn.export-excel{background:#2c3e50;color:#fff}
.btn.export-excel:hover{background:#1a252f}
body.dark-theme .btn.calc-final{background:#0b5e5e}
body.dark-theme .btn.calc-final:hover{background:#084545}
body.dark-theme .btn.export-excel{background:#1e2a36}
body.dark-theme .btn.export-excel:hover{background:#0f161e}
.scores-subject-tabs{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:16px;border-bottom:2px solid #e2e8f0;padding-bottom:6px}
body.dark-theme .scores-subject-tabs{border-bottom-color:#334155}
.subject-tab{background:0 0;border:none;padding:6px 18px;border-radius:20px;font-weight:500;font-size:.95rem;color:#64748b;cursor:pointer;transition:all .2s}
.subject-tab:hover{background:#f1f5f9;color:#1e293b}
.subject-tab.active{background:#3b82f6;color:#fff;box-shadow:0 2px 8px rgba(59,130,246,0.25)}
body.dark-theme .subject-tab{color:#94a3b8}
body.dark-theme .subject-tab:hover{background:#334155;color:#e2e8f0}
body.dark-theme .subject-tab.active{background:#3b82f6;color:#fff}
.scores-toolbar{display:none;align-items:center;gap:12px;padding:10px 16px;background:#f8fafc;border-radius:16px;margin-bottom:16px;flex-wrap:wrap}
body.dark-theme .scores-toolbar{background:#0f172a}
.scores-toolbar #selectedCountLabel{font-weight:600;color:#1e293b;margin-right:8px}
body.dark-theme .scores-toolbar #selectedCountLabel{color:#e2e8f0}
.scores-toolbar .btn{padding:4px 14px;border-radius:20px;font-weight:600;border:none;cursor:pointer;font-size:.8rem;transition:all .2s}
.scores-toolbar .btn:hover{transform:translateY(-1px)}
.btn.grade-5{background:#d1fae5;color:#065f46}
.btn.grade-4{background:#dbeafe;color:#1e40af}
.btn.grade-3{background:#fef3c7;color:#92400e}
.btn.danger{background:#fee2e2;color:#991b1b}
.btn.danger:hover{background:#fecaca}
body.dark-theme .btn.grade-5{background:#065f46;color:#d1fae5}
body.dark-theme .btn.grade-4{background:#1e40af;color:#dbeafe}
body.dark-theme .btn.grade-3{background:#92400e;color:#fef3c7}
body.dark-theme .btn.danger{background:#991b1b;color:#fee2e2}
body.dark-theme .btn.danger:hover{background:#7f1a1a}
.scores-table-wrapper{overflow-x:auto;max-height:70vh;overflow-y:auto;border-radius:12px}
.scores-table{width:100%;border-collapse:separate;border-spacing:0 4px;font-size:.85rem;background:0 0}
.scores-table th{position:sticky;top:0;background:#f8fafc;padding:8px 6px;font-weight:700;font-size:.75rem;color:#1e293b;border-bottom:2px solid #e2e8f0;white-space:nowrap;z-index:10}
body.dark-theme .scores-table th{background:#0f172a;color:#e2e8f0;border-bottom-color:#334155}
.scores-table td{padding:8px 4px;vertical-align:middle;background:#fff;border-radius:6px;color:#1e293b;text-align:center}
body.dark-theme .scores-table td{background:#1e293b;color:#e2e8f0}
.scores-table tbody tr{margin-bottom:4px;display:table-row}
.scores-table tbody tr:hover td{background:#f8fafc}
body.dark-theme .scores-table tbody tr:hover td{background:#334155}
.sticky-col{position:sticky;left:0;z-index:3;background:inherit}
.sticky-col-2{position:sticky;left:42px;z-index:3;background:inherit}
.scores-table th.sticky-col,.scores-table th.sticky-col-2{z-index:6}
.scores-table td.sticky-col,.scores-table td.sticky-col-2{background:inherit}
.scores-table tbody tr:hover td.sticky-col,.scores-table tbody tr:hover td.sticky-col-2{background:#f8fafc}
body.dark-theme .scores-table tbody tr:hover td.sticky-col,body.dark-theme .scores-table tbody tr:hover td.sticky-col-2{background:#334155}
.number-cell input[type=checkbox]{appearance:none;width:1.1rem;height:1.1rem;border:2px solid #cbd5e1;border-radius:.25rem;cursor:pointer;background:#fff;position:relative}
.number-cell input[type=checkbox]:checked{background:#2563eb;border-color:#2563eb}
.number-cell input[type=checkbox]:checked::after{content:"✓";color:#fff;font-size:.8rem;font-weight:700;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
body.dark-theme .number-cell input[type=checkbox]{background:#0f172a;border-color:#475569}
.select-all-label{display:flex;align-items:center;gap:4px;font-weight:500;font-size:.75rem;color:#1e293b;cursor:pointer}
body.dark-theme .select-all-label{color:#e2e8f0}
.select-all-checkbox{appearance:none;width:1.1rem;height:1.1rem;border:2px solid #cbd5e1;border-radius:.25rem;cursor:pointer;background:#fff;position:relative;flex-shrink:0}
.select-all-checkbox:checked{background:#2563eb;border-color:#2563eb}
.select-all-checkbox:checked::after{content:"✓";color:#fff;font-size:.8rem;font-weight:700;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
body.dark-theme .select-all-checkbox{background:#0f172a;border-color:#475569}
.score-cell{text-align:center;padding:6px 2px;cursor:pointer}
.score-cell:hover .score-badge{transform:scale(1.05);filter:brightness(0.95)}
.final-score-cell{text-align:center;padding:6px 2px}
.final-header{background:#106061;color:#fff}
.overall-final-cell{background:#106061;color:#fff;font-weight:700;text-align:center;padding:4px 2px}
.score-badge{display:inline-block;padding:4px 14px;border-radius:8px;font-weight:600;font-size:1rem;min-width:36px;text-align:center;transition:all .15s}
.score-badge.score-5{background:rgba(167,243,208,0.7);color:#065f46}
.score-badge.score-4{background:rgba(191,219,254,0.7);color:#1e40af}
.score-badge.score-3{background:rgba(253,230,138,0.7);color:#92400e}
.score-badge.score-2{background:rgba(254,202,202,0.7);color:#991b1b}
.score-badge.final-score-5{background:#a7f3d0;color:#065f46}
.score-badge.final-score-4{background:#bfdbfe;color:#1e40af}
.score-badge.final-score-3{background:#fde68a;color:#92400e}
.score-badge.final-score-2{background:#fecaca;color:#991b1b}
body.dark-theme .score-badge.score-5{background:rgba(16,185,129,0.25);color:#a7f3d0}
body.dark-theme .score-badge.score-4{background:rgba(59,130,246,0.25);color:#bfdbfe}
body.dark-theme .score-badge.score-3{background:rgba(234,179,8,0.25);color:#fde68a}
body.dark-theme .score-badge.score-2{background:rgba(239,68,68,0.25);color:#fecaca}
body.dark-theme .score-badge.final-score-5{background:#065f46;color:#a7f3d0}
body.dark-theme .score-badge.final-score-4{background:#1e40af;color:#bfdbfe}
body.dark-theme .score-badge.final-score-3{background:#92400e;color:#fde68a}
body.dark-theme .score-badge.final-score-2{background:#991b1b;color:#fecaca}
.score-context-menu{background:#fff;border-radius:12px;box-shadow:0 8px 20px rgba(0,0,0,.15);padding:6px 0;min-width:90px;border:1px solid #e2e8f0;z-index:1000}
.score-context-menu .menu-item{padding:6px 16px;cursor:pointer;font-size:.9rem;font-weight:500;transition:background .15s;color:#1e293b}
.score-context-menu .menu-item:hover{background:#f1f5f9}
.score-context-menu .menu-item[data-score=clear]{color:#ef4444;border-top:1px solid #e2e8f0;margin-top:4px;padding-top:8px}
body.dark-theme .score-context-menu{background:#1e293b;border-color:#334155}
body.dark-theme .score-context-menu .menu-item{color:#e2e8f0}
body.dark-theme .score-context-menu .menu-item:hover{background:#334155}
body.dark-theme .score-context-menu .menu-item[data-score=clear]{border-top-color:#334155}
.student-name{text-align:left!important;font-size:.95rem;font-weight:500;padding-left:8px}
.subject-table .final-score-cell{border-radius:0!important;border-left:1px solid #d0d7e2!important}
.subject-table .final-header{border-radius:0!important;border-left:1px solid #d0d7e2!important;background:#f0f5ff;color:#1e293b}
body.dark-theme .subject-table .final-score-cell,body.dark-theme .subject-table .final-header{border-left-color:#334155!important}
body.dark-theme .subject-table .final-header{background:#1a2a3a;color:#e2e8f0}

/* ===== ЖУРНАЛ УЧЕНИКА ===== */
#studentJournalModal .modal-content{background:#fff;border-radius:24px}
body.dark-theme #studentJournalModal .modal-content{background:#1e293b}
#studentJournalModal .modal-header{border-bottom:1px solid #e2e8f0}
body.dark-theme #studentJournalModal .modal-header{border-bottom-color:#334155}
#studentJournalModal #journalStudentInfo{background:#f8fafc;border-bottom:1px solid #e2e8f0;padding:8px 24px;font-size:.9rem;color:#64748b}
body.dark-theme #studentJournalModal #journalStudentInfo{background:#0f172a;border-bottom-color:#334155;color:#94a3b8}
#studentJournalModal .journal-score-cell{text-align:center;padding:4px 2px;cursor:pointer}
#studentJournalModal .journal-score-cell .score-badge{cursor:pointer}
#studentJournalModal .journal-score-cell .score-badge:hover{transform:scale(1.05);filter:brightness(0.95)}
#studentJournalModal .subject-name{white-space:nowrap;font-weight:500;text-align:left}
#studentJournalModal .final-score-cell{border-left:1px solid #d0d7e2;text-align:center;padding:4px 2px}
body.dark-theme #studentJournalModal .final-score-cell{border-left-color:#334155}

/* Итоговые оценки в журнале – все одного цвета (зелёный, как в таблице "все предметы") */
#studentJournalModal .score-badge.final-score-5,
#studentJournalModal .score-badge.final-score-4,
#studentJournalModal .score-badge.final-score-3,
#studentJournalModal .score-badge.final-score-2 {
  background: #106061 !important;
  color: white !important;
}

/* ===== СОВРЕМЕННЫЙ СЛОЙ (перекрывает старые правила) ===== */
.scores-modern {
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e6eaf2);
  border-radius: 14px;
  box-shadow: none;
  padding: 18px 20px;
}
.scores-breadcrumb { font-size: .8rem; color: var(--c-muted, #7c8798); margin-bottom: 14px; gap: 2px; }
.scores-breadcrumb span { font-weight: 500; }
.scores-breadcrumb .sep { margin: 0 6px; color: var(--c-border-strong, #d5dceb); }

.scores-filters { gap: 12px; }
.scores-filters .filter-group { gap: 8px; }
.scores-filters .filter-group label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--c-muted, #7c8798); font-weight: 700;
}
.scores-filters .filter-group select {
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--c-border, #e6eaf2);
  background-color: var(--c-surface, #fff); color: var(--c-text, #0f172a);
  font-size: .84rem; max-width: 320px;
}
.scores-filters .filter-group select:focus { outline: none; border-color: var(--c-brand, #2563eb); box-shadow: var(--c-ring, 0 0 0 3px rgba(37, 99, 235, .2)); }

.scores-actions-top .btn { border-radius: 10px; padding: 9px 14px; font-size: .84rem; }
.btn.calc-final, body.dark-theme .btn.calc-final { background: var(--c-brand, #2563eb); color: #fff; }
.btn.calc-final:hover, body.dark-theme .btn.calc-final:hover { background: var(--c-brand-2, #1d4ed8); }
.btn.export-excel, body.dark-theme .btn.export-excel {
  background: var(--c-surface, #fff); color: var(--c-text-2, #475569);
  border: 1px solid var(--c-border, #e6eaf2);
}
.btn.export-excel:hover, body.dark-theme .btn.export-excel:hover { background: var(--c-surface-2, #f8fafc); color: var(--c-text, #0f172a); }

.scores-subject-tabs { gap: 2px; border-bottom: 1px solid var(--c-border, #e6eaf2); padding-bottom: 0; }
.subject-tab {
  border-radius: 8px 8px 0 0; padding: 9px 14px; margin-bottom: -1px;
  font-size: .85rem; font-weight: 600; color: var(--c-muted, #7c8798);
  border-bottom: 2px solid transparent;
  background: transparent;
}
.subject-tab:hover { background: var(--c-surface-2, #f8fafc); color: var(--c-text, #0f172a); }
.subject-tab.active {
  background: transparent; color: var(--c-brand, #2563eb);
  border-bottom-color: var(--c-brand, #2563eb);
  box-shadow: none;
}
body.dark-theme .subject-tab.active { background: transparent; color: #93c5fd; border-bottom-color: #60a5fa; }

.scores-table-wrapper { border: 1px solid var(--c-border, #e6eaf2); border-radius: 12px; }
.scores-table th {
  background: var(--c-surface-2, #f8fafc) !important;
  color: var(--c-muted, #7c8798) !important;
  font-size: .68rem !important; letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 1px solid var(--c-border, #e6eaf2) !important;
}
.scores-table td { background: var(--c-surface, #fff) !important; color: var(--c-text, #0f172a) !important; }
.scores-table tbody tr:hover td { background: var(--c-brand-soft, #eff4ff) !important; }

.scores-toolbar {
  background: var(--c-surface-2, #f8fafc);
  border: 1px solid var(--c-border, #e6eaf2);
  border-radius: 10px;
  padding: 8px 12px;
}
.scores-toolbar .btn { border-radius: 8px; padding: 5px 12px; font-size: .78rem; }

.scores-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 46px 24px; text-align: center; color: var(--c-muted, #7c8798); font-size: .88rem;
  background: var(--c-surface-2, #f8fafc);
  border: 1px dashed var(--c-border-strong, #d5dceb);
  border-radius: 12px;
}
.scores-empty i { font-size: 1.7rem; opacity: .45; }
.scores-empty p { margin: 0; max-width: 520px; line-height: 1.5; }

@media (max-width: 900px) {
  .scores-modern { padding: 14px; }
  .scores-filters { flex-direction: column; align-items: stretch; gap: 8px; }
  .scores-filters .filter-group { justify-content: space-between; }
  .scores-filters .filter-group select { flex: 1; max-width: none; }
}


#studentJournalModal .no-topic{color:#f87171;font-weight:600;font-size:.9rem;opacity:.6}
body.dark-theme #studentJournalModal .no-topic{color:#fca5a5;opacity:.5}
#studentJournalModal .journal-score-cell .score-badge:empty{display:inline-block;width:28px;height:28px;border:1px dashed #d0d7e2;border-radius:4px;background:transparent}
#studentJournalModal .journal-score-cell .score-badge:not(:empty){border:none}
body.dark-theme #studentJournalModal .journal-score-cell .score-badge:empty{border-color:#334155}@media (max-width: 900px) {
  .scores-filters .filter-group { flex-wrap: wrap; }
  .scores-filters .filter-group select { width: 100%; min-width: 0; max-width: 100%; }
  .scores-actions-top { width: 100%; }
  .scores-actions-top .btn { flex: 1 1 auto; justify-content: center; }
}
