:root {
  --ink: #1b2430;
  --muted: #647184;
  --canvas: #f5f7fa;
  --panel: #ffffff;
  --line: #d9e2eb;
  --nav: #192435;
  --teal: #0f7b7c;
  --blue: #2f5f9d;
  --green: #2d7a56;
  --gold: #b06c12;
  --red: #b44453;
  --soft-teal: #e7f4f2;
  --soft-blue: #edf3fb;
  --shadow: 0 18px 45px rgba(27, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(25, 36, 53, 0.94), rgba(15, 123, 124, 0.82)),
    url("/site-assets/family-learning.jpg");
  background-size: cover;
  background-position: center;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
  margin-bottom: 4px;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.demo-users {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.demo-users button,
.link-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--teal);
  min-height: 34px;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
}

.rail {
  background: var(--nav);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand > span {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f1bd55;
  color: var(--nav);
  font-weight: 800;
}

.brand strong,
.brand small,
.pilot-box strong,
.pilot-box small,
.pilot-box span {
  display: block;
}

.brand small,
.pilot-box small,
.pilot-box span {
  color: #b9c5d4;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  border: 0;
  border-radius: 7px;
  padding: 11px 12px;
  text-align: left;
  background: transparent;
  color: #d7e0ea;
}

.nav-button.active,
.nav-button:hover {
  background: #263449;
  color: #fff;
}

.pilot-box {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 14px;
}

.pilot-box strong {
  margin: 5px 0;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.header h1 {
  margin: 3px 0 0;
  font-size: 30px;
  line-height: 1.18;
}

.kicker {
  margin: 0;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.session-card,
.metrics article,
.panel,
.phone,
.template {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.session-card {
  min-width: 184px;
  padding: 12px 14px;
}

.session-card small,
.session-card strong,
.session-card span {
  display: block;
}

.session-card small,
.session-card span {
  color: var(--muted);
  font-size: 12px;
}

.session-card .link-button {
  margin-top: 8px;
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.family-manager {
  margin-bottom: 18px;
}

.family-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.family-chip {
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.family-chip.active {
  border-color: var(--teal);
  background: var(--soft-teal);
}

.family-chip strong,
.family-chip span {
  display: block;
}

.family-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-grid div {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.profile-grid span,
.profile-grid strong {
  display: block;
}

.profile-grid span {
  color: var(--muted);
  font-size: 13px;
}

.profile-grid strong {
  margin-top: 9px;
  font-size: 18px;
  line-height: 1.35;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 1fr) auto;
  gap: 10px;
}

.inline-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
}

.metrics article {
  padding: 16px;
  min-height: 112px;
}

.metrics span,
.metrics small {
  color: var(--muted);
}

.metrics strong {
  display: block;
  font-size: 32px;
  margin: 10px 0 6px;
}

.two-col,
.mobile-and-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  gap: 18px;
}

.config-area {
  margin-top: 18px;
}

.plan-builder {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.panel-head h2 {
  margin: 0;
}

.panel-head span,
.text {
  color: var(--muted);
  font-size: 13px;
}

.config-form {
  display: grid;
  gap: 10px;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.planner-controls {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 0.7fr 0.7fr 0.8fr;
  gap: 10px;
}

.config-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.config-form input,
.config-form select,
.config-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

.planner-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.planner-day,
.day-plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.day-title {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.draft-item,
.library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fff;
}

.draft-item + .draft-item {
  margin-top: 8px;
}

.draft-item strong,
.draft-item span,
.library-item strong,
.library-item span {
  display: block;
}

.draft-item span,
.library-item span,
.empty-day {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.library-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.library-form {
  grid-template-columns: minmax(120px, 1fr) minmax(90px, 0.7fr) 80px 80px 80px minmax(160px, 1.4fr) auto;
}

.reward-form {
  grid-template-columns: 96px 96px minmax(160px, 1fr) 110px auto;
}

.inline-form select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
}

.config-form textarea {
  min-height: 184px;
  resize: vertical;
  line-height: 1.6;
}

.list,
.mobile-list,
.child-grid,
.notice-grid {
  display: grid;
  gap: 10px;
}

.row,
.mobile-row,
.child-card,
.notice-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.row strong,
.mobile-row strong,
.child-card strong,
.notice-grid strong {
  display: block;
  margin-bottom: 5px;
}

.meta,
.notice-grid span {
  color: var(--muted);
  font-size: 13px;
}

.danger-text {
  color: var(--red);
  font-weight: 700;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.badge.complete {
  background: #e7f5ee;
  color: var(--green);
}

.badge.partial {
  background: #fff3dc;
  color: var(--gold);
}

.badge.incomplete {
  background: #ffedf0;
  color: var(--red);
}

.badge.na {
  background: #edf0f3;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.primary,
.secondary,
.small,
.tab {
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 34px;
  padding: 7px 10px;
}

.primary {
  background: var(--teal);
  color: #fff;
}

.secondary,
.tab,
.small {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.small {
  color: var(--teal);
  background: var(--soft-teal);
}

.phone {
  padding: 16px;
  max-width: 390px;
}

.phone-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 14px;
}

.phone-top strong {
  color: var(--ink);
}

.today-card {
  background: var(--soft-teal);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.today-card strong,
.today-card span,
.today-card small {
  display: block;
}

.today-card strong {
  font-size: 30px;
  margin: 6px 0;
}

.mobile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.child-hero {
  min-height: 178px;
  background:
    linear-gradient(90deg, rgba(15, 123, 124, 0.92), rgba(47, 95, 157, 0.72)),
    url("/site-assets/family-learning.jpg");
  background-size: cover;
  background-position: center;
  color: #fff;
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 18px;
}

.child-hero .kicker {
  color: #dff4f2;
}

.child-hero h2 {
  margin: 4px 0 8px;
  font-size: 30px;
}

.child-hero p:last-child {
  margin: 0;
}

.child-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.child-card {
  min-height: 160px;
  display: grid;
  gap: 12px;
}

.checkin-box {
  display: grid;
  gap: 8px;
}

.checkin-box select,
.checkin-box textarea,
.checkin-box input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  background: #fff;
  color: var(--ink);
}

.checkin-box textarea {
  resize: vertical;
  line-height: 1.5;
}

.template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.deliverable-editor {
  margin-bottom: 18px;
}

.deliverable-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#shareLinkText {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--muted);
  background: #f8fafc;
}

.tab.active {
  background: var(--teal);
  color: #fff;
}

.template {
  padding: 24px;
  min-height: 520px;
}

.template h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

.template table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.template th,
.template td {
  border: 1px solid var(--line);
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

.template th {
  background: #f1f5f8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--nav);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
}

.share-body {
  background: #eef3f5;
}

.share-page {
  width: min(980px, calc(100% - 28px));
  margin: 24px auto;
  display: grid;
  gap: 16px;
}

.share-header,
.share-section,
.share-metrics article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.share-header {
  padding: 28px;
}

.share-header h1 {
  margin: 4px 0 8px;
  font-size: 34px;
  line-height: 1.18;
}

.share-header p:last-child {
  margin: 0;
  color: var(--muted);
}

.share-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.share-metrics article {
  padding: 16px;
}

.share-metrics span,
.share-section p {
  color: var(--muted);
}

.share-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.share-section {
  padding: 22px;
}

.share-section h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.share-section p {
  margin: 0;
  line-height: 1.7;
}

.table-wrap {
  overflow-x: auto;
}

.share-section table {
  width: 100%;
  border-collapse: collapse;
}

.share-section th,
.share-section td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.share-section th {
  background: #f1f5f8;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-button {
    text-align: center;
    padding: 9px 4px;
    font-size: 13px;
  }

  .pilot-box {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .header,
  .two-col,
  .mobile-and-panel,
  .planner-controls,
  .library-form,
  .reward-form {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .phone {
    max-width: none;
  }

  .planner-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 620px) {
  .metrics,
  .child-grid,
  .inline-form,
  .share-metrics,
  .planner-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .row,
  .mobile-row {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: flex-start;
  }
}
