:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1117;
  color: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 18rem),
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), transparent 24rem),
    #0b1117;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

button:active {
  transform: translateY(1px);
}

.app-shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login-screen,
.client-screen {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.login-screen {
  display: grid;
  align-content: center;
  gap: 24px;
}

.app-footer {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.app-footer.inside {
  padding: 18px 0 120px;
}

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

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
}

.brand span,
.eyebrow,
.unit-strip span,
.cart-bar span,
.muted,
.profile-summary span,
.cart-review-item span {
  color: #94a3b8;
}

.brand strong {
  display: block;
  font-size: 1.05rem;
}

.brand.compact img {
  width: 44px;
  height: 44px;
}

.panel,
.product-card,
.history-card,
.modal-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.product-card,
.history-card,
.panel {
  backdrop-filter: blur(10px);
}

.login-panel,
.profile-panel {
  padding: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 10vw, 3rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #cbd5e1;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #111827;
  color: #f8fafc;
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

input:disabled {
  color: #94a3b8;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(180deg, #4ade80, #22c55e);
  color: #04130a;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.18);
}

.primary-button:disabled {
  background: #334155;
  color: #94a3b8;
}

.secondary-button,
.icon-button {
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: #111827;
  color: #e2e8f0;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: #86efac;
  font-size: 0.9rem;
}

.message.error {
  color: #fca5a5;
}

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

.topbar,
.section-heading,
.cart-bar,
.modal-actions,
.product-actions,
.unit-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  padding-top: 4px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 18px 0 12px;
  padding: 4px;
  border-radius: 8px;
  background: #111827;
}

.tab {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-weight: 800;
}

.tab.active {
  background: #f8fafc;
  color: #111827;
}

.unit-strip {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 3px solid #22c55e;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.86);
}

.unit-strip strong {
  text-align: right;
}

.tab-panel {
  padding-bottom: 112px;
}

.search-field {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 14px 0 0;
  padding: 10px 0 4px;
  background: linear-gradient(180deg, #0b1117 80%, rgba(11, 17, 23, 0));
}

.search-field span {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 800;
}

.products-list,
.history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.product-card,
.history-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  padding: 12px;
}

.product-card {
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.product-card.selected {
  border-color: rgba(34, 197, 94, 0.32);
}

.product-card img {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
  background: #1f2937;
}

.product-info h3,
.history-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.product-info {
  min-width: 0;
}

.product-info h3 {
  overflow-wrap: anywhere;
}

.product-info p,
.history-card p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.product-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding-top: 2px;
}

.qty-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #1f2937;
  color: #f8fafc;
  font-size: 1.25rem;
  font-weight: 900;
}

.qty-button:disabled {
  color: #64748b;
  background: #0f172a;
  cursor: not-allowed;
}

.qty-button.small {
  width: 34px;
  height: 34px;
  font-size: 1rem;
}

.quantity {
  min-width: 34px;
  text-align: center;
  font-weight: 900;
}

.price {
  color: #86efac;
  font-weight: 900;
}

.history-card {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.history-button {
  width: 100%;
  color: inherit;
  text-align: left;
}

.history-button:active {
  transform: translateY(1px);
}

.history-qty,
.history-monitor {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  font-size: 0.78rem;
  font-weight: 800;
}

.history-monitor {
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
}

.profile-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.history-summary {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr 0.8fr;
  gap: 8px;
  margin: 14px 0 4px;
}

.profile-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: #111827;
}

.history-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.9);
}

.profile-summary span,
.history-summary span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #94a3b8;
}

.profile-summary strong,
.history-summary strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.history-summary div:first-child strong {
  color: #86efac;
}

.history-note {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 700;
}

.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.cart-bar {
  position: fixed;
  right: max(18px, calc((100vw - 520px) / 2 + 18px));
  bottom: 18px;
  left: max(18px, calc((100vw - 520px) / 2 + 18px));
  z-index: 10;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.96);
  backdrop-filter: blur(14px);
}

.cart-bar strong {
  display: block;
  margin-top: 2px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.72);
}

.modal-card {
  width: min(100%, 520px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
}

.checkout-items {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.checkout-item,
.checkout-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.checkout-item {
  color: #cbd5e1;
  font-size: 0.92rem;
}

.checkout-total {
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.pix-area {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 8px;
  background: rgba(6, 78, 59, 0.16);
}

.pix-area img {
  width: min(240px, 100%);
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.pix-area textarea {
  width: 100%;
  resize: none;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #020617;
  color: #e2e8f0;
  padding: 10px;
  font: 0.78rem ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.pix-status {
  margin: 0;
  color: #bbf7d0;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px 0;
  padding: 4px;
  border-radius: 8px;
  background: #111827;
}

.card-kind {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: #020617;
}

.payment-method {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-weight: 900;
}

.payment-method.active {
  background: #f8fafc;
  color: #111827;
}

.card-form {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.72);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mp-field {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #f8fafc;
  color-scheme: light;
  padding: 0;
  overflow: hidden;
}

.mp-field iframe {
  width: 100% !important;
  height: 48px !important;
  border: 0 !important;
  display: block;
}

.cart-review-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.cart-review-item > div:first-child {
  min-width: 0;
}

.cart-review-item strong,
.cart-review-item span {
  display: block;
}

.cart-review-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-review-item > .price {
  grid-column: 1 / -1;
  justify-self: end;
}

.cart-note {
  margin: 6px 0 4px;
  font-size: 0.86rem;
}

.processing-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.processing-card h2 {
  max-width: 320px;
  line-height: 1.12;
}

.processing-purchase-items {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  text-align: left;
}

.processing-purchase-items > p {
  margin: 0 0 2px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 900;
  text-align: center;
}

.processing-purchase-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.82);
}

.processing-purchase-item img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #1f2937;
}

.processing-purchase-item strong,
.processing-purchase-item span {
  display: block;
}

.processing-purchase-item strong {
  overflow-wrap: anywhere;
}

.processing-purchase-item span {
  margin-top: 3px;
  color: #86efac;
  font-size: 0.84rem;
  font-weight: 900;
}

.processing-monitor-note {
  margin: 0;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 800;
}

.policy-panel {
  margin-top: 14px;
  padding: 18px;
}

.policy-panel p:last-child {
  margin-bottom: 0;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.receipt-content {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.receipt-row,
.receipt-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.receipt-row span,
.receipt-item span {
  color: #94a3b8;
}

.receipt-row strong,
.receipt-item strong {
  text-align: right;
}

.receipt-items {
  display: grid;
}

.receipt-row.total {
  border-bottom: 0;
  color: #86efac;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(148, 163, 184, 0.22);
  border-top-color: #22c55e;
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

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

@media (max-width: 390px) {
  .login-screen,
  .client-screen {
    padding: 14px;
  }

  .brand.compact img {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 0.96rem;
  }

  .icon-button,
  .secondary-button,
  .primary-button {
    padding: 0 12px;
  }
}

@media (min-width: 760px) {
  .login-screen,
  .client-screen {
    padding: 28px 0;
  }
}
