/* Вёрстка повторяет ЛК студента РАНХиГС (размеры и цвета сняты 2026-11-05 из живого ЛК),
   см. docs/decisions/0004-web-shell.md. Цвета вынесены в переменные — при смене дизайна
   правится :root. */
:root {
  --bg: #f6f5f9;
  --surface: #fff;
  --text: #171520;
  --muted: #717486;
  --line: #eaeaed;
  --accent: #df2935;
  --accent-soft: #fdecee;
  --blue: #447abc;
  --blue-soft: #ecf2f9;
  --green: #3ba55c;
  --orange: #e3832b;
  --violet: #7a5bc4;
  --violet-soft: #f1edfa;
  --menu-w: 248px;
  --radius: 8px;
  --radius-l: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 Manrope, system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
button { font: inherit; cursor: pointer; }
.ico { flex: none; display: block; }
.muted { color: var(--muted); }
small { font-size: 12px; }

.concept-bar {
  background: var(--text); color: #fff; font-size: 12px; text-align: center; padding: 4px 16px;
  position: relative; z-index: 30;
}

/* --- каркас --- */
.layout { display: flex; min-height: calc(100vh - 26px); }
.menu {
  width: var(--menu-w); flex: none; background: var(--surface); padding: 16px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line);
}
.menu__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; min-height: 42px; }
.menu__close { display: none; cursor: pointer; padding: 6px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; }
.wordmark__mark {
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; width: 38px; height: 38px;
  border-radius: 19px 3px; display: grid; place-items: center;
}
.wordmark__text { font-weight: 700; font-size: 13px; line-height: 1.1; text-transform: uppercase; letter-spacing: .02em; }
.wordmark__text small { font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.menu__link {
  display: flex; align-items: center; gap: 8px; padding: 16px; border-radius: 10px; color: var(--text);
  list-style: none; cursor: pointer;
}
.menu__link::-webkit-details-marker { display: none; }
.menu__link .ico:first-child { color: var(--muted); }
.menu__link span { flex: 1; }
.menu__link:hover, .menu__link--active { color: var(--accent); }
.menu__link:hover .ico, .menu__link--active .ico { color: var(--accent); }
.menu__group[open] > summary .ico:last-child { transform: rotate(180deg); }
.menu__sub { padding: 4px 0 8px 44px; display: flex; flex-direction: column; }
.menu__sublink { padding: 10px 0; color: var(--text); }
.menu__sublink:hover, .menu__sublink--active { color: var(--accent); }
.menu-backdrop { display: none; }

.layout__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header {
  background: var(--surface); padding: 16px 32px; min-height: 82px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}
.header__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header__burger { display: none; cursor: pointer; }
.header__title { font-size: 20px; font-weight: 600; }
.header__right { display: flex; align-items: center; gap: 16px; }
.header__bell { color: var(--text); }
.header__user { display: flex; align-items: center; gap: 8px; }
.header__name { font-size: 12px; font-weight: 600; }
.header__logout button { background: none; border: 0; color: var(--muted); padding: 4px; }
.header__logout button:hover { color: var(--accent); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700;
}
.avatar--big { width: 64px; height: 64px; font-size: 24px; }
.breadcr { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.breadcr a { color: var(--text); }
.breadcr .ico { color: var(--muted); }

.main { padding: 32px; flex: 1; }

/* --- главная --- */
.dashboard { display: grid; grid-template-columns: minmax(0, 820px) 300px; gap: 24px; justify-content: center; }
.dashboard__col { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.dashboard__row { display: grid; gap: 24px; }
.dashboard__row--feed { grid-template-columns: 1.23fr 1fr; }
.dashboard__row--grades { grid-template-columns: 1.5fr 1fr; gap: 12px; }
.dashboard__row--two { grid-template-columns: 1fr 1fr; gap: 12px; }
.dashboard__stack { display: flex; flex-direction: column; gap: 12px; }
.dashboard__aside { display: flex; flex-direction: column; gap: 12px; }
.dash-block { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-block__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dash-title { font-size: 24px; line-height: 28px; font-weight: 600; }
.dash-link { color: var(--accent); }
.dash-link--off { color: var(--line); }

.feed-slide {
  height: 288px; border-radius: var(--radius-l); padding: 16px; color: #fff; position: relative;
  background: linear-gradient(140deg, #2b2440 0%, #5a2a3a 55%, #df2935 130%);
  display: flex; flex-direction: column; gap: 8px;
}
.feed-slide__badge { font-size: 11px; text-transform: uppercase; opacity: .7; }
.feed-slide__title { font-size: 20px; line-height: 24px; font-weight: 600; max-width: 90%; }
.feed-slide__counter { position: absolute; left: 16px; bottom: 16px; font-size: 12px; }
.events { display: flex; flex-direction: column; gap: 12px; }
.event-card { display: flex; background: var(--surface); border-radius: var(--radius); overflow: hidden; min-height: 138px; }
.event-card__img { width: 40%; flex: none; }
.event-card__img--a { background: linear-gradient(135deg, #447abc, #7a5bc4); }
.event-card__img--b { background: linear-gradient(135deg, #e3832b, #df2935); }
.event-card__body { padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.event-card__title { font-size: 16px; line-height: 22px; font-weight: 600; }
.event-card__meta { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }

.box { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.box__title { font-size: 16px; line-height: 22px; font-weight: 600; }
.box__note { font-size: 12px; color: var(--muted); }
.skeleton-bars { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; }
.skeleton-bars span { height: 20px; border-radius: 6px; background: linear-gradient(90deg, #f3d4d7, #f8e7e9); }
.gauge {
  width: 160px; height: 80px; margin: 8px auto 0; border-radius: 160px 160px 0 0;
  border: 14px solid var(--line); border-bottom: 0; display: grid; place-items: end center;
}
.gauge span { font-size: 28px; font-weight: 600; }

.ref-card { background: var(--surface); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.ref-card__title { font-weight: 600; }
.ref-card__date { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ref-card--empty .ref-card__date { color: var(--accent); }

.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.service { background: var(--surface); border-radius: var(--radius); padding: 12px; display: flex; align-items: center; gap: 8px; min-height: 52px; }
.service__logo { width: 28px; height: 28px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }

/* --- расписание: шапка дня и карточки занятий --- */
.day-widget { display: flex; flex-direction: column; gap: 12px; }
.day-header { background: var(--surface); border-radius: var(--radius-l); padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; }
.day-header__month { font-size: 12px; font-weight: 500; color: var(--muted); text-align: center; }
.day-header__nav { display: flex; align-items: center; gap: 8px; }
.day-header__btn { color: var(--muted); padding: 3px 0; }
.day-header__week { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); }
.weekday { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.weekday__name { font-size: 12px; font-weight: 500; color: var(--muted); line-height: 14px; }
.weekday__num { font-size: 14px; font-weight: 600; padding: 2px 7px; border-radius: 6px; border: 1px solid transparent; min-width: 26px; text-align: center; }
.weekday--today .weekday__num { border-color: var(--accent); }
.weekday--active .weekday__num { background: var(--accent); color: #fff; border-color: var(--accent); }
.weekday__dot { width: 4px; height: 4px; border-radius: 50%; }
.weekday__dot--on { background: var(--accent); }

.lesson-card { background: var(--surface); border-radius: var(--radius-l); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.lesson-card--empty { color: var(--muted); text-align: center; padding: 24px 16px; }
.lesson-card--cancelled { opacity: .6; }
.lesson-card--cancelled .lesson-card__title { text-decoration: line-through; }
.lesson-card__title { font-size: 16px; line-height: 26px; font-weight: 600; }
.lesson-card__details { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lesson-card__details li { display: flex; gap: 6px; align-items: flex-start; }
.lesson-card__details .ico { color: var(--muted); margin-top: 2px; }
.lesson-card__teacher { color: var(--accent); }
.lesson-card__teacher span { text-decoration: underline; text-underline-offset: 2px; }
.lesson-card__muted { color: var(--muted); font-size: 12px; }
.lesson-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lesson-card__time { font-size: 14px; line-height: 20px; }
.lesson-card__group summary { cursor: pointer; color: var(--blue); font-size: 13px; }
.lesson-card__sub { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.lesson-card__subtitle { font-weight: 600; }
.work-type {
  border: 1px solid var(--blue); background: var(--blue-soft); color: var(--blue); border-radius: 16px;
  padding: 2px 8px; font-weight: 500; text-align: center; min-width: 140px;
}
.work-type--lecture { border-color: var(--violet); background: var(--violet-soft); color: var(--violet); }
.work-type--exam { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.work-type--consult { border-color: var(--green); background: #eaf6ee; color: #2c7d45; }

/* --- внутренние страницы --- */
.page { max-width: 1144px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page--narrow { max-width: 1094px; }
.page__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page__note { font-size: 12px; color: var(--muted); }
.title-1 { font-size: 48px; line-height: 1; font-weight: 600; }
.title-2 { font-size: 32px; line-height: 1.15; font-weight: 600; }
.panel { background: var(--surface); border-radius: var(--radius-l); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.panel--accent { border-left: 4px solid var(--accent); }
.panel__title { font-size: 20px; font-weight: 600; }

.week-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-nav__btn { background: var(--surface); border-radius: 8px; padding: 8px; }
.week-nav__label { font-weight: 600; min-width: 220px; text-align: center; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; align-items: start; }
.week-day { display: flex; flex-direction: column; gap: 12px; }
.week-day__title { font-size: 18px; font-weight: 600; display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; font-weight: 700; font-size: 14px;
  padding: 11px 19px; border-radius: 28px 3px; line-height: 21px;
}
.btn--primary { background: linear-gradient(90deg, #df2935, #ef4b4b); color: #fff; }
.btn--primary:hover { background: #c41f2b; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn--wide { width: 100%; justify-content: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; font-size: 12px; text-align: left; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); color: var(--text); }
.icon-btn--off { color: #b9b9bc; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; color: #fff; background: var(--muted); }
.badge--green { background: var(--green); }
.badge--red { background: var(--accent); }
.badge--orange { background: var(--orange); }
.badge--grey { background: #e3e3e8; color: var(--muted); }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; vertical-align: middle; }
.tag--red { background: var(--accent-soft); color: var(--accent); }

.alert { background: var(--surface); border-radius: var(--radius); padding: 12px 16px; border-left: 4px solid var(--muted); }
.alert--accent { background: var(--accent-soft); border-left-color: var(--accent); font-weight: 500; }
.alert--error { background: var(--accent-soft); border-left-color: var(--accent); }
.alert--ok { border-left-color: var(--green); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; text-align: left; padding: 12px 24px; }
.table td { padding: 16px 24px; border-top: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table__num { color: var(--accent); font-weight: 500; }
.table__paper { color: var(--muted); font-size: 12px; text-align: center; }

.form { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field--short { max-width: 240px; }
.field__label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field__input {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); width: 100%;
}
.field__input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.radio-list { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.radio { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.radio input { accent-color: var(--accent); margin-top: 4px; }

.props { display: grid; grid-template-columns: 220px 1fr; gap: 10px 16px; margin: 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.profile__head { display: flex; gap: 16px; align-items: center; }
.profile__name { font-size: 20px; font-weight: 600; }
.dean-msg { background: var(--bg); border-radius: 8px; padding: 12px 16px; white-space: pre-line; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: flex; gap: 16px; }
.timeline__date { color: var(--muted); font-size: 12px; min-width: 110px; padding-top: 2px; }
.stub { align-items: flex-start; }
.stub__text { font-size: 16px; }

/* --- вход --- */
.login { min-height: calc(100vh - 26px); display: grid; place-items: center; padding: 16px; }
.login__card { background: var(--surface); border-radius: var(--radius-l); padding: 32px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.wordmark--big { margin-bottom: 8px; }
.login__title { font-size: 24px; }
.login__hint { font-size: 12px; color: var(--muted); }

/* --- нижняя панель (мобильная) --- */
.tabbar { display: none; }

@media (max-width: 1240px) {
  .dashboard { grid-template-columns: minmax(0, 1fr) 300px; }
  .services { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1023px) {
  .menu {
    position: fixed; left: 0; top: 0; z-index: 40; height: 100vh; transform: translateX(-100%);
    transition: transform .2s; width: min(300px, 85vw);
  }
  .menu__close, .header__burger { display: block; }
  .menu-toggle:checked ~ .layout .menu { transform: none; }
  .menu-toggle:checked ~ .layout .menu-backdrop { display: block; position: fixed; inset: 0; background: rgba(23, 21, 32, .4); z-index: 35; }
  .header { padding: 12px 16px; min-height: 60px; }
  .header__title { font-size: 16px; }
  .main { padding: 16px 16px 88px; }
  .dashboard { grid-template-columns: 1fr; }
  .dashboard__aside { order: -1; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-radius: 12px 12px 0 0; box-shadow: 0 -2px 12px rgba(23, 21, 32, .08); padding: 6px 4px;
  }
  .tabbar__link { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
  .tabbar__link--active { color: var(--accent); }
  .title-1 { font-size: 32px; }
}
@media (max-width: 640px) {
  .dashboard__row--feed, .dashboard__row--grades, .dashboard__row--two { grid-template-columns: 1fr; }
  .feed-slide { height: 200px; }
  .header__name { display: none; }
  .title-1 { font-size: 28px; }
  .panel { padding: 16px; }
  .week-grid { grid-template-columns: 1fr; }
  .props { grid-template-columns: 1fr; gap: 2px; }
  .props dd { margin-bottom: 8px; }
  /* таблица справок превращается в карточки */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-top: 1px solid var(--line); padding: 12px 0; }
  .table td { border: 0; padding: 4px 0 !important; display: flex; gap: 12px; justify-content: space-between; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; max-width: 45%; }
  .table__paper { text-align: right; }
  .week-nav__label { min-width: 0; }
}
