/* =====================================================================
   TEAM MDC : design épuré, inspiré d'Apple. Mobile d'abord.
   ===================================================================== */

:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --card: #ffffff;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-strong: rgba(120, 120, 128, 0.2);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-press: #0062c4;
  --red: #ff3b30;
  --orange: #ff9500;
  --green: #30b350;
  --purple: #af52de;
  --blur: rgba(250, 250, 252, 0.78);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.18);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --fill: rgba(120, 120, 128, 0.24);
    --fill-strong: rgba(120, 120, 128, 0.36);
    --text: #f5f5f7;
    --muted: #98989d;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #2997ff;
    --accent-press: #0a84ff;
    --red: #ff453a;
    --orange: #ff9f0a;
    --green: #30d158;
    --purple: #bf5af2;
    --blur: rgba(28, 28, 30, 0.78);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body.no-scroll {
  overflow: hidden;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}
.icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
}
.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.center {
  text-align: center;
}
.pad {
  padding: 18px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.link {
  color: var(--accent);
}
.link:hover {
  text-decoration: underline;
}

/* ---------- Structure ---------- */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px calc(120px + env(safe-area-inset-bottom));
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: calc(30px + env(safe-area-inset-top)) 0 14px;
}
.page-head h1 {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.page-head.sub {
  padding-bottom: 10px;
}
.subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 6px -4px;
  color: var(--accent);
  font-size: 16px;
}
.section-title {
  margin: 26px 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.footnote {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Cartes & listes ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.list {
  overflow: hidden;
  margin-bottom: 16px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 56px;
}
.row + .row {
  border-top: 1px solid var(--line);
}
.link-row {
  cursor: pointer;
}
.link-row:hover {
  background: var(--fill);
}
.link-row > .icon:last-child {
  color: var(--muted);
}
.row-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  flex: none;
}
.row-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.row-text small {
  color: var(--muted);
  font-size: 13px;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.profile-info strong {
  font-size: 19px;
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6cb4ff, var(--accent));
  color: #fff;
  font-weight: 600;
  font-size: 22px;
}
.avatar.sm {
  width: 40px;
  height: 40px;
  font-size: 15px;
}
.badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 980px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.badge.warn {
  background: color-mix(in srgb, var(--orange) 16%, transparent);
  color: var(--orange);
}
.badge.muted {
  background: var(--fill);
  color: var(--muted);
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:hover {
  background: var(--accent-press);
}
.btn:active {
  transform: scale(0.98);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: default;
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn.secondary {
  background: var(--fill);
  color: var(--text);
}
.btn.secondary:hover {
  background: var(--fill-strong);
}
.btn.danger {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  color: var(--red);
}
.btn.danger:hover {
  background: color-mix(in srgb, var(--red) 20%, transparent);
}
.btn.danger-fill {
  background: var(--red);
}
.btn.small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 14px;
}
.btn-row {
  display: flex;
  gap: 10px;
}
.btn-row > .btn {
  flex: 1;
}
.btn-row.wrap {
  flex-wrap: wrap;
}
.btn-row.wrap > .btn {
  flex: 0 1 auto;
}
.link-btn {
  background: none;
  border: 0;
  padding: 10px;
  color: var(--accent);
  font-size: 15px;
}
.center-btn {
  display: block;
  margin: 18px auto 0;
}
.round-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform 0.1s, background 0.15s;
}
.round-btn:hover {
  background: var(--accent-press);
}
.round-btn:active {
  transform: scale(0.94);
}
.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--muted);
}
.icon-btn:hover {
  background: var(--fill-strong);
}
.danger-ic {
  color: var(--red);
  background: transparent;
}
.danger-ic:hover {
  background: color-mix(in srgb, var(--red) 12%, transparent);
}

/* ---------- Formulaires ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  margin-left: 2px;
}
.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 16px; /* évite le zoom automatique sur iOS */
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input {
  resize: vertical;
  min-height: 96px;
  line-height: 1.4;
}
.input::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5l4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  text-overflow: ellipsis;
}
.select.compact {
  min-height: 36px;
  width: auto;
  padding: 6px 30px 6px 12px;
  font-size: 14px;
}
.input-wrap {
  position: relative;
}
.input.has-action {
  padding-right: 92px;
}
.input-action {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 8px 10px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 14px;
}
.form-error,
.form-msg {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
}
.form-error,
.form-msg.error {
  background: color-mix(in srgb, var(--red) 11%, transparent);
  color: var(--red);
}
.form-msg.ok {
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green);
}
.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- Écrans d'authentification ---------- */
.auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
}
.auth-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.brand-name {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.auth-title {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
}
.auth-sub {
  margin-top: -8px;
  color: var(--muted);
  text-align: center;
  font-size: 16px;
}
.auth-foot {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.status-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.status-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
}
.status-icon.bad {
  background: color-mix(in srgb, var(--red) 13%, transparent);
  color: var(--red);
}
.steps {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
}
.step-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.info-row .badge {
  margin: 0;
}

/* ---------- Agenda ---------- */
.seg {
  display: flex;
  padding: 2px;
  border-radius: 10px;
  background: var(--fill);
  gap: 2px;
}
.seg button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
}
.seg button[aria-pressed='true'] {
  background: var(--card);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}
@media (prefers-color-scheme: dark) {
  .seg button[aria-pressed='true'] {
    background: #636366;
  }
}
.seg.scroll {
  overflow-x: auto;
  scrollbar-width: none;
}
.seg.scroll::-webkit-scrollbar {
  display: none;
}
.count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--fill-strong);
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}
.count.hot {
  background: var(--red);
  color: #fff;
}
.chips {
  display: flex;
  gap: 8px;
  margin: 14px -20px 0;
  padding: 0 20px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.chip[aria-pressed='true'] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.filter-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.filter-row .select {
  min-height: 40px;
  padding: 8px 32px 8px 12px;
  font-size: 14px;
}
.group {
  margin-top: 24px;
}
.group-title {
  margin: 0 4px 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}
.group.today .group-title {
  color: var(--accent);
}
.group.overdue .group-title {
  color: var(--red);
}
.cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.item {
  padding: 16px 18px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.item:hover {
  box-shadow: var(--shadow), 0 8px 28px rgba(0, 0, 0, 0.06);
}
.item:active {
  transform: scale(0.992);
}
.item.muted-card {
  opacity: 0.6;
}
.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.when {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.when.late {
  color: var(--red);
}
.item-title {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.item-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}
.item-foot {
  margin-top: 14px;
}
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 980px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.t-devoir {
  --c: var(--accent);
}
.t-exam {
  --c: var(--red);
}
.t-date {
  --c: var(--purple);
}
.status-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 32px;
  padding: 4px 30px 4px 14px;
  border: 0;
  border-radius: 980px;
  background-color: var(--fill);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5l4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.status-select.s-doing {
  background-color: color-mix(in srgb, var(--orange) 16%, transparent);
  color: var(--orange);
}
.status-select.s-done {
  background-color: color-mix(in srgb, var(--green) 16%, transparent);
  color: var(--green);
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 56px 24px;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--muted);
}
.empty h3 {
  font-size: 19px;
  font-weight: 600;
}

/* ---------- Détail ---------- */
.detail-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-title {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.detail-date {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text);
}
.detail-date .icon {
  margin-top: 2px;
  color: var(--accent);
}
.detail-desc {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--fill);
  font-size: 15px;
}
.detail-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.action-list {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--fill);
  overflow: hidden;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  min-height: 56px;
}
.action-row + .action-row {
  border-top: 1px solid var(--line);
}
.action-row:hover {
  background: var(--fill);
}
.action-row > .icon:last-child {
  color: var(--muted);
}
.action-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--card);
  color: var(--accent);
  flex: none;
}
.action-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.action-text small {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Feuille modale ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.22s;
}
.overlay.open {
  background: rgba(0, 0, 0, 0.38);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.sheet {
  width: 100%;
  max-width: 540px;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: 26px 26px 0 0;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateY(40px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s;
  padding-bottom: env(safe-area-inset-bottom);
}
.overlay.open .sheet {
  transform: none;
  opacity: 1;
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
  background: var(--bg);
}
.sheet-head h2 {
  font-size: 17px;
  font-weight: 600;
}
.sheet-body {
  padding: 4px 20px 24px;
}
.sheet .input,
.sheet .select {
  background: var(--card);
}
@media (min-width: 640px) {
  .overlay {
    align-items: center;
  }
  .sheet {
    border-radius: 26px;
    max-height: 86dvh;
  }
}

/* ---------- Barre d'onglets ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--blur);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 86px;
  padding: 7px 14px 6px;
  border-radius: 22px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.tab[aria-current='page'] {
  background: var(--fill);
  color: var(--accent);
}
.tab-icon {
  position: relative;
  display: inline-flex;
}
.tab-badge {
  position: absolute;
  top: -4px;
  right: -9px;
  min-width: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 460px);
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(40, 40, 42, 0.94);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transform: translate(-50%, -20px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.toast-action {
  border: 0;
  background: none;
  color: #6cb4ff;
  font-weight: 600;
  padding: 0;
}

/* ---------- Administration ---------- */
.admin-body {
  margin-top: 16px;
}
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.member-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 160px;
  gap: 2px;
}
.member-info .muted {
  overflow-wrap: anywhere;
}
.badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.badges .badge {
  margin: 0;
}
.member-actions {
  display: flex;
  gap: 8px;
}
.member-actions.inline {
  align-items: center;
}
.member .member-actions {
  width: 100%;
  justify-content: flex-end;
}
.member-row .member-info {
  min-width: 0;
}
.code-box {
  padding: 14px;
  border-radius: 12px;
  background: var(--fill);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  user-select: all;
}
.add-subject {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}
.add-subject .select {
  width: auto;
}
.subject-row {
  gap: 10px;
}
.subject-name {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: 16px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
  margin: 0;
}
.slider {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--fill-strong);
  transition: background 0.2s;
}
.slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.switch input:checked + .slider {
  background: var(--green);
}
.switch input:checked + .slider::after {
  transform: translateX(20px);
}
.switch input:focus-visible + .slider {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .tab {
    min-width: 72px;
    padding: 7px 10px 6px;
  }
  .two-cols {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
