/* Pena Steel — painel. Mobile-first: base = celular; 768px = tablet; 1024px = computador. */
:root {
  --bg: #09090a;
  --panel: #111113;
  --line: rgba(255, 255, 255, .1);
  --txt: #ececec;
  --mute: #8d8f94;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Inter, system-ui, sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bot: env(safe-area-inset-bottom, 0px)
}

*,
*::before,
*::after {
  box-sizing: border-box
}

body {
  margin: 0;
  font: 400 .95rem/1.55 var(--sans);
  background: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent
}

h1,
h2,
h3,
p {
  margin: 0
}

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

[hidden] {
  display: none !important
}

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

button {
  cursor: pointer;
  touch-action: manipulation
}

:focus-visible {
  outline: 2px solid #d8dadd;
  outline-offset: 2px
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none
}

.view {
  display: none
}

.view.active {
  display: block
}

/* menu lateral: gaveta no celular */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  padding: calc(1.5rem + var(--top)) 1rem calc(1.5rem + var(--bot));
  background: #060607;
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform .3s, visibility .3s
}

.sidebar.open {
  transform: none;
  visibility: visible;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .65)
}

.brand-min {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5em;
  text-decoration: none;
  color: #fff;
  padding: 0 .6rem
}

.brand-min .wm {
  font: 600 1.3rem var(--serif);
  letter-spacing: .32em;
  margin-right: -.32em
}

.brand-min .wm-sub {
  font: 500 .6rem var(--sans);
  letter-spacing: .4em;
  color: var(--mute)
}

.brand-min small {
  flex-basis: 100%;
  font: 500 .66rem var(--sans);
  letter-spacing: .1em;
  color: var(--mute);
  margin-top: .5rem
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: .2rem
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 48px;
  padding: .6rem .8rem;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  color: #a9abb0;
  font: 500 .95rem var(--sans);
  text-align: left
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .04)
}

.nav-link.active {
  color: #fff;
  border-left-color: #fff;
  background: rgba(255, 255, 255, .06)
}

.side-bottom {
  margin-top: auto;
  font-size: .8rem;
  color: var(--mute)
}

.side-bottom a {
  color: #cfd0d3;
  text-decoration: none;
  display: inline-block;
  padding: .5rem 0
}

/* topo */
.main {
  padding: 0 1rem calc(2.5rem + var(--bot));
  min-width: 0
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0 -1rem 1.2rem;
  padding: calc(.7rem + var(--top)) 1rem .7rem;
  background: rgba(9, 9, 10, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line)
}

.topbar>div {
  flex: 1;
  min-width: 0
}

.topbar h1 {
  font: 500 1.5rem/1.1 var(--serif)
}

.eyebrow {
  font: 500 .66rem var(--sans);
  letter-spacing: .14em;
  color: var(--mute);
  margin-bottom: .2rem
}

.mobile-menu {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--line);
  color: #fff
}

.store-link {
  color: #d4d5d8;
  text-decoration: none;
  font-size: .8rem;
  border: 1px solid var(--line);
  padding: .6rem .8rem;
  white-space: nowrap
}

.welcome {
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem
}

.welcome img {
  display: none
}

.welcome h2 {
  font: 500 clamp(1.5rem, 6vw, 2.3rem)/1.15 var(--serif);
  margin: .2rem 0 .5rem
}

.welcome p:last-child {
  color: var(--mute);
  max-width: 34rem
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1.5rem
}

.stat {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.1rem 1rem;
  background: var(--panel)
}

.stat span {
  font-size: .76rem;
  color: var(--mute)
}

.stat strong {
  font: 500 1.6rem/1 var(--serif)
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1rem
}

.panel-head,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem
}

.panel-head h2,
.section-head h2 {
  font: 500 1.5rem var(--serif)
}

.section-head p:not(.eyebrow) {
  color: var(--mute);
  margin-top: .3rem;
  font-size: .88rem
}

.notice {
  margin-top: 1.4rem;
  padding: 1rem;
  border-left: 2px solid #d9b35f;
  background: rgba(217, 179, 95, .06);
  color: #c9c3b2;
  font-size: .84rem;
  line-height: 1.6
}

/* tabelas viram cartões no celular */
table,
thead,
tbody,
tr,
td {
  display: block
}

thead {
  display: none
}

tr {
  padding: .8rem 0;
  border-bottom: 1px solid var(--line)
}

tr:last-child {
  border: 0
}

td {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .3rem 0;
  text-align: right;
  font-size: .88rem
}

td::before {
  content: attr(data-label);
  flex: none;
  color: var(--mute);
  font-size: .74rem;
  text-align: left
}

td small {
  display: block;
  color: var(--mute)
}

td select {
  min-height: 44px;
  background: #0a0a0b;
  border: 1px solid var(--line);
  padding: .4rem .5rem;
  font-size: 1rem
}

.pill {
  display: inline-block;
  padding: .2rem .6rem;
  font-size: .72rem;
  border: 1px solid rgba(255, 255, 255, .2);
  white-space: nowrap
}

.pill.ok {
  color: #6fbf8e;
  border-color: #6fbf8e55
}

.pill.wait {
  color: #d9b35f;
  border-color: #d9b35f55
}

.pill.no {
  color: #ff9a9a;
  border-color: #ff9a9a55
}

.product-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line)
}

.pcard {
  display: flex;
  flex-direction: column;
  background: var(--panel)
}

.pinfo {
  display: grid;
  gap: .2rem;
  padding: .8rem;
  flex: 1
}

.pinfo h3 {
  font: 500 1.05rem/1.2 var(--serif)
}

.pinfo p {
  font-size: .78rem;
  color: var(--mute)
}

.pact {
  display: flex;
  gap: .5rem;
  padding: 0 .8rem .8rem
}

.empty {
  grid-column: 1/-1;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--mute);
  background: var(--panel)
}

button.primary,
button.secondary {
  min-height: 46px;
  padding: .7rem 1.2rem;
  border-radius: 0;
  font: 600 .85rem var(--sans)
}

button.primary {
  background: #f2f2f0;
  color: #08080a;
  border: 1px solid #f2f2f0
}

button.primary:hover {
  background: transparent;
  color: #fff
}

button.secondary {
  background: transparent;
  color: #ddd;
  border: 1px solid var(--line)
}

.section-head .primary {
  width: 100%
}

.text-button {
  min-height: 40px;
  padding: 0 .4rem;
  background: none;
  border: 0;
  color: #cfd0d3;
  font: 500 .85rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px
}

.danger {
  color: #ff9a9a
}

/* formulário: tela cheia no celular */
.modal {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  background: var(--panel);
  color: var(--txt);
  border: 0
}

.modal::backdrop {
  background: rgba(0, 0, 0, .75)
}

.product-form {
  display: grid;
  gap: 1rem;
  padding: calc(1.2rem + var(--top)) 1.1rem calc(1.5rem + var(--bot))
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start
}

.modal-head h2 {
  font: 500 1.5rem var(--serif)
}

.close {
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.8rem
}

.form-grid {
  display: grid;
  gap: 1rem
}

.product-form label {
  display: grid;
  gap: .35rem;
  font-size: .8rem;
  color: var(--mute)
}

.product-form input:not([type=checkbox]):not([type=file]),
.product-form select,
.product-form textarea {
  min-height: 46px;
  padding: .7rem .85rem;
  background: #0a0a0b;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 1rem
}

.product-form input:focus,
.product-form select:focus,
.product-form textarea:focus {
  border-color: #fff;
  outline: 0
}

.check {
  display: flex !important;
  align-items: center;
  gap: .7rem;
  min-height: 44px
}

.check input {
  width: 20px;
  height: 20px
}

.photo-field img {
  width: 140px;
  margin: .6rem 0;
  border: 1px solid var(--line)
}

.modal-actions {
  display: flex;
  gap: .7rem
}

.modal-actions button {
  flex: 1
}

.form-message {
  min-height: 1.2em;
  font-size: .85rem;
  color: #ff9a9a
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.2rem + var(--bot));
  transform: translate(-50%, 20px);
  max-width: 90%;
  padding: .75rem 1.2rem;
  background: #f2f2f0;
  color: #08080a;
  font-size: .88rem;
  opacity: 0;
  pointer-events: none;
  transition: .3s;
  z-index: 99;
  text-align: center
}

.toast.on {
  opacity: 1;
  transform: translate(-50%, 0)
}

@media (min-width:768px) {
  .main {
    padding: 0 2rem 3rem
  }

  .topbar {
    margin: 0 -2rem 2rem;
    padding-inline: 2rem
  }

  .topbar h1 {
    font-size: 1.9rem
  }

  .stats {
    grid-template-columns: repeat(4, 1fr)
  }

  .stat strong {
    font-size: 2rem
  }

  .product-list {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr))
  }

  .section-head .primary {
    width: auto
  }

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

  .modal {
    width: min(640px, 94vw);
    height: auto;
    max-height: 92vh;
    margin: auto;
    border: 1px solid var(--line)
  }

  .modal-actions {
    justify-content: flex-end
  }

  .modal-actions button {
    flex: none
  }

  .welcome img {
    display: block
  }
}

@media (min-width:1024px) {
  body {
    display: grid;
    grid-template-columns: 240px 1fr
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    transform: none;
    visibility: visible;
    box-shadow: none
  }

  .mobile-menu {
    display: none
  }

  .welcome {
    padding-top: 2rem
  }

  .panel {
    padding: 1.4rem
  }

  table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem
  }

  thead {
    display: table-header-group
  }

  tbody {
    display: table-row-group
  }

  tr {
    display: table-row;
    padding: 0
  }

  td,
  th {
    display: table-cell;
    padding: .9rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, .06)
  }

  td::before {
    display: none
  }

  th {
    font: 500 .72rem var(--sans);
    letter-spacing: .08em;
    color: var(--mute);
    border-bottom: 1px solid var(--line)
  }
}

@media (prefers-reduced-motion:reduce) {
  * {
    transition: none !important;
    animation: none !important
  }
}