:root {
  --bg: #f7f7f9;
  --surface: #ffffff;
  --surface-2: #fff8fa;
  --text: #15151c;
  --muted: #6f7280;
  --soft: #9a9ca6;
  --line: #e5e5eb;
  --line-strong: #d7d8e0;
  --accent: #fd4066;
  --accent-2: #e33359;
  --accent-soft: #fff0f4;
  --accent-border: #ffc4d1;
  --ok: #2caf5a;
  --warn: #b77816;
  --bad: #b42318;
  --shadow-sm: 0 2px 8px rgba(24, 26, 36, .06);
  --shadow: 0 14px 38px rgba(24, 26, 36, .08);
  --radius: 18px;
  --radius-lg: 24px;
  --sidebar: 276px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body, #app { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: inherit; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, rgba(253,64,102,.14), transparent 34%), linear-gradient(135deg, #fbfbfc, #f3f1f4); }
.login-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow); padding: 34px; }
.login-card .brand-block { margin-bottom: 26px; }
.login-card .logo-brand { align-items: flex-start; }

.brand-block { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-mark { width: 58px; height: 58px; border: 2px solid rgba(138, 21, 56, .58); color: var(--accent); display: grid; place-items: center; border-radius: 14px; flex: 0 0 auto; position: relative; font-weight: 900; letter-spacing: -.05em; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; inset: 10px 16px; border-left: 3px solid currentColor; transform: rotate(45deg); opacity: .75; }
.brand-mark::after { transform: rotate(-45deg); }
.brand-word { min-width: 0; }
.brand-word strong { display: block; letter-spacing: .16em; font-size: 15px; line-height: 1.1; white-space: nowrap; }
.brand-word span { display: block; margin-top: 5px; color: var(--muted); letter-spacing: .36em; font-weight: 700; font-size: 11px; }

.field { margin: 14px 0; }
.field label { display: block; font-weight: 800; font-size: 13px; margin: 0 0 7px; color: #252733; }
.input, input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 14px; background: #fff; padding: 12px 14px; outline: none; color: var(--text); }
textarea { min-height: 104px; resize: vertical; }
.input:focus, input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.btn { border: 0; border-radius: 14px; padding: 11px 16px; font-weight: 850; background: var(--accent); color: #fff; display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 42px; box-shadow: 0 7px 18px rgba(253, 64, 102, .22); }
.btn:hover { background: var(--accent-2); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid transparent; box-shadow: none; }
.btn.danger { background: var(--bad); color: #fff; }

.bo-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; background: var(--bg); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar-brand { padding: 30px 24px 24px; border-bottom: 1px solid var(--line); }
.sidebar-nav { padding: 18px 0; display: flex; flex-direction: column; gap: 3px; overflow: auto; }
.nav-item { width: 100%; border: 0; border-left: 4px solid transparent; background: transparent; color: #343744; text-align: left; display: flex; align-items: center; gap: 14px; padding: 13px 24px 13px 22px; font-weight: 750; box-shadow: none; border-radius: 0; }
.nav-item:hover { background: #fff4f7; color: var(--accent); }
.nav-item.active { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), rgba(248,238,242,0)); color: var(--accent); }
.nav-icon { width: 22px; height: 22px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.nav-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-user { margin-top: auto; padding: 18px 22px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.avatar { width: 50px; height: 50px; border-radius: 999px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 900; letter-spacing: .03em; flex: 0 0 auto; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .tag { margin-top: 5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.app-header { height: 72px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; }
.app-header h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn { width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: #5f6370; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.content { width: min(1160px, 100%); margin: 0 auto; padding: 32px 34px 28px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0 28px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-title { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.page-title h2 { margin: 0; font-size: 27px; letter-spacing: -.02em; }
.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.search-wrap { position: relative; min-width: 280px; }
.search-wrap svg { position: absolute; width: 19px; height: 19px; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); stroke: currentColor; stroke-width: 2; fill: none; }
.search-wrap input { padding-left: 44px; height: 48px; border-radius: 14px; box-shadow: var(--shadow-sm); }

.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 850; border: 1px solid var(--line); color: var(--muted); background: #fff; width: fit-content; }
.tag.accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.tag.ok { color: #168343; background: #ecf9f1; border-color: #d0efdc; }
.tag.bad { color: var(--bad); background: #fff0ed; border-color: #f4c7bf; }
.tag.warn { color: var(--warn); background: #fff7e8; border-color: #f3dfb7; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--ok); }
.status-dot.off { background: var(--bad); }
.status-dot.warn { background: var(--warn); }

.grid { display: grid; gap: 18px; }
.metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.two-grid { grid-template-columns: 1fr 1fr; margin-bottom: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.card h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.metric-card { min-height: 142px; display: flex; gap: 18px; align-items: center; }
.metric-icon { width: 60px; height: 60px; border-radius: 999px; background: #f4f1f2; color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.metric-icon svg { width: 27px; height: 27px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.metric-label { color: #4a4d5a; font-size: 15px; line-height: 1.35; }
.metric { font-size: 33px; font-weight: 950; color: var(--accent); margin-top: 9px; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.status-list, .role-list, .quick-grid { display: grid; gap: 12px; }
.status-row, .role-row, .quick-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px; display: flex; align-items: center; gap: 12px; min-height: 58px; }
.status-icon, .quick-icon, .role-icon { width: 42px; height: 42px; border-radius: 11px; background: #f4f2f3; color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.status-icon svg, .quick-icon svg, .role-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.status-main, .role-main { flex: 1; min-width: 0; }
.status-value, .role-note { margin-left: auto; color: #555966; font-size: 14px; white-space: nowrap; }
.quick-grid { grid-template-columns: 1fr 1fr; }
.quick-card { min-height: 68px; justify-content: space-between; cursor: pointer; }
.quick-card:hover { border-color: var(--accent-border); background: #fff5f8; }
.quick-label { flex: 1; font-weight: 800; color: #30333d; }
.chev { color: var(--muted); font-size: 24px; }

.section-head { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 280px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eee; font-size: 14px; vertical-align: top; }
th { background: #fbfaf9; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:nth-child(even) td { background: #fdfcfa; }
tr:hover td { background: #fff8fa; }
.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { padding: 18px 20px 10px; margin: 0; }
.table-card .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.table-link { color: var(--accent); font-weight: 850; display: inline-flex; align-items: center; gap: 5px; padding: 12px 20px 18px; }

.drawer { position: fixed; inset: 0; background: rgba(24, 26, 36, .34); display: none; align-items: stretch; justify-content: flex-end; z-index: 10; }
.drawer.open { display: flex; }
.drawer-panel { width: min(620px, 100%); background: #fff; height: 100%; padding: 26px; overflow: auto; box-shadow: -18px 0 42px rgba(0,0,0,.16); }
.drawer-panel header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.drawer-panel h2 { margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.full { grid-column: 1 / -1; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #171717; color: #fff; padding: 12px 16px; border-radius: 999px; display: none; z-index: 20; box-shadow: var(--shadow); }
.toast.show { display: block; }
pre { white-space: pre-wrap; background: #14151b; color: #fff; border-radius: 18px; padding: 16px; overflow: auto; }
code { background: #f4f2f3; border: 1px solid var(--line); border-radius: 8px; padding: 1px 5px; }

.empty-state { color: var(--muted); padding: 22px; text-align: center; }

@media (max-width: 1100px) {
  .bo-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 12px; }
  .nav-item { border-left: 0; border-radius: 999px; padding: 10px 14px; white-space: nowrap; }
  .nav-item.active { background: var(--accent); color: #fff; }
  .sidebar-user { display: none; }
  .sidebar-brand { padding: 18px 22px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-grid { grid-template-columns: 1fr; }
  .app-header { padding: 0 22px; }
  .content { padding: 24px 22px; }
}
@media (max-width: 680px) {
  .metrics-grid, .quick-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: stretch; }
  .search-wrap { min-width: 0; width: 100%; }
  .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .app-header h1 { font-size: 18px; }
}

.error-box{white-space:pre-wrap;background:#fff1f2;border:1px solid #fecdd3;color:#7f1d1d;border-radius:14px;padding:12px;font-size:12px;line-height:1.45;max-height:220px;overflow:auto;}


/* v0.5 usability refinements */
.logo-brand { flex-direction: column; align-items: flex-start; gap: 4px; }
.brand-logo { width: 168px; max-width: 100%; height: auto; max-height: 48px; object-fit: contain; object-position: left center; display: block; }
.brand-logo-badge { width: 226px; max-height: none; border-radius: 18px; }
.brand-sub { display: none; }
.sidebar-brand { padding-top: 24px; padding-bottom: 18px; }
.sidebar-user { cursor: pointer; }
.sidebar-user:hover { background: var(--surface-2); }
.btn { white-space: nowrap; }
.btn.compact { min-width: 96px; padding-left: 14px; padding-right: 14px; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.search-wrap.has-clear input { padding-right: 42px; }
.clear-search { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); box-shadow: none; font-size: 22px; line-height: 1; display: grid; place-items: center; }
.clear-search:hover { background: var(--accent-soft); color: var(--accent); }
.toolbar .search-wrap { flex: 1 1 320px; min-width: min(420px, 100%); }
.global-results { margin-bottom: 22px; }
.search-result-list { display: grid; gap: 8px; }
.search-result { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 12px 14px; display: grid; grid-template-columns: 130px minmax(150px, 1fr) minmax(220px, 2fr); gap: 12px; align-items: center; text-align: left; box-shadow: none; color: var(--text); }
.search-result:hover { border-color: var(--accent-border); background: #fff5f8; }
.search-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-grid { align-items: stretch; }
.report-card { min-height: 220px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.report-card .metric-icon { margin-bottom: 4px; }
.report-card p { flex: 1; margin: 0; }
.error-box{white-space:pre-wrap;background:#fff1f2;border:1px solid #fecdd3;color:#7f1d1d;border-radius:14px;padding:12px;font-size:12px;line-height:1.45;max-height:220px;overflow:auto;}
@media (max-width: 760px) {
  .search-result { grid-template-columns: 1fr; }
  .btn.compact { min-width: 0; }
}

/* v0.6 multiempresa */
.header-sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.company-select { min-width: 210px; height: 42px; border-radius: 999px; background: #fff; border: 1px solid var(--line); padding: 0 14px; font-weight: 800; color: var(--accent); box-shadow: var(--shadow-sm); }
.company-list { display: grid; gap: 10px; }
.company-row { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.company-row-main { display: grid; gap: 4px; min-width: 0; }
.company-row-main strong, .company-row-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-card { background: #fff5f8; border-color: var(--accent-border); }
@media (max-width: 760px) {
  .app-header { height: auto; min-height: 78px; align-items: flex-start; padding-top: 14px; padding-bottom: 14px; gap: 12px; }
  .header-actions { width: 100%; justify-content: stretch; }
  .company-select { min-width: 0; width: 100%; }
  .company-row { align-items: flex-start; flex-direction: column; }
}


/* Lowdo identity */
.sidebar-brand { background: #fff; }
.login-card .brand-logo, .sidebar-brand .brand-logo { box-shadow: none; }
.login-card { border-color: rgba(253,64,102,.20); }
.logo-brand { flex-direction: column; align-items: flex-start; gap: 0; }
.logo-brand-badge { width: fit-content; }
.app-header h1 strong, .metric { color: var(--accent); }

/* v0.7.2 Lowdo refinements */
.login-card .logo-brand-badge { margin: 0 0 10px 0; }
.login-card .brand-logo-badge { width: 226px; display: block; }
.sidebar-brand .logo-brand-sidebar { display: flex; align-items: flex-start; }
.sidebar-brand .brand-logo-sidebar { width: 172px; max-width: 100%; height: auto; display: block; }
.sidebar-brand { padding-top: 22px; padding-bottom: 16px; }

/* v0.7.3 refined select chevrons */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 42px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236f7280' stroke-width='2.5' 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 14px center;
  background-size: 14px 14px;
}
.company-select { padding-right: 44px; }


/* v0.7.4 header company select chevron */
.company-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 210px;
}
.company-select-wrap .company-select {
  width: 100%;
  padding-right: 46px !important;
  background-image: none !important;
}
.company-select-arrow {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--accent);
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}
.company-select-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* v0.8.0 POS sales report import */
.pos-import-grid { margin-bottom: 22px; align-items: start; }
.pos-import-card { min-height: 100%; }
.pos-import-form { display: grid; gap: 12px; }
.pos-report-list { display: grid; gap: 10px; }
.pos-report-card { max-height: 760px; overflow: hidden; display: flex; flex-direction: column; }
.pos-report-card .pos-report-list { overflow: auto; padding-right: 2px; max-height: 610px; }
.pos-report-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 12px 14px 0; margin-top: 12px; }
.pos-report-pager .btn:disabled { opacity: .45; cursor: default; }
.pos-report-row { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 0; overflow: hidden; }
.pos-report-row summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; }
.pos-report-row summary::-webkit-details-marker { display: none; }
.pos-report-row summary strong { display: block; }
.pos-report-row summary small { display: block; margin-top: 3px; color: var(--muted); }
.pos-report-row[open] summary { border-bottom: 1px solid var(--line); background: #fff8fa; }
.pos-report-row > .muted, .pos-report-row > .error-box { margin: 12px 14px; }
.pos-lines { margin: 12px 14px 14px; }
.pos-lines table { min-width: 560px; }
.pos-lines th, .pos-lines td { padding: 10px 12px; }
#posImportSubmit:disabled { opacity: .65; cursor: wait; }
@media (max-width: 900px) {
  .pos-import-grid { grid-template-columns: 1fr; }
}

/* v0.8.3 POS review stabilization */
.pos-report-note { margin: 12px 14px; }
.pos-review-form { display: grid; gap: 10px; }
.pos-review-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0 14px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff8fa; }
.pos-review-help { line-height: 1.45; }
.pos-review-buttons { display: flex; justify-content: flex-end; }
.pos-line-review input, .pos-line-review select { width: 100%; min-width: 150px; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; color: var(--text); font-weight: 650; }
.pos-line-review input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
.pos-line-review .pos-line-qty { min-width: 82px; max-width: 110px; text-align: right; }
.pos-line-review .pos-line-product { min-width: 220px; }
@media (max-width: 900px) {
  .pos-review-actions { grid-template-columns: 1fr; align-items: stretch; }
  .pos-review-actions .btn { width: 100%; }
}

/* v0.8.5 POS persistent mappings */
.pos-mappings-card { margin-bottom: 22px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750; color: var(--muted); }
.inline-check input { accent-color: var(--accent); }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form select { min-width: 220px; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; color: var(--text); font-weight: 650; }
.tiny { font-size: 11px; }
@media (max-width: 900px) {
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form .btn { width: 100%; }
}


/* v0.8.8 POS review table usability */
.pos-import-grid { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
.pos-import-card { min-width: 0; }
.pos-report-card { max-height: none; overflow: visible; min-width: 0; }
.pos-report-card .pos-report-list { max-height: none; overflow: visible; padding-right: 0; }
.pos-report-row[open] { overflow: visible; }
.pos-review-form { overflow: visible; }
.pos-lines {
  margin: 12px 14px 14px;
  max-height: min(62vh, 620px);
  min-height: 230px;
  overflow: auto;
  resize: vertical;
  overscroll-behavior: contain;
}
.pos-lines table { min-width: 1040px; }
.pos-lines thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff8fa;
  box-shadow: 0 1px 0 var(--line);
}
.pos-lines th, .pos-lines td { padding: 9px 10px; vertical-align: middle; }
.pos-lines th:nth-child(1), .pos-lines td:nth-child(1) { width: 72px; min-width: 72px; text-align: center; }
.pos-lines th:nth-child(2), .pos-lines td:nth-child(2) { min-width: 300px; }
.pos-lines th:nth-child(3), .pos-lines td:nth-child(3) { width: 110px; min-width: 110px; }
.pos-lines th:nth-child(4), .pos-lines td:nth-child(4) { min-width: 280px; }
.pos-lines th:nth-child(5), .pos-lines td:nth-child(5) { width: 150px; min-width: 150px; }
.pos-lines th:nth-child(6), .pos-lines td:nth-child(6) { width: 80px; min-width: 80px; text-align: center; }
.pos-review-actions {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
}
.pos-review-buttons { justify-content: flex-end; }
.pos-line-review input, .pos-line-review select { min-width: 0; }
.pos-line-review .pos-line-product { min-width: 260px; }
.pos-line-review .pos-line-qty { min-width: 82px; max-width: 110px; }
.inline-check { white-space: nowrap; }
@media (max-width: 1120px) {
  .pos-import-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .pos-review-buttons { justify-content: stretch; }
  .pos-review-actions .btn { width: 100%; }
}


/* v0.8.9 POS review in modal */
.pos-report-actions { display: flex; justify-content: flex-end; padding: 12px 14px 14px; border-top: 1px solid var(--line); background: #fff; }
.pos-review-modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(17, 17, 17, .46); display: flex; align-items: flex-start; justify-content: center; padding: 22px; overflow: auto; }
.pos-review-modal { width: min(1320px, calc(100vw - 28px)); max-width: 1320px; margin: 18px auto; padding: 0; overflow: visible; }
.pos-review-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #fff8fa; border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 0; z-index: 3; }
.pos-review-modal-body { padding: 18px 20px 20px; }
.pos-review-modal .pos-review-form { display: grid; gap: 14px; overflow: visible; }
.pos-review-modal .pos-lines { margin: 0; max-height: none; min-height: 0; overflow: visible; resize: none; border-radius: 18px; }
.pos-review-modal .pos-lines table { width: 100%; min-width: 0; table-layout: fixed; }
.pos-review-modal .pos-lines thead th { position: static; box-shadow: none; }
.pos-review-modal .pos-lines th, .pos-review-modal .pos-lines td { padding: 8px 8px; min-width: 0 !important; }
.pos-review-modal .pos-lines th:nth-child(1), .pos-review-modal .pos-lines td:nth-child(1) { width: 62px; min-width: 0 !important; }
.pos-review-modal .pos-lines th:nth-child(2), .pos-review-modal .pos-lines td:nth-child(2) { width: 32%; min-width: 0 !important; }
.pos-review-modal .pos-lines th:nth-child(3), .pos-review-modal .pos-lines td:nth-child(3) { width: 92px; min-width: 0 !important; }
.pos-review-modal .pos-lines th:nth-child(4), .pos-review-modal .pos-lines td:nth-child(4) { width: 30%; min-width: 0 !important; }
.pos-review-modal .pos-lines th:nth-child(5), .pos-review-modal .pos-lines td:nth-child(5) { width: 148px; min-width: 0 !important; }
.pos-review-modal .pos-lines th:nth-child(6), .pos-review-modal .pos-lines td:nth-child(6) { width: 72px; min-width: 0 !important; }
.pos-review-modal .pos-line-review input, .pos-review-modal .pos-line-review select { width: 100%; min-width: 0 !important; }
.pos-review-modal .pos-line-review .pos-line-qty { max-width: none; min-width: 0 !important; }
.pos-review-modal .pos-line-review .pos-line-product { min-width: 0 !important; }
.pos-review-modal .pos-review-actions { margin: 0; grid-template-columns: minmax(0, 1fr) auto; }
.pos-review-modal .pos-review-buttons { align-items: center; }
@media (max-width: 980px) {
  .pos-review-modal-backdrop { padding: 10px; }
  .pos-review-modal { width: calc(100vw - 12px); margin: 6px auto; }
  .pos-review-modal-head { position: static; flex-direction: column; }
  .pos-review-modal .pos-lines { overflow-x: auto; }
  .pos-review-modal .pos-lines table { min-width: 920px; }
  .pos-review-modal .pos-review-actions { grid-template-columns: 1fr; }
}

/* v0.9.0 header/company logo refinements */
.app-header {
  min-height: 94px;
  height: 94px;
  padding: 0 38px;
}
.app-header h1 {
  font-size: 22px;
  line-height: 1.12;
}
.header-title-block { min-width: 0; }
.header-sub { font-size: 13px; }
.sidebar-brand { min-height: 94px; display: flex; align-items: center; padding-top: 20px; padding-bottom: 18px; }
.sidebar-brand .brand-logo-sidebar { width: 192px; max-height: 58px; }
.header-actions { gap: 12px; }
.company-picker { position: relative; min-width: 238px; }
.company-picker-btn {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 44px 6px 8px;
  color: var(--accent);
  font-weight: 850;
}
.company-picker-btn:hover { border-color: var(--accent-border); background: #fff8fa; }
.company-picker-logo,
.company-list-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.company-picker-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-picker-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.company-picker-arrow svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.6; fill: none; }
.company-picker-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(330px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 20;
}
.company-picker-menu.open { display: grid; gap: 6px; }
.company-picker-option {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  border-radius: 14px;
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.company-picker-option:hover,
.company-picker-option.active { background: var(--accent-soft); border-color: var(--accent-border); }
.company-picker-option span { min-width: 0; display: grid; gap: 2px; }
.company-picker-option strong,
.company-picker-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-picker-option small { color: var(--muted); }
.company-logo-fallback {
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}
.company-logo-editor { display: flex; gap: 14px; align-items: center; }
.company-logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.company-logo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}
.company-row-main.with-logo { display: flex; align-items: center; gap: 10px; }
.company-row-main.with-logo > div { min-width: 0; display: grid; gap: 4px; }
@media (max-width: 760px) {
  .app-header { height: auto; min-height: 94px; align-items: flex-start; padding: 14px 22px; flex-direction: column; }
  .header-actions { width: 100%; }
  .company-picker { width: 100%; min-width: 0; }
}

/* v0.10.4 — estado como tag, ações menos destrutivas */
.status-panel { border: 1px solid var(--line); background: #fbfbfc; border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.status-panel p { margin: 0; max-width: 320px; }
.drawer-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 12px; }
.btn.soft-danger { color: var(--bad); border-color: #f1c7c2; background: #fff7f6; box-shadow: none; }
.btn.soft-danger:hover { background: #fff0ed; border-color: #e7ada7; }
.btn.soft-ok { color: #168343; border-color: #caefd9; background: #f3fbf6; box-shadow: none; }
.btn.soft-ok:hover { background: #ecf9f1; border-color: #b7e5ca; }


/* v0.10.5 — consistência visual das tabelas e auditoria filtrável */
.collection-table th.col-active,
.collection-table td.col-active,
.collection-table th.col-ativo,
.collection-table td.col-ativo,
.collection-table th.col-actions,
.collection-table td.col-actions {
  text-align: right;
  width: 150px;
  white-space: nowrap;
}
.collection-table td.col-active .tag,
.collection-table td.col-ativo .tag,
.collection-table td.col-actions .btn {
  margin-left: auto;
}
.collection-table-categories,
.collection-table-operators {
  table-layout: fixed;
  min-width: 0;
}
.collection-table-categories th.col-name,
.collection-table-categories td.col-name,
.collection-table-operators th.col-name,
.collection-table-operators td.col-name {
  width: auto;
  text-align: left;
}
.collection-table-categories th.col-active,
.collection-table-categories td.col-active,
.collection-table-categories th.col-actions,
.collection-table-categories td.col-actions,
.collection-table-operators th.col-active,
.collection-table-operators td.col-active,
.collection-table-operators th.col-actions,
.collection-table-operators td.col-actions {
  width: 170px;
}
.audit-toolbar { align-items: stretch; }
.audit-toolbar .search-wrap { flex: 1 1 340px; }
.compact-select {
  width: auto;
  min-width: 170px;
  height: 48px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  background: #fff;
}
.audit-pager { justify-content: space-between; }
@media (max-width: 760px) {
  .compact-select { width: 100%; }
  .audit-pager { align-items: flex-start; flex-direction: column; }
}

/* v0.11.1 — login separado, setup discreto e área SysOp */
.login-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
}
.link-btn:hover { text-decoration: underline; }
.onboarding-card { max-width: 760px; }
.platform-note {
  border: 1px solid var(--line);
  background: #fbfbfc;
  border-radius: 18px;
  padding: 14px 16px;
}

.login-links.single { justify-content: center; }
.login-setup-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  text-align: center;
}
.login-setup-summary {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  font-size: 12px;
}
.login-setup-summary:hover { color: var(--text); text-decoration: underline; }
.link-btn.technical { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* v0.11.2 — login público limpo e pedido comercial */
.login-interest-copy {
  margin-top: 18px;
  text-align: center;
}
.inline-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.inline-link:hover { color: var(--accent-strong); }


/* v0.11.3 — Plataforma reorganizada e títulos públicos mais discretos */
.login-title { margin: 0 0 6px; font-size: 28px; line-height: 1.08; letter-spacing: -.035em; }
.login-title.lead-title { font-size: 27px; }
.platform-usage-card { margin-bottom: 22px; }
.usage-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.usage-row { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 112px; justify-content: space-between; }
.usage-row strong { display: block; margin-bottom: 4px; }
.usage-row .tag { max-width: 100%; }
.platform-companies-table th:nth-child(3),
.platform-companies-table td:nth-child(3),
.platform-companies-table th:nth-child(4),
.platform-companies-table td:nth-child(4),
.platform-companies-table th:nth-child(5),
.platform-companies-table td:nth-child(5) { text-align: right; white-space: nowrap; }
.platform-companies-table td:nth-child(4) .tag,
.platform-companies-table td:nth-child(5) .btn { margin-left: auto; }
@media (max-width: 980px) { .usage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .login-title, .login-title.lead-title { font-size: 24px; } .usage-list { grid-template-columns: 1fr; } }


/* v0.12 PWA Operação */
.operation-shell { display: grid; gap: 18px; }
.operation-hero { background: linear-gradient(135deg, #171017, #321624); color: #fff; border-radius: 24px; padding: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; box-shadow: var(--shadow-sm); }
.operation-hero .muted { color: rgba(255,255,255,.72); }
.operation-hero .page-title h2 { color: #fff; }
.operation-metrics .metric-card { min-height: 118px; }
.operation-actions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.operation-action { width: 100%; min-height: 112px; text-align: left; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 20px; padding: 15px; display: grid; gap: 10px; box-shadow: var(--shadow-sm); cursor: default; }
.operation-action:hover { border-color: var(--accent-border); background: #fff8fb; }
.operation-action-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.operation-action-icon svg { width: 23px; height: 23px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.operation-action strong { display: block; font-size: 16px; }
.operation-action small { display: block; color: var(--muted); margin-top: 3px; }
.operation-stock-card { padding-bottom: 10px; }
.operation-stock-list { display: grid; gap: 10px; }
.operation-stock-row { border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.operation-stock-row summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; }
.operation-stock-row summary::-webkit-details-marker { display: none; }
.operation-stock-row summary strong { display: block; }
.operation-stock-row summary small { display: block; color: var(--muted); margin-top: 4px; }
.operation-stock-total { display: grid; justify-items: end; gap: 4px; white-space: nowrap; }
.operation-lot-list { list-style: none; margin: 0; padding: 0 14px 14px; display: grid; gap: 8px; }
.operation-lot-list li { border-top: 1px solid #f0ecee; padding-top: 8px; display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.operation-lot-list li span { color: var(--muted); }
@media (max-width: 900px) {
  .operation-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .operation-hero { align-items: stretch; flex-direction: column; }
  .operation-actions-grid { grid-template-columns: 1fr; }
  .operation-stock-row summary { align-items: flex-start; flex-direction: column; }
  .operation-stock-total { justify-items: start; }
  .operation-lot-list li { grid-template-columns: 1fr; }
}

/* v0.12.1 PWA Operação 2.0 */
.operation-v2 { gap: 16px; }
.operation-appbar { display: none; }
.operation-nav-mobile { display: none; }
.operation-hero-v2 { align-items: stretch; }
.operation-install-box { display: grid; gap: 8px; justify-items: end; max-width: 320px; }
.ios-install-tip { color: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08); padding: 10px 12px; border-radius: 14px; font-size: 13px; line-height: 1.35; }
.operation-primary-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.operation-main-grid { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); }
.operation-recent-list { display: grid; gap: 10px; }
.operation-recent-row { border: 1px solid var(--line); border-radius: 15px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; }
.operation-recent-row strong, .operation-recent-row small { display: block; }
.operation-recent-row small { color: var(--muted); margin-top: 4px; font-size: 12px; }
.operation-company-logo { width: 42px; height: 42px; border-radius: 14px; object-fit: cover; background: #fff; border: 1px solid rgba(255,255,255,.16); }
.operation-appbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.operation-appbar-brand strong, .operation-appbar-brand span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-appbar-brand strong { font-size: 16px; }
.operation-appbar-brand span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.operation-nav-btn { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 10px 8px; min-height: 66px; display: grid; gap: 6px; align-content: center; justify-items: center; color: #30333d; box-shadow: var(--shadow-sm); }
.operation-nav-btn svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.operation-nav-btn strong { font-size: 12px; }
.operation-nav-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.operation-more { position: relative; }
.operation-more summary { list-style: none; border: 1px solid var(--line); background: #fff; border-radius: 18px; min-height: 66px; padding: 10px 8px; display: grid; gap: 6px; align-content: center; justify-items: center; font-weight: 850; font-size: 12px; box-shadow: var(--shadow-sm); cursor: pointer; }
.operation-more summary::-webkit-details-marker { display: none; }
.operation-more summary svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 2; fill: none; }
.operation-more-menu { position: absolute; z-index: 8; right: 0; top: calc(100% + 8px); width: min(320px, 86vw); max-height: 65vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 8px; display: grid; gap: 4px; }
.operation-more-menu button { width: 100%; border: 0; background: transparent; box-shadow: none; border-radius: 13px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; text-align: left; font-weight: 800; color: var(--text); }
.operation-more-menu button:hover { background: var(--accent-soft); color: var(--accent); }
.operation-more-menu svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; fill: none; }

@media (min-width: 861px) {
  [data-install-pwa], [data-ios-install-tip] { display: none !important; }
}

@media (max-width: 860px) {
  body.lowdo-operation-tab { background: #f6f5f7; }
  body.lowdo-operation-tab .bo-shell { display: block; }
  body.lowdo-operation-tab .sidebar { display: none; }
  body.lowdo-operation-tab .app-header { display: none; }
  body.lowdo-operation-tab .footer { display: none; }
  body.lowdo-operation-tab .content { padding: max(16px, env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); width: 100%; }
  body.lowdo-operation-tab .operation-appbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: 22px; padding: 10px 12px; backdrop-filter: blur(16px); position: sticky; top: max(8px, env(safe-area-inset-top)); z-index: 5; box-shadow: var(--shadow-sm); }
  body.lowdo-operation-tab .operation-nav-mobile { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  body.lowdo-operation-tab .operation-hero { border-radius: 24px; padding: 18px; }
  body.lowdo-operation-tab .operation-hero .page-title h2 { font-size: 25px; }
  body.lowdo-operation-tab .operation-hero .page-title { gap: 8px; }
  body.lowdo-operation-tab .operation-install-box { justify-items: stretch; max-width: none; }
  body.lowdo-operation-tab .operation-primary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.lowdo-operation-tab .operation-action { min-height: 112px; border-radius: 22px; padding: 14px; }
  body.lowdo-operation-tab .operation-action .tag { font-size: 11px; padding: 4px 8px; }
  body.lowdo-operation-tab .operation-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.lowdo-operation-tab .metric-card { min-height: 94px; padding: 14px; gap: 12px; }
  body.lowdo-operation-tab .metric-icon { width: 44px; height: 44px; }
  body.lowdo-operation-tab .metric { font-size: 24px; margin-top: 4px; }
  body.lowdo-operation-tab .metric-label { font-size: 13px; }
  body.lowdo-operation-tab .operation-main-grid { grid-template-columns: 1fr; }
  body.lowdo-operation-tab .card { border-radius: 22px; padding: 16px; }
  body.lowdo-operation-tab .card-head { align-items: flex-start; }
  body.lowdo-operation-tab .operation-stock-row { border-radius: 18px; }
}

@media (max-width: 420px) {
  body.lowdo-operation-tab .operation-nav-mobile { gap: 6px; }
  body.lowdo-operation-tab .operation-nav-btn, body.lowdo-operation-tab .operation-more summary { min-height: 60px; border-radius: 16px; padding: 8px 4px; }
  body.lowdo-operation-tab .operation-nav-btn strong, body.lowdo-operation-tab .operation-more summary { font-size: 11px; }
  body.lowdo-operation-tab .operation-primary-actions { grid-template-columns: 1fr; }
  body.lowdo-operation-tab .operation-metrics { grid-template-columns: 1fr; }
}

/* v0.12.3 — Administração compacta no mobile/PWA */
.mobile-admin-bar { display: none; }
@media (max-width: 860px) {
  body.lowdo-mobile-admin { background: #f6f5f7; }
  body.lowdo-mobile-admin .bo-shell { display: block; }
  body.lowdo-mobile-admin .sidebar,
  body.lowdo-mobile-admin .app-header,
  body.lowdo-mobile-admin .footer { display: none; }
  body.lowdo-mobile-admin .mobile-admin-bar { display: grid; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 14px 0; position: sticky; top: 0; z-index: 6; background: linear-gradient(180deg, #f6f5f7 0%, rgba(246,245,247,.94) 82%, rgba(246,245,247,0) 100%); }
  .mobile-admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 22px; padding: 10px 12px; box-shadow: var(--shadow-sm); backdrop-filter: blur(16px); }
  .mobile-admin-top span, .mobile-admin-top strong { display: block; }
  .mobile-admin-top span { font-size: 12px; color: var(--muted); font-weight: 800; }
  .mobile-admin-top strong { font-size: 17px; letter-spacing: -.02em; }
  .mobile-admin-top .btn { width: auto; min-width: 116px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
  .mobile-admin-top .btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
  .mobile-admin-menu { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); overflow: hidden; }
  .mobile-admin-menu summary { list-style: none; padding: 12px 14px; font-weight: 900; color: var(--accent); cursor: pointer; }
  .mobile-admin-menu summary::-webkit-details-marker { display: none; }
  .mobile-admin-menu > div { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px; max-height: 55vh; overflow: auto; }
  .mobile-admin-menu button { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 11px; color: var(--text); font-weight: 850; display: flex; align-items: center; gap: 8px; min-width: 0; text-align: left; box-shadow: none; }
  .mobile-admin-menu button svg { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; stroke-width: 2; fill: none; }
  .mobile-admin-menu button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.lowdo-mobile-admin .content { padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); width: 100%; }
  body.lowdo-mobile-admin .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  body.lowdo-mobile-admin .page-title h2 { font-size: 26px; }
  body.lowdo-mobile-admin .page-actions { width: 100%; justify-content: stretch; }
  body.lowdo-mobile-admin .page-actions .btn { width: 100%; }
  body.lowdo-mobile-admin .toolbar { gap: 8px; }
  body.lowdo-mobile-admin .search-wrap { width: 100%; min-width: 0; }
  body.lowdo-mobile-admin .table-card, body.lowdo-mobile-admin .card { border-radius: 22px; }
  body.lowdo-mobile-admin .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body.lowdo-mobile-admin table { min-width: 680px; }
}
@media (max-width: 420px) {
  .mobile-admin-menu > div { grid-template-columns: 1fr; }
  .mobile-admin-top { align-items: flex-start; flex-direction: column; }
  .mobile-admin-top .btn { width: 100%; }
}

/* v0.12.4 — update inteligente e navegação mobile com drawer */
.update-notice {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 140;
  width: min(560px, calc(100vw - 24px));
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(21, 18, 24, .18);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(18px);
}
.update-notice strong, .update-notice span { display: block; }
.update-notice strong { font-weight: 950; }
.update-notice span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.nav-drawer-panel {
  width: min(360px, 92vw);
  background: #f6f5f7;
  padding: 18px;
}
.nav-drawer-head { align-items: flex-start; }
.nav-drawer-head .brand-logo-badge { width: 184px; max-width: 100%; }
.nav-drawer-search { margin: 10px 0 12px; }
.nav-drawer-search .search-wrap { min-width: 0; width: 100%; }
.nav-drawer-list { display: grid; gap: 10px; }
.nav-drawer-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.nav-drawer-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.nav-drawer-group summary::-webkit-details-marker { display: none; }
.nav-drawer-group summary svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform .18s ease;
}
.nav-drawer-group[open] summary svg { transform: rotate(180deg); }
.nav-drawer-group > div { display: grid; gap: 5px; padding: 0 8px 8px; }
.nav-drawer-item {
  border: 0;
  background: transparent;
  border-radius: 15px;
  padding: 11px 12px;
  color: var(--text);
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}
.nav-drawer-item:hover, .nav-drawer-item.active { background: #f0eef3; }
.nav-drawer-item.active { color: var(--accent); }
.nav-drawer-item svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-drawer-user {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.82);
}
.nav-drawer-user strong, .nav-drawer-user span { display: block; }
.nav-drawer-user span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.operation-more-trigger { cursor: pointer; }
.operation-menu-btn { flex: 0 0 auto; }
.mobile-shellbar { min-height: 58px; }
.mobile-menu-trigger svg, .operation-menu-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }
@media (max-width: 860px) {
  body.lowdo-operation-tab .operation-appbar { grid-template-columns: auto 1fr auto; }
  body.lowdo-operation-tab .operation-appbar-brand { min-width: 0; }
  body.lowdo-operation-tab .operation-appbar-brand strong,
  body.lowdo-operation-tab .operation-appbar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.lowdo-mobile-admin .mobile-admin-bar { padding: max(10px, env(safe-area-inset-top)) 14px 0; }
  body.lowdo-mobile-admin .mobile-admin-top { flex-direction: row; align-items: center; }
  body.lowdo-mobile-admin .mobile-admin-top .btn { width: auto; min-width: 110px; }
  body.lowdo-mobile-admin .mobile-admin-top > div { min-width: 0; flex: 1; }
  body.lowdo-mobile-admin .mobile-admin-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 420px) {
  .update-notice { align-items: stretch; flex-direction: column; }
  .update-notice .btn { width: 100%; }
  .nav-drawer-panel { width: 94vw; padding: 14px; }
  .nav-drawer-head .brand-logo-badge { width: 160px; }
  body.lowdo-mobile-admin .mobile-admin-top { flex-wrap: nowrap; }
  body.lowdo-mobile-admin .mobile-admin-top .btn { padding-left: 10px; padding-right: 10px; min-width: 96px; }
}


/* v0.12.6 — refinamento mobile/tablet, drawer e perfil */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
.main, .content, .card, .table-wrap, .drawer-panel { min-width: 0; max-width: 100%; }
.status-value { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.status-dot { flex: 0 0 auto; }
.avatar-img { object-fit: cover; padding: 0; background: #fff; border: 1px solid var(--line); }
.avatar-mini { width: 34px; height: 34px; font-size: 12px; }
.avatar-xl { width: 82px; height: 82px; font-size: 24px; }
.mobile-profile-trigger { padding: 2px; border-radius: 999px; background: transparent; border: 0; box-shadow: none; }
.profile-card-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-card-main h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.profile-upload-row { margin-top: 18px; display: grid; gap: 8px; }
.profile-upload-row input { width: 100%; }
.drawer.navigation-open { justify-content: flex-start; }
.drawer.navigation-open .drawer-panel { box-shadow: 18px 0 42px rgba(0,0,0,.16); width: min(370px, 100vw); max-width: 100vw; }
.nav-drawer-panel { overflow-x: hidden; }
.nav-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.nav-drawer-head > div { min-width: 0; }
.nav-drawer-head .icon-btn { flex: 0 0 auto; }
.nav-drawer-company { margin: 12px 0 0; font-size: 16px; line-height: 1.15; font-weight: 950; color: var(--text); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.nav-drawer-user .avatar { width: 44px; height: 44px; }
.usage-row { gap: 10px; }
.usage-row .tag { align-self: flex-start; white-space: normal; text-align: left; line-height: 1.25; }

@media (max-width: 860px), (pointer: coarse) {
  body.lowdo-mobile-admin { background: #f6f5f7; }
  body.lowdo-mobile-admin .bo-shell { display: block; max-width: 100vw; overflow-x: hidden; }
  body.lowdo-mobile-admin .sidebar,
  body.lowdo-mobile-admin .app-header,
  body.lowdo-mobile-admin .footer { display: none; }
  body.lowdo-mobile-admin .mobile-admin-bar { display: grid; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 0; position: sticky; top: 0; z-index: 6; background: linear-gradient(180deg, #f6f5f7 0%, rgba(246,245,247,.96) 82%, rgba(246,245,247,0) 100%); }
  body.lowdo-mobile-admin .content { padding: 12px 12px calc(18px + env(safe-area-inset-bottom)); width: 100%; max-width: 100vw; overflow-x: hidden; }
  body.lowdo-mobile-admin .mobile-admin-top { flex-direction: row; align-items: center; flex-wrap: nowrap; }
  body.lowdo-mobile-admin .mobile-admin-top > div { min-width: 0; flex: 1; }
  body.lowdo-mobile-admin .mobile-admin-top strong,
  body.lowdo-mobile-admin .mobile-admin-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.lowdo-mobile-admin .mobile-admin-top .btn { width: auto; min-width: 106px; padding-left: 10px; padding-right: 10px; }
  body.lowdo-mobile-admin .page-head { min-width: 0; }
  body.lowdo-mobile-admin .grid { max-width: 100%; }
  body.lowdo-mobile-admin .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.lowdo-mobile-admin .metric-card { min-height: 92px; padding: 14px; gap: 10px; }
  body.lowdo-mobile-admin .metric-icon { width: 42px; height: 42px; }
  body.lowdo-mobile-admin .metric-icon svg { width: 21px; height: 21px; }
  body.lowdo-mobile-admin .metric { font-size: 24px; margin-top: 3px; }
  body.lowdo-mobile-admin .metric-label { font-size: 13px; }
  body.lowdo-mobile-admin .operation-primary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.lowdo-mobile-admin .operation-action { min-height: 102px; padding: 13px; border-radius: 20px; }
  body.lowdo-mobile-admin .operation-main-grid { grid-template-columns: 1fr; }
  body.lowdo-mobile-admin .operation-hero { border-radius: 22px; padding: 16px; flex-direction: column; align-items: stretch; }
  body.lowdo-mobile-admin .operation-hero .page-title h2 { font-size: 26px; }
  body.lowdo-mobile-admin .operation-install-box { justify-items: stretch; max-width: none; }
  body.lowdo-mobile-admin .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 460px) {
  body.lowdo-mobile-admin .metrics-grid { grid-template-columns: 1fr; }
  body.lowdo-mobile-admin .operation-primary-actions { grid-template-columns: 1fr; }
  body.lowdo-mobile-admin .mobile-admin-top .btn { min-width: 92px; }
  .nav-drawer-panel { width: 100vw; padding: 14px; }
  .nav-drawer-head .brand-logo-badge { width: 156px; }
  .nav-drawer-company { font-size: 17px; }
}


/* v0.12.7 — polimento mobile/tablet, drawer animado e limpeza visual */
body.lowdo-standalone [data-install-pwa],
body.lowdo-standalone [data-ios-install-tip] { display: none !important; }

.drawer {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.drawer .drawer-panel {
  transform: translateX(102%);
  transition: transform .26s cubic-bezier(.22,.8,.24,1);
  will-change: transform;
}
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer.navigation-open .drawer-panel { transform: translateX(-102%); }
.drawer.navigation-open.open .drawer-panel { transform: translateX(0); }
.drawer.navigation-open .drawer-panel {
  width: min(388px, calc(100vw - 14px));
  max-width: calc(100vw - 14px);
}
.nav-drawer-panel { overscroll-behavior: contain; }
.nav-drawer-head .icon-btn { margin-left: auto; }

.table-link { width: 100%; justify-content: flex-end; text-align: right; }
.btn.refresh-subtle { box-shadow: none; opacity: .78; }
.btn.refresh-subtle:hover { opacity: 1; background: var(--accent-soft); }

.role-row { align-items: flex-start; flex-wrap: wrap; }
.role-main { flex: 0 0 110px; }
.role-note { flex: 1 1 220px; margin-left: 0; white-space: normal; line-height: 1.35; }

.profile-card .tag { margin-top: 0; }
.status-value { gap: 10px; }
.usage-row { gap: 12px; align-items: flex-start; }
.usage-row .tag { padding: 6px 10px; line-height: 1.22; }

@media (max-width: 860px), (pointer: coarse) {
  body.lowdo-mobile-admin .mobile-admin-bar,
  body.lowdo-mobile-admin .content {
    width: min(1120px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    margin-left: auto;
    margin-right: auto;
  }
  body.lowdo-mobile-admin .content { padding-left: 0; padding-right: 0; }
  body.lowdo-mobile-admin .mobile-admin-top { width: 100%; }
  body.lowdo-mobile-admin .page-head,
  body.lowdo-mobile-admin .toolbar,
  body.lowdo-mobile-admin .card,
  body.lowdo-mobile-admin .grid,
  body.lowdo-mobile-admin .operation-shell,
  body.lowdo-mobile-admin .operation-primary-actions,
  body.lowdo-mobile-admin .operation-main-grid {
    min-width: 0;
    max-width: 100%;
  }
  body.lowdo-mobile-admin .page-actions .btn.refresh-subtle { width: auto; }
  body.lowdo-mobile-admin .metric-card { overflow: hidden; }
  body.lowdo-mobile-admin .metric { font-size: 22px; }
  body.lowdo-mobile-admin .metric-label { font-size: 12px; }
  body.lowdo-mobile-admin .operation-install-box { display: none; }
  body.lowdo-mobile-admin .drawer-panel { max-width: calc(100vw - 14px); }
  body.lowdo-mobile-admin .form-grid { grid-template-columns: 1fr; }
  body.lowdo-mobile-admin .drawer-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
  body.lowdo-mobile-admin .drawer-actions .btn { width: auto; max-width: 100%; }
}

@media (min-width: 861px) and (pointer: coarse) {
  body.lowdo-mobile-admin .mobile-admin-bar,
  body.lowdo-mobile-admin .content {
    width: min(1180px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }
  body.lowdo-mobile-admin .mobile-admin-bar { padding-top: max(12px, env(safe-area-inset-top)); }
  body.lowdo-mobile-admin .content { padding-top: 18px; }
  body.lowdo-mobile-admin .mobile-admin-top { padding: 12px 16px; border-radius: 24px; }
  body.lowdo-mobile-admin .mobile-admin-top strong { font-size: 18px; }
  body.lowdo-mobile-admin .metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.lowdo-mobile-admin .two-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.lowdo-mobile-admin .operation-primary-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.lowdo-mobile-admin .operation-main-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}

@media (max-width: 420px) {
  body.lowdo-mobile-admin .mobile-admin-bar,
  body.lowdo-mobile-admin .content {
    width: min(100%, calc(100vw - 12px));
    max-width: calc(100vw - 12px);
  }
  .drawer.navigation-open .drawer-panel { width: calc(100vw - 10px); max-width: calc(100vw - 10px); }
  .role-main { flex-basis: 100%; }
  .role-note { flex-basis: 100%; }
}
