:root {
  --bg: #f7f3ef;
  --surface: #ffffff;
  --text: #2c2419;
  --text-muted: #6b5f52;
  --accent: #c45c3e;
  --accent-hover: #a84d33;
  --accent-light: #f9ebe6;
  --success: #2d8a5e;
  --success-bg: #e8f5ee;
  --error: #c0392b;
  --error-bg: #fdecea;
  --border: #e5ddd4;
  --shadow: 0 4px 24px rgba(44, 36, 25, 0.08);
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: linear-gradient(135deg, #c45c3e 0%, #8b3a2a 100%);
  color: white;
  padding: 2rem 1.5rem;
  text-align: center;
}

.header__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__subtitle {
  margin-top: 0.35rem;
  opacity: 0.9;
  font-size: 0.95rem;
}

.main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Home screen */
.home__intro {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.home__intro p {
  color: var(--text-muted);
}

.stage {
  margin-bottom: 2rem;
}

.stage__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-left: 0.25rem;
}

.block-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.block-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(196, 92, 62, 0.15);
}

.block-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.block-card__meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.block-card__badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.2rem 0.6rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.block-card__badge--done {
  background: var(--success-bg);
  color: var(--success);
}

/* Quiz screen */
.quiz-header {
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.back-link:hover {
  color: var(--accent);
}

.quiz-header__title {
  font-size: 1.35rem;
  font-weight: 700;
}

.quiz-header__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  margin-top: 1rem;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.question-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.question-card__number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.question-card__text {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.option:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.option input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.option--selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.option--correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.option--wrong {
  border-color: var(--error);
  background: var(--error-bg);
}

.option--correct-hint {
  border-color: var(--success);
  background: var(--success-bg);
  opacity: 0.7;
}

.option--dimmed {
  opacity: 0.55;
}

.option--disabled {
  pointer-events: none;
  opacity: 0.85;
}

.option__text {
  flex: 1;
}

.option__mark {
  font-weight: 700;
  color: var(--success);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.option__mark--bad {
  color: var(--error);
}

.answer-feedback {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.answer-feedback--ok {
  background: var(--success-bg);
  color: var(--success);
  border: 2px solid var(--success);
}

.answer-feedback--bad {
  background: var(--error-bg);
  color: var(--error);
  border: 2px solid var(--error);
}

.answer-feedback--bad span {
  color: var(--text);
  font-size: 0.9rem;
}

.answer-feedback--wait {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-align: center;
}

.quiz-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.quiz-header__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quiz-score {
  display: flex;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.quiz-score__ok {
  color: var(--success);
  background: var(--success-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.quiz-score__bad {
  color: var(--error);
  background: var(--error-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.quiz-actions--sticky {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom, 0px));
  margin-top: 0.5rem;
  z-index: 10;
}

.option__label {
  font-weight: 600;
  color: var(--accent);
  min-width: 1.5rem;
}

.quiz-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: white;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--primary:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Results screen */
.results {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}

.results__icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.results__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.results__subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.score-card {
  padding: 1.25rem;
  border-radius: 12px;
}

.score-card--correct {
  background: var(--success-bg);
}

.score-card--wrong {
  background: var(--error-bg);
}

.score-card__number {
  font-size: 2rem;
  font-weight: 700;
}

.score-card--correct .score-card__number {
  color: var(--success);
}

.score-card--wrong .score-card__number {
  color: var(--error);
}

.score-card__label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.results__percent {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.results-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.review-list {
  text-align: left;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.review-list__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.review-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.review-item:last-child {
  border-bottom: none;
}

.review-item--correct {
  color: var(--success);
}

.review-item--wrong {
  color: var(--error);
}

.review-item__question {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

@media (max-width: 480px) {
  .header {
    padding: 1.1rem 1rem;
  }

  .header__title {
    font-size: 1.25rem;
  }

  .header__subtitle {
    font-size: 0.85rem;
  }

  .main {
    padding: 1rem 0.85rem 1.5rem;
  }

  .footer {
    padding: 0.75rem;
    font-size: 0.8rem;
  }

  .home__intro {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .block-card {
    padding: 1rem 1.1rem;
  }

  .stage__title {
    font-size: 1rem;
  }

  .quiz-header__title {
    font-size: 1.15rem;
  }

  .question-card {
    padding: 1.15rem;
  }

  .question-card__text {
    font-size: 1rem;
    line-height: 1.5;
  }

  .option {
    padding: 0.9rem 0.85rem;
    min-height: 56px;
    gap: 0.6rem;
  }

  .option__text {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .auth-card {
    padding: 1.25rem;
    margin: 0;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 1rem;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .quiz-actions,
  .results-actions {
    flex-direction: row;
    gap: 0.5rem;
  }

  .quiz-actions .btn,
  .results-actions .btn {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 0.75rem;
    font-size: 0.9rem;
  }

  .results {
    padding: 1.25rem;
  }

  .user-bar {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Auth */
.hidden {
  display: none !important;
}

.user-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.user-bar__name {
  font-size: 0.95rem;
  opacity: 0.95;
}

.user-bar__logout {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}

.user-bar__logout:hover {
  background: rgba(255, 255, 255, 0.25);
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 400px;
  margin: 0 auto;
}

.auth-card__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.auth-card__desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field__label {
  font-size: 0.875rem;
  font-weight: 600;
}

.form-input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  background: var(--error-bg);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
}

.btn--full {
  width: 100%;
}

.auth-card__hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-card__link {
  display: block;
  margin-top: 0.75rem;
  text-align: center;
  color: var(--accent);
  font-size: 0.9rem;
}

.auth-card__staff-btn {
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-card__divider {
  margin: 1rem 0 0.75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-card__link-btn {
  display: block;
  width: 100%;
  padding: 0.35rem;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
}

.auth-form--welcome {
  margin-top: 0;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
}

/* History */
.history-section {
  margin-top: 2rem;
}

.history-section__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.history-item__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.history-item__date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-item__score {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.history-item__correct {
  color: var(--success);
}

.history-item__wrong {
  color: var(--error);
}

.history-item__percent {
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* Admin */
.main--wide {
  max-width: 960px;
}

.header--admin {
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.panel__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.panel__empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.intern-list,
.attempt-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.intern-card,
.attempt-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.intern-card:hover,
.attempt-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.intern-card__name,
.attempt-card__title {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.intern-card__meta,
.attempt-card__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.intern-card__stats {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.attempt-card__score {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-detail__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.admin-detail__meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.admin-detail .score-grid {
  max-width: 400px;
}

.admin-detail .results__percent {
  text-align: left;
  margin-bottom: 1.5rem;
}

/* Admin tabs */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.admin-tab {
  flex: 1;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab--active {
  background: var(--accent);
  color: white;
}

.admin-grid--content {
  grid-template-columns: 1.4fr 1fr;
}

.panel--wide {
  min-height: 200px;
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.form-success {
  color: var(--success);
  font-size: 0.875rem;
  background: var(--success-bg);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.content-stages-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.content-stage__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.content-stage__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.content-blocks {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.content-block-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-block-btn {
  flex: 1;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.15s;
}

.content-block-btn:hover {
  border-color: var(--accent);
}

.content-block-btn__title {
  font-weight: 600;
  font-size: 0.95rem;
}

.content-block-btn__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.btn-icon:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.btn-icon--danger:hover {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
}

.questions-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question-admin-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.question-admin-item--editing {
  background: var(--surface);
  border-color: var(--accent);
}

.question-admin-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.question-admin-item__num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
}

.question-admin-item__actions {
  display: flex;
  gap: 0.35rem;
}

.question-admin-item__text {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.question-admin-item__options {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.question-opt {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.question-opt--correct {
  color: var(--success);
  font-weight: 600;
}

.question-form__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.option-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.option-input-row__label {
  font-weight: 600;
  color: var(--accent);
  min-width: 2rem;
}

.option-input-row .form-input {
  flex: 1;
}

.option-correct-radio {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.option-correct-radio:has(input:checked) {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.option-correct-radio input {
  display: none;
}

@media (max-width: 768px) {
  .admin-grid--content {
    grid-template-columns: 1fr;
  }
}

/* Users management */
.admin-grid--users {
  grid-template-columns: 1.2fr 1fr;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.user-row--editing {
  border-color: var(--accent);
  background: var(--accent-light);
}

.user-row__name {
  font-weight: 600;
}

.user-row__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.user-row__badge {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

.role-badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.role-badge--intern {
  background: #e8f5ee;
  color: #2d8a5e;
}

.role-badge--senior_barista {
  background: #e8eef5;
  color: #2563eb;
}

.role-badge--admin {
  background: #f9ebe6;
  color: #c45c3e;
}

.panel__desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem;
}

.panel--highlight {
  border: 2px solid var(--accent-light);
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-success {
  color: var(--success);
  font-size: 0.9rem;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn--danger {
  background: #fdecea;
  color: var(--error);
  border: 1px solid #f5c6cb;
}

.btn--danger:hover {
  background: #f8d7da;
}

.auth-card__desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

@media (max-width: 768px) {
  .admin-grid--users {
    grid-template-columns: 1fr;
  }
}

/* Shift reports */
.admin-grid--reports {
  grid-template-columns: 1.2fr 1fr;
}

.admin-grid--reports .panel--reports-history {
  grid-column: 1;
  grid-row: 1;
}

.admin-grid--reports .panel--reports-form {
  grid-column: 2;
  grid-row: 1;
}

.shift-report-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shift-report-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.shift-report-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.shift-report-card__author {
  font-weight: 600;
}

.shift-report-card__username {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.shift-report-card__date {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.shift-report-card__scores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.score-pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.score-pill--team {
  background: #e8eef5;
  color: #2563eb;
}

.score-pill--self {
  background: #f9ebe6;
  color: #c45c3e;
}

.shift-report-card__text {
  white-space: pre-wrap;
  line-height: 1.55;
  margin-bottom: 0.6rem;
}

.shift-report-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rating-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.rating-btn {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.rating-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rating-btn--active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.shift-report-card__location {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.2rem;
}

.panel__desc--location {
  background: var(--accent-light);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.form-field--location .req {
  color: var(--error);
}

.intern-card__stats--readiness {
  margin-top: 0.35rem;
  font-weight: 600;
  color: var(--accent);
}

.admin-tabs--detail {
  margin: 1.25rem 0;
}

.panel--readiness {
  margin-bottom: 1rem;
}

.readiness-overall {
  text-align: center;
  margin-bottom: 1.25rem;
}

.readiness-overall__value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.readiness-overall__label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.readiness-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.85rem;
}

.readiness-bar__label {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.readiness-bar__track {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.readiness-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b3a2a);
  border-radius: 999px;
  transition: width 0.3s;
}

.readiness-bar__pct {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 2.5rem;
  text-align: right;
}

.practical-checklist {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.practical-section__title {
  font-size: 1rem;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.practical-section__tasks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.practical-task {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.practical-task--done {
  border-color: #b8dfc8;
  background: #e8f5ee;
}

.practical-task__check {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.practical-task__text {
  flex: 1;
  line-height: 1.45;
}

.practical-task__meta {
  width: 100%;
  padding-left: 1.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.practical-admin-tasks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.practical-admin-task {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.practical-admin-task--editing {
  flex-wrap: wrap;
}

.practical-admin-task__text {
  flex: 1;
  line-height: 1.45;
}

.admin-tabs--home {
  margin-bottom: 1.25rem;
}

.theory-view__title {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.theory-view__desc {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.theory-lessons {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.theory-lesson {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}

.theory-lesson__title {
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.theory-lesson__text {
  line-height: 1.65;
  color: var(--text);
}

.theory-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin-bottom: 0.75rem;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.theory-video iframe,
.theory-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.theory-video-link a {
  color: var(--accent);
}

.theory-admin-preview {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.form-field__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-input--file {
  padding: 0.5rem;
  background: var(--surface);
}

.theory-field-youtube {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.theory-upload-current {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.block-card--theory {
  text-align: left;
}

.practical-admin-task__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .admin-grid--reports {
    grid-template-columns: 1fr;
  }

  .admin-grid--reports .panel--reports-form {
    grid-column: 1;
    grid-row: 1;
  }

  .admin-grid--reports .panel--reports-history {
    grid-column: 1;
    grid-row: 2;
  }

  .shift-report-card__header {
    flex-direction: column;
  }
}

/* Hub */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

.hub-card {
  display: block;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.hub-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.hub-card--shtab {
  border-color: #c4b5fd;
  background: linear-gradient(145deg, #faf8ff 0%, var(--surface) 100%);
}

.hub-card__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.hub-card__title {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.hub-card__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.user-bar__hub-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  margin-right: 0.75rem;
}

.user-bar__hub-link:hover {
  text-decoration: underline;
}

.header--shtab .header__title {
  color: #5b21b6;
}

/* Shtab kanban */
.shtab-toolbar {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.shtab-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.shtab-hint--tg code {
  background: #ede9fe;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.shtab-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shtab-filter__label {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.shtab-filter .form-input--sm {
  min-width: 180px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 0.75rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.kanban-col {
  background: #f8f9fb;
  border-radius: var(--radius);
  min-height: 320px;
  border: 1px solid var(--border);
}

.kanban-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
}

.kanban-col__title {
  font-size: 0.9rem;
  margin: 0;
  font-weight: 600;
}

.kanban-col__count {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #eef0f4;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.kanban-col__body {
  padding: 0.5rem;
  min-height: 260px;
}

.kanban-col__body--over {
  background: #ede9fe;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  cursor: grab;
  text-align: left;
  transition: box-shadow 0.15s;
}

.task-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.task-card--dragging {
  opacity: 0.5;
}

.task-card__top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.task-card__archive {
  margin-left: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  opacity: 0.65;
}

.task-card__archive:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.task-card__title {
  font-size: 0.92rem;
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.task-card__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.task-card__priority {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
}

.urgency {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.urgency--ok { background: #22c55e; }
.urgency--soon { background: #eab308; }
.urgency--hot { background: #f97316; }
.urgency--overdue { background: #ef4444; }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.archive-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.archive-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.archive-card__badge {
  font-weight: 600;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.archive-card__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.archive-card__desc {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.archive-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.idea-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.idea-card__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.idea-card__status {
  font-weight: 600;
  color: var(--accent);
}

.idea-card__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.idea-card__desc {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.idea-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.form-input--sm {
  max-width: 160px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.form-textarea {
  resize: vertical;
  min-height: 4rem;
  font-family: inherit;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-error--banner {
  margin-bottom: 1rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  z-index: 1000;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.modal--wide {
  max-width: 720px;
}

.modal__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  flex: 1;
  margin: 0;
  font-size: 1.15rem;
}

.modal__close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

.modal__body {
  padding: 1.25rem;
}

.task-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.task-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.task-comments {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

.task-comment {
  background: #f8f9fb;
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}

.task-comment__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

.task-comment p {
  margin: 0;
  font-size: 0.9rem;
}

.auth-form--inline {
  display: flex;
  gap: 0.5rem;
}

.auth-form--inline .form-input {
  flex: 1;
}

.task-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.task-history {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.task-history__time {
  color: var(--text-muted);
  white-space: nowrap;
}

.role-badge--owner {
  background: #ede9fe;
  color: #5b21b6;
}

.role-badge--manager {
  background: #dbeafe;
  color: #1d4ed8;
}

.role-badge--smm {
  background: #fce7f3;
  color: #be185d;
}

@media (max-width: 900px) {
  .kanban {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .kanban {
    grid-template-columns: 1fr;
  }
}

/* CRM стажёров */
.hub-card--crm {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}

.user-bar__link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  margin-right: 0.75rem;
}

.user-bar__link:hover {
  text-decoration: underline;
}

.crm-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.crm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.crm-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.crm-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.crm-chip--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.crm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.crm-table-wrap {
  overflow-x: auto;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.crm-table th,
.crm-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.crm-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
}

.crm-row {
  cursor: pointer;
}

.crm-row:hover {
  background: #fafafa;
}

.crm-cell-comment {
  max-width: 220px;
  color: var(--text-muted);
}

.crm-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #f3f4f6;
}

.crm-badge--new { background: #e0f2fe; color: #0369a1; }
.crm-badge--contacted { background: #fef3c7; color: #b45309; }
.crm-badge--waiting_reply { background: #fee2e2; color: #b91c1c; }
.crm-badge--interview { background: #ede9fe; color: #6d28d9; }
.crm-badge--internship { background: #dbeafe; color: #1d4ed8; }
.crm-badge--suitable { background: #dcfce7; color: #15803d; }
.crm-badge--reserve { background: #f3e8ff; color: #7e22ce; }
.crm-badge--working { background: #d1fae5; color: #047857; }
.crm-badge--rejected { background: #f3f4f6; color: #6b7280; }
.crm-badge--archived { background: #e5e7eb; color: #374151; }

.crm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.crm-modal {
  background: #fff;
  border-radius: 16px;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.crm-modal__title {
  margin: 0 0 1rem;
}

.crm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.crm-form-grid,
.crm-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.form-field--full {
  grid-column: 1 / -1;
}

.crm-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.crm-day {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.crm-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.crm-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.crm-detail-save {
  margin: 1rem 0;
}

.crm-training {
  display: grid;
  gap: 0.5rem;
}

.crm-comment-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.crm-comment-form textarea {
  flex: 1;
}

.crm-comments {
  display: grid;
  gap: 0.75rem;
}

.crm-comment {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: #fafafa;
}

.crm-comment__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

@media (max-width: 768px) {
  .crm-form-grid,
  .crm-detail-grid {
    grid-template-columns: 1fr;
  }

  .crm-detail-head {
    flex-direction: column;
  }
}
