* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #eef2f7;
  color: #2c3e50;
  font-size: 14px;
  min-height: 100vh;
}
a { color: #1a5fa8; text-decoration: none; }
a:hover { color: #2c7dd6; }

/* ============ ЛОГИН ============ */
.login-page {
  display: flex; align-items: center; justify-content: center;
  background: #e8edf5; min-height: 100vh; padding: 20px;
}
.login-box {
  background: white; padding: 44px 40px; border-radius: 4px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.06);
  width: 100%; max-width: 420px;
}
.login-box h1 { font-size: 20px; margin-bottom: 26px; text-align: left; color: #1a3a8f; font-weight: 500; }
.login-box .subtitle { color: #7a8fa6; margin-bottom: 24px; font-size: 13px; }
.login-box label { display: block; margin: 0 0 6px; font-size: 13px; color: #4a5568; }
.login-box input {
  width: 100%; padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid #d1d9e0; border-radius: 3px;
  font-size: 14px; outline: none; background: #fff;
  transition: border-color .15s;
}
.login-box input:focus { border-color: #1a5fa8; }
.login-box .divider { height: 1px; background: #e8edf5; margin: 8px 0 20px; }
.login-box button {
  width: 100%; padding: 13px;
  background: #1a5fa8; color: white; border: none;
  border-radius: 3px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: .15s;
}
.login-box button:hover { background: #144d8a; }
.login-box .error { color: #c53030; margin-top: 12px; font-size: 13px; }

/* ============ ШАПКА ============ */
header {
  background: #1a5fa8; color: white;
  display: flex; align-items: stretch;
  height: 52px; font-size: 13px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.header-left {
  padding: 0 20px; font-size: 13px;
  border-right: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-weight: 500;
}
.header-left:hover { background: rgba(255,255,255,0.06); }
.header-left .logo-icon { font-size: 16px; }
.header-menu {
  display: flex; flex: 1; align-items: stretch;
  padding-left: 8px;
}
.header-menu a {
  color: white; padding: 0 14px;
  font-size: 13px; transition: .15s;
  display: flex; align-items: center;
  border-bottom: 3px solid transparent;
}
.header-menu a:hover { background: rgba(255,255,255,0.06); }
.header-menu a.active { border-bottom-color: #ffd54f; }
.header-right {
  padding: 0 16px; display: flex; align-items: center; gap: 14px;
  border-left: 1px solid rgba(255,255,255,0.15);
  font-size: 12px;
}
.header-right .phone { opacity: .85; font-size: 12px; }
.header-right .user-name { font-weight: 500; cursor: pointer; font-size: 13px; }
.header-right .avatar-circle {
  width: 34px; height: 34px; border-radius: 50%;
  background: #4a90d9; color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 2px solid rgba(255,255,255,0.3);
}
.header-right .logout-icon {
  background: transparent; color: white; border: none;
  font-size: 16px; cursor: pointer; opacity: .8; padding: 6px;
}
.header-right .logout-icon:hover { opacity: 1; }

/* ============ ОСНОВНОЙ КОНТЕНТ ============ */
main { padding: 24px 32px; max-width: 1400px; margin: 0 auto; }
.page-title { font-size: 26px; font-weight: 300; color: #2c3e50; margin-bottom: 8px; }
.page-subtitle { font-size: 13px; color: #7a8fa6; margin-bottom: 24px; line-height: 1.5; }
.section-title { font-size: 16px; font-weight: 400; color: #4a5568; margin-bottom: 14px; }

/* ============ ГЛАВНАЯ: блок с уроком ============ */
.hero-block {
  position: relative;
  background: linear-gradient(135deg, #3b7ca6 0%, #2c5a7f 50%, #1e4a6b 100%);
  border-radius: 4px; overflow: hidden;
  padding: 26px 30px; margin-bottom: 24px;
  min-height: 130px;
  display: flex; align-items: center; justify-content: space-between;
  color: white;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(255,255,255,0.04) 0%, transparent 40%),
    linear-gradient(135deg, #3b7ca6 0%, #2c5a7f 50%, #1e4a6b 100%);
}
.hero-block .hero-date {
  font-size: 30px; font-weight: 300; letter-spacing: -0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.hero-block .hero-current {
  background: white; padding: 14px 22px; border-radius: 4px;
  color: #2c3e50; box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  min-width: 280px;
}
.hero-block .hero-current .row1 {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: #7a8fa6; margin-bottom: 4px;
}
.hero-block .hero-current .class-badge {
  background: #eef2f7; color: #4a5568; padding: 2px 8px;
  border-radius: 3px; font-size: 11px; font-weight: 600;
}
.hero-block .hero-current .row2 {
  display: flex; align-items: baseline; gap: 16px; margin-top: 8px;
}
.hero-block .hero-current .big-time {
  font-size: 30px; font-weight: 500; color: #2c3e50;
  line-height: 1;
}
.hero-block .hero-current .lesson-info {
  font-size: 13px;
}
.hero-block .hero-current .lesson-info .subject-name {
  color: #2c3e50; font-weight: 600; margin-bottom: 2px;
}
.hero-block .hero-current .lesson-info .time-info {
  color: #7a8fa6; font-size: 12px;
}

/* ============ ОБЪЯВЛЕНИЯ ============ */
.announcements-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-bottom: 14px;
}
@media (max-width: 900px) { .announcements-grid { grid-template-columns: 1fr; } }

.announcement-card {
  padding: 18px 18px 16px; border-radius: 4px;
  background: white; cursor: pointer; transition: .15s;
  border-left: 4px solid #4a90d9;
  position: relative; min-height: 130px;
  display: flex; flex-direction: column;
}
.announcement-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08); transform: translateY(-1px); }
.announcement-card.blue { background: #ebf3fa; border-left-color: #4a90d9; }
.announcement-card.pink { background: #fbeef4; border-left-color: #d672a8; }
.announcement-card.white { background: #f4f7fb; border-left-color: #8a9bb5; }

.announcement-card .date-badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; color: #8a9bb5;
}
.announcement-card .author-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.announcement-card .avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  background: #b8c8dc; color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.announcement-card .author-name {
  font-size: 12px; color: #4a5568; line-height: 1.3;
}
.announcement-card h4 {
  font-size: 13px; color: #1a5fa8; margin-bottom: 6px; font-weight: 600;
  line-height: 1.3;
}
.announcement-card .text {
  font-size: 12px; color: #7a8fa6; line-height: 1.45;
  flex: 1;
}

.link-arrow {
  color: #1a5fa8; font-weight: 500; font-size: 13px;
  display: inline-flex; align-items: center; gap: 4px;
}
.link-arrow:hover { color: #2c7dd6; }

/* ============ ТАБЫ ============ */
.tabs {
  display: flex; margin-bottom: 20px;
  background: white; border-radius: 4px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tab {
  flex: 1; padding: 14px 24px; background: transparent; border: none;
  cursor: pointer; font-weight: 500; color: #7a8fa6;
  font-size: 13px; border-radius: 3px;
  transition: .15s; text-align: center;
}
.tab:hover { color: #1a5fa8; }
.tab.active { background: #1a5fa8; color: white; font-weight: 500; }

/* ============ ФОРМЫ ============ */
.filter-bar {
  background: white; padding: 16px 20px; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.filter-field { flex: 1; min-width: 130px; }
.filter-field label {
  display: block; font-size: 11px; color: #8a9bb5;
  margin-bottom: 5px; font-weight: 500;
}
.filter-field input, .filter-field select, .filter-field textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid #d1d9e0; border-radius: 3px; outline: none;
  font-size: 13px; background: white; color: #2c3e50;
  transition: border-color .15s;
}
.filter-field input:focus, .filter-field select:focus, .filter-field textarea:focus {
  border-color: #1a5fa8;
}
.filter-field.full { flex: 1 1 100%; }

/* ============ КНОПКИ ============ */
.btn {
  padding: 10px 20px; border: none; border-radius: 3px;
  cursor: pointer; font-weight: 500; transition: .15s; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-primary { background: #1a5fa8; color: white; }
.btn-primary:hover { background: #144d8a; }
.btn-light { background: #eef2f7; color: #4a5568; }
.btn-light:hover { background: #e2e8f0; }
.btn-danger { background: #c53030; color: white; }
.btn-danger:hover { background: #9b2c2c; }
.btn-outline {
  background: transparent; color: #1a5fa8;
  border: 1px solid #cbd5e0;
}
.btn-outline:hover { background: #f4f7fb; border-color: #1a5fa8; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon {
  background: transparent; border: none; cursor: pointer;
  color: #8a9bb5; font-size: 15px; padding: 6px 8px; border-radius: 3px;
}
.btn-icon:hover { color: #1a5fa8; background: #eef2f7; }

/* ============ ТАБЛИЦЫ ============ */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: white; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
}
.data-table th {
  background: white; padding: 12px 14px; text-align: left;
  font-weight: 500; color: #4a5568; font-size: 12px;
  border-bottom: 1px solid #e8edf5;
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid #f4f7fb;
  font-size: 13px; color: #2c3e50;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fbfd; }

/* Журнал: сетка с датами */
.journal-table {
  width: 100%; border-collapse: collapse; background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border-radius: 4px; overflow: hidden; font-size: 12px;
}
.journal-table th {
  padding: 10px 6px; text-align: center;
  font-weight: 500; color: #4a5568; font-size: 11px;
  border-bottom: 1px solid #e8edf5;
  background: white;
}
.journal-table th.name-col,
.journal-table td.name-col { text-align: left; padding-left: 14px; }
.journal-table .month-row th {
  color: #1a5fa8; font-weight: 600; font-size: 11px;
  padding: 8px 6px 4px; border-bottom: none;
}
.journal-table td {
  padding: 10px 6px; text-align: center;
  border-bottom: 1px solid #f4f7fb;
}
.journal-table td.name-col { text-align: left; }
.journal-table td.date-cell { cursor: pointer; position: relative; }
.journal-table td.date-cell:hover { background: #f4f7fb; }
.journal-table .avg { color: #4a5568; font-weight: 500; }

/* ============ ОЦЕНКИ ============ */
.grade {
  display: inline-block; padding: 3px 9px; border-radius: 3px;
  font-weight: 600; font-size: 12px; min-width: 24px; text-align: center;
}
.grade-5 { background: #4caf50; color: white; }
.grade-4 { background: #66bb6a; color: white; }
.grade-3 { background: #ef6c00; color: white; }
.grade-2 { background: #c62828; color: white; }

/* ============ ПОСЕЩАЕМОСТЬ ============ */
.att-btn {
  display: inline-block; width: 26px; height: 26px; line-height: 24px;
  text-align: center; border-radius: 50%; font-size: 11px; font-weight: 600;
  border: 1px solid #cbd5e0; cursor: pointer; margin-right: 4px;
  background: white; color: #8a9bb5;
  vertical-align: middle; transition: .15s;
}
.att-btn:hover { border-color: #1a5fa8; color: #1a5fa8; }
.att-btn.active { background: #1a5fa8; color: white; border-color: #1a5fa8; }
.att-btn.Н.active { background: #c53030; border-color: #c53030; }
.att-btn.У.active { background: #ef6c00; border-color: #ef6c00; }
.att-btn.Б.active { background: #4a90d9; border-color: #4a90d9; }

/* ============ СТРАНИЦА УРОКА: ЛЕВЫЙ САЙДБАР ============ */
.lesson-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 24px;
  align-items: start;
}
@media (max-width: 800px) { .lesson-layout { grid-template-columns: 1fr; } }

.sidebar-menu {
  background: white; padding: 8px 0; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.sidebar-menu button, .sidebar-menu a {
  display: block; width: 100%; text-align: left;
  padding: 12px 22px; background: transparent; border: none;
  cursor: pointer; font-size: 13px; color: #7a8fa6;
  border-left: 3px solid transparent; transition: .15s;
  text-decoration: none;
}
.sidebar-menu button:hover, .sidebar-menu a:hover {
  color: #1a5fa8; background: #f9fbfd;
}
.sidebar-menu button.active, .sidebar-menu a.active {
  color: #1a5fa8; font-weight: 600;
  border-left-color: #1a5fa8; background: #f4f7fb;
}

/* ============ КАРТОЧКА УРОКА (шапка) ============ */
.lesson-header {
  background: white; padding: 20px 26px;
  border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 16px;
}
.lesson-header h1 {
  font-size: 24px; font-weight: 300; color: #2c3e50;
}
.lesson-header .back {
  color: #8a9bb5; font-size: 13px; margin-bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px;
}
.lesson-header .back:hover { color: #1a5fa8; }

/* ============ КАРТОЧКИ ДОМАШКИ ============ */
.hw-card {
  background: white; padding: 20px 24px; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 14px;
  border-left: 3px solid #4a90d9;
}
.hw-card .hw-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.hw-card .hw-subject { font-size: 15px; color: #1a5fa8; font-weight: 600; }
.hw-card .hw-link { color: #4a90d9; font-size: 12px; cursor: pointer; }
.hw-card .hw-row {
  display: flex; margin-bottom: 8px; font-size: 13px;
}
.hw-card .hw-label {
  width: 160px; color: #8a9bb5; flex-shrink: 0;
}
.hw-card .hw-value { color: #2c3e50; flex: 1; }
.hw-card .hw-checkbox {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid #f4f7fb;
  font-size: 13px; color: #4a5568; cursor: pointer;
}

/* ============ РАСПИСАНИЕ ============ */
.schedule-nav {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; font-size: 13px; color: #4a5568;
}
.schedule-nav .arrow-btn {
  width: 34px; height: 34px; border: 1px solid #d1d9e0;
  border-radius: 3px; background: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #4a5568; font-size: 14px; transition: .15s;
}
.schedule-nav .arrow-btn:hover { border-color: #1a5fa8; color: #1a5fa8; }

.schedule-table {
  width: 100%; border-collapse: collapse; background: white;
  border-radius: 4px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); font-size: 12px;
}
.schedule-table th {
  padding: 12px 8px; text-align: center; font-weight: 400;
  color: #8a9bb5; font-size: 12px;
  border-bottom: 1px solid #e8edf5;
  background: white;
}
.schedule-table th.today {
  color: #1a5fa8; font-weight: 600;
  border-bottom: 3px solid #1a5fa8;
}
.schedule-table th .day-name { display: block; font-weight: 600; color: #4a5568; }
.schedule-table th.today .day-name { color: #1a5fa8; }
.schedule-table th .day-date { display: block; font-size: 11px; margin-top: 2px; }
.schedule-table td {
  padding: 8px; border-bottom: 1px solid #f4f7fb;
  vertical-align: top; height: 70px;
}
.schedule-table td.lesson-num {
  width: 60px; color: #8a9bb5; text-align: center;
  vertical-align: top; padding-top: 14px;
  font-size: 12px;
}
.schedule-table td.lesson-num .time {
  display: block; font-size: 10px; color: #b8c8dc;
  margin-top: 3px;
}
.schedule-table td.lesson-cell { cursor: pointer; }
.schedule-table td.lesson-cell:hover { background: #f9fbfd; }
.schedule-table .subject {
  color: #1a5fa8; font-weight: 600; font-size: 12px;
  line-height: 1.3; margin-bottom: 4px;
}
.schedule-table .info { color: #8a9bb5; font-size: 11px; }
.schedule-table .not-filled {
  color: #b8c8dc; font-size: 12px; font-style: italic;
  padding: 8px 0;
}

/* ============ МОДАЛЬНЫЕ ОКНА ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: white; padding: 26px 28px; border-radius: 4px;
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  position: relative;
}
.modal .modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; border: 1px solid #d1d9e0;
  cursor: pointer; color: #8a9bb5; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.modal .modal-close:hover { background: #f4f7fb; color: #2c3e50; }
.modal h3 { font-size: 16px; margin-bottom: 18px; color: #2c3e50; font-weight: 500; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px;
}

/* Оценка-попап (в журнале) */
.grade-popup {
  position: absolute; z-index: 100;
  background: white; border-radius: 4px; padding: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  min-width: 260px;
}
.grade-popup .popup-row {
  display: flex; gap: 6px; margin-bottom: 10px; align-items: center;
}
.grade-popup .presence-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid #d1d9e0; background: white;
  cursor: pointer; color: #8a9bb5; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.grade-popup .presence-btn.active {
  background: #4a90d9; color: white; border-color: #4a90d9;
}
.grade-popup .grade-select {
  flex: 1; padding: 7px 10px; border: 1px solid #d1d9e0;
  border-radius: 3px; font-size: 13px;
}
.grade-popup .dbl-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #4a5568;
  margin: 8px 0;
}
.grade-popup .dbl-row a { color: #4a90d9; font-size: 12px; margin-left: auto; }
.grade-popup .actions {
  display: flex; justify-content: space-between;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef2f7;
}
.grade-popup .actions button {
  background: transparent; border: none; cursor: pointer;
  color: #8a9bb5; font-size: 13px; padding: 4px 8px;
}
.grade-popup .actions button.primary { color: #1a5fa8; font-weight: 500; }
.grade-popup .actions button:hover { color: #1a5fa8; }

/* ============ КАРТОЧКИ СТАТИСТИКИ (директор) ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 16px; }
.stat {
  background: linear-gradient(135deg, #1a5fa8, #144d8a);
  color: white; padding: 20px 22px; border-radius: 4px;
}
.stat .num { font-size: 30px; font-weight: 600; line-height: 1; }
.stat .lbl { opacity: .85; font-size: 13px; margin-top: 6px; }

/* ============ УТИЛИТЫ ============ */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.text-muted { color: #8a9bb5; }
.text-small { font-size: 12px; }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap { display: flex; gap: 8px; align-items: center; }
.hidden { display: none !important; }

/* Спец. Аватарки */
.avatar-letter {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 600; color: white;
  background: #b8c8dc;
}
.avatar-34 { width: 34px; height: 34px; font-size: 12px; }
.avatar-40 { width: 40px; height: 40px; font-size: 13px; }
.avatar-44 { width: 44px; height: 44px; font-size: 14px; }