body {
  font-family: 'Inter', Arial, sans-serif;
  background: linear-gradient(to bottom, #dbeafe, #ffffff);
  margin: 0;
  min-height: 100vh;
  color: #1f2937;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px clamp(20px, 4vw, 40px) 48px;
  box-sizing: border-box;
}

h1 {
  font-size: 2.4rem;
  font-weight: 700;
  text-align: center;
  color: #1e293b;
  margin-bottom: 24px;
}

.clock {
  text-align: center;
  color: #475569;
  margin-top: -8px;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.actions-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px auto 32px;
  width: 100%;
  max-width: 960px;
}

.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 960px;
  margin: 24px auto 32px;
  align-items: center;
}

.actions-stack .actions-bar {
  margin: 0;
}

.actions-bar > * {
  flex: 1 1 220px;
  width: 100%;
  max-width: 260px;
}

.toggle-toy-button,
.secondary-action {
  padding: 9px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  min-height: 42px;
  width: 100%;
}

.toggle-toy-button:hover,
.secondary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.toggle-toy-button.disabled,
.toggle-toy-button:disabled {
  background: #cbd5f5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 24px;
  margin: 0 auto 24px;
  width: 100%;
  max-width: 1000px;
  box-sizing: border-box;
}

.card.hidden {
  display: none;
}

.local-filter {
  margin: 0 auto 20px;
  text-align: center;
  width: 100%;
  max-width: 260px;
}

.local-filter label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: #64748b;
}

.local-filter select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d0d7e2;
  background: #f8fbff;
  font-size: 0.95rem;
  color: #1f2937;
  width: 100%;
  max-width: 220px;
  box-sizing: border-box;
  min-width: 0;
  text-align: center;
  text-align-last: center;
}

#form-crianca,
#form-brinquedo,
#form-local {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

#form-crianca input,
#form-crianca select,
#form-brinquedo input {
  flex: 1 1 100%;
  min-width: 0;
  border: 1px solid #d0d7e2;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  background: #f8fbff;
  width: 100%;
  max-width: 100%;
}

#form-crianca > * {
  width: 100%;
}

#form-brinquedo > *,
#form-local > * {
  width: 100%;
}

#form-crianca button {
  background: #16a34a;
  color: #fff;
  margin-left: auto;
}

#form-crianca button,
#form-brinquedo button,
#form-local button {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#form-crianca button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(22, 163, 74, 0.25);
}

#form-brinquedo .form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

#form-local {
  justify-content: flex-start;
}

#form-local input {
  flex: 1 1 100%;
  min-width: 0;
  border: 1px solid #d0d7e2;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  background: #f8fbff;
}

#form-local .form-actions {
  width: 100%;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

#form-local button,
#form-brinquedo .form-actions button {
  max-width: none;
}

#form-local button,
#form-brinquedo button {
  background: #0ea5e9;
  color: #fff;
}

#form-local button.secondary,
#form-brinquedo button.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

#form-local button:hover,
#form-brinquedo button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.25);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 24px auto 32px;
  width: 100%;
  max-width: 1000px;
}

.cards-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto 32px;
}

.form-card {
  background: #ffffff;
  border-radius: 18px;
  padding: clamp(18px, 4vw, 24px);
  box-shadow: 0 16px 28px rgba(30, 64, 175, 0.12);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto 24px;
}

.form-card h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #1f2937;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.session-card {
  background: #ffffff;
  border-radius: 18px;
  padding: clamp(18px, 4vw, 24px);
  box-shadow: 0 16px 28px rgba(30, 64, 175, 0.12);
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 100%;
}

.session-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 45px rgba(30, 64, 175, 0.18);
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
}

.session-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.85rem;
  font-weight: 600;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #475569;
}

.session-meta strong {
  color: #ef4444;
  font-weight: 700;
  font-size: 1.1rem;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #60a5fa);
  transition: width 0.4s ease;
}

.session-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #64748b;
}

.session-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.session-actions button,
.session-actions a {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.session-actions .btn-start {
  background: #22c55e;
  color: #fff;
}

.session-actions .btn-renovar {
  background: #e2e8f0;
  color: #1f2937;
}

.session-actions .btn-delete {
  background: #fee2e2;
  color: #b91c1c;
}

.session-actions .btn-pix {
  background: #0ea5e9;
  color: #fff;
  text-decoration: none;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: row;
}
.session-actions .btn-pix.paid {
  background: #22c55e;
  color: #ffffff;
  text-decoration: none;
  pointer-events: none;
}
.session-actions .btn-pix.paid:disabled {
  cursor: default;
}
.session-actions .btn-pix.paid:hover {
  transform: none;
  box-shadow: none;
}

.session-actions button svg {
  width: 16px;
  height: 16px;
}

.session-actions button:hover,
.session-actions a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
}

.form-card form,
.form-card > .alert,
.form-card > .empty,
.form-card > ul,
.form-card > p {
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1024px) {
  .page {
    padding: 28px clamp(18px, 5vw, 32px) 40px;
  }

  .actions-bar {
    max-width: 600px;
  }

  .actions-bar > * {
    flex: 1 1 240px;
    max-width: 200px;
  }

  .card {
    padding: 22px;
    border-radius: 16px;
  }

  .cards-container,
  .cards-grid {
    max-width: 880px;
  }

  #form-crianca button,
  #form-brinquedo button,
  #form-local button {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 0.97rem;
  }

  h1 {
    font-size: 2.05rem;
  }

  .page {
    padding: 24px 18px 36px;
  }

  .card {
    padding: 18px;
    border-radius: 16px;
    max-width: 640px;
  }

  .form-card {
    max-width: 360px;
  }

  .actions-bar {
    flex-direction: column;
    align-items: center;
    max-width: 280px;
  }

  .actions-bar > * {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }

  .local-filter {
    text-align: center;
    max-width: 260px;
  }

  .local-filter label {
    align-items: center;
  }

  .local-filter select {
    max-width: 220px;
  }

  .toggle-toy-button,
  .secondary-action {
    width: 100%;
    font-size: 0.88rem;
    padding: 7px 12px;
    border-radius: 10px;
    min-height: 15px;
    max-height: 25px;
  }

  #form-crianca {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }

  #form-crianca input,
  #form-crianca datalist,
  #form-crianca select {
    min-width: 100%;
    flex: 1 1 100%;
  }

  #form-crianca button {
    width: 100%;
    margin-left: 0;
    font-size: 0.92rem;
    padding: 11px 14px;
    border-radius: 10px;
    max-width: 100%;
  }

  #form-brinquedo,
  #form-local {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }

  #form-brinquedo input,
  #form-local input {
    min-width: 100%;
  }

  #form-brinquedo .form-actions,
  #form-local .form-actions {
    flex-direction: column;
    width: 100%;
  }

  #form-brinquedo button,
  #form-local button {
    width: 100%;
    font-size: 0.92rem;
    padding: 11px 14px;
    border-radius: 10px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 640px;
  }

  .session-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .session-meta {
    flex-wrap: wrap;
  }

  .session-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .session-actions {
    flex-direction: column;
  }

  .session-actions button,
  .session-actions a {
    width: 100%;
    font-size: 0.92rem;
    padding: 11px 14px;
    border-radius: 10px;
  }

  .date-filter {
    grid-template-columns: 1fr;
    max-width: 100%;
    justify-items: stretch;
    gap: 12px;
  }

  .date-filter label {
    width: 100%;
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
  }

  .date-filter label:first-child {
    justify-self: stretch;
    max-width: 100%;
  }

  .date-filter__local select {
    max-width: 100%;
  }

  .date-filter button {
    width: 100%;
    max-width: 100%;
    font-size: 0.92rem;
    padding: 11px 14px;
    border-radius: 10px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrapper {
    height: 320px;
  }

  .chart-wrapper.small {
    width: 100%;
    height: 280px;
  }

  .cards-container {
    max-width: 640px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.85rem;
  }

  .page {
    padding: 20px 16px 32px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
    max-width: 100%;
  }

  .form-card {
    max-width: 320px;
  }

  .session-actions {
    gap: 10px;
    flex-direction: column;
  }

  .alert {
    width: 100%;
  }

  .toggle-toy-button,
  .secondary-action {
    font-size: 0.86rem;
    padding: 7px 12px;
    border-radius: 10px;
    min-height: 45px;
  }

  #form-crianca input,
  #form-brinquedo input {
    min-width: 100%;
  }

  .actions-bar {
    max-width: 100%;
    gap: 8px;
    flex-direction: column;
    align-items: center;
  }

  .actions-bar > * {
    max-width: 200px;
    margin: 0 auto;
  }

  .local-filter {
    max-width: 240px;
  }

  .local-filter select {
    max-width: 210px;
  }
  .date-filter {
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .date-filter button {
    max-width: 100%;
  }

  .date-filter label:first-child {
    justify-self: stretch;
    max-width: 100%;
  }

  .date-filter__local select {
    max-width: 100%;
  }
}

.alert {
  margin: 10px auto;
  padding: 12px 16px;
  width: 100%;
  max-width: 900px;
  border-radius: 10px;
  text-align: left;
  box-sizing: border-box;
}
.alert {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.alert.fade-away {
  opacity: 0;
  transform: translateY(-6px);
}

.alert.success { background: #e6f6ec; color: #206a37; border: 1px solid #9dd1a8; }
.alert.error { background: #fdecea; color: #9b2615; border: 1px solid #f5a99b; }
.alert.info { background: #e8f1ff; color: #0b3d91; border: 1px solid #9abbf8; }
.alert ul { margin: 0; padding-left: 20px; }

.toys-list { list-style: none; margin: 16px 0 0; padding: 0; text-align: left; }
.toys-list li { padding: 8px 0; border-bottom: 1px solid #edf2f7; }
.toys-list li:last-child { border-bottom: none; }
.toys-list strong { color: #1f2937; }
.toys-list em { margin-left: 6px; color: #0ea5e9; font-style: normal; font-weight: 600; }
.empty { text-align: left; color: #6c757d; margin-top: 10px; }

.timer {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 700;
  font-size: 1.2rem;
}

.chart-wrapper {
  position: relative;
  width: min(100%, 680px);
  margin: 0 auto;
}

.chart-wrapper canvas {
  width: 100% !important;
}

.chart-wrapper.small {
  width: min(100%, 360px);
  height: 260px;
}

.chart-wrapper.small canvas {
  height: 100% !important;
}

.date-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 220px));
  gap: 16px;
  align-items: end;
  justify-content: center;
  justify-items: center;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.date-filter label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9rem;
  color: #475569;
  gap: 4px;
  text-align: center;
  width: 100%;
  max-width: 280px;
}

.date-filter label:first-child {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 340px;
}

.date-filter input[type="date"],
.date-filter select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #f8fbff;
  box-sizing: border-box;
}

.date-filter select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.date-filter__local {
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.date-filter__label-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #475569;
}

.date-filter__label-icon {
  font-size: 1rem;
}

.date-filter__local select {
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%231f2937' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  border: 1px solid #d1d5db;
  box-shadow: none;
  padding-right: 42px;
}

.date-filter button {
  grid-column: 1 / -1;
  justify-self: center;
  width: auto;
  min-width: 160px;
  max-width: 220px;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.date-filter button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.25);
}

@media (max-width: 768px) {
  .date-filter {
    grid-template-columns: 1fr;
    justify-content: center;
    justify-items: center;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .date-filter label {
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 320px;
  }

  .date-filter label:first-child {
    justify-self: stretch;
  }

  .date-filter__local select {
    max-width: 100%;
    text-align: center;
    text-align-last: center;
  }

  .date-filter label input[type="date"],
  .date-filter label select {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .date-filter button {
    width: 100%;
    max-width: 320px;
    margin: 4px auto 0;
  }
}

@media (max-width: 480px) {
  .date-filter {
    grid-template-columns: 1fr;
  }
}

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

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fbff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid #e2e8f0;
}

.metric-card .session-title {
  font-size: 1rem;
}
