:root {
  --brand-primary: #ee7f3b;
  --brand-secondary: #ffe8d8;
  --brand-accent: #1767b5;
  --brand-surface: #fffaf5;
  --text-strong: #1f2333;
  --text-soft: #5e667f;
  --ok: #2f9e61;
  --warn: #d7861f;
  --danger: #b5393f;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 14px 50px rgba(29, 41, 67, 0.1);
  --shadow-strong: 0 18px 60px rgba(21, 32, 62, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
  color: var(--text-strong);
  background: linear-gradient(140deg, #f8f3eb 0%, #e7effc 45%, #f3f7ff 100%);
  overflow-x: hidden;
}

.ambient-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.65;
  animation: drift 16s ease-in-out infinite;
}

.orb-a {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -130px;
  background: radial-gradient(circle at 25% 30%, #ffce9f, rgba(255, 130, 48, 0.15));
}

.orb-b {
  width: 360px;
  height: 360px;
  top: 18%;
  right: -80px;
  background: radial-gradient(circle at 30% 25%, #89ccff, rgba(46, 121, 194, 0.09));
  animation-delay: 3s;
}

.orb-c {
  width: 500px;
  height: 500px;
  bottom: -220px;
  left: 34%;
  background: radial-gradient(circle at 42% 42%, #fff0bc, rgba(255, 185, 74, 0.08));
  animation-delay: 6s;
}

.grain {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.18) 0.8px, transparent 0.8px),
    radial-gradient(rgba(44, 54, 88, 0.06) 0.8px, transparent 0.8px);
  background-position: 0 0, 14px 14px;
  background-size: 26px 26px;
  opacity: 0.35;
}

.app-shell {
  width: min(1260px, calc(100vw - 2rem));
  margin: 1rem auto 1.8rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.8));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.top-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(120deg, color-mix(in srgb, var(--brand-primary) 13%, white), color-mix(in srgb, var(--brand-accent) 13%, white));
  border-bottom: 1px solid rgba(255, 255, 255, 0.85);
}

.brand-block {
  display: flex;
  gap: 0.95rem;
  align-items: center;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.9);
  object-fit: contain;
  box-shadow: inset 0 0 0 1px rgba(18, 35, 66, 0.08);
}

.product-name {
  margin: 0;
  font-size: 0.77rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--brand-accent) 68%, #29415f);
  font-weight: 700;
}

h1 {
  margin: 0.1rem 0;
  font-family: "Fraunces", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(1.2rem, 2.8vw, 1.8rem);
  font-weight: 700;
  color: #23304a;
  line-height: 1.1;
}

.school-tagline {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
}

.safety-pill {
  color: #1f3a5f;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.role-switch,
.subnav-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.role-switch button,
.subnav-strip button,
.quick-type-btn,
.chip-btn,
.ghost-btn,
.primary-btn,
.danger-btn,
.neutral-btn {
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.2s ease;
}

.role-switch button,
.subnav-strip button {
  padding: 0.48rem 0.92rem;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  font-size: 0.86rem;
  color: #2d3f61;
}

.role-switch button:hover,
.subnav-strip button:hover {
  transform: translateY(-1px);
}

.role-switch button.active,
.subnav-strip button.active {
  color: #ffffff;
  background: linear-gradient(130deg, var(--brand-primary), var(--brand-accent));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--brand-primary) 26%, transparent);
}

.app-main {
  padding: 1rem 1.15rem 1.3rem;
}

.context-strip {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.context-card {
  padding: 0.95rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(251, 249, 245, 0.84));
  border: 1px solid rgba(223, 228, 241, 0.85);
  box-shadow: 0 8px 30px rgba(43, 62, 101, 0.07);
}

.context-card h3 {
  margin: 0;
  font-family: "Fraunces", "Palatino Linotype", serif;
  font-size: 1.01rem;
}

.context-card p {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.child-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
}

.child-card {
  border: 1px solid rgba(195, 208, 234, 0.95);
  border-radius: 18px;
  padding: 0.78rem;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.65));
  cursor: pointer;
}

.child-card.active {
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand-primary) 16%, white), rgba(255, 255, 255, 0.86));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--brand-primary) 24%, transparent);
}

.child-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #ffffff;
}

.child-meta h4 {
  margin: 0;
  font-size: 0.95rem;
}

.child-meta p {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.view-root {
  min-height: 420px;
  animation: fade-up 0.35s ease both;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 0.9rem;
}

.card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.73));
  border: 1px solid rgba(214, 223, 242, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px rgba(37, 59, 106, 0.08);
}

.card-header {
  padding: 0.95rem 1rem 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.card-header h3,
.card-header h2 {
  margin: 0;
  font-family: "Fraunces", "Palatino Linotype", serif;
  font-size: 1.08rem;
}

.card-content {
  padding: 0 1rem 1rem;
}

.summary-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 17%, white), color-mix(in srgb, var(--brand-accent) 12%, white));
  color: #23304a;
  box-shadow: 0 14px 35px color-mix(in srgb, var(--brand-primary) 22%, transparent);
}

.summary-card h2 {
  margin: 0;
  font-family: "Fraunces", "Palatino Linotype", serif;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
}

.timeline-list {
  display: grid;
  gap: 0.75rem;
}

.timeline-item {
  border-radius: 17px;
  border: 1px solid rgba(211, 220, 239, 0.9);
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem 0.4rem;
}

.timeline-top h4 {
  margin: 0;
  font-size: 0.96rem;
}

.timeline-top p {
  margin: 0.12rem 0 0;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.badge {
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.28rem 0.58rem;
  align-self: start;
}

.badge.milestone {
  background: #f8da86;
  color: #553800;
}

.badge.normal {
  background: rgba(45, 109, 191, 0.12);
  color: #1e4e88;
}

.timeline-body {
  padding: 0 0.9rem 0.9rem;
}

.timeline-caption {
  margin: 0.4rem 0;
  color: #2f3651;
  font-size: 0.9rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
}

.media-tile {
  border-radius: 12px;
  border: 1px solid rgba(202, 211, 235, 0.88);
  background: #f9fbff;
  overflow: hidden;
}

.media-visual {
  position: relative;
  min-height: 110px;
  background-size: cover;
  background-position: center;
}

.media-visual button {
  position: absolute;
  right: 0.35rem;
  top: 0.35rem;
  font-size: 0.72rem;
  padding: 0.32rem 0.55rem;
}

.media-tile footer {
  font-size: 0.74rem;
  padding: 0.45rem 0.55rem 0.55rem;
  color: #425174;
}

.reaction-row {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-btn {
  padding: 0.35rem 0.62rem;
  background: rgba(45, 109, 191, 0.08);
  color: #274167;
  font-weight: 700;
  font-size: 0.77rem;
}

.chip-btn.active {
  background: rgba(238, 127, 59, 0.18);
  color: #6e370f;
}

.note-box {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 11px;
  border: 1px solid rgba(228, 204, 134, 0.8);
  background: rgba(255, 245, 214, 0.72);
  color: #64480f;
  font-size: 0.82rem;
}

.right-column {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.ai-summary-box {
  padding: 0.82rem;
  border-radius: 14px;
  border: 1px solid rgba(182, 199, 233, 0.8);
  background: linear-gradient(130deg, rgba(237, 243, 255, 0.92), rgba(252, 246, 235, 0.85));
}

.ai-summary-box p {
  margin: 0.38rem 0 0;
  color: #2f3f62;
  font-size: 0.88rem;
  line-height: 1.45;
}

.list-rows {
  display: grid;
  gap: 0.52rem;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  padding: 0.55rem 0.62rem;
  border-radius: 11px;
  background: rgba(247, 250, 255, 0.75);
  border: 1px solid rgba(211, 220, 242, 0.85);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-beginning {
  background: #d77d28;
}

.status-developing {
  background: #d5bb2a;
}

.status-proficient {
  background: #3fae73;
}

.status-mastered {
  background: #2d6ccf;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.neutral-btn {
  padding: 0.48rem 0.86rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(128deg, var(--brand-primary), var(--brand-accent));
  color: #ffffff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}

.ghost-btn {
  background: rgba(244, 248, 255, 0.88);
  color: #2e4369;
  border: 1px solid rgba(199, 213, 241, 0.95);
}

.neutral-btn {
  background: rgba(235, 242, 255, 0.85);
  color: #2d4b71;
}

.danger-btn {
  background: rgba(181, 57, 63, 0.12);
  color: #8e2f35;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 0.72rem;
}

.subject-card {
  border-radius: 14px;
  border: 1px solid rgba(209, 220, 242, 0.95);
  background: rgba(255, 255, 255, 0.91);
  padding: 0.72rem;
  display: flex;
  gap: 0.68rem;
  align-items: center;
}

.progress-ring {
  --value: 60;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, #ffffff 72%, transparent 73% 100%),
    conic-gradient(var(--brand-accent) calc(var(--value) * 1%), rgba(226, 234, 252, 1) 0);
}

.progress-ring span {
  font-size: 0.76rem;
  font-weight: 700;
  color: #2d4169;
}

.skill-list button {
  width: 100%;
  border: 1px solid rgba(204, 216, 239, 0.95);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
  padding: 0.58rem 0.65rem;
  font: inherit;
  margin-top: 0.45rem;
  cursor: pointer;
}

.skill-list button.active {
  border-color: color-mix(in srgb, var(--brand-primary) 65%, #ffd2b4);
  box-shadow: inset 0 0 0 1px rgba(234, 128, 63, 0.3);
}

.trend-chart {
  width: 100%;
  height: 88px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff, #f2f6ff);
  border: 1px solid rgba(212, 221, 241, 0.92);
}

.event-list {
  display: grid;
  gap: 0.62rem;
}

.event-card {
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(204, 216, 241, 0.9);
  background: rgba(255, 255, 255, 0.92);
}

.event-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
}

.event-top h4 {
  margin: 0;
  font-size: 0.95rem;
}

.event-top p {
  margin: 0.2rem 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.priority-urgent {
  background: rgba(181, 57, 63, 0.16);
  color: #8d2931;
}

.priority-action {
  background: rgba(240, 164, 30, 0.17);
  color: #80530f;
}

.priority-digest {
  background: rgba(39, 132, 84, 0.16);
  color: #295f45;
}

.priority-passive {
  background: rgba(93, 112, 145, 0.12);
  color: #405275;
}

.event-actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.messages-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 0.8rem;
}

.thread-list {
  border-radius: 14px;
  border: 1px solid rgba(205, 216, 238, 0.94);
  background: rgba(255, 255, 255, 0.82);
  padding: 0.45rem;
  max-height: 460px;
  overflow: auto;
}

.thread-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  padding: 0.6rem;
  background: transparent;
  cursor: pointer;
  margin-bottom: 0.3rem;
}

.thread-btn.active {
  background: rgba(236, 244, 255, 0.9);
  border-color: rgba(189, 205, 236, 0.95);
}

.thread-btn h4 {
  margin: 0;
  font-size: 0.9rem;
}

.thread-btn p {
  margin: 0.16rem 0 0;
  color: var(--text-soft);
  font-size: 0.77rem;
}

.chat-panel {
  border-radius: 14px;
  border: 1px solid rgba(205, 217, 241, 0.94);
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 420px;
}

.chat-header {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(219, 227, 244, 0.93);
}

.chat-header h3 {
  margin: 0;
  font-size: 0.98rem;
}

.chat-header p {
  margin: 0.18rem 0 0;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.chat-feed {
  padding: 0.72rem;
  display: grid;
  gap: 0.4rem;
  overflow-y: auto;
  max-height: 332px;
}

.bubble {
  max-width: 82%;
  padding: 0.56rem 0.7rem;
  border-radius: 12px;
  font-size: 0.84rem;
}

.bubble.parent {
  justify-self: end;
  background: color-mix(in srgb, var(--brand-primary) 20%, white);
  border: 1px solid rgba(238, 136, 74, 0.3);
}

.bubble.teacher {
  justify-self: start;
  background: rgba(239, 244, 255, 0.95);
  border: 1px solid rgba(197, 210, 238, 0.9);
}

.chat-composer {
  padding: 0.62rem;
  border-top: 1px solid rgba(219, 228, 244, 0.95);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

textarea,
input,
select {
  width: 100%;
  border-radius: 11px;
  border: 1px solid rgba(193, 205, 232, 0.95);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.55rem 0.62rem;
  font: inherit;
  color: #223355;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #435170;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.58rem;
}

.media-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.library-tile {
  border-radius: 12px;
  border: 1px solid rgba(202, 214, 238, 0.92);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
}

.library-tile .media-visual {
  min-height: 96px;
}

.library-tile footer {
  padding: 0.4rem 0.5rem;
  font-size: 0.72rem;
  color: #44557a;
}

.memory-pages {
  display: grid;
  gap: 0.7rem;
}

.memory-page {
  border-radius: 15px;
  border: 1px solid rgba(203, 214, 238, 0.94);
  background: linear-gradient(154deg, rgba(255, 255, 255, 0.95), rgba(254, 248, 239, 0.9));
  padding: 0.72rem;
}

.memory-page h4 {
  margin: 0;
  font-family: "Fraunces", "Palatino Linotype", serif;
  font-size: 1rem;
}

.memory-page p {
  margin: 0.42rem 0 0;
  font-size: 0.84rem;
  color: #384767;
}

.memory-thumb-row {
  margin-top: 0.45rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.4rem;
}

.memory-thumb {
  min-height: 70px;
  border-radius: 10px;
  border: 1px solid rgba(205, 215, 239, 0.94);
  background-size: cover;
  background-position: center;
}

.teacher-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.85rem;
}

.quick-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-bottom: 0.62rem;
}

.quick-type-btn {
  padding: 0.42rem 0.74rem;
  font-size: 0.77rem;
  font-weight: 700;
  color: #31507a;
  background: rgba(235, 242, 255, 0.84);
}

.quick-type-btn.active {
  background: rgba(236, 134, 79, 0.2);
  color: #6a350d;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 0.42rem;
  margin-top: 0.5rem;
}

.tag-chip {
  padding: 0.38rem 0.5rem;
  border-radius: 11px;
  border: 1px solid rgba(193, 207, 235, 0.95);
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.77rem;
  cursor: pointer;
}

.tag-chip.selected {
  background: rgba(236, 134, 79, 0.19);
  border-color: rgba(228, 128, 61, 0.6);
  color: #66390f;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.metric-card {
  border-radius: 12px;
  border: 1px solid rgba(206, 216, 236, 0.95);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.58rem;
}

.metric-card h4 {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-card p {
  margin: 0.26rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.assessment-grid {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.assessment-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  border-radius: 10px;
  border: 1px solid rgba(206, 216, 238, 0.95);
  padding: 0.48rem 0.58rem;
  background: rgba(255, 255, 255, 0.92);
}

.assessment-row h4 {
  margin: 0;
  font-size: 0.86rem;
}

.assessment-row p {
  margin: 0.18rem 0 0;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.admin-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0.86rem;
}

.preview-device {
  border-radius: 26px;
  border: 1px solid rgba(211, 220, 241, 0.95);
  background: #ffffff;
  overflow: hidden;
  width: min(290px, 100%);
  margin: 0 auto;
  box-shadow: 0 12px 36px rgba(35, 52, 86, 0.16);
}

.preview-head {
  padding: 0.7rem 0.8rem;
  color: #ffffff;
  background: linear-gradient(145deg, var(--brand-primary), var(--brand-accent));
}

.preview-head h4 {
  margin: 0;
}

.preview-body {
  padding: 0.75rem;
  display: grid;
  gap: 0.42rem;
}

.mini-block {
  border-radius: 9px;
  padding: 0.45rem;
  border: 1px solid rgba(209, 217, 239, 0.96);
  background: rgba(247, 250, 255, 0.9);
  font-size: 0.75rem;
}

.bar-chart {
  display: grid;
  gap: 0.42rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.79rem;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(220, 229, 247, 0.95);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
}

.table-shell {
  border-radius: 13px;
  overflow: auto;
  border: 1px solid rgba(205, 217, 240, 0.95);
  background: rgba(255, 255, 255, 0.9);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  padding: 0.55rem 0.62rem;
  text-align: left;
  border-bottom: 1px solid rgba(216, 226, 244, 0.94);
  font-size: 0.8rem;
}

th {
  color: #415678;
  background: rgba(243, 248, 255, 0.9);
}

.toggle-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.52rem 0;
  border-bottom: 1px dashed rgba(215, 224, 240, 0.9);
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  position: absolute;
  inset: 0;
  background: #ccd8f0;
  border-radius: 999px;
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: color-mix(in srgb, var(--brand-primary) 70%, var(--brand-accent));
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.splash-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(247, 237, 225, 0.95), rgba(224, 238, 255, 0.95));
  z-index: 1000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-card {
  text-align: center;
  padding: 1.2rem 1.35rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-strong);
  animation: fade-up 0.5s ease both;
}

.splash-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.splash-title {
  margin: 0.45rem 0 0;
  font-size: 1.3rem;
  font-family: "Fraunces", "Palatino Linotype", serif;
  color: #243452;
}

.splash-subtitle {
  margin: 0.35rem 0 0;
  color: #526186;
  font-size: 0.9rem;
}

.toast-container {
  position: fixed;
  right: 0.9rem;
  bottom: 0.9rem;
  z-index: 1200;
  display: grid;
  gap: 0.45rem;
}

.toast {
  min-width: 230px;
  max-width: 320px;
  padding: 0.58rem 0.7rem;
  border-radius: 11px;
  background: rgba(31, 42, 68, 0.92);
  color: #ffffff;
  font-size: 0.8rem;
  box-shadow: 0 10px 22px rgba(18, 27, 46, 0.28);
}

.confirm-dialog {
  border: none;
  border-radius: 16px;
  max-width: 460px;
  width: calc(100vw - 2rem);
  box-shadow: 0 26px 58px rgba(12, 20, 34, 0.26);
  padding: 0;
}

.confirm-dialog::backdrop {
  background: rgba(13, 19, 36, 0.48);
}

.confirm-content {
  padding: 0.95rem 1rem;
}

.confirm-content h3 {
  margin: 0;
  font-size: 1.02rem;
}

.confirm-content p {
  margin: 0.55rem 0;
  color: #465677;
  white-space: pre-line;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.empty-state {
  padding: 0.82rem;
  border: 1px dashed rgba(198, 211, 238, 0.95);
  border-radius: 12px;
  color: #506186;
  font-size: 0.82rem;
  background: rgba(248, 251, 255, 0.8);
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(12px) translateX(-18px);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .panel-grid,
  .teacher-layout,
  .admin-layout,
  .messages-layout {
    grid-template-columns: 1fr;
  }

  .messages-layout {
    gap: 0.6rem;
  }

  .chat-feed {
    max-height: 250px;
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: calc(100vw - 0.7rem);
    margin: 0.35rem auto 0.8rem;
    border-radius: 18px;
  }

  .top-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-main {
    padding: 0.8rem;
  }

  .context-grid,
  .child-selector-grid {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 88px 1fr auto;
    gap: 0.35rem;
  }
}
