/* ==========================================================================
   Central de Compras — identidade GARAGE
   Paleta oficial (Mineral · Terra · Sol · Mata · Mar · Molé · Toast).
   Para mudar a aparência, comece pelas variáveis abaixo.
   A cor de destaque (--brand) também pode ser trocada no painel → Configurações.
   ========================================================================== */
:root {
  /* paleta da marca */
  --mineral: #DACCB4;  --mineral-2: #BFA387;
  --terra: #C68463;    --terra-2: #D27D56;
  --sol: #EFE1A7;      --sol-2: #F4E87A;
  --mata: #C2CBB4;     --mata-2: #91AC80;
  --mar: #BFCDCC;
  --mole: #392D2B;
  --toast: #CA9978;

  /* papéis */
  --brand: var(--terra);            /* destaque: seleção, links, anel de foco */
  --ink: var(--mole);               /* botões principais e textos */
  --bg: #F7F3EC;
  --surface: #FFFDF9;
  --surface-2: #F1EBE0;
  --text: var(--mole);
  --muted: #7A6D66;
  --border: #E6DCCB;
  --border-strong: #D3C5AE;
  --ok: #5F7F4E;
  --danger: #B5523B;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(57, 45, 43, .05);
  --shadow-lg: 0 18px 50px rgba(57, 45, 43, .22);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;

  --brand-soft: color-mix(in srgb, var(--brand) 14%, var(--surface));
  --brand-ring: color-mix(in srgb, var(--brand) 38%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 3px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .input { flex: 1; min-width: 180px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* títulos no estilo da marca: condensado, caixa alta */
.head, .hero h1, .modal-head h2, .section-title, .login-card h1 {
  font-family: var(--font-head); font-stretch: condensed; font-weight: 700;
  text-transform: uppercase; letter-spacing: .01em;
}
/* rótulos no estilo "MINERAL · TERRA": leve, espaçado */
.label-caps { text-transform: uppercase; letter-spacing: .14em; font-weight: 400; font-size: 12px; color: var(--muted); }

/* ---------- layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 36px 16px 80px; }
.container.wide { max-width: 1440px; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 20px; }
.topbar-in.wide { max-width: 1440px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; white-space: nowrap; }
.wordmark { font-family: "Segoe UI", sans-serif; font-weight: 300; font-size: 20px; letter-spacing: .42em; margin-right: -.42em; text-transform: uppercase; color: var(--mole); }
.brand-sep { width: 1px; height: 22px; background: var(--border-strong); }
.brand-sub { text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; color: var(--muted); }
.search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; }
.search-label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.top-actions { display: flex; gap: 8px; margin-left: auto; }
.hero { margin-bottom: 18px; }
.hero h1 { font-size: 34px; }
.hero p { margin: 8px 0 0; max-width: 640px; }
.foot { text-align: center; padding: 28px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.foot a { color: var(--muted); text-decoration: none; }
.foot .wordmark { display: block; font-size: 14px; margin-bottom: 6px; color: var(--muted); }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--brand)); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.danger { color: var(--danger) !important; }
.count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(255,255,255,.18); font-size: 12px; display: inline-grid; place-items: center; }
#cart-btn.has-items .count { background: var(--terra); color: #fff; }
.icon-btn { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; font-size: 14px; color: var(--muted); flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- formulários ---------- */
.input { width: 100%; height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font: inherit; color: inherit; }
textarea.input { height: auto; min-height: 44px; resize: vertical; line-height: 1.45; }
input[type=color].input { padding: 3px; width: 80px; }
.input:focus { outline: 3px solid var(--brand-ring); outline-offset: 0; border-color: var(--brand); }
.input-sm { height: 30px; padding: 2px 8px; font-size: 13px; width: auto; }
.field { margin-bottom: 16px; min-width: 0; }
.field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.req { color: var(--danger); }
.help { font-size: 12.5px; color: var(--muted); margin: 4px 0 6px; }
.field-label + .help { margin-top: -2px; }
.error { color: var(--danger); font-size: 12.5px; }
.error:not(:empty) { margin-top: 4px; }
.has-error .input, .has-error .drop { border-color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }
.checks { display: flex; flex-direction: column; gap: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid2 .span2 { grid-column: 1 / -1; }
.inline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .input { width: 90px; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; }
.step { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); font-size: 20px; cursor: pointer; color: var(--text); }
.step:hover { background: var(--brand-soft); border-color: var(--brand); }
.unit { color: var(--muted); margin-left: 4px; }
.with-prefix, .with-suffix { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; overflow: hidden; max-width: 260px; }
.with-prefix span, .with-suffix span { padding: 0 12px; color: var(--mole); font-weight: 600; background: var(--mata); align-self: stretch; display: grid; place-items: center; }
.with-prefix .input, .with-suffix .input { border: 0; border-radius: 0; }
.with-prefix .input { font-size: 17px; font-weight: 600; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; text-align: center; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop.full { display: none; }
.drop input { display: none; }
.drop-icon { font-size: 24px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumbs:empty { display: none; }
.thumbs.inline { margin: 0; }
.thumb { position: relative; }
.thumb-x { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--mole); color: #fff; font-size: 11px; cursor: pointer; }
.file-prev { display: block; width: 76px; height: 76px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--mole); }
.file-prev img, .file-prev video { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-prev.video { width: 150px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font-size: 13px; text-decoration: none; color: var(--text); }
.info-box { padding: 10px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--sol) 60%, white); font-size: 14px; }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented label { cursor: pointer; }
.segmented input { display: none; }
.segmented span { display: block; padding: 8px 16px; font-weight: 600; font-size: 14px; }
.segmented label + label span { border-left: 1px solid var(--border-strong); }
.segmented input:checked + span { background: var(--ink); color: #fff; }

/* ---------- portal: cartões ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em; }
.crumbs:empty { display: none; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--border-strong); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { --tile: var(--mineral); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tile); }
.card:hover { transform: translateY(-2px); border-color: var(--tile); box-shadow: 0 10px 26px rgba(57,45,43,.1); }
.tile { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--tile) 55%, white); font-size: 26px; color: var(--mole); }
.tile.code { font-family: var(--font-head); font-stretch: condensed; font-weight: 700; font-size: 18px; }
.card-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.card-title { font-weight: 700; font-size: 16px; }
.card.group .card-title { font-weight: 700; }
.card-desc { font-size: 13.5px; color: var(--muted); }
.card-path { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.card-meta { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.card.item .add { color: var(--ink); }
.card.other { border-style: dashed; background: transparent; box-shadow: none; }
.card.other::before { display: none; }
.card.other .tile { background: transparent; border: 1.5px dashed var(--border-strong); }

/* lista compacta (categorias com muitos produtos) */
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.cards.compact .card { flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; }
.cards.compact .card::before { inset: 0 auto 0 0; width: 3px; height: auto; }
.cards.compact .tile { width: 42px; height: 42px; font-size: 20px; }
.cards.compact .tile.code { font-size: 16px; }
.cards.compact .card-title { font-size: 14.5px; }
.cards.compact .card.group .card-title { font-size: 14.5px; }
.cards.compact .card-desc { font-size: 12.5px; }
.cards.compact .card-meta { font-size: 11px; white-space: nowrap; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; background: var(--mata); color: var(--mole); font-size: 11px; letter-spacing: .06em; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty.small { padding: 18px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(57, 45, 43, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade .15s; }
.modal { width: 100%; max-width: 540px; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 90vh; animation: pop .18s; }
.modal.md { max-width: 660px; }
.modal.lg { max-width: 920px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 21px; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 8px 8px; }
.modal-backdrop.is-drawer { justify-content: flex-end; padding: 0; }
.modal.drawer { max-width: 560px; height: 100vh; max-height: 100vh; border-radius: 0; animation: slide .2s; }
.modal.drawer .modal-foot { border-radius: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

.item-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.item-head .tile { width: 56px; height: 56px; }

.section-title { font-size: 17px; margin: 24px 0 12px; }
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { --tile: var(--mineral); display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--tile); border-radius: var(--radius); background: var(--surface); }
.line .tile { width: 40px; height: 40px; font-size: 18px; }
.line .tile.code { font-size: 14px; }
.line-body { flex: 1; min-width: 0; }
.line-title { font-weight: 700; }
.line-actions { display: flex; flex-direction: column; gap: 4px; }
.answers { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 8px 0 0; font-size: 13.5px; }
.answers dt { color: var(--muted); }
.answers dd { margin: 0; overflow-wrap: anywhere; }

.success { text-align: center; padding: 10px 0; }
.success-icon { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--mata); color: var(--mole); font-size: 30px; display: grid; place-items: center; font-weight: 700; }
.protocol { font-family: var(--font-head); font-stretch: condensed; font-size: 32px; font-weight: 700; letter-spacing: .03em; margin: 4px 0 10px; user-select: all; }
.note { margin: 10px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--sol) 55%, white); font-size: 14px; }
.mine-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.mine { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.mine-items { margin-top: 4px; font-size: 14px; }

/* ---------- selos de status (paleta) ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); }
.st-gray { background: #ECE5D9; color: #5D514B; }
.st-amber { background: var(--sol); color: #62531A; }
.st-blue { background: var(--mar); color: #2E4847; }
.st-purple { background: color-mix(in srgb, var(--toast) 55%, white); color: #6B4330; }
.st-green { background: var(--mata); color: #3C5230; }
.st-red { background: color-mix(in srgb, var(--terra-2) 40%, white); color: #86361F; }
.st-sand { background: var(--mineral); color: #5D4A33; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--border-strong); }

/* ---------- toast ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: var(--radius-sm); background: var(--mole); color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .2s; transition: opacity .3s; max-width: 90vw; }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
.toast.out { opacity: 0; }

/* ---------- admin ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; text-align: center; padding: 36px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.login-card .wordmark { font-size: 24px; margin-bottom: 4px; }
.login-card h1 { font-size: 20px; }
.tabs { display: flex; gap: 2px; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: var(--radius-sm); font: inherit; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.tabs button:hover { background: var(--surface-2); color: var(--text); }
.tabs button.active { background: var(--ink); color: #fff; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { flex: 1 1 140px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat.wide { flex: 3 1 300px; }
.stat-k { display: flex; align-items: center; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat b { font-family: var(--font-head); font-stretch: condensed; font-size: 30px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar > .input { width: auto; }
.toolbar #f-q { flex: 1 1 240px; }
.toolbar .inline .input { width: auto; }
#dirty.warn { color: var(--danger); font-weight: 600; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--brand-soft); }
.table tr.urgent td:first-child { box-shadow: inset 3px 0 0 var(--terra-2); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; padding: 14px; background: var(--surface-2); border-radius: var(--radius); }
.detail-grid .k { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.history { margin-top: 12px; font-size: 14px; }
.history summary { cursor: pointer; font-weight: 600; }
.history ul { padding-left: 18px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.tree-panel { padding: 8px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.tree-node { --tile: transparent; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; border-left: 3px solid var(--tile); }
.tree-node:hover { background: var(--surface-2); }
.tree-node.sel { background: var(--ink); color: #fff; }
.tree-node.sel .tree-meta { color: rgba(255,255,255,.7); }
.tree-node.inactive .tree-name { text-decoration: line-through; opacity: .55; }
.tree-icon { min-width: 22px; text-align: center; font-size: 12px; }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-meta { font-size: 11.5px; color: var(--muted); }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.span2 { grid-column: span 2; }
.span4 { grid-column: 1 / -1; }
.child-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.child { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.child:hover { border-color: var(--brand); }
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px dashed var(--border-strong); background: var(--surface); padding: 6px 11px; border-radius: 20px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.chip:hover { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background: var(--c); box-shadow: inset 0 0 0 1px rgba(57,45,43,.15); }
.swatch.sel { border-color: var(--mole); }
.swatch.none { background: repeating-linear-gradient(45deg, #fff 0 4px, var(--surface-2) 4px 8px); }
.blocks { display: flex; flex-direction: column; gap: 10px; }
.block-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.block-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--border); }
.block-num { width: 22px; height: 22px; border-radius: 50%; background: var(--mole); color: #fff; font-size: 12px; display: grid; place-items: center; flex: none; }
.block-type { font-weight: 700; font-size: 14px; }
.block-props { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; padding: 12px 12px 0; }
.block-props .field { margin-bottom: 12px; }
.block-props .field-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.block-props .input { height: 34px; font-size: 14px; background: #fff; }
.block-props textarea.input { height: auto; }
.check.prop { margin-bottom: 12px; font-size: 14px; }
.preview { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; background: var(--bg); }
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.settings .section-title { margin-top: 0; }
.sticky-save { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; }
.sticky-save .btn { box-shadow: var(--shadow-lg); height: 44px; padding: 0 22px; }

/* ---------- sessão / menu do usuário ---------- */
.user-menu { position: relative; }
.user-menu summary { list-style: none; gap: 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--mineral); color: var(--mole); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-menu .menu a, .user-menu .menu button { display: block; text-align: left; padding: 8px 10px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--text); text-decoration: none; border-radius: var(--radius-sm); cursor: pointer; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--surface-2); }
.btn.active { background: var(--surface-2); }
.count.soft { background: var(--sol); color: var(--mole); }
.requester { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); margin-bottom: 14px; }
.requester .avatar { width: 36px; height: 36px; font-size: 15px; }
.login-card .small { margin: 0; }
.show-sm { display: none; }
[hidden] { display: none !important; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }
.head { font-size: 24px; }

/* ---------- minhas solicitações (plano de ação) ---------- */
.plan-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.plan-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 30px; background: var(--surface); font: inherit; font-size: 13.5px; cursor: pointer; color: var(--text); }
.plan-chip b { font-family: var(--font-head); font-stretch: condensed; font-size: 16px; margin-left: 2px; }
.plan-chip .dot { margin-right: 0; }
.plan-chip:hover { border-color: var(--border-strong); }
.plan-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.plan-chip.warn { background: color-mix(in srgb, var(--terra-2) 22%, white); border-color: transparent; cursor: default; color: #86361F; }
.dot.st-amber { background: var(--sol-2); } .dot.st-blue { background: #8FAAA8; } .dot.st-purple { background: var(--toast); }
.dot.st-green { background: var(--mata-2); } .dot.st-red { background: var(--terra-2); } .dot.st-gray { background: var(--mineral-2); }
.table.plan tr.late td:first-child { box-shadow: inset 3px 0 0 var(--terra-2); }
.progress { display: inline-block; width: 110px; height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--mineral-2); }
.progress.st-amber i { background: var(--sol-2); } .progress.st-blue i { background: #8FAAA8; } .progress.st-purple i { background: var(--toast); }
.progress.st-green i { background: var(--mata-2); }

.steps { display: flex; list-style: none; margin: 0 0 16px; padding: 0; }
.steps li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; text-align: center; color: var(--muted); }
.steps li::before { content: ""; position: absolute; top: 14px; left: -50%; right: 50%; height: 2px; background: var(--border); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.now::before { background: var(--mata-2); }
.steps li span { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); font-weight: 700; font-size: 13px; }
.steps li.done span { background: var(--mata-2); border-color: var(--mata-2); color: #fff; }
.steps li.now { color: var(--text); font-weight: 700; }
.steps li.now span { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps.canceled { justify-content: center; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 12px 14px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--mineral-2); border: 2px solid var(--surface); }
.timeline li:first-child::before { background: var(--ink); }
.timeline .when { display: block; font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }
.note.soft { background: var(--surface-2); }
.modal-foot .grow { flex: 1; }

/* ---------- tabelas editáveis (usuários, e-mails) ---------- */
.edit-table td { vertical-align: middle; padding: 6px 10px; }
.edit-table tbody tr { cursor: default; }
.edit-table tbody tr:hover { background: transparent; }
.edit-table tr.inactive td { opacity: .55; }
.cell { width: 100%; min-width: 90px; height: 34px; padding: 4px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: 14px; color: inherit; transition: background .3s, border-color .15s; }
.cell:hover { border-color: var(--border); background: #fff; }
.cell:focus { outline: 3px solid var(--brand-ring); border-color: var(--brand); background: #fff; }
.edit-table td:first-child .cell { min-width: 250px; }
.cell.saved { background: color-mix(in srgb, var(--mata) 60%, white); }
select.cell { cursor: pointer; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 11px; background: var(--border-strong); transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + i { background: var(--mata-2); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 3px solid var(--brand-ring); }
.cats { border: 1px dashed transparent; background: none; font: inherit; text-align: left; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cats:hover { border-color: var(--border-strong); }
.cat-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); max-height: 320px; overflow-y: auto; }
.cat-list.disabled { opacity: .5; }

/* ---------- página inicial: categorias à esquerda, produtos à direita ---------- */
.shop { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.shop-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.shop-cat { --tile: var(--mineral); display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-left: 3px solid transparent; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: 14.5px; color: var(--text); text-align: left; cursor: pointer; }
.shop-cat:hover { background: var(--surface-2); }
.shop-cat.active { background: color-mix(in srgb, var(--tile) 45%, white); border-left-color: var(--tile); font-weight: 700; }
.shop-cat-icon { width: 24px; text-align: center; font-size: 17px; flex: none; }
.shop-cat-name { flex: 1; min-width: 0; }
.shop-cat-count { font-size: 12px; color: var(--muted); }
.shop-body { min-width: 0; }
.shop-head { margin-bottom: 14px; }
.shop-head .head { font-size: 26px; }
.shop-head p { margin: 4px 0 0; }
.shop-body .crumbs { margin-bottom: 8px; text-transform: none; letter-spacing: normal; font-size: 13.5px; }
/* página de um produto com opções: nome exatamente como na planilha */
.shop-head .head.as-typed { text-transform: none; }
.field-label.left { text-align: left; margin-bottom: -6px; }
.sync-box { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.sync-errors { margin: 4px 0 0; padding-left: 18px; color: var(--danger); }
.dot.st-sand, .progress.st-sand i { background: var(--mineral-2); }

/* ---------- campo de data dd/mm/aaaa ---------- */
.date-field { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.date-field .date-text { width: 130px; }
.date-btn { height: 40px; width: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: 16px; }
.date-btn:hover { background: var(--surface-2); }
.date-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.toolbar .date-field .date-text, .toolbar .date-btn { height: 36px; }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .shop { grid-template-columns: 1fr; gap: 14px; }
  .shop-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .shop-cat { width: auto; flex: none; white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .shop-cat.active { border-bottom-color: var(--tile); }
  .split { grid-template-columns: 1fr; }
  .tree-panel { position: static; max-height: 320px; }
  .grid-form, .block-props { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-in { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
}
@media (max-width: 640px) {
  /* lista de solicitações vira cartões no celular */
  .table.plan thead { display: none; }
  .table.plan, .table.plan tbody, .table.plan tr, .table.plan td { display: block; width: 100%; }
  .table.plan tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table.plan td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 10px; }
  .table.plan td::before { content: attr(data-th); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
  .table.plan td[colspan]::before { display: none; }
  .steps li { font-size: 10.5px; }
  .top-actions { width: 100%; }
  #mine-btn, #cart-btn { flex: 1 1 0; min-width: 0; padding: 0 8px; }
  .table.plan td { flex-wrap: wrap; text-align: right; }
  .table.plan td::before { flex: none; text-align: left; }
  .show-sm { display: inline; }
  .top-actions { gap: 4px; }
  .user-menu summary { padding: 0 6px; }
  .plan-summary { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 4px; }
  .plan-chip { white-space: nowrap; }
  .hide-sm { display: none; }
  .brand-sep, .brand-sub { display: none; }
  .wordmark { font-size: 17px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .shop-cat-count { display: none; }
  .container { padding-top: 24px; }
  .hero h1 { font-size: 27px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cards.compact { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .tile { width: 44px; height: 44px; font-size: 22px; }
  .cards:not(.compact) .card-desc { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .line { flex-wrap: wrap; }
  .line-actions { flex-direction: row; width: 100%; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 10px 10px 0 0; }
  .modal.drawer { height: 100vh; max-height: 100vh; }
}
