/* Painel do estoque */

.admin-main {
  max-width: 1120px; margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}
.admin .brand { font-size: 24px; }
.head-actions { display: flex; gap: 4px; }
.head-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 8px; background: none; color: #fff; cursor: pointer;
  font: 600 16px/1 var(--font); text-decoration: none;
}
.head-link:hover { background: rgba(255, 255, 255, .1); }

.muted { color: var(--muted); }
.small { font-size: 15px; }
.pad { padding: 32px 0; }
code { font-size: .92em; background: rgba(0, 0, 0, .06); padding: 1px 5px; border-radius: 4px; }

/* ------------------------------------------------------------ formulários */

.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; font-weight: 600; font-size: 15px; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #B9C1C6; border-radius: 8px; background: #fff;
  font-weight: 400; font-size: 17px;
}
.field textarea { resize: vertical; min-height: 190px; line-height: 1.5; }
.field.invalid input { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field-err { color: var(--danger); font-weight: 500; font-size: 15px; }
.form-error { color: var(--danger); margin: 0 0 14px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-quiet { background: none; color: var(--danger); padding: 0 12px; }
.btn-danger-quiet:hover { background: #FBEAE8; }

.auth {
  max-width: 420px; margin: 40px auto; padding: 28px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
.auth h1 { font: 800 38px/1 var(--font-cond); margin: 0 0 8px; }
.auth > p { margin: 0 0 22px; }

.notice-bar { background: #FFF6CF; border: 1px solid #EED76B; border-radius: 10px; padding: 12px 14px; margin: 0 0 18px; }

/* ------------------------------------------------------------ lista */

.a-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.a-top h1 { font: 800 44px/1 var(--font-cond); margin: 0; }
.a-top p { margin: 6px 0 0; }
.a-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  min-height: 40px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  font-weight: 600; font-size: 15px;
}
.tab .n { margin-left: 6px; font-weight: 500; opacity: .7; }
.tab[aria-pressed="true"] { background: var(--asphalt); border-color: var(--asphalt); color: #fff; }
.a-filters .search { flex: 1 1 240px; }
.a-filters .search input { height: 44px; }

.a-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.a-row {
  display: grid; grid-template-columns: 104px minmax(0, 1fr) auto;
  grid-template-areas: "thumb main status" "thumb main actions";
  gap: 6px 16px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line);
}
.a-row:first-child { border-top: 0; }
.a-thumb {
  grid-area: thumb; width: 104px; aspect-ratio: 4 / 3; padding: 0; border: 0; cursor: pointer;
  display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: #DDE1E4; color: #98A1A7;
}
.a-thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-main { grid-area: main; min-width: 0; }
.a-title {
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font: 700 22px/1.1 var(--font-cond);
}
.a-title:hover { text-decoration: underline; }
.a-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 5px; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.a-status { grid-area: status; justify-self: end; }
.a-status select {
  height: 38px; padding: 0 32px 0 12px; cursor: pointer;
  border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: 15px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18' fill='none' stroke='%231F262B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.st-available { background-color: #E3F3E9; color: #0F5A2B; }
.st-reserved { background-color: #FFF2C2; color: #5C4700; }
.st-sold { background-color: #E8EBED; color: #3F484E; }
.st-hidden { background-color: #fff; color: #3F484E; border-color: #B9C1C6 !important; border-style: dashed !important; }
.a-actions { grid-area: actions; justify-self: end; display: flex; gap: 2px; }
.btn-icon {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; color: var(--asphalt); cursor: pointer;
  font: 600 15px/1 var(--font); text-decoration: none;
}
.btn-icon:hover { background: var(--concrete); }
.a-none { padding: 22px 16px; color: var(--muted); }
.a-empty { background: var(--paper); border: 1px dashed #B9C1C6; border-radius: 12px; padding: 28px; }
.a-empty p { margin: 0; font-size: 18px; max-width: 52ch; }

@media (max-width: 640px) {
  .a-top h1 { font-size: 38px; }
  .a-row { grid-template-columns: 88px minmax(0, 1fr); grid-template-areas: "thumb main" "status actions"; padding: 12px; }
  .a-thumb { width: 88px; }
  .a-status { justify-self: start; }
}

/* ------------------------------------------------------------ editor */

.ed-head { margin-bottom: 18px; }
.ed-head h1 { font: 800 44px/1 var(--font-cond); margin: 6px 0 0; }
.ed-head p { margin: 4px 0 0; }
.link-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0;
  border: 0; background: none; cursor: pointer; font-weight: 600;
}
.link-back:hover span { text-decoration: underline; }
.ed-grid { display: grid; gap: 22px; }
@media (min-width: 960px) { .ed-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.ed-box { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.ed-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ed-sec-head h2 { font: 700 28px/1 var(--font-cond); margin: 0; }
.ed-photos > p { margin: 8px 0 0; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  margin: 14px 0; padding: 22px 16px; cursor: pointer;
  border: 2px dashed #AEB7BC; border-radius: 10px;
}
.drop span { color: var(--muted); font-size: 15px; }
.drop:hover, .drop.over { border-color: var(--asphalt); background: #F5F6F7; }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; }
.tile { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: #DDE1E4; cursor: grab; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile.dragging { opacity: .4; }
.tile.drop-target { outline: 3px solid var(--focus); outline-offset: 2px; }
.tile-n {
  position: absolute; left: 6px; top: 6px; padding: 4px 7px; border-radius: 5px;
  background: rgba(20, 25, 28, .78); color: #fff; font: 600 13px/1 var(--font);
}
.tile:first-child .tile-n { background: var(--sticker); color: var(--sticker-ink); }
.tile-state {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .74); font-weight: 600; font-size: 15px;
}
.tile-state.err { background: rgba(180, 35, 24, .86); color: #fff; }
.tile-tools {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between;
  padding: 5px; background: linear-gradient(transparent, rgba(0, 0, 0, .5));
}
.tile-tools button {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0; cursor: pointer;
  border: 0; border-radius: 6px; background: rgba(255, 255, 255, .94); color: var(--asphalt);
}
.tile-tools button:disabled { opacity: .35; cursor: default; }
.tile-tools [data-remove] { color: var(--danger); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 12px; }
@media (max-width: 480px) {
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 .field:first-child { grid-column: 1 / -1; }
}
.status-set { border: 0; margin: 0 0 16px; padding: 0; }
.status-set legend { padding: 0; margin-bottom: 2px; font-weight: 600; font-size: 15px; }
.radio {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 6px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px;
}
.radio:has(input:checked) { border-color: var(--asphalt); background: #F5F6F7; }
.radio input { margin: 4px 0 0; width: 18px; height: 18px; accent-color: var(--asphalt); }
.radio strong { display: block; font-weight: 600; }
.radio-text > span { color: var(--muted); font-size: 15px; }
.field-help { font-weight: 400; font-size: 14px; color: var(--muted); }
.card-set { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 16px; padding: 10px 14px 2px; }
.card-set legend { padding: 0 6px; font-weight: 600; font-size: 15px; }
.card-set legend em { font-style: normal; font-weight: 400; color: var(--muted); }
.card-set .check { margin: -6px 0 16px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--asphalt); }

.ed-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 24px calc(-1 * max(16px, env(safe-area-inset-left))) 0;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(237, 239, 240, .96); border-top: 1px solid var(--line);
}
.ed-hint { flex: 1 1 200px; color: var(--muted); font-size: 15px; }
.ed-danger { margin-top: 18px; }
@media (max-width: 560px) {
  .ed-hint { flex-basis: 100%; }
  .ed-hint:empty { display: none; }
  .ed-bar .btn { flex: 1 1 0; }
}
.ed-hint.err { color: var(--danger); font-weight: 500; }
.ed-bar .btn { min-height: 46px; font-size: 17px; }

/* ------------------------------------------------------------ diálogo */

.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(15, 20, 23, .55); }
.modal[hidden] { display: none; }
.modal-card { width: 100%; max-width: 470px; padding: 22px; background: var(--paper); border-radius: 12px; }
.modal-card h2 { font: 800 30px/1.05 var(--font-cond); margin: 0 0 8px; }
.modal-card p { margin: 0; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-actions .btn { min-height: 46px; font-size: 17px; }
.m-url { width: 100%; margin-top: 12px; padding: 10px 12px; border: 1px solid #B9C1C6; border-radius: 8px; font-size: 15px; }

/* ------------------------------------------------------------- leads */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0 0 14px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi strong { font: 800 40px/1 var(--font-cond); }
.kpi span { color: var(--muted); font-size: 15px; }
.kpi:first-child { background: var(--asphalt); border-color: var(--asphalt); color: var(--on-dark); }
.kpi:first-child span { color: var(--on-dark-muted); }
.capi-line { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.capi-line.on strong { color: #0F5A2B; }
.l-grid { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 900px) { .l-grid { grid-template-columns: 1fr 1fr; } }
.l-h { font: 700 26px/1 var(--font-cond); margin: 0 0 14px; }
.l-bars { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.l-bars li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name n" "bar bar"; gap: 4px 12px; align-items: baseline; }
.l-name { grid-area: name; min-width: 0; overflow-wrap: anywhere; }
.l-bars strong { grid-area: n; font-variant-numeric: tabular-nums; }
.l-bar { grid-area: bar; height: 8px; border-radius: 4px; background: var(--concrete-2); position: relative; overflow: hidden; }
.l-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--vcm-red); border-radius: 4px; }
.l-recent { margin-bottom: 24px; }
.l-list { list-style: none; margin: 0; padding: 0; }
.l-list li { display: grid; grid-template-columns: 110px 1fr; gap: 2px 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.l-list li:first-child { border-top: 0; }
.l-when { color: var(--muted); font-variant-numeric: tabular-nums; grid-row: span 3; }
.l-what em { color: var(--muted); font-style: normal; }
.l-from { color: var(--muted); }
.ed-box code { font-size: 13px; overflow-wrap: anywhere; }
