:root {
  --bg: #0e0e11;
  --card: #1b1c22;
  --text: #fff;
  --muted: #b8bdc3;
  --border: #2a2b33;
  --accent: #4f8cff;
  --accent-hover: #6da0ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 16px;
  flex: 1;
}

.group-selector-container {
  margin-bottom: 20px;
}

.group-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.group-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

.group-select:hover {
  background-color: #25262e;
  border-color: var(--muted);
}

.group-select:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-container {
  margin-bottom: 20px;
}

.subgroup-filter {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.subgroup-btn {
  flex: 1;
  max-width: 120px;
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.subgroup-btn:hover {
  background: #25262e;
  border-color: var(--muted);
}

.subgroup-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.day-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.day-selector::-webkit-scrollbar {
  display: none;
}

.day-btn {
  flex-shrink: 0;
  padding: 10px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.day-btn:hover {
  background: #25262e;
  border-color: var(--muted);
}

.day-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.day-btn .day-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.day-btn .day-date {
  font-size: 12px;
  opacity: 0.8;
}

.day-content {
  display: none;
}

.day-content.active {
  display: block;
}

.day-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text);
}

.pair {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.pair.past {
  filter: grayscale(0.3) brightness(0.8);
}

.pair.past .pair-header {
  background: rgba(255, 255, 255, 0.01);
}

.pair.past .subject-name {
  color: var(--muted);
}

.pair.past .teacher,
.pair.past .room {
  opacity: 0.75;
}

.pair.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.2);
}

.pair:hover {
  border-color: var(--muted);
}

.pair-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.pair-number {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pair-time {
  font-size: 13px;
  color: var(--muted);
}

.lesson {
  padding: 14px 16px;
}

.subject-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
  line-height: 1.4;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.room {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(79, 140, 255, 0.15);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

.teacher {
  font-size: 13px;
  color: var(--muted);
}

.empty {
  opacity: 0.4;
  font-style: italic;
  text-align: center;
  padding: 16px;
}

.lesson-slot {
  padding: 14px 16px;
  border-left: 4px solid;
}

.lesson-slot.empty-slot {
  opacity: 0.4;
  font-style: italic;
  border-left: 4px solid #444;
}

.lesson-divider {
  height: 1px;
  background: var(--border);
  margin: 0 16px;
}

.error-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 15px;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 15px;
}

/* Футер */
/* Футер */
.footer {
  background: #0a0a0d; /* Темнее основного фона */
  padding: 20px 0;
  color: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2);
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-contacts {
  display: flex;
  gap: 25px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-link {
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.contact-link:hover {
  color: var(--accent);
  background: rgba(79, 140, 255, 0.1);
  border-color: rgba(79, 140, 255, 0.2);
  transform: translateY(-2px);
}

.contact-icon {
  font-size: 1.2em;
}

@media (max-width: 640px) {
  /* Адаптация футера для мобильных */
  .footer {
    padding: 12px 16px;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.15);
  }

  .footer-content {
    gap: 8px;
  }

  .footer-contacts {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .contact-link {
    padding: 6px 10px;
    font-size: 0.9em;
  }
}
/* RESET для шапки */
.header * {
  box-sizing: border-box;
}

/* HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

/* NAV */
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  /* КЛЮЧЕВОЕ */
  min-height: 60px;
}

/* LOGO */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;

  text-decoration: none;
  color: var(--text);

  flex-shrink: 0;
}

/* ЕСЛИ ЕСТЬ IMG */
.nav-logo img {
  height: 48px;      /* ← МЕНЯЙ ЭТО */
  width: auto;
  max-width: 100%;
  display: block;
}

/* ЕСЛИ ТОЛЬКО ТЕКСТ */
.nav-logo {
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

/* LINKS */
.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--accent);
}

/* MOBILE */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    background: var(--card);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-logo img {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .nav-logo img {
    height: 32px;
  }
}