/* ═══════════════════════════════════════════════════════════════
   MŠ Docházka — Front Portal CSS  (redesign v5)
   Moderní, přehledné, plně responzivní UI
   Zachovány všechny původní CSS třídy
═══════════════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────────────── */
:root {
  --msd-bg:          #f1f5f9;
  --msd-card:        #ffffff;
  --msd-text:        #0f172a;
  --msd-muted:       #64748b;
  --msd-border:      #e2e8f0;
  --msd-brand:       #e73c6b;
  --msd-brand-2:     #f472b6;
  --msd-brand-light: #fce7f3;
  --msd-accent:      #3b82f6;
  --msd-accent-light:#eff6ff;
  --msd-success:     #22c55e;
  --msd-warning:     #f59e0b;
  --msd-danger:      #ef4444;
  --msd-shadow:      0 4px 24px rgba(15,23,42,.09);
  --msd-shadow-soft: 0 2px 10px rgba(15,23,42,.05);
  --msd-shadow-lg:   0 12px 40px rgba(15,23,42,.13);
  --msd-radius:      18px;
  --msd-radius-sm:   10px;
  --msd-radius-lg:   24px;
  --msd-transition:  .18s ease;
  font-size: 15px;
}

/* ── Base ───────────────────────────────────────────────────── */
body { background: var(--msd-bg); }

.msd-shell {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
  color: var(--msd-text);
  font-family: inherit;
}

/* ── Portal header ──────────────────────────────────────────── */
.msd-header {
  background: linear-gradient(135deg, #fff 0%, #f8fbff 100%);
  border: 1px solid var(--msd-border);
  border-radius: var(--msd-radius-lg);
  padding: 28px 32px;
  box-shadow: var(--msd-shadow-soft);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.msd-header::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231,60,107,.08) 0%, transparent 70%);
  pointer-events: none;
}
.msd-header h1 {
  margin: 0 0 4px;
  font-size: clamp(22px, 4vw, 36px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.02em;
}
.msd-header p { margin: 0; color: var(--msd-muted); font-size: 14px; }
.msd-header-text h1 { margin: 0; }
.msd-header-text p  { margin: 4px 0 0; }

/* ── Cards & boxes ──────────────────────────────────────────── */
.msd-stat,
.msd-login-card,
.msd-child-card,
.msd-box,
.msd-bulk {
  background: var(--msd-card);
  border: 1px solid var(--msd-border);
  border-radius: var(--msd-radius);
  box-shadow: var(--msd-shadow-soft);
}
.msd-box { padding: 22px 24px; }
.msd-bulk { padding: 20px; margin: 18px 0; }

/* ── Stat cards ─────────────────────────────────────────────── */
.msd-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.msd-stat {
  padding: 18px 20px;
  transition: transform var(--msd-transition), box-shadow var(--msd-transition);
}
.msd-stat:hover { transform: translateY(-2px); box-shadow: var(--msd-shadow); }
.msd-stat span   { display: block; color: var(--msd-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.msd-stat strong { display: block; font-size: 32px; font-weight: 800; line-height: 1.1; margin-top: 6px; color: var(--msd-text); }
.msd-stat small  { display: block; margin-top: 4px; color: var(--msd-muted); font-size: 12px; }

/* ── Buttons ────────────────────────────────────────────────── */
.msd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--msd-brand-2), var(--msd-brand));
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(231,60,107,.25);
  text-decoration: none;
  transition: opacity var(--msd-transition), transform var(--msd-transition), box-shadow var(--msd-transition);
  white-space: nowrap;
  line-height: 1.3;
}
.msd-btn:hover    { opacity: .92; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(231,60,107,.3); }
.msd-btn:active   { transform: translateY(0); }
.msd-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.msd-btn-full     { width: 100%; justify-content: center; padding: 13px 0 !important; font-size: 15px !important; border-radius: 12px !important; }

.msd-btn-light {
  background: #fff;
  color: var(--msd-text);
  border: 1.5px solid var(--msd-border);
  box-shadow: none;
}
.msd-btn-light:hover { background: #f8fafc; border-color: #cbd5e1; box-shadow: none; }

.msd-btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 9px;
}

/* ── Login card ─────────────────────────────────────────────── */
.msd-login-card {
  padding: 32px 36px;
  max-width: 480px;
  margin: 28px auto;
}

/* ── Section headings ───────────────────────────────────────── */
.msd-child-head,
.msd-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.msd-child-head h2,
.msd-section-head h3 { margin: 0; font-size: 22px; font-weight: 800; }
.msd-meta { margin: 4px 0 0; color: var(--msd-muted); font-size: 13px; }

/* ── Forms ──────────────────────────────────────────────────── */
.msd-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.msd-form-grid label,
.msd-bulk label {
  font-size: 13px;
  font-weight: 600;
  color: var(--msd-text);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.msd-form-grid input,
.msd-form-grid select,
.msd-form-grid textarea,
.msd-bulk input,
.msd-bulk select,
.msd-inline-form input {
  width: 100%;
  margin-top: 4px;
  border: 1.5px solid var(--msd-border);
  border-radius: 10px;
  padding: 10px 13px;
  background: #f8fafc;
  font-size: 14px;
  font-family: inherit;
  color: var(--msd-text);
  transition: border-color var(--msd-transition), box-shadow var(--msd-transition), background var(--msd-transition);
  outline: none;
}
.msd-form-grid input:focus,
.msd-form-grid select:focus,
.msd-form-grid textarea:focus,
.msd-bulk input:focus,
.msd-bulk select:focus,
.msd-inline-form input:focus {
  border-color: var(--msd-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  background: #fff;
}
.msd-form-grid .full { grid-column: 1 / -1; }
.msd-form-grid textarea { min-height: 100px; resize: vertical; }

/* ── Calendar ───────────────────────────────────────────────── */
.msd-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  background: linear-gradient(180deg, #f8fbff, #f1f5fb);
  border: 1px solid var(--msd-border);
  border-radius: 22px;
  padding: 14px;
}
.msd-dow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--msd-muted);
  font-weight: 700;
  padding: 4px 2px;
  text-align: center;
}
.msd-day {
  min-height: 96px;
  border: 1.5px solid #dde8f5;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
  transition: transform var(--msd-transition), box-shadow var(--msd-transition), border-color var(--msd-transition);
  overflow: hidden;
  cursor: pointer;
}
.msd-day:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15,23,42,.09);
  border-color: #b6cfe8;
}
.msd-empty {
  background: transparent;
  border-style: dashed;
  border-color: #e2e8f0;
  opacity: .4;
  cursor: default;
}
.msd-empty:hover { transform: none; box-shadow: none; }
.msd-day-num { font-size: 17px; font-weight: 800; line-height: 1; }
.msd-day.is-today {
  outline: 2px solid rgba(231,60,107,.25);
  box-shadow: 0 8px 24px rgba(231,60,107,.1);
  border-color: #f9a8d4;
}
.msd-day.is-selected {
  border-color: var(--msd-brand);
  box-shadow: 0 10px 28px rgba(231,60,107,.18);
}
.msd-day-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}
.msd-day small {
  font-size: clamp(8px, 1.6cqi, 11px);
  color: var(--msd-muted);
  display: block;
  line-height: 1.3;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Attendance badges ──────────────────────────────────────── */
.msd-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: clamp(8px, 1.8cqi, 12px);
  font-weight: 700;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
.status-full_day     { background: #dcfce7; color: #14532d; }
.status-morning      { background: #fef9c3; color: #713f12; }
.status-afternoon    { background: #ffedd5; color: #7c2d12; }
.status-absent       { background: #fee2e2; color: #991b1b; }
.status-late_absent  { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.status-waitlist     { background: #fef3c7; color: #92400e; }

/* ── Occupancy pill ─────────────────────────────────────────── */
.msd-occupancy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 10px;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

/* ── Replacement badge ──────────────────────────────────────── */
.msd-replacement {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 12px;
}

/* ── Modal ──────────────────────────────────────────────────── */
.msd-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.msd-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(6px);
}
.msd-modal-card {
  position: relative;
  z-index: 2;
  max-width: 680px;
  width: 100%;
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--msd-shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.msd-close {
  position: absolute;
  top: 14px; right: 14px;
  border: 1.5px solid var(--msd-border);
  background: #f8fafc;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--msd-muted);
  transition: background var(--msd-transition), color var(--msd-transition);
  flex-shrink: 0;
}
.msd-close:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* ── New pill modal ─────────────────────────────────────────── */
.msd-modal-card-new {
  width: min(560px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  z-index: 2;
  background: #fff;
  box-shadow: var(--msd-shadow-lg);
}
.msd-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid #f0f4f8;
  flex-shrink: 0;
}
.msd-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--msd-text); }
.msd-modal-head .msd-close {
  position: static;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--msd-border);
  background: #f8fafc;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--msd-muted);
}
.msd-modal-body-new {
  padding: 18px 24px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Modal sections ─────────────────────────────────────────── */
.msd-mdl-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--msd-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 8px;
}
.msd-mdl-hint {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 0 0 8px;
  line-height: 1.5;
}
.msd-mdl-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.msd-mdl-textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--msd-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  background: #f8fafc;
  color: var(--msd-text);
  transition: border-color var(--msd-transition), box-shadow var(--msd-transition);
  box-sizing: border-box;
}
.msd-mdl-textarea:focus { border-color: var(--msd-accent); box-shadow: 0 0 0 3px rgba(59,130,246,.1); background: #fff; }
.msd-mdl-repl-section {
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: 12px;
  padding: 12px 14px;
}
.msd-mdl-repl-section .msd-mdl-label { color: #92400e; }
.msd-mdl-repl-section .msd-mdl-hint  { color: #b45309; }
.msd-mdl-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 4px;
  border-top: 1px solid #f0f4f8;
  margin-top: 12px;
  flex-wrap: wrap;
}
.msd-mdl-msg { font-size: 13px; color: var(--msd-muted); }

/* ── Choice grid ────────────────────────────────────────────── */
.msd-mdl-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.msd-mdl-choice-grid-3 { grid-template-columns: repeat(3, 1fr); }
.msd-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 2px solid var(--msd-border);
  background: #f8fafc;
  cursor: pointer;
  transition: all var(--msd-transition);
  text-align: center;
  min-height: 72px;
}
.msd-choice-btn:hover { border-color: #93c5fd; background: #eff6ff; }
.msd-choice-btn.is-active { border-color: var(--msd-accent); background: #eff6ff; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.msd-choice-btn.msd-choice-absent:hover { border-color: #fca5a5; background: #fff5f5; }
.msd-choice-btn.msd-choice-absent.is-active { border-color: var(--msd-danger); background: #fef2f2; box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
.msd-choice-icon  { font-size: 24px; line-height: 1; display: block; }
.msd-choice-label { font-size: 13px; font-weight: 600; color: #334155; line-height: 1.3; display: block; }
.msd-choice-btn.is-active .msd-choice-label { color: #1d4ed8; }
.msd-choice-btn.msd-choice-absent.is-active .msd-choice-label { color: #dc2626; }
.msd-choice-hint  { font-size: 11px; color: #94a3b8; font-weight: 400; display: block; }

/* ── Table ──────────────────────────────────────────────────── */
.msd-table-wrap { overflow: auto; }
.msd-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}
.msd-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--msd-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.msd-table td {
  background: #fff;
  padding: 13px 14px;
  border-top: 1px solid var(--msd-border);
  border-bottom: 1px solid var(--msd-border);
  vertical-align: middle;
  font-size: 14px;
}
.msd-table td:first-child { border-left: 1px solid var(--msd-border); border-radius: 12px 0 0 12px; }
.msd-table td:last-child  { border-right: 1px solid var(--msd-border); border-radius: 0 12px 12px 0; }
.msd-table .msd-badge { white-space: nowrap; }

/* ── Navigation ─────────────────────────────────────────────── */
.msd-month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.msd-note { margin: 0 0 14px; color: var(--msd-muted); font-size: 13.5px; }

/* ── Chip toolbar ───────────────────────────────────────────── */
.msd-child-chip-toolbar,
.msd-inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0;
}
.msd-inline-form label { font-weight: 600; }
.msd-child-chip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.msd-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1.5px solid var(--msd-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  box-shadow: var(--msd-shadow-soft);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color var(--msd-transition), background var(--msd-transition);
}
.msd-chip:hover { border-color: #93c5fd; background: #eff6ff; }
.msd-chip input { margin: 0; }
.msd-chip-search,
.msd-child-search {
  min-width: 220px;
  max-width: 320px;
  border: 1.5px solid var(--msd-border);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color var(--msd-transition);
}
.msd-chip-search:focus,
.msd-child-search:focus { border-color: var(--msd-accent); }
.msd-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msd-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.msd-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #475569; }
.msd-teacher-child { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--msd-border); }

/* ── Unified tabs ───────────────────────────────────────────── */
.msd-unified-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0 20px;
}
.msd-tab-btn {
  padding: 9px 20px;
  border-radius: 24px;
  border: 2px solid var(--msd-border);
  background: #fff;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--msd-transition);
  white-space: nowrap;
}
.msd-tab-btn:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.msd-tab-btn.is-active { background: var(--msd-accent); border-color: var(--msd-accent); color: #fff; box-shadow: 0 3px 10px rgba(59,130,246,.3); }
.msd-tab-panel { display: none; }
.msd-tab-panel.is-active { display: block; }
.msd-unified .msd-tab-panel { display: none !important; }
.msd-unified .msd-tab-panel.is-active { display: block !important; }

/* ── Child tabs ─────────────────────────────────────────────── */
.msd-child-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 18px; }
.msd-child-tab {
  border: 1.5px solid var(--msd-border);
  background: #fff;
  color: var(--msd-text);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--msd-shadow-soft);
  transition: all var(--msd-transition);
}
.msd-child-tab:hover { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.msd-child-tab.is-active { background: var(--msd-text); color: #fff; border-color: var(--msd-text); }
.msd-card-hidden { display: none; }

/* ── Soft badge ─────────────────────────────────────────────── */
.msd-soft-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 11px;
  background: #f8fafc;
  border: 1px solid var(--msd-border);
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}
.msd-inline-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ── Admin parent overview ──────────────────────────────────── */
.msd-apo-wrap { display: flex; flex-direction: column; gap: 18px; padding: 4px 0 20px; }
.msd-apo-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--msd-shadow-soft);
  border: 1px solid var(--msd-border);
}
.msd-apo-month-nav { display: flex; align-items: center; gap: 10px; }
.msd-apo-month-input {
  padding: 8px 13px;
  border: 1.5px solid var(--msd-border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  background: #f8fafc;
  transition: border-color var(--msd-transition);
}
.msd-apo-month-input:focus { border-color: var(--msd-accent); background: #fff; }
.msd-apo-search {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px;
  border: 1.5px solid var(--msd-border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #f8fafc;
  transition: border-color var(--msd-transition);
}
.msd-apo-search:focus { border-color: var(--msd-accent); background: #fff; }
.msd-apo-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; background: #f8fafc; border-radius: 11px; }
.msd-apo-grid { display: flex; flex-direction: column; gap: 14px; }
.msd-apo-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--msd-shadow-soft);
  border: 1px solid var(--msd-border);
  overflow: hidden;
  transition: box-shadow var(--msd-transition);
}
.msd-apo-card:hover { box-shadow: var(--msd-shadow); }
.msd-apo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
}
.msd-apo-parent-info h3 { margin: 0 0 5px; font-size: 15px; font-weight: 700; color: var(--msd-text); }
.msd-apo-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--msd-muted); }
.msd-apo-meta span { display: flex; align-items: center; gap: 3px; }
.msd-apo-child-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.msd-apo-child-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #f1f5f9;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all var(--msd-transition);
  line-height: 1.3;
}
.msd-apo-child-btn small { font-size: 11px; font-weight: 500; color: #94a3b8; }
.msd-apo-child-btn:hover { background: #e2e8f0; transform: translateY(-1px); }
.msd-apo-child-btn.is-active { background: #eff6ff; border-color: var(--msd-accent); color: #1d4ed8; }
.msd-apo-child-btn.is-active small { color: #60a5fa; }
.msd-apo-cal-panel { border-top: 1.5px solid #f1f5f9; background: #fafbfc; }
.msd-apo-cal-inner { padding: 16px 18px; }
.msd-apo-loading { display: flex; align-items: center; gap: 10px; color: var(--msd-muted); font-size: 14px; padding: 20px 0; }

/* ── Spinner ────────────────────────────────────────────────── */
@keyframes msd-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.msd-spinner-inline {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--msd-accent);
  border-radius: 50%;
  animation: msd-spin .65s linear infinite;
  flex-shrink: 0;
}

/* ── Manager embedded ───────────────────────────────────────── */
.msd-manager-embedded { min-height: auto !important; background: transparent !important; }
.msd-mgr-nav-embedded {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 0 16px;
  border-bottom: 2px solid var(--msd-border);
  margin-bottom: 20px;
}
.msd-mgr-nav-embedded .msd-mgr-navbtn {
  background: #f1f5f9;
  color: #475569;
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 13.5px;
  transition: all var(--msd-transition);
}
.msd-mgr-nav-embedded .msd-mgr-navbtn:hover { background: #e2e8f0; color: var(--msd-text); }
.msd-mgr-nav-embedded .msd-mgr-navbtn.is-active { background: var(--msd-accent); color: #fff; }
#msd-mgr-content { padding: 4px 0; }

/* ── Menu / Jídelníček ──────────────────────────────────────── */
.msd-menu-section { margin-bottom: 0; }
.msd-week-nav { display: flex; gap: 8px; }
.msd-menu-week-label { font-size: 13px; font-weight: 600; color: var(--msd-muted); margin-bottom: 14px; }
.msd-menu-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.msd-menu-day { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 6px; }
.msd-menu-day-head {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--msd-text);
  padding: 6px 0;
  border-bottom: 2px solid var(--msd-border);
}
.msd-menu-day-head small { font-size: 11px; font-weight: 400; color: #94a3b8; }
.msd-menu-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--msd-border);
  transition: background var(--msd-transition);
}
.msd-menu-item:hover { background: #f1f5f9; }
.msd-menu-mtype { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .4px; }
.msd-menu-dish  { font-size: 13px; color: var(--msd-text); font-weight: 500; line-height: 1.4; }
.msd-menu-allergens { font-size: 11px; color: #d97706; }
.msd-menu-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.msd-menu-table th { background: #f8fafc; padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--msd-muted); text-transform: uppercase; border-bottom: 2px solid var(--msd-border); text-align: center; }
.msd-menu-table th div { font-size: 13px; font-weight: 700; color: var(--msd-text); }
.msd-menu-table th small { font-size: 11px; font-weight: 400; color: #94a3b8; }
.msd-menu-table td { padding: 8px 10px; border-bottom: 1px solid #f0f4f8; vertical-align: top; min-width: 130px; }
.msd-menu-type-lbl { font-size: 12px; font-weight: 700; color: var(--msd-muted); white-space: nowrap; }
.msd-menu-cell { background: #fafbfc; }
.msd-menu-cell:hover { background: #f1f5f9; }
.msd-menu-actions { display: flex; gap: 4px; margin-top: 6px; }
.msd-menu-item-alert { border-left: 3px solid var(--msd-warning); background: #fffbeb; }
.msd-menu-allergen-warn { margin-top: 6px; font-size: 12px; color: #92400e; background: #fef3c7; border: 1px solid var(--msd-warning); border-radius: 5px; padding: 4px 8px; line-height: 1.4; }
.msd-menu-allergen-warn strong { font-weight: 700; }
.msd-menu-child-warn { display: inline-flex; align-items: center; gap: 4px; background: #fff7ed; border: 1px solid #fb923c; border-radius: 8px; padding: 3px 10px; font-size: 12px; font-weight: 600; color: #7c2d12; margin-top: 4px; }

/* ── Events ─────────────────────────────────────────────────── */
.msd-events-section { margin-bottom: 0; }
.msd-parent-events { display: flex; flex-direction: column; gap: 14px; }
.msd-parent-event {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--msd-border);
  border-radius: 16px;
  padding: 16px 18px;
  transition: box-shadow var(--msd-transition);
}
.msd-parent-event:hover { box-shadow: var(--msd-shadow); }
.msd-event-date-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--msd-accent);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 54px;
  flex-shrink: 0;
}
.msd-event-day { font-size: 22px; font-weight: 800; line-height: 1; }
.msd-event-mon { font-size: 10px; font-weight: 600; opacity: .85; margin-top: 2px; }
.msd-event-info { flex: 1; }
.msd-event-title { font-size: 16px; font-weight: 700; color: var(--msd-text); margin-bottom: 5px; }
.msd-event-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--msd-muted); margin-bottom: 6px; }
.msd-event-desc { font-size: 13px; color: #475569; line-height: 1.5; margin-top: 6px; }
.msd-event-rsvps { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #f0f4f8; }
.msd-event-child-rsvp { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msd-rsvp-name { font-size: 13px; font-weight: 700; color: var(--msd-text); min-width: 100px; }
.msd-rsvp-btns { display: flex; gap: 8px; }
.msd-rsvp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 50px;
  border: 1.5px solid var(--msd-border);
  background: #f8fafc;
  color: var(--msd-muted);
  cursor: pointer;
  transition: all var(--msd-transition);
}
.msd-rsvp-btn:hover { border-color: #cbd5e1; background: #f1f5f9; color: #334155; }
.msd-rsvp-btn-yes.is-active { background: #dcfce7; border-color: #86efac; color: #166534; box-shadow: 0 2px 8px rgba(22,101,52,.15); }
.msd-rsvp-btn-no.is-active  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; box-shadow: 0 2px 8px rgba(153,27,27,.12); }
.msd-events-grid { display: flex; flex-direction: column; gap: 14px; }
.msd-event-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--msd-border);
  padding: 16px 18px;
  transition: box-shadow var(--msd-transition);
}
.msd-event-card:hover { box-shadow: var(--msd-shadow); }
.msd-event-card .msd-event-date { display: flex; flex-direction: column; align-items: center; background: var(--msd-accent); color: #fff; border-radius: 10px; padding: 10px 12px; min-width: 50px; flex-shrink: 0; }
.msd-event-card .msd-event-day   { font-size: 20px; font-weight: 800; line-height: 1; }
.msd-event-card .msd-event-month { font-size: 10px; font-weight: 600; opacity: .85; margin-top: 2px; }
.msd-event-body    { flex: 1; }
.msd-event-rsvp-count { color: #16a34a; font-weight: 600; }
.msd-event-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ── RSVP admin ─────────────────────────────────────────────── */
.msd-rsvp-admin-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.msd-rsvp-count { display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 20px; background: #f8fafc; border: 1px solid var(--msd-border); }
.msd-rsvp-yes   { background: #dcfce7; border-color: #86efac; color: #166534; }
.msd-rsvp-no    { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.msd-rsvp-unset { background: #f1f5f9; border-color: #cbd5e1; color: var(--msd-muted); }
.msd-rsvp-admin-list { margin-top: 10px; border-top: 1px solid #f1f5f9; padding-top: 8px; }
.msd-rsvp-admin-list .msd-event-child-rsvp { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #f8fafc; gap: 8px; flex-wrap: wrap; }
.msd-rsvp-btn-remove { background: none; border: 1px solid #fca5a5; color: var(--msd-danger); border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 13px; }
.msd-rsvp-btn-remove:hover { background: #fee2e2; }

/* ── Teacher accordion ──────────────────────────────────────── */
.msd-teacher-class-section { margin-bottom: 20px; }
.msd-teacher-accordion {
  border: 1.5px solid #f1f5f9;
  border-radius: 16px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow var(--msd-transition), border-color var(--msd-transition);
}
.msd-teacher-accordion:hover { box-shadow: var(--msd-shadow); border-color: #fce7f3; }
.msd-teacher-accordion.is-open { border-color: #f9a8d4; box-shadow: 0 4px 16px rgba(236,72,153,.08); }
.msd-teacher-acc-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; }
.msd-teacher-acc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  border-radius: 12px;
  transition: background var(--msd-transition);
  min-width: 0;
}
.msd-teacher-acc-btn:hover { background: #f8fafc; }
.msd-teacher-acc-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(29,78,216,.15);
}
.msd-teacher-acc-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.msd-teacher-acc-name { font-size: 15px; font-weight: 700; color: var(--msd-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msd-teacher-acc-meta { font-size: 12px; color: #94a3b8; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msd-teacher-acc-meta-pill { background: #f1f5f9; border-radius: 20px; padding: 2px 8px; font-size: 11px; font-weight: 500; color: var(--msd-muted); white-space: nowrap; }
.msd-teacher-acc-chevron {
  font-size: 11px; color: #cbd5e1; transition: transform .2s; flex-shrink: 0; margin-left: 4px;
  background: #f8fafc; border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.msd-teacher-accordion.is-open .msd-teacher-acc-chevron { transform: rotate(180deg); background: #fdf2f8; color: #ec4899; }
.msd-teacher-acc-body { display: none; border-top: 1px solid #f0f4f8; padding: 16px 18px; background: #fafbfc; }
.msd-teacher-accordion.is-open .msd-teacher-acc-body { display: block; }
.msd-teacher-acc-cal-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.msd-teacher-cal-month { font-size: 14px; font-weight: 700; color: var(--msd-text); min-width: 70px; text-align: center; }

/* ── Child info modal ───────────────────────────────────────── */
.msd-child-info-modal { display: flex; flex-direction: column; gap: 16px; }
.msd-child-info-section { background: #f8fafc; border-radius: 12px; padding: 14px 16px; border: 1px solid var(--msd-border); }
.msd-child-info-section h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--msd-muted); margin: 0 0 10px; }
.msd-child-info-row { display: flex; gap: 8px; margin-bottom: 6px; font-size: 13.5px; }
.msd-child-info-label { color: var(--msd-muted); min-width: 120px; flex-shrink: 0; }
.msd-child-info-val { color: var(--msd-text); font-weight: 500; }
.msd-child-info-val a { color: var(--msd-accent); text-decoration: none; }
.msd-child-info-allergy { background: #fff5f5; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 12px; color: #991b1b; font-size: 13px; margin-top: 6px; }

/* ── Front modal overlay ────────────────────────────────────── */
.msd-front-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.msd-front-modal {
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--msd-shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 88vh;
  display: flex; flex-direction: column;
}
.msd-front-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--msd-border); }
.msd-front-modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.msd-front-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--msd-muted); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.msd-front-modal-close:hover { background: #f1f5f9; }
.msd-front-modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }

/* ── Portal logo ────────────────────────────────────────────── */
.msd-portal-logo { height: 56px; max-width: 180px; object-fit: contain; display: block; margin-bottom: 8px; }
.msd-login-logo  { height: 54px; max-width: 160px; object-fit: contain; display: block; margin: 0 auto 16px; }
.msd-mgr-card-full { grid-column: 1 / -1; }
.msd-logo-settings { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.msd-logo-preview-wrap {
  flex-shrink: 0;
  background: repeating-conic-gradient(#e2e8f0 0% 25%, #f8fafc 0% 50%) 0 0/16px 16px;
  border-radius: 12px; padding: 12px;
  display: flex; align-items: center; justify-content: center;
  min-width: 120px; min-height: 80px;
}
.msd-logo-preview { max-height: 80px; max-width: 160px; object-fit: contain; }
.msd-logo-placeholder { font-size: 12px; color: #94a3b8; font-style: italic; text-align: center; padding: 8px; }
.msd-logo-controls { flex: 1; min-width: 240px; }

/* ── Unified login ──────────────────────────────────────────── */
.msd-unified-login-wrap { display: flex; flex-direction: column; align-items: center; padding: 28px 16px 60px; gap: 20px; }
.msd-unified-login-card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 4px 32px rgba(0,0,0,.10);
  padding: 36px 40px 32px;
  width: 100%; max-width: 440px;
  border: 1px solid var(--msd-border);
}
.msd-unified-login-card h2 { font-size: 24px; font-weight: 800; color: var(--msd-text); margin: 0 0 10px; }
.msd-unified-login-card .msd-note { margin-bottom: 22px; line-height: 1.55; }
.msd-login-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.msd-login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--msd-muted); }
.msd-login-form input {
  padding: 11px 14px;
  border: 1.5px solid var(--msd-border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color var(--msd-transition), box-shadow var(--msd-transition);
  font-family: inherit;
  background: #f8fafc;
  color: var(--msd-text);
}
.msd-login-form input:focus { border-color: var(--msd-accent); box-shadow: 0 0 0 3px rgba(59,130,246,.12); background: #fff; }
.msd-login-msg { margin-top: 12px; font-size: 13.5px; min-height: 20px; text-align: center; }
.msd-login-msg.is-error   { color: #dc2626; }
.msd-login-msg.is-loading { color: var(--msd-muted); }

/* ── Bulk section ───────────────────────────────────────────── */
.msd-bulk-redesigned {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--msd-shadow-soft);
  border: 1px solid var(--msd-border);
  overflow: hidden;
  margin-bottom: 20px;
}
.msd-bulk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #f0f4f8;
  background: #fafbfc;
}
.msd-bulk-title h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--msd-text); }
.msd-bulk-title .msd-note { margin: 0; font-size: 13px; }
.msd-bulk-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 18px; }
.msd-bulk-label {
  display: block; font-size: 12px; font-weight: 700; color: var(--msd-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px;
}
.msd-bulk-label small { font-weight: 400; text-transform: none; color: #94a3b8; letter-spacing: 0; font-size: 12px; }
.msd-bulk-dates { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msd-bulk-dates label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--msd-muted); }
.msd-bulk-input {
  padding: 9px 14px;
  border: 1.5px solid var(--msd-border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #f8fafc;
  color: var(--msd-text);
  font-family: inherit;
  transition: border-color var(--msd-transition), box-shadow var(--msd-transition);
}
.msd-bulk-input:focus { border-color: var(--msd-accent); box-shadow: 0 0 0 3px rgba(59,130,246,.1); background: #fff; }
.msd-bulk-sep { font-weight: 700; color: #94a3b8; margin-top: 18px; }
.msd-bulk-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.msd-att-pill {
  padding: 9px 18px;
  border-radius: 30px;
  border: 2px solid var(--msd-border);
  background: #f8fafc;
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--msd-transition);
  white-space: nowrap;
  user-select: none;
}
.msd-att-pill:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.msd-att-pill.is-active { border-color: var(--msd-accent); background: #eff6ff; color: #1d4ed8; }
.msd-att-pill.is-absent.is-active { border-color: var(--msd-danger); background: #fef2f2; color: #dc2626; }
.msd-att-pill.is-absent:hover { border-color: #fca5a5; background: #fff5f5; color: #dc2626; }
.msd-bulk-who .msd-att-pill { display: inline-flex; align-items: center; gap: 6px; }
.msd-bulk-who label.msd-att-pill { cursor: pointer; }
.msd-bulk-who label.msd-att-pill:has(input:checked) { border-color: var(--msd-accent); background: #eff6ff; color: #1d4ed8; }
.msd-bulk-footer {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px; border-top: 1px solid #f0f4f8;
  background: #fafbfc; flex-wrap: wrap;
}
.msd-bulk-note { font-size: 12.5px; color: var(--msd-muted); }
.msd-bulk-note strong { color: var(--msd-text); }

/* ── Bulk modal trigger ─────────────────────────────────────── */
.msd-bulk-trigger-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: #f8fafc;
  border-radius: 14px; margin-bottom: 0;
  border: 1px solid var(--msd-border);
}
#msd-bulk-modal .msd-modal-card-new { max-height: 90vh; overflow-y: auto; }
#msd-bulk-modal .msd-bulk-dates { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#msd-bulk-modal .msd-bulk-input { display: block; margin-top: 4px; padding: 7px 10px; border: 1.5px solid var(--msd-border); border-radius: 8px; font-size: 14px; font-family: inherit; }
#msd-bulk-modal .msd-bulk-input:focus { border-color: var(--msd-accent); outline: none; }
#msd-bulk-modal .msd-bulk-sep { color: #94a3b8; margin-top: 20px; }

/* ── Parent summary bar ─────────────────────────────────────── */
.msd-parent-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; padding: 14px 0; border-bottom: 1px solid #f0f4f8; }
.msd-parent-summary .msd-stat { flex: 1; min-width: 120px; background: #f8fafc; border-radius: 12px; padding: 10px 14px; border: 1px solid #f0f4f8; }

/* ── Parent info bar ────────────────────────────────────────── */
.msd-parent-shell { display: flex; flex-direction: column; gap: 20px; }
.msd-parent-shell .msd-box,
.msd-parent-shell .msd-bulletin-section,
.msd-parent-shell .msd-menu-section,
.msd-parent-shell .msd-events-section,
.msd-parent-shell .msd-inbox-section,
.msd-parent-shell .msd-bulk-trigger-row,
.msd-parent-shell .msd-child-card { margin-bottom: 0 !important; margin-top: 0 !important; }
.msd-parent-shell .msd-box { padding: 22px 24px; border-radius: 20px; }
.msd-parent-shell .msd-child-card { padding: 0; border-radius: 20px; overflow: hidden; }
.msd-parent-shell .msd-child-card .msd-child-head { margin: 0 !important; border-radius: 20px 20px 0 0; padding: 16px 20px 14px !important; }
.msd-parent-info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.msd-pib-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 13px 16px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--msd-border);
  box-shadow: var(--msd-shadow-soft);
}
.msd-pib-item:not(:last-child) { border-right: 1px solid var(--msd-border); }
.msd-pib-label { font-size: 10px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.msd-pib-item strong { font-size: 18px; color: var(--msd-text); font-weight: 800; }
.msd-pib-sub { display: block; font-size: 11px; color: var(--msd-muted); font-weight: 400; margin-top: 2px; line-height: 1.4; }
.msd-pib-sub strong { font-size: 11px; font-weight: 600; }
.msd-pib-month-nav { display: flex; align-items: center; gap: 8px; }
.msd-pib-nav-btn { padding: 2px 10px; border-radius: 8px; background: #f0f4f8; color: #475569; font-size: 16px; font-weight: 700; text-decoration: none; line-height: 1.5; }
.msd-pib-nav-btn:hover { background: #dbeafe; color: #1d4ed8; }

/* ── Child head ─────────────────────────────────────────────── */
.msd-child-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 20px 12px; }
.msd-child-head-info h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.msd-child-meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.msd-child-head-nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.msd-child-month-label { font-size: 14px; font-weight: 700; color: var(--msd-text); min-width: 70px; text-align: center; }

/* ── Parent child selector ──────────────────────────────────── */
.msd-parent-child-selector { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.msd-pcs-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 30px;
  border: 2px solid var(--msd-border); background: #f8fafc;
  cursor: pointer; transition: all var(--msd-transition); user-select: none;
}
.msd-pcs-item:hover { border-color: #93c5fd; background: #eff6ff; }
.msd-pcs-cb { display: none; }
.msd-pcs-item:has(.msd-pcs-cb:checked) { border-color: var(--msd-accent); background: #eff6ff; }
.msd-pcs-avatar { width: 30px; height: 30px; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msd-pcs-item:has(.msd-pcs-cb:checked) .msd-pcs-avatar { background: var(--msd-accent); color: #fff; }
.msd-pcs-name { font-size: 13px; font-weight: 600; color: #334155; line-height: 1.3; }
.msd-pcs-name small { font-weight: 400; color: var(--msd-muted); }

/* ── Day states ─────────────────────────────────────────────── */
.msd-day-locked-parent { opacity: .52; cursor: default !important; filter: grayscale(30%); }
.msd-day-locked-parent:hover { transform: none !important; box-shadow: none !important; }
.msd-locked-tip {
  position: fixed; background: var(--msd-text); color: #fff;
  padding: 6px 14px; border-radius: 8px; font-size: 13px;
  z-index: 99999; pointer-events: none; white-space: nowrap;
  animation: msd-tip-in .15s ease;
}
@keyframes msd-tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.msd-day-blocked {
  background: #f8fafc; border: 1.5px dashed #e2e8f0; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: default; padding: 8px 4px; gap: 4px; pointer-events: none; opacity: .65;
}
.msd-day-blocked .msd-day-num { color: #94a3b8; font-size: 17px; font-weight: 700; }
.msd-day-blocked-label { font-size: 9.5px; color: #94a3b8; text-align: center; line-height: 1.2; max-width: 72px; word-break: break-word; }
.msd-day-holiday-open { border-color: #fed7aa; background: #fff7ed; }
.msd-day-weekend-open { border-color: #ddd6fe; background: #faf5ff; }
.msd-day-school-closed {
  background: #fff1f2; border: 2px solid #fca5a5; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: default; padding: 8px 4px; gap: 2px; pointer-events: none; opacity: .9;
}
.msd-day-school-closed .msd-day-num { color: #dc2626; font-size: 17px; font-weight: 700; }
.msd-day-school-closed-label { font-size: 9px; color: #dc2626; text-align: center; line-height: 1.2; max-width: 72px; word-break: break-word; font-weight: 600; }
.msd-day-deactivated {
  background: repeating-linear-gradient(45deg, #f8f8f8, #f8f8f8 4px, #f0f0f0 4px, #f0f0f0 8px);
  border: 1.5px solid #e2e8f0; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 8px 4px; pointer-events: none; opacity: .6;
}
.msd-day-num-deact { font-size: 17px; font-weight: 700; color: #94a3b8; }
.msd-day-deact-label { font-size: 9px; color: #94a3b8; text-align: center; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.msd-day-before-start { background: transparent; border: 1px dashed #e2e8f0; border-radius: 16px; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: .35; }
.msd-day-after-cutoff { border-color: #fde68a !important; background: linear-gradient(180deg, #fffbeb, #fef9ee) !important; }
.msd-day-after-cutoff .msd-day-num { color: #92400e; }
.msd-day-contact-school { background: #f8fafc; color: #94a3b8; border: 1px dashed #cbd5e1; cursor: not-allowed; opacity: .95; }
.msd-day-contact-school .msd-day-num { color: #cbd5e1; }
.msd-day-contact-school-label { display: block; margin-top: 10px; line-height: 1.25; color: #94a3b8; font-size: 11px; text-align: center; }
.msd-day-preplan { border-color: #c7d2fe !important; background: #eef2ff !important; }
.msd-day-preplan-badge { display: block; font-size: 10px; color: #4338ca; background: #e0e7ff; border-radius: 4px; padding: 2px 5px; margin: 2px 0 3px; line-height: 1.4; text-align: center; }

/* ── Badges ─────────────────────────────────────────────────── */
.msd-badge-present { background: #dcfce7; color: #166534; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.msd-badge-absent  { background: #fee2e2; color: #991b1b; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.msd-badge-lunch   { background: #fef9c3; color: #713f12; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.msd-soft-badge    { border-radius: 99px; padding: 1px 7px; font-size: 11px; font-weight: 500; display: inline-block; }

/* ── Attendance chips ───────────────────────────────────────── */
.msd-att-chip { display: inline-flex; align-items: center; gap: 3px; border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.msd-att-chip-full      { background: #dff7e5; color: #14532d; }
.msd-att-chip-morning   { background: #fff4cc; color: #713f12; }
.msd-att-chip-afternoon { background: #ffe1bf; color: #7c2d12; }
.msd-att-chip-absent    { background: #fee2e2; color: #7f1d1d; }
.msd-att-chip-late      { background: #ffd9b3; color: #7c2d12; }

/* ── Capacity squares ───────────────────────────────────────── */
.msd-sq-row { display: flex; gap: 3px; width: 100%; margin-top: 5px; justify-content: center; }
.msd-sq { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; min-width: 0; border-radius: 6px; padding: 3px 2px; line-height: 1; cursor: default; }
.msd-sq-num { font-size: clamp(10px, 1.8cqi, 14px); font-weight: 800; line-height: 1; }
.msd-sq-lbl { font-size: clamp(7px, 1.1cqi, 9px); font-weight: 600; opacity: .75; margin-top: 1px; white-space: nowrap; }
.msd-sq-ok   { background: #dcfce7; color: #166534; }
.msd-sq-warn { background: #fef9c3; color: #854d0e; }
.msd-sq-full { background: #fee2e2; color: #991b1b; }

/* ── Irregular plan badge ───────────────────────────────────── */
.msd-plan-irregular { display: inline-flex; align-items: center; gap: 4px; background: #fff3cd; border: 1px solid #ffc107; color: #856404; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; }

/* ── Waitlist banner ────────────────────────────────────────── */
.msd-waitlist-banner { margin: 0 0 14px; border: 2px solid var(--msd-warning); border-radius: 14px; background: #fffbeb; padding: 14px 16px 12px; }
.msd-waitlist-banner-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.msd-waitlist-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.msd-waitlist-text { display: flex; flex-direction: column; gap: 2px; }
.msd-waitlist-text strong { font-size: 14px; color: #92400e; }
.msd-waitlist-text span   { font-size: 12px; color: #b45309; }
.msd-waitlist-plan-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid #fde68a; padding-top: 10px; }
.msd-waitlist-plan-label { font-size: 13px; color: #78350f; flex: 1; }
.msd-waitlist-plan-form { border-top: 1px solid #fde68a; padding-top: 12px; margin-top: 2px; }
.msd-waitlist-plan-form .msd-mgr-formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.msd-waitlist-plan-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #374151; }
.msd-waitlist-plan-form input,
.msd-waitlist-plan-form select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }

/* ── Chat inbox ─────────────────────────────────────────────── */
.msd-inbox-thread { background: #fff; border: 1px solid var(--msd-border); border-radius: 16px; margin-bottom: 14px; overflow: hidden; }
.msd-inbox-thread.is-archived { opacity: .65; }
.msd-inbox-thread-head { padding: 12px 16px 8px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 8px; }
.msd-inbox-subject { font-weight: 700; font-size: 15px; color: var(--msd-text); }
.msd-inbox-archive-badge { font-size: 11px; background: #f1f5f9; color: var(--msd-muted); padding: 2px 8px; border-radius: 999px; }
.msd-chat-thread { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; max-height: 360px; min-height: 120px; overflow-y: auto; scroll-behavior: smooth; }
.msd-chat-msg    { display: flex; }
.msd-chat-school { justify-content: flex-start; }
.msd-chat-parent { justify-content: flex-end; }
.msd-chat-bubble { max-width: 75%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; }
.msd-chat-school .msd-chat-bubble { background: #f1f5f9; color: var(--msd-text); border-bottom-left-radius: 4px; }
.msd-chat-bubble-me { background: var(--msd-accent); color: #fff; border-bottom-right-radius: 4px; }
.msd-chat-bubble-me .msd-chat-meta { color: rgba(255,255,255,.7); }
.msd-chat-meta { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.msd-inbox-reply { padding: 10px 16px 14px; display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid #f1f5f9; }
.msd-inbox-reply-txt { flex: 1; border: 1.5px solid var(--msd-border); border-radius: 10px; padding: 8px 12px; font-size: 13px; resize: none; font-family: inherit; }
.msd-inbox-reply-txt:focus { border-color: var(--msd-accent); outline: none; }

/* ── Nástěnka ───────────────────────────────────────────────── */
#msd-bulletin-list { display: flex; flex-direction: column; gap: 12px; }
.msd-bl-card { background: #fff; border: 1.5px solid var(--msd-border); border-radius: 14px; padding: 16px 18px; transition: box-shadow var(--msd-transition); }
.msd-bl-card:hover { box-shadow: var(--msd-shadow); }
.msd-bl-card-pinned { border-color: #f97316; background: #fffbf5; }
.msd-bl-card-new    { border-color: #ec4899; background: #fdf2f8; }
.msd-bl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.msd-bl-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.msd-bl-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; line-height: 1.6; }
.msd-bl-pinned { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.msd-bl-new    { background: #fce7f3; color: #be185d; border: 1px solid #fbcfe8; }
.msd-bl-class  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.msd-bl-date   { font-size: 11px; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
.msd-bl-subject { font-size: 15px; font-weight: 700; color: var(--msd-text); margin-bottom: 6px; line-height: 1.4; }
.msd-bl-body   { font-size: 14px; color: #475569; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msd-bl-footer { margin-top: 10px; font-size: 11px; color: #94a3b8; border-top: 1px solid #f1f5f9; padding-top: 8px; }

/* ── Portal compact topbar ──────────────────────────────────── */
.msd-portal-topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--msd-shadow-soft);
  border: 1px solid var(--msd-border);
  margin-bottom: 14px;
  text-align: center;
}
.msd-portal-logo-small { height: 60px; max-width: 200px; object-fit: contain; display: block; margin: 0 auto; }
.msd-portal-name { font-size: 15px; font-weight: 700; color: var(--msd-text); }
.msd-portal-topbar-right { display: flex; align-items: center; gap: 18px; }
.msd-portal-user { font-size: 13px; color: var(--msd-muted); }
.msd-unified .msd-header { display: none !important; }
.msd-logout-link { margin-left: auto; }

/* ── Card refresh loader ────────────────────────────────────── */
.msd-card-refresh-loader { position: absolute; top: 10px; right: 10px; font-size: 18px; color: #ec4899; opacity: .7; animation: msd-spin .7s linear infinite; pointer-events: none; z-index: 10; }

/* ── Notice ─────────────────────────────────────────────────── */
.msd-front-notice {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 99999; padding: 12px 20px; border-radius: 14px;
  font-weight: 700; box-shadow: var(--msd-shadow-lg);
  max-width: min(92vw, 720px); text-align: center; font-size: 14px;
}
.msd-front-notice.ok  { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; }
.msd-front-notice.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Admin misc ─────────────────────────────────────────────── */
.msd-admin-presets    { margin: 0 0 14px; }
.msd-selected-count   { font-weight: 700; color: var(--msd-text); }
.msd-month-quicknav .button { margin-right: 8px; }
.msd-child-picker-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.msd-child-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.msd-check { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--msd-border); border-radius: 14px; background: #fff; }
.msd-admin-child { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--msd-border); }
.msd-admin-child h3 small { color: var(--msd-muted); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   TEACHER PORTAL v2
═══════════════════════════════════════════════════════════════ */
.msd-teacher-portal { max-width: 960px; margin: 0 auto; padding: 0 0 40px; }

/* Header */
.msd-tc-header {
  padding: 22px 24px 16px;
  background: linear-gradient(135deg, #fff5f9 0%, #fff 60%);
  border-bottom: 1px solid #fce7f3;
}
.msd-tc-title    { font-size: 22px; font-weight: 800; color: var(--msd-text); margin: 0 0 5px; letter-spacing: -.02em; }
.msd-tc-subtitle { font-size: 13px; color: #94a3b8; margin: 0; font-weight: 500; }

/* Tab bar */
.msd-tc-tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #fff;
  padding: 14px 18px;
  gap: 8px;
  border-bottom: 1px solid #f0f4f8;
}
.msd-tc-tabs::-webkit-scrollbar { display: none; }
.msd-tc-tab {
  flex: 0 0 auto;
  padding: 9px 18px;
  font-size: 13px; font-weight: 600;
  color: var(--msd-muted);
  background: #f1f5f9;
  border: 1.5px solid transparent;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--msd-transition);
  position: relative;
}
.msd-tc-tab:hover { color: #ec4899; background: #fdf2f8; border-color: #f9a8d4; }
.msd-tc-tab.is-active { color: #fff; background: linear-gradient(135deg, #ec4899, #db2777); border-color: transparent; box-shadow: 0 3px 10px rgba(236,72,153,.3); }
.msd-tab-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; box-shadow: 0 1px 4px rgba(239,68,68,.4); border: 2px solid #fff;
}

/* Panels */
.msd-tc-panel { padding: 0; animation: msd-tc-fade .18s ease; background: #fff; border-radius: 0 0 16px 16px; overflow: hidden; }
@keyframes msd-tc-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.msd-tc-panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid #f1f5f9; }
.msd-tc-panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--msd-text); }
.msd-tc-date { font-size: 13px; color: var(--msd-muted); }

/* Class block */
.msd-tc-class { background: #fff; border-radius: 14px; border: 1.5px solid #f0f4f8; margin: 12px 16px; box-shadow: var(--msd-shadow-soft); overflow: hidden; }
.msd-tc-class:last-child { margin-bottom: 16px; }
.msd-tc-class-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; background: linear-gradient(135deg, #fdf2f8, #fff); border-bottom: 1.5px solid #fce7f3; }
.msd-tc-class-name { font-size: 14px; font-weight: 800; color: #be185d; margin-right: 4px; letter-spacing: -.01em; }
.msd-tc-children { padding: 10px 14px 6px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.msd-tc-absent { padding: 0 14px 10px; margin-top: 6px; font-size: 12px; color: var(--msd-muted); }
.msd-tc-absent summary { cursor: pointer; padding: 4px 0; }
.msd-tc-absent-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.msd-tc-child {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f8fafc; border: 1px solid var(--msd-border);
  border-radius: 20px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 500; color: #334155;
  transition: all var(--msd-transition);
}
.msd-tc-child-clickable { cursor: pointer; }
.msd-tc-child-clickable:hover { background: #fdf2f8; border-color: #f9a8d4; color: #be185d; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(236,72,153,.12); }
.msd-tc-child-name { font-weight: 600; }

/* Lunch summary */
.msd-tc-lunch-summary { background: #f0fdf4; border: 1.5px solid #bbf7d0; border-radius: 14px; margin: 12px 16px; padding: 12px 16px; }
.msd-tc-lunch-summary h3 { margin: 0 0 10px; font-size: 12px; color: #166534; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.msd-tc-lunch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.msd-tc-lunch-card { background: #fff; border: 1.5px solid #d1fae5; border-radius: 10px; padding: 8px 12px; text-align: center; }
.msd-tc-lunch-card.is-nonzero { background: #dcfce7; border-color: #86efac; }
.msd-tc-lunch-class { font-size: 11px; color: #166534; margin-bottom: 4px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msd-tc-lunch-count { font-size: 24px; font-weight: 800; color: #14532d; }
.msd-tc-lunch-card:not(.is-nonzero) .msd-tc-lunch-count { color: #6ee7b7; }

/* Week table */
.msd-tc-week-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.msd-tc-week-class { background: #fff; border-radius: 14px; border: 1.5px solid #f0f4f8; margin: 12px 16px; box-shadow: var(--msd-shadow-soft); overflow: hidden; }
.msd-tc-week-class:last-child { margin-bottom: 16px; }
.msd-tc-week-class-name { font-size: 13px; font-weight: 800; color: #be185d; margin: 0; padding: 10px 14px; background: linear-gradient(135deg, #fdf2f8, #fff); border-bottom: 1.5px solid #fce7f3; }
.msd-table-wrap { overflow-x: auto; padding: 8px; }
.msd-tc-week-table { min-width: 480px; width: 100%; border-collapse: collapse; border-radius: 10px; overflow: hidden; }
.msd-tc-week-table th, .msd-tc-week-table td { font-size: 11px; padding: 6px 8px; min-width: 80px; border: 1px solid #f1f5f9; }
.msd-tc-week-table th { background: #f8fafc; font-weight: 700; color: #475569; text-align: center; }
.msd-tc-blocked  { background: #f1f5f9 !important; color: #94a3b8 !important; }
.msd-tc-today    { background: #eff6ff !important; }
.msd-tc-tomorrow { background: #f0fdf4 !important; }
.msd-tc-summary-row td { background: #f8fafc; }
.msd-tc-week-lunch-row { display: flex; border-top: 1px dashed var(--msd-border); margin-top: 4px; }
.msd-tc-week-lunch-cell { flex: 1; text-align: center; font-size: 11px; padding: 3px 4px; color: #16a34a; font-weight: 600; min-width: 80px; }
.msd-tc-week-lunch-cell.is-blocked { color: #94a3b8; }

/* Calendar */
.msd-tc-legend { padding: 14px 16px; margin: 12px 16px 0; background: #fff; border-radius: 14px; border: 1.5px solid var(--msd-border); box-shadow: var(--msd-shadow-soft); }
.msd-tc-legend h4 { margin: 0 0 8px; font-size: 11px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.msd-tc-cal-class { background: #fff; border-radius: 14px; border: 1.5px solid #f0f4f8; margin: 12px 16px; box-shadow: var(--msd-shadow-soft); overflow: hidden; padding-bottom: 12px; }
.msd-tc-cal-class:last-child { margin-bottom: 16px; }
.msd-tc-cal-class-name { font-size: 14px; font-weight: 800; color: #be185d; margin: 0; padding: 10px 14px; background: linear-gradient(135deg, #fdf2f8, #fff); border-bottom: 1.5px solid #fce7f3; }
.msd-tc-health-badge { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 10px 14px; margin-top: 8px; }
.msd-tc-health-badge p { margin: 3px 0; font-size: 12px; color: #7c2d12; }

/* Teacher tomorrow preview */
.msd-teacher-tomorrow { margin-bottom: 20px; }
.msd-teacher-tomorrow-class { border: 0.5px solid var(--msd-border); border-radius: 12px; padding: 14px 16px; margin: 10px 0; background: #f8fafc; }
.msd-teacher-tomorrow-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.msd-teacher-tomorrow-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--msd-text); }
.msd-teacher-tomorrow-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.msd-teacher-tomorrow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; margin-top: 6px; }
.msd-teacher-tomorrow-child { display: flex; align-items: center; gap: 5px; background: #fff; border: 0.5px solid var(--msd-border); border-radius: 8px; padding: 5px 10px; font-size: 13px; }
.msd-teacher-tomorrow-child-absent { background: #fff5f5; border-color: #fecaca; color: #7f1d1d; opacity: .85; }
.msd-teacher-tomorrow-icon { font-size: 14px; flex-shrink: 0; }
.msd-teacher-tomorrow-name { flex: 1; font-weight: 500; color: var(--msd-text); }
.msd-teacher-tomorrow-lunch { font-size: 13px; }
.msd-teacher-tomorrow-grid-absent { margin-top: 6px; }
.msd-teacher-tomorrow-absent-details { margin-top: 8px; }

/* Weekly outlook */
.msd-teacher-week-outlook { overflow-x: auto; }
.msd-teacher-week-class { margin-bottom: 20px; }
.msd-teacher-week-class-name { font-size: 15px; font-weight: 600; color: var(--msd-text); margin: 0 0 8px; padding: 0; }
.msd-teacher-week-table { min-width: 640px; width: 100%; }
.msd-teacher-week-table th, .msd-teacher-week-table td { vertical-align: top; min-width: 110px; font-size: 12px; padding: 5px 7px; line-height: 1.5; }
.msd-teacher-week-table th { font-size: 12px; white-space: nowrap; }
.msd-week-today    { background: #eff6ff !important; }
.msd-week-tomorrow { background: #f0fdf4 !important; }
.msd-week-blocked  { background: #f1f5f9 !important; color: #94a3b8 !important; opacity: .7; }
.msd-week-summary-row td { background: #f8fafc; font-size: 11px; }
.msd-week-summary-cell { white-space: nowrap; }
.msd-week-child-name { font-size: 12px; color: #334155; }
.msd-att-dot   { font-size: 11px; }
.msd-att-lunch { font-size: 11px; margin-left: 2px; }
.msd-week-absent-header td { padding: 0; }
.msd-week-absent-header details { padding: 4px 6px; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */

/* ≤ 900px */
@media (max-width: 900px) {
  .msd-child-head,
  .msd-section-head { flex-direction: column; align-items: flex-start; }
  .msd-calendar { gap: 5px; padding: 10px; }
  .msd-day { min-height: 88px; padding: 8px 4px; }
  .msd-day-num { font-size: 16px; }
}

/* ≤ 768px */
@media (max-width: 768px) {
  .msd-shell { padding: 0 14px; }
  .msd-header { padding: 22px 20px; }
  .msd-summary { grid-template-columns: repeat(2, 1fr); }
  .msd-unified-login-card { padding: 28px 24px 24px; }
  .msd-apo-head { flex-direction: column; }
  .msd-apo-child-btns { width: 100%; }
  .msd-parent-info-bar { grid-template-columns: 1fr 1fr; }
}

/* ≤ 640px */
@media (max-width: 640px) {
  .msd-shell { padding: 0 10px; }
  .msd-header { padding: 18px 16px; border-radius: 16px; }
  .msd-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msd-dow { display: none; }
  .msd-day { min-height: 90px; }
  .msd-stat strong { font-size: 26px; }
  .msd-child-chip-toolbar,
  .msd-inline-form,
  .msd-month-nav { flex-direction: column; align-items: stretch; }
  .msd-chip-search,
  .msd-child-search { max-width: none; width: 100%; }
  .msd-parent-event { flex-direction: column; }
  .msd-event-date-pill { flex-direction: row; gap: 6px; width: 100%; justify-content: flex-start; }
  .msd-menu-grid { flex-direction: column; }
  .msd-menu-day { min-width: auto; }
  .msd-bulk-header { padding: 14px 16px; }
  .msd-bulk-body   { padding: 14px 16px; }
  .msd-bulk-footer { padding: 12px 16px; }
  .msd-att-pill { padding: 8px 14px; font-size: 13px; }
  .msd-mdl-choice-grid { grid-template-columns: 1fr 1fr; }
  .msd-mdl-choice-grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ≤ 500px */
@media (max-width: 500px) {
  .msd-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .msd-parent-info-bar { grid-template-columns: 1fr 1fr; gap: 8px; }
  .msd-unified-login-card { padding: 22px 18px; }
  .msd-tc-tab { padding: 11px 12px; font-size: 12px; }
  .msd-tc-panel-head { padding: 14px 14px 10px; }
  .msd-tc-week-table { min-width: 360px; }
  .msd-tc-week-table th, .msd-tc-week-table td { font-size: 10px; padding: 3px 3px; min-width: 60px; }
  .msd-tc-title { font-size: 18px; }
  .msd-teacher-tomorrow-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .msd-teacher-week-table th, .msd-teacher-week-table td { min-width: 80px; }
}
