/* =========================================================
   КИПиА Portal — экзаменационные билеты
   ========================================================= */

.tickets-page,
.ticket-page,
.question-page {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.tickets-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;

  margin-bottom: 26px;
  padding: 28px 30px;

  background: #ffffff;
  border: 1px solid #dfe5e8;
  border-radius: 12px;
}

.tickets-kicker,
.answer-kicker {
  margin-bottom: 7px;

  color: #1976d2;

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tickets-hero h1 {
  margin: 0 0 10px;

  font-size: 30px;
}

.tickets-hero p {
  max-width: 720px;
  margin: 0;

  color: #607d8b;
  line-height: 1.6;
}

.tickets-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 9px;

  min-width: 360px;
}

.tickets-stats > div {
  padding: 14px 12px;

  background: #f5f8fa;
  border-radius: 8px;

  text-align: center;
}

.tickets-stats strong {
  display: block;

  margin-bottom: 4px;

  color: #0d47a1;

  font-size: 22px;
}

.tickets-stats span {
  color: #78909c;

  font-size: 11px;
}

.qualification-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;

  margin-bottom: 22px;
}

.qualification-tab {
  padding: 10px 18px;

  border: 1px solid #cfd8dc;
  border-radius: 999px;

  background: #ffffff;
  color: #455a64;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;
}

.qualification-tab:hover {
  border-color: #90caf9;
}

.qualification-tab.active {
  border-color: #1976d2;

  background: #1976d2;
  color: #ffffff;
}

.qualification-section[hidden] {
  display: none;
}

.qualification-heading h2 {
  margin: 0 0 16px;

  font-size: 24px;
}

.module-list {
  display: grid;
  gap: 18px;
}

.module-card {
  overflow: hidden;

  background: #ffffff;

  border: 1px solid #dfe5e8;
  border-radius: 12px;
}

.module-card-header {
  padding: 20px 22px;

  background: #f8fafb;
  border-bottom: 1px solid #e6ebee;
}

.module-code {
  margin-bottom: 5px;

  color: #1976d2;

  font-size: 13px;
  font-weight: 800;
}

.module-card-header h3 {
  margin: 0;

  font-size: 17px;
  line-height: 1.45;
}

.module-ticket-count {
  margin-top: 7px;

  color: #78909c;

  font-size: 12px;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 9px;

  padding: 18px;
}

.ticket-chip {
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 13px 8px;

  background: #ffffff;

  border: 1px solid #d5dde1;
  border-radius: 8px;

  color: #37474f;
  text-decoration: none;
}

.ticket-chip:hover {
  border-color: #64b5f6;

  background: #e3f2fd;

  transform: translateY(-1px);
}

.ticket-chip-label {
  margin-bottom: 2px;

  color: #78909c;

  font-size: 11px;
}

.ticket-chip strong {
  font-size: 17px;
}

/* =========================================================
   Один билет
   ========================================================= */

.ticket-breadcrumb {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;

  margin-bottom: 18px;

  color: #78909c;

  font-size: 13px;
}

.ticket-breadcrumb a {
  color: #546e7a;
  text-decoration: none;
}

.ticket-breadcrumb a:hover {
  color: #1976d2;
}

.ticket-context {
  margin-bottom: 18px;
}

.ticket-qualification {
  margin-bottom: 5px;

  color: #1976d2;

  font-size: 14px;
  font-weight: 800;
}

.ticket-module {
  color: #455a64;

  line-height: 1.5;
}

.exam-ticket-sheet {
  max-width: 960px;
  margin: 0 auto;

  padding: 38px 46px;

  background: #ffffff;

  border: 1px solid #d8dfe3;
  border-radius: 10px;

  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.045);
}

.exam-ticket-title {
  margin-bottom: 30px;

  color: #1f2d33;

  font-size: 24px;
  font-weight: 800;

  text-align: center;
}

.ticket-question-list {
  margin: 0;
  padding-left: 28px;
}

.ticket-question-list li {
  margin-bottom: 17px;
  padding-left: 6px;

  font-size: 16px;
  line-height: 1.55;
}

.ticket-question-list li::marker {
  font-weight: 800;
}

.ticket-question-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;

  padding: 8px 10px;

  border-radius: 7px;

  color: #263238;
  text-decoration: none;
}

.ticket-question-link:hover {
  background: #eaf4fb;
}

.ticket-question-text {
  flex: 1;
}

.answer-status {
  flex-shrink: 0;

  padding: 4px 8px;

  border-radius: 999px;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
}

.answer-status.ready {
  background: #e8f5e9;
  color: #2e7d32;
}

.answer-status.empty {
  background: #f1f3f4;
  color: #78909c;
}

.ticket-navigation {
  max-width: 960px;
  margin: 20px auto 0;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.ticket-navigation > div:last-child {
  text-align: right;
}

.ticket-nav-button {
  display: inline-flex;

  padding: 9px 14px;

  border: 1px solid #90caf9;
  border-radius: 7px;

  background: #ffffff;
  color: #1565c0;

  font-size: 13px;
  font-weight: 700;

  text-decoration: none;
}

.ticket-nav-button:hover {
  background: #e3f2fd;
}

.ticket-nav-button.secondary {
  border-color: #cfd8dc;
  color: #546e7a;
}

/* =========================================================
   Вопрос / ответ
   ========================================================= */

.question-page {
  max-width: 1120px;
}

.question-card {
  margin-bottom: 20px;
  padding: 26px 30px;

  background: #ffffff;

  border: 1px solid #dfe5e8;
  border-radius: 12px;
}

.question-context-label {
  margin-bottom: 10px;

  color: #1976d2;

  font-size: 12px;
  font-weight: 800;
}

.question-card h1 {
  margin: 0;

  font-size: 25px;
  line-height: 1.45;
}

.answer-section {
  margin-top: 18px;
}

.answer-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;

  margin-bottom: 14px;
}

.answer-heading-row h2 {
  margin: 0;

  font-size: 23px;
}

.answer-content {
  min-height: 160px;
}

.answer-empty {
  padding: 30px;

  background: #ffffff;

  border: 1px dashed #b0bec5;
  border-radius: 10px;

  color: #607d8b;

  text-align: center;
}

.answer-empty strong {
  display: block;

  margin-bottom: 8px;

  color: #455a64;
}

.answer-empty p {
  max-width: 660px;
  margin: 0 auto;

  line-height: 1.55;
}

.question-used-in {
  margin-top: 28px;
}

.question-used-in h2 {
  margin-bottom: 13px;

  font-size: 18px;
}

.question-usage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-usage-list a {
  display: flex;
  gap: 7px;
  align-items: center;

  padding: 8px 10px;

  background: #ffffff;

  border: 1px solid #dce3e6;
  border-radius: 7px;

  color: #546e7a;

  font-size: 12px;
  text-decoration: none;
}

.question-usage-list a:hover,
.question-usage-list a.current {
  border-color: #64b5f6;

  background: #e3f2fd;
}

.question-answer-editor {
  height: calc(100vh - 210px);
  min-height: 590px;
}

.tickets-empty {
  padding: 30px;

  background: #fff8e1;

  border: 1px solid #ffe082;
  border-radius: 10px;
}

/* =========================================================
   Навигация портала
   ========================================================= */

.portal-nav {
  display: flex;
  gap: 5px;
  align-items: center;

  margin-left: 18px;
}

.portal-nav a {
  padding: 8px 11px;

  border-radius: 6px;

  color: #546e7a;

  font-size: 13px;
  font-weight: 700;

  text-decoration: none;
}

.portal-nav a:hover {
  background: #eef3f6;
}

.portal-nav a.active {
  background: #e3f2fd;
  color: #0d47a1;
}

@media (max-width: 1000px) {
  .tickets-hero {
    display: block;
  }

  .tickets-stats {
    min-width: 0;
    margin-top: 20px;
  }

  .portal-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 700px) {
  .tickets-page,
  .ticket-page,
  .question-page {
    width: min(100% - 24px, 1240px);
    padding-top: 20px;
  }

  .tickets-stats {
    grid-template-columns: 1fr;
  }

  .exam-ticket-sheet {
    padding: 27px 20px;
  }

  .ticket-question-link {
    display: block;
    padding: 8px 4px;
  }

  .answer-status {
    display: inline-block;
    margin-top: 7px;
  }

  .ticket-navigation {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .ticket-navigation > div:last-child {
    text-align: center;
  }

  .answer-heading-row {
    display: block;
  }

  .answer-heading-row .edit-button {
    margin-top: 12px;
  }

  .question-answer-editor {
    height: calc(100vh - 170px);
    min-height: 500px;
  }
}
