:root {
  --bg-a: #f7f1df;
  --bg-b: #ffd9a0;
  --accent: #ef5b2a;
  --accent-dark: #b63b14;
  --ink: #1f1f1f;
  --card: #fff9ef;
  --ok: #1f9d5c;
  --warn: #c53a1e;
  --muted: #6f6258;
  --shadow: 0 18px 44px rgba(102, 56, 12, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Sora", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.45) 0%, transparent 45%),
    linear-gradient(125deg, rgba(247, 241, 223, 0.62), rgba(255, 217, 160, 0.62)),
    url("../../image/Fundo.png");
  background-size: auto, auto, cover;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-attachment: scroll, scroll, scroll;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: none;
  z-index: -1;
  animation: drift 10s ease-in-out infinite alternate;
}

.bg-shape-1 {
  width: 320px;
  height: 320px;
  background: rgba(239, 91, 42, 0.23);
  top: -80px;
  left: -60px;
}

.bg-shape-2 {
  width: 280px;
  height: 280px;
  background: rgba(40, 160, 126, 0.2);
  bottom: -90px;
  right: -40px;
  animation-delay: 1.2s;
}

.hero {
  max-width: 1024px;
  margin: 0 auto;
  padding: 2.8rem 1.2rem 1.2rem;
  animation: reveal 0.7s ease;
}

.brand-row {
  margin-bottom: 0.5rem;
}

.site-logo {
  width: clamp(88px, 16vw, 150px);
  height: auto;
  display: block;
}

.eyebrow {
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.hero-subtitle {
  max-width: 780px;
  line-height: 1.55;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.badge {
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-open {
  background: rgba(31, 157, 92, 0.14);
  color: var(--ok);
}

.badge-closed {
  background: rgba(197, 58, 30, 0.14);
  color: var(--warn);
}

.badge-info {
  background: rgba(0, 0, 0, 0.08);
}

.page-wrap {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0.7rem 1.2rem 2.4rem;
  display: grid;
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid rgba(182, 59, 20, 0.2);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  animation: reveal 0.6s ease;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.stock-item {
  border-radius: 14px;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid rgba(182, 59, 20, 0.2);
}

.stock-item strong {
  font-size: 1.05rem;
}

.stock-item p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.stock-item.esgotado {
  border-color: rgba(197, 58, 30, 0.5);
  background: rgba(197, 58, 30, 0.08);
}

.grid {
  display: grid;
  gap: 1.15rem;
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.35;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border-radius: 12px;
  border: 1px solid rgba(111, 98, 88, 0.26);
  background: rgba(255, 255, 255, 0.96);
  padding: 0.78rem 0.8rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus {
  outline: 2px solid rgba(239, 91, 42, 0.2);
  border-color: rgba(239, 91, 42, 0.55);
  box-shadow: 0 0 0 3px rgba(239, 91, 42, 0.1);
}

.children-container {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.2rem;
}

.child-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(182, 59, 20, 0.24);
  border-radius: 12px;
  padding: 1.05rem;
}

.child-title {
  margin-bottom: 0.85rem;
  font-size: 1.03rem;
}

.child-card .grid {
  gap: 1rem;
}

.child-card .grid + .grid {
  margin-top: 0.4rem;
}

.child-card label {
  gap: 0.58rem;
}

.child-card input,
.child-card select {
  padding: 0.82rem 0.84rem;
}

.form-card form {
  display: grid;
  gap: 1.25rem;
}

.admin-code-row {
  border: 1px solid rgba(182, 59, 20, 0.24);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.75);
}

.info-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.info-list p {
  margin: 0;
  line-height: 1.58;
}

.actions-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: linear-gradient(130deg, var(--accent), #ff8f00);
  color: #fff;
  box-shadow: 0 6px 18px rgba(239, 91, 42, 0.35);
}

.btn-secondary {
  background: #f4ddc2;
  color: #4f2c18;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(111, 98, 88, 0.4);
  color: #4f2c18;
}

.btn-danger {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(130deg, #b32222, #d84315);
  box-shadow: 0 6px 18px rgba(179, 34, 34, 0.3);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover {
  transform: translateY(-1px);
}

.feedback {
  margin: 0;
  min-height: 1.2rem;
  color: var(--warn);
  font-size: 0.9rem;
}

.feedback.ok {
  color: var(--ok);
}

.admin-gear {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
  border: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 1.1rem;
}

.assistant-widget {
  position: fixed;
  right: 8px;
  bottom: 16px;
  width: min(340px, calc(100vw - 24px));
  z-index: 12;
}

.assistant-toggle {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0;
  cursor: pointer;
  transition: transform 0.22s ease;
}

.assistant-toggle:hover {
  transform: translateY(-2px) scale(1.03);
}

.assistant-toggle[aria-expanded="true"] {
  transform: rotate(-8deg) scale(1.04);
}

.assistant-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.assistant-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.assistant-panel {
  margin-top: 0.45rem;
  border-radius: 14px;
  padding: 0.85rem;
  background: #fffaf3;
  border: 1px solid rgba(111, 98, 88, 0.34);
  box-shadow: var(--shadow);
  transform-origin: bottom right;
}

.assistant-panel.is-open {
  animation: panel-in 220ms ease-out forwards;
}

.assistant-panel.is-closing {
  animation: panel-out 180ms ease-in forwards;
}

.faq-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.faq-buttons button {
  border: 1px solid rgba(111, 98, 88, 0.3);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.faq-answer {
  border-radius: 10px;
  background: rgba(244, 221, 194, 0.4);
  padding: 0.7rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.admin-body,
.list-body {
  padding: 1rem;
}

.admin-header {
  max-width: 1150px;
  margin: 0 auto 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-grid {
  max-width: 1150px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card {
  grid-column: 1 / -1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.stats-grid article {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(111, 98, 88, 0.26);
  padding: 0.7rem;
}

.stats-grid strong {
  font-size: 1.5rem;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inventory-form {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.inventory-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 0.6rem;
  align-items: center;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-card {
  max-width: 1150px;
  margin: 0 auto;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid rgba(111, 98, 88, 0.22);
  padding: 0.55rem;
  vertical-align: top;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-buttons button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  padding: 0.35rem 0.55rem;
}

.action-edit {
  background: #f4ddc2;
}

.action-delete {
  background: rgba(197, 58, 30, 0.2);
}

.edit-dialog {
  border: 0;
  border-radius: 14px;
  width: min(760px, calc(100vw - 24px));
  max-height: 92vh;
}

.edit-form {
  display: grid;
  gap: 0.7rem;
}

.success-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.success-wrap {
  width: min(760px, 100%);
}

.success-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 249, 239, 0.95);
  border: 1px solid rgba(182, 59, 20, 0.22);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 1.4rem;
  text-align: center;
  animation: reveal 0.55s ease;
}

.success-burst {
  position: absolute;
  inset: -30% -10% auto;
  height: 220px;
  background: radial-gradient(circle at center, rgba(239, 91, 42, 0.24), rgba(255, 255, 255, 0));
  animation: pulse-soft 1.6s ease-in-out infinite;
  pointer-events: none;
}

.success-logo {
  width: 88px;
  height: auto;
  display: block;
  margin: 0 auto 0.75rem;
}

.success-card h1 {
  font-size: clamp(1.45rem, 4vw, 2.15rem);
  margin-bottom: 0.35rem;
}

.success-subtitle {
  margin: 0 auto 1rem;
  max-width: 540px;
  color: #5d544b;
}

.success-data {
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(111, 98, 88, 0.2);
  border-radius: 12px;
  padding: 0.95rem;
  margin-bottom: 1rem;
}

.success-data p {
  margin: 0.35rem 0;
}

.receipt-title {
  margin: 0.95rem 0 0.55rem;
  font-size: 1.05rem;
}

.receipt-children {
  display: grid;
  gap: 0.65rem;
}

.receipt-child-item {
  border: 1px solid rgba(111, 98, 88, 0.2);
  border-radius: 10px;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.72);
}

.receipt-child-item p {
  margin: 0.2rem 0;
}

.success-feedback {
  margin-top: 0.7rem;
  text-align: center;
}

.success-email-status {
  color: var(--warn);
}

.success-email-status.ok {
  color: var(--ok);
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.success-actions a {
  text-decoration: none;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translateY(0) rotate(0deg);
  }
  to {
    transform: translateY(20px) rotate(8deg);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes panel-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
}

@keyframes pulse-soft {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.55;
  }
}

@media (max-width: 860px) {
  .two-cols,
  .admin-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .inventory-row {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2.4rem 1rem 1rem;
  }

  .page-wrap {
    padding: 0.6rem 1rem 5.8rem;
    gap: 1rem;
  }

  .card {
    padding: 1rem;
  }

  .form-card form {
    gap: 1rem;
  }

  .actions-row {
    gap: 0.6rem;
  }

  .actions-row .btn-primary {
    width: 100%;
    text-align: center;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .assistant-widget {
    width: min(300px, calc(100vw - 20px));
    right: 6px;
    bottom: 10px;
  }

  .assistant-toggle {
    width: 64px;
    height: 64px;
  }

  .assistant-icon {
    width: 42px;
    height: 42px;
  }

  .bg-shape {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  body {
    background: #fff !important;
  }

  .success-burst,
  .success-actions,
  .success-feedback {
    display: none !important;
  }

  .success-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
