/* CWS Phones — painel da equipe. Mobile first. */
:root {
  --bg: #0c0c0f; --panel: #141418; --panel-2: #1b1b21; --line: rgba(255,255,255,.09);
  --text: #f5f5f7; --muted: #a3a3ab; --accent: #ff6a2b; --accent-ink: #1c0a02;
  --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.link { color: var(--accent); font-size: 14px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-weight: 500; font-size: 13px; }
.brand__mark { background: var(--accent); color: var(--accent-ink); padding: 3px 8px; border-radius: 9px; font-size: 15px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px; white-space: nowrap; transition: transform .12s, background .2s; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #ff7d45; }
.btn--ghost { background: var(--panel-2); border: 1px solid var(--line); }
.btn--danger { background: rgba(248,113,113,.14); color: var(--bad); border: 1px solid rgba(248,113,113,.3); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.inp, .fld input, .fld select, .fld textarea { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); padding: 0 12px; font-size: 16px; }
.fld textarea { padding: 10px 12px; min-height: 76px; resize: vertical; }
.fld { display: grid; gap: 6px; }
.fld > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.err { color: var(--bad); font-size: 14px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(90% 60% at 50% 0%, #1d1410, var(--bg)); }
.login__card { width: min(400px, 100%); display: grid; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.login h1 { font-size: 26px; letter-spacing: -.03em; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--panel-2); border-radius: 14px; gap: 4px; }
.seg button { min-height: 44px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--text); color: #111; }

/* layout */
.app { min-height: 100vh; padding-bottom: 76px; }
.side { display: none; }
.main { padding: 0 16px 24px; max-width: 1200px; margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 14px; position: sticky; top: 0; background: linear-gradient(var(--bg) 75%, transparent); z-index: 5; }
.top h1 { font-size: 24px; letter-spacing: -.03em; }
.top__r { display: flex; align-items: center; gap: 10px; }
.live { display: none; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } 0% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); } }
.chip-user { padding: 6px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip-user.owner { color: var(--accent); }
.bottom { position: fixed; inset: auto 0 0 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(20,20,24,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.bottom button { display: grid; justify-items: center; gap: 2px; padding: 8px 0; min-height: 56px; font-size: 12px; color: var(--muted); }
.bottom button i { font-style: normal; font-size: 18px; }
.bottom button[aria-current="page"] { color: var(--accent); }

.bar { display: grid; gap: 10px; margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat b { font-size: 22px; letter-spacing: -.02em; }
.list { display: grid; gap: 10px; }

/* linha de produto (cartão no celular, grade no desktop) */
.row { display: grid; grid-template-columns: 56px 1fr auto; grid-template-areas: "th main price" "th meta meta" "st st act"; gap: 8px 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.row.flash { animation: flash 1.4s; }
@keyframes flash { 20% { box-shadow: 0 0 0 2px var(--accent); } }
.row__th { grid-area: th; width: 56px; height: 56px; border-radius: 12px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; }
.row__th svg { height: 86%; width: auto; } .row__th img { width: 100%; height: 100%; object-fit: cover; }
.row__main { grid-area: main; min-width: 0; }
.row__main b { display: block; font-size: 15px; letter-spacing: -.01em; }
@media (min-width: 900px) { .row__main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.row__main span { font-size: 13px; color: var(--muted); }
.row__meta { grid-area: meta; display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.row__meta b { color: var(--text); font-weight: 600; }
.row__price { grid-area: price; text-align: right; }
.pbtn { font-weight: 700; font-size: 17px; letter-spacing: -.02em; padding: 6px 10px; min-height: 40px; border-radius: 10px; border: 1px dashed var(--line); }
.pbtn:hover { border-color: var(--accent); }
.pinp { width: 130px; min-height: 40px; border-radius: 10px; border: 2px solid var(--accent); background: var(--panel-2); text-align: right; padding: 0 10px; font-size: 16px; font-weight: 700; }
.row__cost { font-size: 12px; color: var(--muted); display: block; text-align: right; }
.row__st { grid-area: st; }
.row__st select { min-height: 40px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); padding: 0 10px; font-size: 14px; width: 100%; }
.row__act { grid-area: act; display: flex; gap: 6px; justify-content: flex-end; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid var(--line); margin-right: 6px; vertical-align: 1px; }
.tag--lacrado { color: #7dd3fc; } .tag--novo { color: var(--ok); } .tag--seminovo { color: var(--warn); } .tag--usado { color: #fda4af; }
.st-disponivel select { color: var(--ok); } .st-reservado select { color: var(--warn); } .st-vendido select, .st-oculto select { color: var(--muted); }

.simple { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.simple b { font-size: 16px; } .simple p { color: var(--muted); font-size: 14px; grid-column: 1 / -1; }
.simple .row__act { grid-column: 2; grid-row: 1; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; border: 1px dashed var(--line); border-radius: 18px; }

.card-p { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 14px; }
.card-p h2 { font-size: 20px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

/* diálogo */
.dlg { border: 0; padding: 0; background: var(--panel); color: var(--text); width: 100%; max-width: 100%; max-height: 94dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; overflow: auto; }
.dlg::backdrop { background: rgba(0,0,0,.7); }
.dlg form { padding: 20px 18px 24px; display: grid; gap: 14px; }
.dlg h2 { font-size: 22px; letter-spacing: -.02em; }
.g2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.g1 { grid-column: 1 / -1; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.ph { position: relative; width: 78px; height: 78px; border-radius: 12px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph button { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.7); font-size: 15px; }
.ph em { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 1px 6px; font-style: normal; font-weight: 700; }
.add-ph { width: 78px; height: 78px; border-radius: 12px; border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: 24px; cursor: pointer; }
.dlg__act { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; padding-top: 6px; background: linear-gradient(transparent, var(--panel) 30%); }
.colorrow { display: grid; grid-template-columns: 1fr 52px; gap: 8px; }
.colorrow input[type=color] { padding: 3px; }

.toast { position: fixed; z-index: 90; left: 50%; bottom: 84px; transform: translate(-50%, 16px); opacity: 0; transition: .3s; padding: 10px 18px; border-radius: 999px; background: var(--text); color: #111; font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); pointer-events: none; text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 220px 1fr; padding-bottom: 0; }
  .bottom { display: none; }
  .side { display: flex; flex-direction: column; gap: 24px; padding: 22px 16px; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; background: var(--panel); }
  .tabs { display: grid; gap: 4px; }
  .tabs button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--muted); font-weight: 600; text-align: left; }
  .tabs button i { font-style: normal; width: 20px; text-align: center; }
  .tabs button:hover { background: var(--panel-2); color: var(--text); }
  .tabs button[aria-current="page"] { background: var(--panel-2); color: var(--accent); }
  .side__foot { margin-top: auto; display: grid; gap: 8px; }
  .main { padding: 0 32px 40px; width: 100%; }
  .live { display: inline-flex; }
  .bar { grid-template-columns: 1fr 200px auto; align-items: center; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .row { grid-template-columns: 56px minmax(180px, 2fr) 170px 120px 160px 150px auto; grid-template-areas: "th main meta price st act act"; }
  .row__st { max-width: 150px; }
  .toast { bottom: 24px; }
  .dlg { width: min(640px, 94vw); margin: auto; border-radius: 24px; }
  .g2.three { grid-template-columns: 1fr 1fr 1fr; }
}

/* cadastro de produto: passos no celular, fotos com câmera e reordenação */
.steps { list-style: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0; }
.steps li { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.steps li b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--panel-2); font-size: 12px; }
.steps li.is-cur { color: var(--text); border-color: var(--accent); }
.steps li.is-cur b { background: var(--accent); color: var(--accent-ink); }
.steps li.is-done b { background: var(--ok, #22c55e); color: #05260f; }
.step { display: grid; gap: 14px; }
.step h3 { font-size: 15px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.dlg.is-wizard .step:not(.is-cur) { display: none; }
.dlg:not(.is-wizard) .steps { display: none; }
.dlg:not(.is-wizard) .step { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.dlg:not(.is-wizard) #f_back, .dlg:not(.is-wizard) #f_next { display: none; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-actions .btn { cursor: pointer; min-height: 48px; }
.photos .ph { width: 104px; height: 104px; cursor: grab; }
.photos .ph__x { top: 4px; right: 4px; width: 32px; height: 32px; font-size: 18px; }
.ph__bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; background: rgba(0, 0, 0, .55); }
.ph__bar button, .ph__bar span { position: static; width: 34px; height: 30px; border-radius: 0; background: none; font-size: 15px; }
.ph em { bottom: 34px; }
.ph--busy { display: grid; place-items: center; font-size: 28px; color: var(--muted); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
