/* ============================================================
   APP MENINAS V2 — PROTÓTIPO VISUAL
   Estrutura mobile first, sem framework e sem banco de dados.
   ============================================================ */

/* ============================================================
   1. VARIÁVEIS
   ============================================================ */
:root {
  --font-playful: "Sour Gummy", system-ui, sans-serif;
  --font-sans: "Roboto Condensed", Arial, sans-serif;

  --pink-header: #ec008c;
  --pink-strong: #ed168c;
  --pink-dark: #a90067;
  --pink-soft: #ffd4e8;

  --orange-main: #fa7000;
  --orange-dark: #c74608;
  --orange-line: #e48a04;
  --yellow: #fff126;
  --yellow-panel: #ffe6a4;
  --yellow-soft: #fff4c9;

  --metas-main: #ff9ec2;
  --metas-dark: #d51b9d;
  --metas-panel: #ffd8e9;

  --config-main: #63c1ff;
  --config-dark: #157ebc;
  --config-panel: #e6fffb;

  --purple-footer: #c30ce5;
  --purple-dark: #6f138e;
  --ink: #7c1b0d;
  --ink-dark: #4d1831;
  --white: #ffffff;

  --shadow-comic: 0 4px 0 rgba(82, 27, 43, 0.25), 0 8px 14px rgba(82, 27, 43, 0.16);
  --shadow-soft: 0 8px 20px rgba(79, 24, 70, 0.18);
  --border-thin: 2px solid rgba(124, 27, 13, 0.22);
  --radius-card: 8px;
  --radius-panel: 10px;
}

/* ============================================================
   2. RESET / BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f7d7e8;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink-dark);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top, rgba(255,255,255,.95), rgba(255,226,239,.92) 45%, rgba(230,186,218,.92));
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #fff126;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ============================================================
   3. SHELL DO APP
   ============================================================ */
.app-shell {
  position: relative;
  width: min(100%, 420px);
  min-height: 100vh;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 0 36px rgba(84, 22, 75, 0.28);
  overflow: hidden;
}

.page-stage {
  position: relative;
  min-height: 760px;
  padding: 1px 0 54px;
  isolation: isolate;
}

.page-stage::before,
.page-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page-stage::before {
  z-index: -2;
}

.page-stage::after {
  z-index: -1;
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% auto;
  opacity: .9;
}

.page-content {
  position: relative;
  width: calc(100% - 36px);
  margin: 38px auto 0;
}

/* ============================================================
   4. HEADER
   ============================================================ */
.app-header {
  position: relative;
  z-index: 10;
  height: 132px;
  background-color: var(--pink-header);
  background-image:
    linear-gradient(100deg, rgba(255,0,142,.16), rgba(167,0,111,.12)),
    url("../assets/imgs/app2_header_fundo.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  overflow: hidden;
}

.app-header::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 170px;
  height: 170px;
  border: 18px solid rgba(255,255,255,.06);
  border-radius: 50%;
}

.app-header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 16px 18px 25px;
}

.app-header__logo-link {
  display: block;
  width: 160px;
  transform: rotate(-1deg);
}

.app-header__logo {
  width: 100%;
  filter: drop-shadow(0 3px 0 rgba(140, 0, 89, .25));
}

.app-header__date-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: -4px;
}

.app-header__date {
  color: var(--yellow);
  font-family: var(--font-playful);
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.7px;
  text-shadow: 0 2px 0 rgba(107, 0, 75, .48);
  white-space: nowrap;
}

.calendar-button {
  position: relative;
  width: 27px;
  height: 31px;
  padding: 0;
  border: 2px solid #ffea28;
  border-radius: 2px;
  background: #f8eb2a;
  box-shadow: 2px 3px 0 rgba(111, 0, 76, .35);
  transform: rotate(1.5deg);
}

.calendar-button__top {
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: 7px;
  background: #fff568;
  border-bottom: 2px solid rgba(164, 123, 0, .28);
}

.calendar-button__grid {
  position: absolute;
  inset: 10px 5px 5px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  opacity: .48;
}

.calendar-button__grid i {
  background: #d99900;
  border-radius: 1px;
}

/* ============================================================
   5. NAVEGAÇÃO / ABAS
   ============================================================ */
.nav-tabs {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  margin: -31px auto -22px;
  padding: 0 18px;
}

.nav-tab {
  display: block;
  flex: 0 0 auto;
  width: 92px;
  transform-origin: center top;
  transition: transform .18s ease, filter .18s ease;
  filter: drop-shadow(0 4px 2px rgba(80, 25, 50, .3));
}

.nav-tab--meninas {
  transform: rotate(-4deg) translateY(9px);
}

.nav-tab--metas {
  transform: rotate(-2deg) translateY(7px);
}

.nav-tab--config {
  transform: rotate(-3deg) translateY(9px);
}

.nav-tab.is-active {
  position: relative;
  z-index: 3;
  width: 122px;
  transform: rotate(-3deg) translateY(0);
  filter: drop-shadow(0 6px 3px rgba(80, 25, 50, .35));
}

.nav-tab:hover {
  filter: drop-shadow(0 7px 4px rgba(80, 25, 50, .36)) brightness(1.03);
}

.nav-tab:active {
  transform: translateY(3px) rotate(-2deg) scale(.98);
}

/* ============================================================
   6. FUNDOS POR TELA
   ============================================================ */
.page-stage--meninas::before {
  background: linear-gradient(180deg, #fa7000 0%, #ff9b43 58%, #ffe1d0 100%);
}

.page-stage--meninas::after {
  background-image: url("../assets/imgs/app2_halftone_amarelo.png");
}

.page-stage--metas::before {
  background: linear-gradient(180deg, #ff9ec2 0%, #ffbdd7 58%, #ffdbe8 100%);
}

.page-stage--metas::after {
  background-image: url("../assets/imgs/app2_halftone_rosa.png");
}

.page-stage--config::before {
  background: linear-gradient(180deg, #63c1ff 0%, #99d7ff 56%, #cfeaff 100%);
}

.page-stage--config::after {
  background-image: url("../assets/imgs/app2_halftone_azul.png");
}

.page-content--meninas,
.page-content--metas,
.page-content--config {
  min-height: 600px;
}

/* ============================================================
   7. TELA MENINAS
   ============================================================ */
.children-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.child-accordion {
  position: relative;
}

.child-accordion__trigger {
  position: relative;
  display: grid;
  grid-template-columns: 75px 1fr 22px;
  align-items: center;
  width: calc(100% - 26px);
  min-height: 54px;
  margin-left: 26px;
  padding: 8px 12px 8px 38px;
  border: 2px solid #db8b00;
  border-radius: 7px;
  color: var(--ink);
  background: #ffe098;
  box-shadow: 0 2px 0 rgba(255,255,255,.55) inset;
  text-align: left;
  transition: transform .18s ease, background .18s ease;
}

.child-accordion__trigger:hover {
  background: #ffeaad;
}

.child-accordion__trigger[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: #ffd66d;
}

.child-accordion__title {
  grid-column: 2;
  font-family: var(--font-playful);
  font-size: 18px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
}

.comic-arrow {
  grid-column: 3;
  justify-self: end;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 9px solid #b7410d;
  transition: transform .18s ease;
}

.child-accordion__trigger[aria-expanded="true"] .comic-arrow {
  transform: rotate(90deg);
}

.polaroid {
  position: absolute;
  z-index: 4;
  display: block;
  padding: 19px 4px 5px;
  border: 2px solid #d98300;
  background: #ffffff;
  box-shadow: 0 5px 8px rgba(80, 31, 43, .25);
  transform: rotate(-7deg);
  overflow: hidden;
}

.polaroid--small {
  left: -21px;
  top: -12px;
  width: 72px;
  height: 73px;
}

.polaroid__label {
  position: absolute;
  top: 1px;
  left: 3px;
  right: 3px;
  z-index: 2;
  color: #ffffff;
  font-family: var(--font-playful);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-shadow: -1px 1px 0 #2c78aa, 1px 1px 0 #2c78aa;
}

.polaroid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,.12);
}

.child-accordion:nth-child(even) .polaroid {
  transform: rotate(-9deg);
}

.child-accordion:nth-child(3n) .polaroid {
  transform: rotate(-5deg);
}

.child-accordion__panel {
  width: calc(100% - 26px);
  margin-left: 26px;
}

.daily-card {
  position: relative;
  padding: 18px 14px 18px;
  border: 2px solid #e59800;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(180deg, rgba(255,239,174,.98), rgba(255,219,143,.98));
  box-shadow: var(--shadow-soft);
}

.daily-summary {
  margin-bottom: 19px;
}

.daily-summary__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.daily-summary__eyebrow,
.daily-summary__date {
  margin: 0;
  font-family: var(--font-playful);
  font-style: italic;
}

.daily-summary__eyebrow {
  font-size: 15px;
  font-weight: 600;
}

.daily-summary__date {
  font-size: 13px;
}

.daily-summary__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 4px 4px 1px 4px;
  color: #ffffff;
  background: #d65f07;
  font-family: var(--font-playful);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(119, 41, 0, .35);
}

.progress-track {
  position: relative;
  height: 13px;
  border: 2px solid #db6410;
  background: rgba(255,255,255,.72);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(123, 50, 8, .18);
}

.progress-track__fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ffbc00, #ff7c00 72%, #ed4c09);
  transition: width .26s ease;
}

.status-stars {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 46px;
  margin: -3px 0 -8px 7px;
}

.status-star {
  width: 52px;
  margin-left: -7px;
  opacity: .14;
  filter: drop-shadow(0 3px 2px rgba(128, 58, 0, .28));
  transform: rotate(-8deg);
  transition: opacity .24s ease, transform .24s ease;
}

.status-star:nth-child(2) {
  transform: rotate(8deg);
}

.status-star.is-earned {
  transform: rotate(-4deg) scale(1.1);
}

.status-star:nth-child(2).is-earned {
  transform: rotate(5deg) scale(1.1);
}

.daily-summary__message {
  margin: 0;
  color: #5e2816;
  font-family: var(--font-playful);
  font-size: 14px;
  font-style: italic;
  font-weight: 500;
  text-align: right;
}

.goal-groups {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.goal-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 0 5px;
  border-bottom: 1px solid #b9340d;
  color: #8e240b;
  background: transparent;
  font-family: var(--font-playful);
  font-size: 19px;
  font-weight: 800;
  text-align: left;
}

.goal-group__chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.goal-group__toggle[aria-expanded="false"] .goal-group__chevron,
.editable-group__toggle[aria-expanded="false"] .goal-group__chevron {
  transform: rotate(-45deg);
}

.goal-group__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px 2px 0 19px;
}

.goal-check {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 2px 0;
  color: #4b2c25;
  background: transparent;
  font-family: var(--font-playful);
  font-size: 14px;
  font-style: italic;
  line-height: 1.05;
  text-align: left;
}

.goal-check__star {
  width: 31px;
  height: 31px;
  object-fit: contain;
  transition: transform .16s ease, filter .16s ease;
}

.goal-check:hover .goal-check__star {
  transform: rotate(-9deg) scale(1.08);
}

.goal-check.is-checked .goal-check__star {
  filter: drop-shadow(0 2px 1px rgba(160, 75, 0, .3));
}

.adjustment-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
  margin: 23px 0 6px -3px;
}

.adjustment-button {
  width: 84px;
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 3px 1px rgba(80, 26, 36, .25));
  transition: transform .18s ease, opacity .18s ease, filter .18s ease;
}

.adjustment-button--bonus {
  transform: rotate(-3deg);
}

.adjustment-button--penalty {
  transform: rotate(1.5deg);
}

.adjustment-button:not(.is-active) {
  opacity: .68;
}

.adjustment-button.is-active {
  opacity: 1;
  transform: translateY(-3px) rotate(-2deg) scale(1.06);
  filter: drop-shadow(0 5px 2px rgba(80, 26, 36, .33)) saturate(1.25);
}

.adjustment-button--penalty.is-active {
  transform: translateY(-3px) rotate(2deg) scale(1.06);
}

.closure-result {
  min-height: 18px;
  margin: 5px 0 9px;
  color: #9b2a0c;
  font-family: var(--font-playful);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.close-day-button {
  position: relative;
  display: block;
  width: 170px;
  min-height: 45px;
  margin: 2px 0 0 auto;
  padding: 0;
  color: #ffffff;
  background: transparent;
  font-family: var(--font-playful);
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(106, 0, 53, .42);
  filter: drop-shadow(0 3px 1px rgba(86, 28, 38, .28));
  transform: rotate(-1deg);
}

.close-day-button img {
  width: 100%;
}

.close-day-button span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 12px 0;
  white-space: nowrap;
}

.child-accordion.is-closed .daily-card::after {
  content: "DIA FECHADO";
  position: absolute;
  top: 10px;
  right: -6px;
  padding: 4px 10px;
  border: 2px solid #fff;
  color: #fff;
  background: #7d2e9f;
  font-family: var(--font-playful);
  font-size: 12px;
  font-weight: 800;
  transform: rotate(4deg);
  box-shadow: 0 3px 0 rgba(75, 20, 86, .28);
}

.child-accordion.is-closed .goal-check,
.child-accordion.is-closed .adjustment-button {
  pointer-events: none;
  opacity: .48;
}

/* ============================================================
   8. TELA METAS
   ============================================================ */
.children-list--editor {
  gap: 16px;
}

.child-accordion__trigger--pink {
  border-color: #d530ad;
  color: #bf198e;
  background: #ffd7e7;
}

.child-accordion__trigger--pink:hover,
.child-accordion__trigger--pink[aria-expanded="true"] {
  background: #ffc9df;
}

.goals-editor-card {
  padding: 14px 12px 16px;
  border: 2px solid #e44ac4;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: rgba(255, 225, 239, .96);
  box-shadow: var(--shadow-soft);
}

.editable-groups {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.editable-group__header {
  display: grid;
  grid-template-columns: 25px 1fr;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid #f04cc7;
}

.editable-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 1px 6px;
  color: #cf159e;
  background: transparent;
  font-family: var(--font-playful);
  font-size: 19px;
  text-align: left;
}

.editable-group__toggle strong {
  font-weight: 800;
}

.editable-group__body {
  padding: 12px 3px 1px 7px;
}

.editable-goal-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.editable-goal {
  display: grid;
  grid-template-columns: 23px 1fr;
  align-items: center;
  gap: 7px;
  color: #3f2733;
  font-family: var(--font-playful);
  font-size: 14px;
  font-style: italic;
  line-height: 1.08;
}

.comic-checkbox {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.comic-checkbox input {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.comic-checkbox > span {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid #d92ac1;
  background: #ffffff;
  box-shadow: 1px 1px 0 rgba(115, 30, 104, .18);
}

.comic-checkbox input:checked + span {
  background: #ffed38;
}

.comic-checkbox input:checked + span::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-right: 3px solid #c91a9c;
  border-bottom: 3px solid #c91a9c;
  transform: rotate(42deg);
}

.comic-checkbox--group {
  width: 22px;
  height: 22px;
}

.add-goal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
}

.comic-input,
.comic-textarea,
.comic-select {
  width: 100%;
  border: 2px solid #cf30b5;
  border-radius: 3px;
  color: #47253b;
  background: rgba(255,255,255,.92);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  box-shadow: inset 0 2px 4px rgba(94, 28, 75, .08);
}

.comic-input,
.comic-select {
  min-height: 34px;
  padding: 6px 9px;
}

.comic-textarea {
  min-height: 80px;
  padding: 8px 10px;
  resize: vertical;
}

.add-goal-input {
  min-width: 0;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
  color: #6d174f;
  background: transparent;
  font-family: var(--font-playful);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.icon-text-button img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.icon-text-button--danger {
  color: #cc177d;
}

.day-selector,
.selection-tools {
  position: relative;
  margin-top: 16px;
  padding: 8px 7px;
  border: 1px solid rgba(226, 60, 194, .32);
  background: rgba(255,255,255,.28);
}

.day-selector h4,
.selection-tools h4 {
  margin: 0 0 7px;
  color: #cb1596;
  font-family: var(--font-playful);
  font-size: 12px;
}

.day-selector__options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-right: 0;
}

.day-pill {
  position: relative;
  display: inline-flex;
}

.day-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.day-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #e631bd;
  border-radius: 50%;
  color: #bd168e;
  background: #ffffff;
  font-family: var(--font-playful);
  font-size: 11px;
  font-weight: 700;
}

.day-pill input:checked + span {
  color: #ffffff;
  background: #d72caf;
  box-shadow: 0 2px 0 rgba(112, 18, 93, .25);
}

.all-days-option,
.selection-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5f2b50;
  font-family: var(--font-playful);
  font-size: 12px;
  font-weight: 600;
}

.all-days-option {
  margin-top: 8px;
}

.asset-action-button {
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 2px 1px rgba(73, 21, 64, .18));
}

.asset-action-button--apply {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 61px;
}

.selection-tools__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.text-tool-button {
  padding: 4px 0;
  color: #67465a;
  background: transparent;
  font-family: var(--font-playful);
  font-size: 12px;
  text-decoration: underline;
}

.asset-action-button--delete {
  width: 112px;
  margin-left: auto;
}

.group-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-top: 18px;
}

.editor-feedback {
  min-height: 18px;
  margin: 8px 0 0;
  color: #bb117e;
  font-family: var(--font-playful);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

/* ============================================================
   9. TELA CONFIG
   ============================================================ */
.page-content--config {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.config-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin: 0 auto -3px;
  padding: 7px 18px 8px 12px;
  border: 3px solid #0f8bca;
  color: #ffffff;
  background: #1e9bd9;
  box-shadow: 0 5px 0 rgba(16, 97, 149, .28);
  transform: rotate(-1.5deg);
}

.config-intro__spark {
  color: #fff132;
  font-size: 33px;
  text-shadow: 0 2px 0 rgba(37, 80, 117, .35);
}

.config-intro__eyebrow,
.config-intro h1 {
  margin: 0;
  font-family: var(--font-playful);
}

.config-intro__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.config-intro h1 {
  font-size: 25px;
  line-height: .9;
}

.config-panel {
  overflow: hidden;
  border: 2px solid #338fbc;
  border-radius: 8px;
  background: rgba(231, 255, 252, .94);
  box-shadow: var(--shadow-soft);
}

.config-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 61px;
  padding: 8px 14px;
  color: #ffffff;
  background: linear-gradient(100deg, #26a8e5, #0d81bc);
}

.config-panel--periods .config-panel__header {
  background: linear-gradient(100deg, #795bd7, #4937a9);
}

.config-panel--history .config-panel__header {
  background: linear-gradient(100deg, #e04ea3, #b81579);
}

.config-panel__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  color: #fff638;
  font-family: var(--font-playful);
  font-size: 23px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(24, 72, 115, .28);
}

.config-panel__eyebrow,
.config-panel__header h2 {
  margin: 0;
  font-family: var(--font-playful);
}

.config-panel__eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.config-panel__header h2 {
  font-size: 24px;
  line-height: .95;
}

.config-panel__body {
  padding: 15px 13px 17px;
}

.config-period-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}

.config-period-tab {
  min-height: 35px;
  padding: 5px 6px;
  border: 2px solid #1f8fc5;
  color: #146b98;
  background: #ffffff;
  font-family: var(--font-playful);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(18, 83, 126, .16);
  transform: rotate(-1deg);
}

.config-period-tab:nth-child(2) {
  transform: rotate(1deg);
}

.config-period-tab.is-active {
  color: #ffffff;
  background: #1d97d2;
  transform: translateY(-2px) rotate(-1deg) scale(1.04);
}

.config-period-tabs--secondary .config-period-tab {
  border-color: #6c55c9;
  color: #5945b4;
}

.config-period-tabs--secondary .config-period-tab.is-active {
  color: #ffffff;
  background: #6250c6;
}

.config-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.comic-fieldset {
  min-width: 0;
  margin: 0;
  padding: 9px 9px 10px;
  border: 2px dashed rgba(38, 142, 192, .45);
  border-radius: 6px;
  background: rgba(255,255,255,.5);
}

.comic-fieldset legend {
  padding: 0 5px;
  color: #1c79a7;
  font-family: var(--font-playful);
  font-size: 13px;
  font-weight: 800;
}

.comic-radio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
  color: #334252;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
}

.comic-radio input {
  position: absolute;
  opacity: 0;
}

.comic-radio > span {
  width: 17px;
  height: 17px;
  border: 2px solid #218fc4;
  border-radius: 50%;
  background: #ffffff;
}

.comic-radio input:checked + span {
  box-shadow: inset 0 0 0 4px #ffffff;
  background: #ff4ca0;
}

.reward-person-panel,
.reward-collective-note,
.reward-type-panel {
  margin-top: 13px;
}

.comic-label {
  display: block;
  margin-bottom: 5px;
  color: #1e789f;
  font-family: var(--font-playful);
  font-size: 13px;
  font-weight: 700;
}

.comic-select {
  border-color: #2b9ace;
}

.reward-collective-note {
  padding: 9px 11px;
  border: 2px dashed #e34d9c;
  color: #9a276c;
  background: #fff0f7;
  font-family: var(--font-playful);
  font-size: 13px;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.form-grid--reward {
  grid-template-columns: 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field--wide {
  grid-column: 1 / -1;
}

.form-field > span {
  color: #276a8e;
  font-family: var(--font-playful);
  font-size: 12px;
  font-weight: 700;
}

.form-field .comic-input,
.form-field .comic-textarea {
  border-color: #398ec0;
}

.form-field--hours {
  max-width: 230px;
}

.hours-rule-table {
  display: grid;
  gap: 5px;
  margin-top: 11px;
}

.hours-rule-table > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border-left: 5px solid #27a6dc;
  background: rgba(255,255,255,.68);
  font-size: 12px;
}

.hours-rule-table strong {
  color: #225f83;
}

.hours-rule-table span {
  color: #c62480;
  font-family: var(--font-playful);
  font-weight: 700;
}

.config-subtitle {
  margin: 17px 0 9px;
  padding-bottom: 4px;
  border-bottom: 2px solid rgba(39, 135, 183, .3);
  color: #1e789f;
  font-family: var(--font-playful);
  font-size: 18px;
}

.reward-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.reward-preview {
  min-width: 0;
  padding: 8px 7px;
  border: 2px solid #319dd0;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 3px 0 rgba(38, 113, 157, .13);
}

.reward-preview:nth-child(2) {
  transform: translateY(2px) rotate(.6deg);
}

.reward-preview h4 {
  margin: 0 0 6px;
  color: #d82c88;
  font-family: var(--font-playful);
  font-size: 15px;
  text-align: center;
}

.reward-preview dl,
.reward-preview dl div,
.reward-preview dt,
.reward-preview dd {
  margin: 0;
}

.reward-preview dl {
  display: grid;
  gap: 4px;
}

.reward-preview dl div {
  display: flex;
  flex-direction: column;
  padding-bottom: 3px;
  border-bottom: 1px dotted rgba(38, 113, 157, .28);
}

.reward-preview dt {
  color: #65717d;
  font-size: 9px;
  line-height: 1;
}

.reward-preview dd {
  color: #224f67;
  font-family: var(--font-playful);
  font-size: 13px;
  font-weight: 700;
}

.preview-hours-row {
  display: none !important;
}

[data-config-rewards].is-hours .preview-hours-row {
  display: flex !important;
}

.comic-save-button {
  display: block;
  min-width: 205px;
  min-height: 42px;
  margin: 17px auto 0;
  padding: 7px 17px;
  border: 3px solid #a70e69;
  color: #ffffff;
  background: linear-gradient(180deg, #f13b9e, #d7187d);
  font-family: var(--font-playful);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 0 #8b0b59, 0 7px 10px rgba(92, 23, 74, .18);
  transform: rotate(-1deg);
}

.comic-save-button--blue {
  border-color: #3d2f97;
  background: linear-gradient(180deg, #7866de, #5945bd);
  box-shadow: 0 4px 0 #3c2e92, 0 7px 10px rgba(72, 50, 130, .18);
}

.config-feedback {
  min-height: 18px;
  margin: 9px 0 0;
  color: #b01b70;
  font-family: var(--font-playful);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.period-history {
  display: grid;
  gap: 8px;
}

.period-history article {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 9px 9px 9px 76px;
  border: 2px solid rgba(93, 77, 188, .34);
  background: rgba(255,255,255,.7);
}

.period-history__type {
  position: absolute;
  left: 7px;
  top: 50%;
  width: 60px;
  padding: 4px 5px;
  color: #ffffff;
  background: #6653c5;
  font-family: var(--font-playful);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  transform: translateY(-50%) rotate(-2deg);
}

.period-history strong {
  color: #4e3ea2;
  font-family: var(--font-playful);
  font-size: 14px;
}

.period-history small {
  color: #59606f;
  font-size: 11px;
  font-weight: 600;
}

.history-note {
  margin: 0 0 11px;
  color: #74455d;
  font-size: 13px;
  font-weight: 600;
}

.history-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 2px solid rgba(192, 33, 123, .32);
  background: #ffffff;
}

.history-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 12px;
}

.history-table th,
.history-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #efd7e4;
  text-align: left;
  white-space: nowrap;
}

.history-table th {
  color: #ffffff;
  background: #c71f80;
  font-family: var(--font-playful);
  font-size: 12px;
}

.history-table tbody tr:nth-child(even) {
  background: #fff4f9;
}

.history-tag {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  color: #615866;
  background: #eee8ed;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-tag--bonus {
  color: #875d00;
  background: #fff0a5;
}

.history-tag--penalty {
  color: #125a9a;
  background: #bfe5ff;
}

/* ============================================================
   10. FOOTER DE PRÊMIOS
   ============================================================ */
.rewards-footer {
  position: relative;
  z-index: 5;
  min-height: 178px;
  margin-top: -22px;
  padding: 32px 7px 14px;
  color: #ffffff;
  background-color: var(--purple-footer);
  background-image:
    linear-gradient(90deg, rgba(204,0,225,.14), rgba(98,0,190,.18)),
    url("../assets/imgs/app2_footer_fundo.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  clip-path: polygon(0 11%, 100% 0, 100% 100%, 0 100%);
}

.rewards-footer__inner {
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: start;
  gap: 6px;
}

.rewards-periods__title {
  margin: 0 0 7px;
  color: #fff237;
  font-family: var(--font-playful);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(86, 0, 101, .45);
}

.rewards-periods__buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.period-button {
  min-width: 57px;
  padding: 3px 5px;
  border: 1px solid rgba(255,255,255,.7);
  color: #ffffff;
  background: rgba(117, 14, 160, .68);
  font-family: var(--font-playful);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  transform: rotate(-1deg);
}

.period-button.is-active {
  color: #6e166f;
  background: #fff130;
  box-shadow: 2px 2px 0 rgba(76, 0, 84, .3);
  transform: translateX(4px) rotate(-1deg);
}

.reward-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.reward-card {
  min-width: 0;
  text-align: center;
}

.reward-card__name {
  margin: 0 0 3px;
  color: #ffffff;
  font-family: var(--font-playful);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(90, 0, 101, .55);
  text-transform: uppercase;
}

.reward-card__photo-wrap {
  width: 100%;
  padding: 4px;
  border: 2px solid #311b64;
  background: #c678e6;
  box-shadow: 0 3px 0 rgba(53, 0, 72, .25);
  transform: rotate(-4deg);
}

.reward-card:nth-child(2) .reward-card__photo-wrap {
  transform: rotate(5deg);
}

.reward-card:nth-child(3) .reward-card__photo-wrap {
  transform: rotate(3deg);
}

.reward-card__photo {
  width: 100%;
  aspect-ratio: 1.12 / 1;
  object-fit: cover;
  background: #c27ae5;
}

.reward-card__status {
  margin: 7px 0 1px;
  color: #fff136;
  font-family: var(--font-playful);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(76, 0, 84, .45);
  text-transform: uppercase;
}

.reward-card__description {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-playful);
  font-size: 8px;
  font-style: italic;
  line-height: 1.05;
}

/* ============================================================
   11. BOTÕES E COMPONENTES
   ============================================================ */
.close-day-button,
.comic-save-button,
.config-period-tab,
.period-button,
.icon-text-button,
.asset-action-button,
.adjustment-button {
  transition: transform .16s ease, filter .16s ease, opacity .16s ease;
}

.close-day-button:hover,
.comic-save-button:hover,
.asset-action-button:hover {
  filter: brightness(1.05) drop-shadow(0 4px 2px rgba(75, 20, 59, .25));
}

.close-day-button:active,
.comic-save-button:active,
.asset-action-button:active,
.icon-text-button:active {
  transform: translateY(2px) scale(.98);
}

.splash-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 0;
  background: #dd087f;
}

.splash-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 420px);
  min-height: 100vh;
  padding: 40px 28px;
  overflow: hidden;
  text-align: center;
  background-color: #e4008c;
  background-image:
    linear-gradient(155deg, rgba(255,0,139,.2), rgba(101,0,130,.12)),
    url("../assets/imgs/app2_header_fundo.png");
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 35px rgba(74, 4, 67, .35);
}

.splash-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0 32%, rgba(86,0,101,.18) 100%);
  pointer-events: none;
}

.splash-shell__burst {
  position: absolute;
  width: 560px;
  height: 560px;
  background: repeating-conic-gradient(from 4deg, rgba(255,255,255,.11) 0 8deg, transparent 8deg 18deg);
  animation: slow-spin 38s linear infinite;
}

@keyframes slow-spin {
  to { transform: rotate(360deg); }
}

.splash-logo,
.splash-kicker,
.splash-copy,
.splash-enter {
  position: relative;
  z-index: 2;
}

.splash-logo {
  width: 245px;
  margin-bottom: 34px;
  filter: drop-shadow(0 7px 0 rgba(90,0,92,.28));
  animation: splash-pop .7s cubic-bezier(.2,.9,.3,1.25) both;
}

@keyframes splash-pop {
  from { opacity: 0; transform: scale(.75) rotate(-4deg); }
  to { opacity: 1; transform: scale(1) rotate(-1deg); }
}

.splash-kicker {
  margin: 0;
  color: #fff12a;
  font-family: var(--font-playful);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.02;
  text-shadow: 0 3px 0 rgba(87,0,89,.45);
}

.splash-copy {
  max-width: 310px;
  margin: 13px 0 25px;
  color: #ffffff;
  font-family: var(--font-playful);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.15;
}

.splash-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 180px;
  min-height: 54px;
  padding: 10px 23px;
  border: 3px solid #b15d00;
  color: #7b3700;
  background: #fff12a;
  font-family: var(--font-playful);
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 0 #c66b00, 0 10px 18px rgba(71, 0, 65, .25);
  transform: rotate(-2deg);
}

.splash-enter:hover {
  transform: translateY(-2px) rotate(1deg) scale(1.03);
}

.splash-enter__star {
  color: #ec168d;
  font-size: 25px;
}

/* ============================================================
   12. RESPONSIVO
   ============================================================ */
@media (max-width: 370px) {
  .app-header__inner {
    padding-left: 13px;
    padding-right: 13px;
  }

  .app-header__logo-link {
    width: 140px;
  }

  .app-header__date {
    font-size: 21px;
  }

  .app-header__date-area {
    gap: 7px;
  }

  .nav-tabs {
    gap: 3px;
    padding-inline: 10px;
  }

  .nav-tab {
    width: 82px;
  }

  .nav-tab.is-active {
    width: 108px;
  }

  .page-content {
    width: calc(100% - 24px);
  }

  .child-accordion__trigger,
  .child-accordion__panel {
    width: calc(100% - 19px);
    margin-left: 19px;
  }

  .reward-preview-grid {
    grid-template-columns: 1fr;
  }

  .reward-preview dl {
    grid-template-columns: repeat(2, 1fr);
  }

  .rewards-footer__inner {
    grid-template-columns: 60px 1fr;
  }

  .reward-card__name {
    font-size: 12px;
  }
}

@media (min-width: 701px) {
  .app-shell,
  .splash-shell {
    width: 700px;
  }

  .app-header {
    height: 178px;
  }

  .app-header__inner {
    padding: 22px 32px 36px;
  }

  .app-header__logo-link {
    width: 258px;
  }

  .app-header__date {
    font-size: 38px;
  }

  .calendar-button {
    width: 39px;
    height: 44px;
  }

  .nav-tabs {
    gap: 16px;
    min-height: 88px;
    margin-top: -45px;
    margin-bottom: -28px;
  }

  .nav-tab {
    width: 145px;
  }

  .nav-tab.is-active {
    width: 190px;
  }

  .page-content {
    width: calc(100% - 84px);
    margin-top: 55px;
  }

  .child-accordion__trigger {
    grid-template-columns: 108px 1fr 30px;
    min-height: 73px;
    padding-left: 57px;
  }

  .child-accordion__title {
    font-size: 25px;
  }

  .polaroid--small {
    left: -31px;
    top: -18px;
    width: 104px;
    height: 105px;
    padding-top: 26px;
  }

  .polaroid__label {
    font-size: 23px;
  }

  .daily-card {
    padding: 26px 28px 25px;
  }

  .daily-summary__eyebrow {
    font-size: 21px;
  }

  .daily-summary__date,
  .daily-summary__message {
    font-size: 18px;
  }

  .daily-summary__badge {
    min-width: 78px;
    font-size: 28px;
  }

  .progress-track {
    height: 18px;
  }

  .status-star {
    width: 74px;
  }

  .goal-group__toggle,
  .editable-group__toggle {
    font-size: 27px;
  }

  .goal-check {
    grid-template-columns: 45px 1fr;
    gap: 10px;
    font-size: 20px;
  }

  .goal-check__star {
    width: 44px;
    height: 44px;
  }

  .adjustment-button {
    width: 124px;
  }

  .close-day-button {
    width: 248px;
    font-size: 20px;
  }

  .goals-editor-card {
    padding: 22px 23px 25px;
  }

  .editable-goal {
    grid-template-columns: 28px 1fr;
    gap: 10px;
    font-size: 19px;
  }

  .comic-checkbox {
    width: 24px;
    height: 24px;
  }

  .icon-text-button,
  .all-days-option,
  .selection-tool {
    font-size: 17px;
  }

  .icon-text-button img {
    width: 20px;
    height: 20px;
  }

  .day-selector h4,
  .selection-tools h4 {
    font-size: 16px;
  }

  .day-pill span {
    width: 29px;
    height: 29px;
    font-size: 15px;
  }

  .asset-action-button--apply {
    width: 88px;
  }

  .asset-action-button--delete {
    width: 155px;
  }

  .config-panel__body {
    padding: 22px 24px 25px;
  }

  .config-intro h1 {
    font-size: 36px;
  }

  .config-period-tab {
    min-height: 44px;
    font-size: 19px;
  }

  .comic-fieldset legend,
  .comic-label,
  .form-field > span {
    font-size: 17px;
  }

  .comic-radio,
  .history-note {
    font-size: 16px;
  }

  .comic-input,
  .comic-textarea,
  .comic-select {
    font-size: 17px;
  }

  .reward-preview h4 {
    font-size: 21px;
  }

  .reward-preview dt {
    font-size: 12px;
  }

  .reward-preview dd {
    font-size: 18px;
  }

  .rewards-footer {
    min-height: 260px;
    padding: 47px 16px 21px;
  }

  .rewards-footer__inner {
    grid-template-columns: 110px 1fr;
    gap: 12px;
  }

  .rewards-periods__title {
    font-size: 29px;
  }

  .period-button {
    min-width: 87px;
    font-size: 15px;
  }

  .reward-cards {
    gap: 13px;
  }

  .reward-card__name {
    font-size: 21px;
  }

  .reward-card__status {
    font-size: 16px;
  }

  .reward-card__description {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
