:root {
  --bg: #0b0c10;
  --card: #171a24;
  --line: rgba(244, 239, 230, 0.1);
  --text: #f4efe6;
  --muted: #9a9286;
  --accent: #ff7a1a;
  --danger: #ff6b88;
  --ok: #3ee0a0;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: radial-gradient(1200px 500px at 100% -10%, rgba(255,122,26,.18), transparent 55%), #0b0c10;
  color: var(--text);
  font-family: Vazirmatn, Tahoma, sans-serif;
}
body.menu-open { overflow: hidden; }
img, video { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; }
h1 { font-size: clamp(22px, 6vw, 32px); line-height: 1.4; margin: 12px 0; }
h2 { font-size: clamp(16px, 4.5vw, 22px); line-height: 1.4; }
.wrap { width: min(980px, 100%); margin: 0 auto; padding: 16px 12px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-top: 16px; color: var(--text); }
.session-pick {
  display: block;
  width: 100%;
  text-align: right;
  color: var(--text);
  background: #12141c;
  cursor: pointer;
  font-family: inherit;
}
.session-pick b { color: var(--text); font-size: 18px; }
.session-pick .muted { color: #c9c2b6; }
.session-pick.is-on { outline: 2px solid var(--accent); }
.session-pick:disabled { opacity: .45; cursor: not-allowed; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  min-height: 44px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.btn-p { background: var(--accent); color: #1a0d04; }
.btn-g { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-d { background: var(--danger); color: #fff; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.split { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.grow { flex: 1 1 180px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.page-head h1 { margin: 0; }
input, select { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #12141c; color: var(--text); font-family: inherit; min-height: 44px; }
label { display: block; margin-top: 12px; font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }
.err { background: rgba(255,107,136,.12); color: var(--danger); padding: 10px; border-radius: 12px; }
.ok { background: rgba(62,224,160,.12); color: var(--ok); padding: 10px; border-radius: 12px; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.06); }
.grid { display: grid; gap: 12px; }
.grid-2, .grid-3 { grid-template-columns: 1fr; }
img.avatar { width: 112px; height: 112px; object-fit: cover; border-radius: 24px; }
.session-cells { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 10px; }
.session-cell {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid #6f6a62;
  background: #2a2e3a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 800;
  color: #f4efe6;
}
.session-cell.is-present { background: var(--ok); border-color: var(--ok); color: #0b0c10; }
.session-cell.is-unexcused { background: var(--danger); border-color: var(--danger); }
.session-cell.is-excused { background: #8b909c; border-color: #8b909c; }
.session-cell.is-makeup:not(.is-present):not(.is-unexcused):not(.is-excused) {
  outline: 1px dashed #c9c2b6;
  outline-offset: 2px;
}
.session-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.session-legend .session-cell { width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; outline: none; font-size: 0; }
.weekdays { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.weekdays label { display: flex; align-items: center; gap: 6px; width: auto; margin: 0; color: var(--text); }
.weekdays input { width: auto; min-height: 18px; }
.date-row { align-items: stretch; }
.date-row input, .date-row select { flex: 1 1 28%; width: auto; min-width: 0; }
.date-row .btn { flex: 1 1 100%; }

.topbar { display: flex; align-items: center; justify-content: flex-start; gap: 12px; }
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 18px; }
.burger {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #12141c;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  flex-shrink: 0;
}
.burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 40;
}
.drawer-backdrop[hidden] { display: none !important; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(86vw, 320px);
  height: 100%;
  background: #12141c;
  border-left: 1px solid var(--line);
  z-index: 50;
  transform: translateX(110%);
  transition: transform .25s ease;
  padding: 20px 16px;
  overflow-y: auto;
}
body.menu-open .drawer { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.drawer-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}
.drawer-nav { display: flex; flex-direction: column; gap: 8px; }
.drawer-nav a,
.drawer-nav button {
  display: flex;
  width: 100%;
  text-align: right;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  min-height: 48px;
  align-items: center;
}
.drawer-nav form { margin: 0; }

@media (min-width: 720px) {
  .wrap { padding: 24px 16px 48px; }
  .card { padding: 20px; border-radius: 24px; }
  .grid-2 { grid-template-columns: 160px 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .date-row .btn { flex: 0 0 auto; }
  .actions-row .btn { flex: 1 1 auto; }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 719px) {
  .actions-row .btn { flex: 1 1 100%; }
  .split { align-items: stretch; }
  .split > .btn, .split > a.btn { width: 100%; }
  img.avatar { width: 88px; height: 88px; }
}
