:root {
  color-scheme: light;
  --brand: #8A5532; --brand-deep: #74462A; --brand-soft: #F3E9E0;
  --ink: #2F3440; --slate: #4E525C; --muted: #8F8884;
  --bg: #F5F2EE; --card: #fff; --sand: #EFE9E1; --line: rgba(29,27,26,.09);
  --green: #2F8F57; --green-soft: #E4F3EA; --amber: #B7700F; --amber-soft: #FBF0DF; --red: #C8433A; --red-soft: #FBE9E7; --blue: #3E63C7; --blue-soft: #E8EDFA;
  --font: 'Jost', system-ui, sans-serif; --radius: 6px;
  --shadow: 0 1px 2px rgba(29,27,26,.05), 0 6px 18px rgba(29,27,26,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--slate); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: var(--ink); }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

.demo-bar { display: flex; align-items: center; gap: 10px; padding: 7px 16px; background: var(--ink); color: #E9E4E0; font-size: 12.5px; flex-wrap: wrap; }
.demo-tag { background: var(--brand); color: #fff; font-weight: 600; font-size: 11px; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.demo-txt { flex: 1; min-width: 0; }
.demo-links { display: flex; gap: 6px; }
.demo-links a { padding: 4px 11px; border-radius: 99px; border: 1px solid rgba(255,255,255,.2); white-space: nowrap; }
.demo-links a.hot { background: #25D366; border-color: #25D366; color: #08341b; font-weight: 600; }
@media (max-width: 640px) { .demo-txt { display: none; } .demo-links { flex: 1; justify-content: flex-end; } }

.shell { display: grid; grid-template-columns: 240px minmax(0,1fr); min-height: calc(100dvh - 38px); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: calc(100dvh - 38px); }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.side-logo img { height: 30px; }
.side-logo span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 500; color: var(--slate); transition: background .2s, color .2s; }
.side nav a:hover { background: var(--sand); }
.side nav a.on { background: var(--ink); color: #fff; }
.pill { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 8px; }
.side-ft { margin-top: auto; font-size: 12.5px; display: grid; gap: 10px; padding: 0 8px; }
.ghost { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; text-align: left; }
.ghost:hover { background: var(--sand); }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; gap: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-logo span, .side-ft { display: none; }
  .side nav { flex-direction: row; }
  .side nav a { white-space: nowrap; padding: 8px 10px; font-size: 13px; }
  .side nav a svg { display: none; }
}

.main { padding: 26px 30px 60px; min-width: 0; }
@media (max-width: 700px) { .main { padding: 18px 14px 50px; } }
.page-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-hd h1 { font-size: 26px; }
.page-hd p { margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 13.5px; transition: background .2s, transform .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-line { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn-line:hover { background: var(--sand); }
.btn-red { color: var(--red); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.kpi { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.kpi small { font-size: 12.5px; color: var(--muted); display: block; }
.kpi b { display: block; font-size: 26px; font-weight: 600; color: var(--ink); margin-top: 4px; letter-spacing: -.02em; }
.kpi span { font-size: 12.5px; }
.kpi .up { color: var(--green); font-weight: 600; }
.cols { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 1000px) { .cols { grid-template-columns: minmax(0,1fr); } }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.panel h3 { font-size: 15.5px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.panel h3 a { font-size: 12.5px; font-weight: 500; color: var(--slate); text-decoration: underline; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border: 0; }
.alert-row img { width: 44px; height: 44px; border-radius: 8px; background: var(--sand); object-fit: contain; mix-blend-mode: multiply; }
.alert-row .t { flex: 1; min-width: 0; }
.alert-row .t b { color: var(--ink); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row .t small { font-size: 12px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 120px minmax(0,1fr) 70px; gap: 10px; align-items: center; font-size: 13px; }
.bar { height: 10px; border-radius: 99px; background: var(--sand); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar-row span:last-child { text-align: right; color: var(--ink); font-weight: 600; }

.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tools input[type=search], .tools select { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; }
.tools input[type=search] { flex: 1; min-width: 200px; }
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FCFBFA; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border: 0; }
tr.off td { opacity: .5; }
.p-cell { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.p-cell img { width: 48px; height: 48px; border-radius: 8px; background: var(--sand); object-fit: contain; mix-blend-mode: multiply; flex: none; }
.p-cell b { color: var(--ink); font-weight: 600; display: block; }
.p-cell small { font-size: 12px; color: var(--muted); }
.num { width: 108px; border: 1px solid transparent; background: var(--sand); border-radius: 8px; padding: 6px 9px; font-variant-numeric: tabular-nums; transition: border-color .2s, background .2s; }
.num:hover { border-color: var(--line); }
.num:focus { background: #fff; border-color: var(--ink); outline: none; }
.num.sm { width: 64px; }
.stk { display: flex; gap: 6px; align-items: center; }
.stk label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.dots { display: flex; gap: 4px; }
.dots i { width: 14px; height: 14px; border-radius: 99px; border: 1px solid rgba(0,0,0,.15); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.tag::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.tag.in { background: var(--green-soft); color: var(--green); }
.tag.low { background: var(--amber-soft); color: var(--amber); }
.tag.out { background: var(--red-soft); color: var(--red); }
.tag.order { background: var(--blue-soft); color: var(--blue); }
.tag.off { background: var(--sand); color: var(--muted); }
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #D9D3CE; border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 99px; background: #fff; transition: transform .2s cubic-bezier(.3,1.4,.5,1); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(17px); }

.ostatus { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; background: #fff; }
.o-items { display: flex; gap: 4px; }
.o-items img { width: 34px; height: 34px; border-radius: 6px; background: var(--sand); object-fit: contain; mix-blend-mode: multiply; }

/* formulario */
.form { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .form { grid-template-columns: minmax(0,1fr); } }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields { grid-template-columns: minmax(0,1fr); } }
.field label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid rgba(29,27,26,.18); border-radius: 10px; padding: 9px 12px; background: #fff; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.var-row { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.var-row + .var-row { margin-top: 10px; }
.drop { width: 76px; height: 76px; border-radius: 10px; background: var(--sand); border: 1.5px dashed rgba(29,27,26,.2); display: grid; place-items: center; overflow: hidden; cursor: pointer; position: relative; font-size: 11px; text-align: center; color: var(--muted); }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.drop input { display: none; }
.var-fields { display: grid; grid-template-columns: minmax(0,1fr) 54px repeat(2, 70px); gap: 8px; align-items: end; }
.var-fields input[type=color] { width: 54px; height: 38px; padding: 3px; border-radius: 10px; border: 1px solid rgba(29,27,26,.18); }
@media (max-width: 560px) { .var-fields { grid-template-columns: minmax(0,1fr) 54px; } }
.preview { position: sticky; top: 20px; }
.preview .pc-img { aspect-ratio: 1; border-radius: 12px; background: var(--sand); overflow: hidden; display: grid; place-items: center; }
.preview .pc-img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; padding: 6%; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: flex; gap: 6px; align-items: center; font-size: 13.5px; }
.checks input { width: 16px; height: 16px; accent-color: var(--ink); }

.modal { position: fixed; inset: 0; z-index: 80; background: rgba(20,16,14,.45); display: grid; place-items: center; padding: 16px; }
.modal-card { background: #fff; border-radius: 18px; padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow); animation: up .3s; max-width: calc(100% - 32px); }
.toast a { color: #fff; text-decoration: underline; font-weight: 600; margin-left: 8px; }
@keyframes up { from { transform: translate(-50%, 16px); opacity: 0; } }
.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { background: #FFF6D8; } }
.side-logo img { width: auto; }
