/* ==========================================================================
   MECANDRIA — Mecandria ERP (page-specific; loaded only on erp.html, after hms.css)
   The page reuses the .hm- layout of the HMS page (hero, flow, module explorer,
   module picker, quote). This file adds only the "Try it" sale demo (.er-).
   ========================================================================== */

.no-js .er-try { display: none; }

.er-demo { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(20px, 3vw, 36px); align-items: start; }

/* ---- the invoice form ---- */
.er-bill { border: 1px solid var(--bm-line-2); border-radius: 18px; background: var(--bm-surface); box-shadow: 0 30px 60px -48px rgba(29, 27, 47, .5); overflow: hidden; }
.er-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--bm-line); background: var(--bm-surface-2); }
.er-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--bm-line-2); }
.er-bar span { margin-left: 10px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--bm-dim); }
.er-bar b { margin-left: 6px; color: #1D1B2F; font-variant-numeric: tabular-nums; }
.er-bill fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.er-bill legend, .er-qty label { padding: 0; margin-bottom: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--bm-dim); }
.er-bill .er-items { padding: 20px 20px 0; }
.er-items > div { display: grid; gap: 8px; }
.er-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--bm-line-2); background: var(--bm-surface-2); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.er-item input { accent-color: rgb(var(--bm-cyan)); width: 16px; height: 16px; margin: 0; flex: none; }
.er-item:has(input:checked) { border-color: rgba(var(--bm-cyan), .6); background: rgba(var(--bm-cyan), .04); }
.er-item .t { display: grid; gap: 2px; min-width: 0; }
.er-item b { font-size: .92rem; }
.er-item small { font-size: .8rem; color: var(--bm-dim); }
.er-item .s { margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--bm-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.er-row { display: flex; flex-wrap: wrap; gap: 18px 28px; padding: 20px 20px 0; }
.er-step { display: inline-flex; border: 1.5px solid var(--bm-line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.er-step button { width: 40px; border: 0; background: transparent; font: inherit; font-size: 1.1rem; color: #1D1B2F; cursor: pointer; }
.er-step button:hover { background: rgba(var(--bm-cyan), .08); }
.er-step input { width: 56px; padding: 9px 0; border: 0; border-inline: 1px solid var(--bm-line); text-align: center; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.er-step input::-webkit-inner-spin-button, .er-step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.er-pay { display: flex; flex-wrap: wrap; gap: 8px; }
.er-pay legend { width: 100%; }
.er-pay label { cursor: pointer; }
.er-pay input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.er-pay span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--bm-line-2); font-size: .85rem; font-weight: 600; color: #3A3648; transition: border-color .2s ease, background .2s ease, color .2s ease; }
.er-pay input:checked + span { border-color: rgb(var(--bm-cyan)); background: rgb(var(--bm-cyan)); color: #fff; }
.er-pay input:focus-visible + span, .er-step button:focus-visible, .er-step input:focus-visible, .er-reset:focus-visible { outline: 2px solid rgb(var(--bm-magenta)); outline-offset: 2px; }

.er-total { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 20px 0; padding-top: 16px; border-top: 1px dashed var(--bm-line-2); font-size: .9rem; color: var(--bm-muted); }
.er-total b { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; color: #1D1B2F; font-variant-numeric: tabular-nums; }
.er-msg { min-height: 1.5em; margin: 10px 20px 0; font-size: .85rem; color: rgb(var(--bm-cyan)); }
.er-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 12px 20px 22px; }
.er-reset { padding: 0; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--bm-dim); cursor: pointer; }
.er-reset:hover { color: rgb(var(--bm-magenta)); }

/* ---- the four module cards ---- */
.er-feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.er-card { position: relative; padding: 18px 18px 20px; border: 1px solid var(--bm-line-2); border-radius: 16px; background: var(--bm-surface); box-shadow: 0 30px 60px -52px rgba(29, 27, 47, .5); }
.er-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.er-card .hm-ic { width: 30px; height: 30px; border-radius: 8px; }
.er-card .hm-ic svg { width: 17px; height: 17px; }
.er-card h3 { margin: 0; font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.er-card header em { margin-left: auto; font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--bm-dim); }
.er-card.is-hit { animation: er-hit 1.2s var(--ease); }
.er-card.is-hit::after { content: "Updated"; position: absolute; top: -9px; right: 14px; padding: 3px 8px; border-radius: 999px; background: rgb(var(--bm-cyan)); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; animation: er-tag 1.8s var(--ease) both; }
@keyframes er-hit { 0% { border-color: rgb(var(--bm-cyan)); box-shadow: 0 0 0 4px rgba(var(--bm-cyan), .15); } 100% { border-color: var(--bm-line-2); box-shadow: 0 30px 60px -52px rgba(29, 27, 47, .5); } }
@keyframes er-tag { 0% { opacity: 0; transform: translateY(4px); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.er-stock { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.er-stock li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; font-size: .82rem; color: #3A3648; }
.er-stock .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.er-stock b { font-variant-numeric: tabular-nums; }
.er-stock em { grid-column: 1 / -1; order: 3; justify-self: start; font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; color: rgb(var(--bm-magenta)); background: rgba(var(--bm-magenta), .08); }
.er-stock i { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--bm-line); position: relative; overflow: hidden; }
.er-stock i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: rgb(var(--bm-cyan)); border-radius: inherit; transition: width .6s var(--ease); }
.er-stock li.is-low i::before { background: rgb(var(--bm-magenta)); }

.er-nums { margin: 0; display: grid; gap: 10px; }
.er-nums div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--bm-line); }
.er-nums div:last-child { border-bottom: 0; padding-bottom: 0; }
.er-nums dt { font-size: .82rem; color: var(--bm-muted); }
.er-nums dd { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; color: #1D1B2F; font-variant-numeric: tabular-nums; }

.er-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.er-log li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; font-size: .8rem; line-height: 1.45; color: #3A3648; }
.er-log time { font-variant-numeric: tabular-nums; color: var(--bm-dim); }
.er-log li:first-child { color: #1D1B2F; }

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .er-demo { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .er-feed { grid-template-columns: 1fr; }
  .er-bill .er-items, .er-row { padding-inline: 16px; }
  .er-total, .er-msg { margin-inline: 16px; }
  .er-acts { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .er-card.is-hit, .er-card.is-hit::after { animation: none; }
  .er-card.is-hit::after { display: none; }
  .er-stock i::before { transition: none; }
}
