@import url("xtart.css");

.button,
.button--primary,
.button--ghost,
.button--warning,
.button--success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button:disabled { opacity: 0.4; cursor: not-allowed; }
.button--primary, .button--success { background: var(--lime); color: var(--ink); }
.button--warning { background: var(--ink); }
.button--ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.login { display: grid; }
.layout { display: grid; }
.cards { display: grid; gap: 0.8rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.cards article, .two-columns article { padding: 1rem; border-radius: 18px; background: var(--mist); }
.cards span { display: block; margin-bottom: 0.35rem; color: var(--muted); font-size: 0.76rem; text-transform: uppercase; }
.cards strong { font-size: 1.4rem; }
.section-title, .topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-title select {
  min-height: 42px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.session-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.max-control > span { display: block; margin-bottom: 0.4rem; color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.max-control > div { display: flex; align-items: center; gap: 1rem; }
.max-control button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.max-control strong { min-width: 2.5rem; text-align: center; font-size: 1.6rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.55rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.8rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
.status { display: inline-flex; padding: 0.25rem 0.55rem; border-radius: 999px; background: var(--mist); font-size: 0.74rem; font-weight: 800; }
.status--present, .status--approved { background: #eaffb0; }
.status--absent, .status--rejected { background: #ffd4d0; }
.status--excused, .status--superseded { background: #ffe7b3; }
.status--expired { background: #ecece8; }
.row-actions { display: flex; gap: 0.3rem; }
.row-actions button {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 750;
}
.two-columns { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.subject-item { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.subject-item span { display: block; color: var(--muted); }
.live-label { color: var(--ok); font-size: 0.78rem; }
.count { display: grid; width: 2.2rem; height: 2.2rem; place-items: center; border-radius: 50%; background: var(--lime); color: var(--ink); }
.request-list { display: grid; gap: 0.7rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.request-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: var(--mist);
}
.request-list span { display: block; color: var(--muted); font-size: 0.8rem; }
.request-actions { display: flex; gap: 0.4rem; }
.request-actions button { padding: 0.5rem 0.65rem; border: 0; border-radius: 999px; font-weight: 800; cursor: pointer; }
.approve { background: var(--lime); }
.reject { background: var(--danger); color: #fff; }
.stats-note, .message { color: var(--muted); }
.message--error { color: var(--danger); }
.evolution { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.warn { color: #9b1c1c; font-weight: 800; }
.eyebrow { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.xt-spark {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 92px;
  margin-top: 0.8rem;
}
.xt-spark span {
  flex: 1;
  border-radius: 8px 8px 0 0;
  background: var(--lime);
  min-height: 8px;
}
.xt-main > section.panel:not(.is-active) { display: none; }
.xt-top { margin-bottom: 0.75rem; }
#panel-message { margin: 0; min-height: 0; }
#panel-message:not(:empty) { margin: 0 0 0.7rem; min-height: 1.3rem; }
.xt-side nav a.is-active { background: transparent; color: #fff; font-weight: 750; }
.finish-btn { background: var(--ink); color: #fff; white-space: nowrap; }
.xt-side__foot .button { border-radius: 999px; background: #fff; color: var(--ink); }

.week-cal { margin-bottom: 1rem; padding: 0.85rem 0.9rem 1rem; border-radius: 22px; background: #fff; }
.week-cal__head { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; margin-bottom: 0.85rem; }
.week-cal__head h2 { margin: 0; text-align: center; font-size: 1.55rem; letter-spacing: -0.03em; text-transform: capitalize; }
.week-cal__nav {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.15rem; cursor: pointer;
}
.week-cal__nav:hover { background: var(--mist); }
.week-cal__weekdays, .week-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.45rem; }
.week-cal__weekdays { margin-bottom: 0.35rem; color: #9a9a96; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.08em; text-align: center; }
.week-cal__day { min-height: 148px; padding: 0.55rem 0.4rem; border: 2px solid #e4e4e0; border-radius: 16px; background: #fff; }
.week-cal__day.is-today { border-color: #E9FA5D; }
.week-cal__day strong { display: block; margin-bottom: 0.4rem; color: #8d8d88; font-size: 0.95rem; font-weight: 650; }
.week-cal__day.is-today strong { color: var(--ink); font-weight: 800; }
.class-chip {
  display: grid; gap: 0.12rem; margin-top: 0.28rem; padding: 0.32rem 0.42rem; border-radius: 8px;
  background: #f6d7b8; color: var(--ink); font-size: 0.68rem; line-height: 1.2;
}
.class-chip span, .class-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-chip small { color: inherit; font-weight: 700; opacity: 0.8; }
.class-chip__qr {
  display: grid; place-items: center; width: 18px; height: 18px; margin-top: 0.08rem; padding: 0;
  border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer;
}
.class-chip__qr svg { width: 11px; height: 11px; }
.class-chip__list {
  display: grid; place-items: center; width: 18px; height: 18px; margin-top: 0.08rem; padding: 0;
  border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer;
}
.class-chip__list svg { width: 11px; height: 11px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 0.9rem; }
.kpi-card { display: flex; gap: 0.8rem; align-items: flex-start; padding: 1rem 1.05rem; border-radius: 20px; background: #fff; }
.kpi-card > .kpi-card__icon { display: flex; width: 42px; height: 42px; flex: none; align-items: center; justify-content: center; border-radius: 14px; background: #f3f3f1; color: #111; }
.kpi-card--classes > .kpi-card__icon { background: #FFF651; }
.kpi-card--average > .kpi-card__icon { background: #B4FF51; }
.kpi-card--absent > .kpi-card__icon { background: #D5E664; }
.kpi-card--requests > .kpi-card__icon { background: #DEFF52; }
.kpi-card__icon svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kpi-card > div span { display: block; color: var(--muted); font-size: 0.82rem; }
.kpi-card strong { display: block; margin: 0.15rem 0; font-size: 1.85rem; letter-spacing: -0.04em; }
.kpi-card small { font-size: 0.75rem; font-weight: 700; }
.delta--up { color: #16a34a; }
.delta--down { color: #e11d48; }
.delta--flat { color: var(--muted); }

.dash-split { display: grid; grid-template-columns: 1.35fr 0.9fr; gap: 0.85rem; margin-bottom: 0.85rem; }
.dash-split--bottom { grid-template-columns: 1.25fr 0.9fr; }
.dash-card { padding: 1rem 1.05rem 1.1rem; border-radius: 22px; background: #fff; }
.dash-card__head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.85rem; }
.dash-card__head h2 { margin: 0; font-size: 0.78rem; letter-spacing: 0.06em; }
.dash-card__head span, .text-link { color: var(--muted); font-size: 0.78rem; }
.text-link { border: 0; background: none; padding: 0; cursor: pointer; }
.text-link:hover { color: var(--ink); }
.dash-empty { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.85rem; }
.next-class { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 0.9rem; align-items: center; }
.next-class__art { height: 84px; border-radius: 16px; background: radial-gradient(circle at 30% 20%, #e9fa5d 0 18%, transparent 19%), linear-gradient(145deg, #1a1a1a, #3a3a34 55%, #d6ff2a); }
.next-class h3 { margin: 0.15rem 0 0.35rem; font-size: 1.25rem; letter-spacing: -0.03em; }
.next-class__meta { margin: 0; color: var(--muted); font-size: 0.82rem; }
.start-btn { min-height: 44px; padding: 0 1rem; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; cursor: pointer; }
.start-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.risk-list { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.risk-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr) 92px auto; gap: 0.65rem; align-items: center; }
.risk-list .avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: #f3f3f1; font-size: 0.72rem; font-weight: 800; }
.risk-list strong, .risk-list small { display: block; }
.risk-list small { color: var(--muted); font-size: 0.75rem; }
.risk-meter { display: grid; justify-items: end; gap: 0.2rem; }
.risk-meter b { font-size: 0.82rem; }
.risk-meter i { display: block; width: 72px; height: 6px; border-radius: 999px; background: #eee; overflow: hidden; }
.risk-meter i span { display: block; height: 100%; border-radius: inherit; }
.risk-pill { padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-style: normal; font-weight: 750; white-space: nowrap; }
.risk-pill--high { background: #ffe1e1; color: #c81e1e; }
.risk-pill--mid { background: #ffe8d2; color: #c2410c; }
.risk-pill--low { background: #fff3c4; color: #a16207; }
.risk-pill--ok { background: #e7f8df; color: #3f7d1f; }
.today-table { width: 100%; border-collapse: collapse; }
.today-table th, .today-table td { padding: 0.7rem 0.4rem; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.84rem; }
.today-table th { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; }
.present-bar { display: flex; align-items: center; gap: 0.45rem; min-width: 110px; }
.present-bar i { flex: 1; height: 6px; border-radius: 999px; background: #eee; overflow: hidden; }
.present-bar i span { display: block; height: 100%; border-radius: inherit; background: #8fd14f; }
.present-bar i.is-mid span { background: #f5a524; }
.present-bar i.is-low span { background: #d0d0cc; }
.state-pill { display: inline-flex; align-items: center; gap: 0.3rem; color: #3f7d1f; font-size: 0.78rem; font-weight: 700; }
.state-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-pill--pending { color: #8d8d88; }
.state-pill--live { color: #65a30d; }
.row-menu { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #6f6f6c; cursor: pointer; font-size: 1.1rem; }
.trend-card, .today-card { margin-bottom: 0.85rem; }
.trend-card .dash-card__head h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.03em; }
.trend-range {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.42rem 0.85rem;
  border: 1px solid #e6e6e2; border-radius: 999px; background: #fff; color: #3a3a38;
  font-size: 0.84rem; font-weight: 650;
}
.trend-range::after { content: "⌄"; color: #6f6f6c; font-size: 0.95rem; line-height: 1; }
.trend-plot { display: grid; grid-template-columns: 3rem minmax(0, 1fr); column-gap: 0.4rem; }
.trend-y { display: flex; flex-direction: column; justify-content: space-between; height: 196px; color: var(--muted); font-size: 0.78rem; font-weight: 650; text-align: right; }
.trend-canvas { position: relative; }
.trend-x { grid-column: 2; display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 0.45rem; color: var(--muted); font-size: 0.78rem; font-weight: 650; text-align: center; }
#week-chart { width: 100%; height: 196px; display: block; }
.trend-dots { position: absolute; inset: 0; pointer-events: none; }
.trend-dots i { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: #111; }
.trend-badge { position: absolute; padding: 0.18rem 0.48rem; border-radius: 8px; background: #1c1c1c; color: #fff; font-size: 0.78rem; font-weight: 800; line-height: 1.2; pointer-events: none; }
.subject-table { width: 100%; border-collapse: collapse; background: #fff; }
.subject-table th, .subject-table td { padding: 0.85rem 0.6rem; border-bottom: 1px solid #F5F5F3; text-align: left; vertical-align: middle; }
.subject-table th { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.subject-table strong, .subject-table small { display: block; }
.subject-table small { color: var(--muted); font-size: 0.78rem; }
.text-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.text-actions .button { min-height: 36px; padding: 0.35rem 0.75rem; font-size: 0.75rem; }
.text-actions .is-danger { color: #e11d48; border-color: #fecdd3; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 1rem; background: rgba(11, 11, 11, 0.35); }
.modal[hidden] { display: none; }
.modal__card { width: min(560px, 100%); max-height: min(82vh, 760px); overflow: auto; padding: 1.2rem; border: 1px solid #F5F5F3; border-radius: 20px; background: #fff; }
.modal__card h2 { margin: 0 0 0.8rem; }
.modal__card label { display: grid; gap: 0.3rem; margin-bottom: 0.7rem; font-size: 0.85rem; font-weight: 650; }
.modal__card input, .modal__card select { min-height: 42px; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-weight: 500; }
.modal__card input[type="color"] { width: 72px; padding: 0.2rem; cursor: pointer; }
.modal__card--subject { width: min(920px, 100%); max-height: min(90vh, 960px); }
.modal__card--subject .block { margin: 0 0 1rem; padding: 1rem; border-radius: 18px; background: var(--mist); }
.modal__card--subject .block h3 { margin: 0 0 0.8rem; font-size: 0.82rem; letter-spacing: 0.06em; }
.modal__card--subject .form-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.modal__card--subject .form-grid label { margin-bottom: 0; color: var(--muted); font-size: 0.78rem; }
.modal__card--subject .check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem; }
.modal__card--subject .check input { min-height: 0; width: 18px; padding: 0; }
.schedule-row { display: grid; grid-template-columns: 1.2fr 0.8fr 0.8fr auto; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.icon-btn { display: inline-grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn--danger { color: var(--danger); }
@media (max-width: 900px) { .modal__card--subject .form-grid { grid-template-columns: 1fr; } }
.subject-name { display: flex; align-items: center; gap: 0.6rem; }
.color-swatch { display: inline-block; width: 18px; height: 18px; flex: none; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.6rem; }
.modal__card--roll { width: min(480px, 100%); }
.roll-list { display: grid; gap: 0.15rem; margin: 0.8rem 0 0; padding: 0; list-style: none; }
.roll-item { display: flex; align-items: center; gap: 0.4rem; border-bottom: 1px solid #F5F5F3; }
.roll-name { flex: 1; min-height: 44px; padding: 0.55rem 0.15rem; border: 0; background: transparent; color: #b5b5b0; font: inherit; font-size: 1rem; font-weight: 500; text-align: left; cursor: pointer; }
.roll-item--in .roll-name { color: var(--ink); font-weight: 800; }
.roll-trash { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border: 0; border-radius: 10px; background: #fff0ee; color: #e11d48; cursor: pointer; }
.roll-trash svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.roster-list { display: grid; gap: 0.15rem; margin: 0.4rem 0 0.8rem; padding: 0; list-style: none; }
.roster-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px solid #F5F5F3; }
.roster-list small { display: block; color: var(--muted); }
.help { color: var(--muted); font-size: 0.82rem; }
#roster-new { margin: 0.4rem 0 0.8rem; }
#roster-create { margin-bottom: 0.8rem; }
@media (max-width: 1100px) {
  .kpi-row, .dash-split, .dash-split--bottom, .next-class { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .cards, .two-columns { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar, .section-title, .session-controls { flex-direction: column; align-items: stretch; }
  .actions { justify-content: stretch; }
  .actions .button { flex: 1; }
}
