/* ============ FULILAIPOS — tema azul (design ref) ============ */
/* 2026-10-20 按 Figma 设计稿还原：表格/圆角/字体/颜色/宽度 */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel2: #f3f4f6;
  --soft: #f9fafb;
  --text: #1f2937;
  --muted: #6b7280;
  --faint: #9ca3af;
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --accent-soft: #eff4ff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: var(--ok); font-weight: 600; }
.err { color: var(--danger); font-weight: 600; }

/* ---------------- app shell ---------------- */
.app { display: flex; min-height: 100vh; }

/* ---------------- sidebar ---------------- */
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.logo {
  display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 84px; flex-shrink: 0;
  color: #1E293B; font-weight: 900; font-size: 26px; letter-spacing: -.01em;
  border-bottom: 1px solid #E2E8F0;
}
.logo-mark {
  width: 27px; height: 27px; border-radius: 6px; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 23px; font-weight: 700; flex-shrink: 0;
}
.ws-label { font-size: 11px; letter-spacing: .04em; color: #64748B; padding: 14px 18px 6px; }
.ws-box {
  margin: 0 16px 8px; padding: 10px 8px; background: transparent;
  border-top: 1px solid #E2E8F0; border-bottom: 1px solid #E2E8F0; border-radius: 0;
  display: flex; justify-content: space-between; align-items: center; color: #1E293B; font-size: 13px; font-weight: 400;
}
.ws-box .chev { color: #9ca3af; }

/* nav tree (1º nível = grupo, 2º nível = folha) */
.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.navsec { font-size: 11px; letter-spacing: .04em; color: #64748B; padding: 8px 10px 6px; }
.navgroup { margin-bottom: 2px; }
.navgroup-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: none; color: #1E293B;
  padding: 0 10px; height: 40px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.navgroup-btn svg { width: 17px; height: 17px; flex-shrink: 0; color: #6b7280; }
.navgroup-btn:hover { background: var(--panel2); color: #1E293B; }
.navgroup-btn .chev { margin-left: auto; font-style: normal; font-size: 11px; color: #9ca3af; transition: transform .15s; }
.navgroup.open .navgroup-btn .chev { transform: rotate(180deg); }
.navsub { display: none; padding: 2px 0 6px 26px; position: relative; }
.navsub::before {
  content: ""; position: absolute; left: 21px; top: 4px; bottom: 10px; width: 1px;
  background: #E2E8F0;
}
.navgroup.open .navsub { display: block; }
.navsub button {
  display: flex; align-items: center; width: 100%; text-align: left; position: relative;
  background: transparent; border: none; color: #64748B;
  padding: 0 10px; height: 40px; border-radius: 4px; font-size: 12px; cursor: pointer;
}
.navsub button:hover { background: var(--panel2); color: #1E293B; }
.navsub button.active { background: #EFF6FF; color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
/* 三级结构：分组内的子分组（电子发票） */
.navsub.branch::before { display: none; }
.navsub .navgroup-btn { font-size: 12px; }
.navsub .navgroup.active-parent > .navgroup-btn { background: #EFF6FF; color: var(--accent); }
.navsub .navgroup.active-parent > .navgroup-btn .chev { color: var(--accent); }

/* sidebar footer / avatar */
.side-foot { padding: 10px 10px 12px; border-top: 1px solid var(--border); }
.side-switch {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--accent); font-size: 11px; font-weight: 900; cursor: pointer;
  padding: 2px 8px; margin-bottom: 8px; line-height: 1.4;
}
.side-switch:hover { text-decoration: underline; }
.avatar-wrap { position: relative; }
.avatar-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; color: #374151; padding: 7px 8px; border-radius: 10px; cursor: pointer;
}
.avatar-row:hover { background: var(--panel2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.avatar-meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; overflow: hidden; }
.avatar-meta b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-meta small { font-size: 10.5px; color: var(--muted); }
.avatar-row .chev { margin-left: auto; color: #9ca3af; font-size: 11px; }
.avatar-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; z-index: 50;
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.14); padding: 10px;
}
.am-head { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.am-head b { font-size: 13.5px; }
.am-head small { color: var(--muted); font-size: 11.5px; }
.am-label { font-size: 10.5px; letter-spacing: .1em; color: var(--muted); padding: 6px 8px 4px; }
.am-langs { display: flex; gap: 6px; padding: 0 8px 8px; }
.am-langs button {
  flex: 1; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 0; font-size: 12.5px; cursor: pointer; color: var(--text);
}
.am-langs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.am-sep { height: 1px; background: var(--border); margin: 2px 0; }
.am-logout { width: 100%; text-align: left; background: transparent; border: none; color: var(--danger); padding: 8px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.am-logout:hover { background: #fef2f2; }

/* ---------------- topbar ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  height: 84px; padding: 0 32px; background: var(--panel); border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
}
.crumb { font-size: 12px; color: #64748B; margin-bottom: 4px; }
.ptitle { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.01em; color: #1E293B; }
.topright { display: flex; align-items: center; gap: 12px; }
.langpill { background: #fff; border: 1px solid #E2E8F0; border-radius: 4px; padding: 3px; display: flex; gap: 2px; }
.langpill button { border: none; background: transparent; padding: 0 12px; height: 27px; border-radius: 2px; font-size: 11px; color: #686C73; cursor: pointer; white-space: nowrap; }
.langpill button.on { background: var(--accent); color: #fff; font-weight: 400; }
.badge { padding: 4px 12px; border-radius: 999px; font-size: 11.5px; background: #fef3c7; color: var(--warn); font-weight: 600; }
.badge.real { background: #fee2e2; color: var(--danger); }
.content { padding: 24px 32px 60px; max-width: 1240px; width: 100%; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

/* ---------------- page head / stats ---------------- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.eyebrow { font-size: 11px; color: var(--accent); font-weight: 400; letter-spacing: .04em; margin-bottom: 6px; }
.bigtitle { margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -.01em; color: #1E293B; }
.sub { margin: 0; color: #64748B; font-size: 13px; }
.addbtn {
  background: var(--accent); color: #fff; border: none; border-radius: 4px;
  padding: 0 16px; height: 36px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.addbtn:hover { background: var(--accent2); }
.backrow { margin-bottom: 14px; }
.backlink { background: transparent; border: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px 0; }
.backlink:hover { color: var(--accent); }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 18px; overflow: hidden;
}
.stat { padding: 20px 24px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
.stat-label { font-size: 12px; color: #757980; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -.01em; color: #1E293B; }
.stat-sub { font-size: 11px; color: #64748B; margin-top: 6px; }
.stat-sub.warn { color: var(--warn); }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr; } .stat { border-right: none; border-bottom: 1px solid var(--border); } }

/* ---------------- cards ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; margin-bottom: 16px;
}
h2 { font-size: 14px; margin: 0 0 12px; color: #111827; letter-spacing: 0; font-weight: 600; }
.card h2 { color: #111827; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------------- forms ---------------- */
.row { margin-bottom: 12px; }
.row.cols { display: flex; gap: 12px; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
label.grow { flex: 1; min-width: 160px; }
input, select, textarea {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font-size: 13.5px; min-width: 90px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { width: 100%; resize: vertical; }
.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.check input[type="checkbox"] {
  width: 15px; height: 15px; min-width: 15px; flex: 0 0 15px; padding: 0; margin: 0;
  border-radius: 2px; accent-color: #2563EB; box-shadow: none;
}
.check span { white-space: nowrap; }

/* ---------------- buttons ---------------- */
button {
  border: none; border-radius: 10px; padding: 9px 16px; font-size: 13.5px; cursor: pointer;
  background: var(--panel2); color: var(--text); font-family: inherit;
}
button.primary { background: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent2); }
button.big { font-size: 15.5px; padding: 12px 26px; }
button.ghost { background: #fff; border: 1px solid var(--border); }
button.ghost:hover { border-color: var(--accent); color: var(--accent); }
button.danger { background: #fef2f2; color: var(--danger); }
button.danger:hover { background: var(--danger); color: #fff; }
button.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }

/* ---------------- tables ---------------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.card > table.tbl { margin: 0 -20px; width: calc(100% + 40px); }
table.tbl th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px;
  padding: 12px 20px; background: var(--soft); border-bottom: 1px solid var(--border);
}
table.tbl td { padding: 16px 20px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--soft); }

/* ---------------- notas (design ref Figma) ---------------- */
.card-table { padding: 0; overflow: hidden; border-radius: 6px; }
.card-table table.tbl { margin: 0; width: 100%; }
.card-table table.tbl th {
  text-align: left; color: #64748B; font-weight: 600; font-size: 11px;
  padding: 15px 12px; background: #F5F7FA; border-bottom: 1px solid var(--border);
}
.card-table table.tbl th:first-child { padding-left: 20px; }
.card-table table.tbl th:last-child { padding-right: 20px; }
.card-table table.tbl td {
  padding: 16px 12px; border-bottom: 1px solid #E2E8F0; vertical-align: middle;
  font-size: 12px; color: #1E293B;
}
.card-table table.tbl td:first-child { padding-left: 20px; }
.card-table table.tbl td:last-child { padding-right: 20px; }
.card-table table.tbl tr:last-child td { border-bottom: none; }
.docid { display: block; font-weight: 600; color: #1E293B; }
.docsub { display: block; font-size: 10px; color: #64748B; margin-top: 4px; }
.client { display: block; color: #1E293B; }
.clientsub { display: block; font-size: 10px; color: #64748B; margin-top: 4px; }
.status-tag { display: inline-block; padding: 5px 9px; border-radius: 3px; font-size: 11px; font-weight: 400; white-space: nowrap; line-height: 1; }
.status-tag.ok { background: #ECFDF5; color: #047857; }
.status-tag.rej { background: #FEE2E2; color: #DC2626; }
.status-tag.sim { background: #F5EAD1; color: #936310; }
.btn-view {
  background: #fff; border: 1px solid var(--border); border-radius: 3px;
  color: var(--accent); font-size: 10px; font-weight: 700; padding: 7px 11px; cursor: pointer;
}
.btn-view:hover { background: var(--accent-soft); }
.btn-xml {
  background: transparent; border: none; color: var(--muted); font-size: 10px; font-weight: 600;
  padding: 7px 3px; cursor: pointer;
}
.btn-xml:hover { color: var(--accent); }
.btn-print {
  background: #fff; border: 1px solid var(--border); border-radius: 3px;
  color: #1E293B; font-size: 10px; font-weight: 700; padding: 7px 11px; cursor: pointer;
}
.btn-print:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- docs de ajuda ---------------- */
.doclink { color: var(--accent); text-decoration: none; font-weight: 600; }
.doclink:hover { text-decoration: underline; }
#docDetailTitle { font-size: 15px; letter-spacing: 0; color: var(--text); }
.docbody { font-size: 13.5px; line-height: 1.6; }
th.tright, td.tright { text-align: right; }
.tnum { font-weight: 600; color: #111827; }
.tsub { display: block; font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.chave-cell { font-family: Consolas, monospace; font-size: 11.5px; color: var(--muted); }

/* status pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.auth { background: #dcfce7; color: var(--ok); }
.pill.rej { background: #fee2e2; color: var(--danger); }
.pill.sim { background: #fef3c7; color: var(--warn); }

/* ---------------- list tools / filters / pager ---------------- */
.listtools { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.filters { display: flex; gap: 5px; background: transparent; border: none; padding: 0; }
.filters button { background: transparent; border: none; color: #717780; padding: 6px 14px; border-radius: 3px; font-size: 12px; font-weight: 700; }
.filters button:hover { color: var(--accent); }
.filters button.active { background: #EFF6FF; color: var(--accent); font-weight: 700; }
.search {
  width: 280px; min-width: 0; padding: 8px 12px 8px 34px; height: 36px;
  background-color: #fff; border: 1px solid var(--border); border-radius: 4px; font-size: 12px;
  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='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center;
}
.search:focus { background-color: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.listfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 10px; color: #737880; }
.card-table .listfoot { padding: 0 20px 16px; margin-top: 0; }
.pager { display: flex; gap: 5px; align-items: center; }
.pager button {
  height: 24px; padding: 0 10px; font-size: 10px; font-weight: 700;
  background: #fff; border: 1px solid #D4D8DD; color: #575D66; border-radius: 3px;
}
.pager button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.pager button:disabled { opacity: .45; cursor: default; }
.pager .pnum {
  min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; background: var(--accent); color: #fff;
  border: 1px solid var(--accent); border-radius: 3px; padding: 0;
}
.empty-row td { text-align: center; color: var(--muted); padding: 28px 0; }

/* ---------------- misc content ---------------- */
.totalRow { text-align: right; font-size: 17px; margin-top: 10px; }
.totalRow b { color: var(--accent); }
ol.pre li { margin-bottom: 8px; font-size: 13.5px; line-height: 1.6; }
#statusMsg { margin-left: 10px; font-size: 13px; }
.qrbox { display: flex; gap: 20px; align-items: center; }
.qrbox img { width: 160px; height: 160px; background: #fff; border-radius: 8px; padding: 6px; border: 1px solid var(--border); }
.kv { font-size: 13px; line-height: 1.8; }
.kv b { color: var(--accent); }
code.chave { font-family: Consolas, monospace; font-size: 12px; word-break: break-all; }
code { background: var(--panel2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: 12px; }

/* ---------------- login (tela dividida) ---------------- */
.login-overlay { position: fixed; inset: 0; z-index: 100; display: flex; background: #fff; }
.login-left {
  flex: 1; min-width: 0; position: relative; overflow: hidden;
  background: #EFF6FF;
  display: flex; flex-direction: column; padding: 38px 90px;
  border-right: 1px solid #E2E8F0;
}
.login-left::after {
  content: "NF-e"; position: absolute; right: -30px; bottom: -80px; line-height: 1;
  font-size: 480px; font-weight: 700; color: rgba(37,99,235,.03); pointer-events: none;
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  white-space: nowrap;
}
.login-logo { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 900; color: #1E293B; letter-spacing: -.01em; }
.login-hero { margin: auto 0; max-width: 560px; position: relative; }
.login-tag { color: var(--accent); font-size: 11px; letter-spacing: .04em; font-weight: 400; }
.login-h1 { font-size: 48px; font-weight: 600; color: #1E293B; margin: 14px 0 12px; letter-spacing: -.02em; }
.login-sub2 { color: #64748B; font-size: 14px; margin: 0; }
.login-copy { color: #64748B; font-size: 11px; position: relative; }

.login-right {
  width: 46%; min-width: 400px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; position: relative; padding: 30px;
}
.login-topbar { position: absolute; top: 28px; right: 28px; }
.login-topbar .am-langs { padding: 3px; }
.login-form { width: 360px; max-width: 100%; display: flex; flex-direction: column; gap: 14px; position: relative; }
.login-welcome { color: #64748B; font-size: 11px; font-weight: 400; letter-spacing: .04em; }
.login-title { font-size: 26px; font-weight: 600; color: #1E293B; margin: 0; letter-spacing: -.01em; }
.login-form .login-sub { color: #747980; font-size: 13px; margin: 0 0 6px; }
.login-form label { display: flex; flex-direction: column; gap: 7px; font-size: 11px; color: #64748B; }
.login-form input { padding: 0 13px; height: 43px; border: 1px solid #E2E8F0; border-radius: 4px; font-size: 13px; width: 100%; background: #fff; color: #1E293B; }
.login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.login-btn { width: 100%; background: var(--accent); color: #fff; border-radius: 4px; height: 43px; padding: 0; font-size: 14px; font-weight: 600; margin-top: 2px; }
.login-btn:hover { background: var(--accent2); }
.login-forgot { text-align: center; color: var(--accent); font-size: 11px; font-weight: 700; cursor: pointer; }
.login-forgot:hover { color: var(--accent2); }
.login-hint { text-align: center; line-height: 1.5; }
@media (max-width: 760px) {
  .login-left { display: none; }
  .login-right { width: 100%; min-width: 0; }
}

/* ---------------- sistema ---------------- */
.menuchecks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 10px; }
.menuchecks .check { font-size: 13px; }
.roleitem {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 10px; background: var(--panel2);
}

/* ---------------- config (design ref Figma) ---------------- */
#view-config { max-width: none; }
.cfgcard { padding: 24px 26px; margin-bottom: 20px; border-radius: 6px; border-color: #E2E8F0; }
.cfg-num { font-size: 11px; letter-spacing: .04em; color: #64748B; font-weight: 400; margin-bottom: 6px; }
.cfg-title { font-size: 18px; font-weight: 600; color: #1E293B; margin: 0 0 6px; letter-spacing: .01em; }
.cfg-sub { font-size: 12px; color: #64748B; margin: 0 0 22px; }
.cfg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.cfg-fields label { font-size: 12px; color: #64748B; gap: 8px; }
.cfg-fields input, .cfg-fields select {
  width: 100%; background: #fff; border: 1px solid #E2E8F0; border-radius: 4px;
  height: 40px; padding: 0 14px; font-size: 12px; color: #1E293B;
}
.cfg-fields input:focus, .cfg-fields select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.cfg-fields input:disabled { background: #F5F7FA; color: #64748B; cursor: not-allowed; }
.cfg-note {
  grid-column: 1 / -1;
  background: #F5F7FA; border-radius: 4px; padding: 14px 16px;
  font-size: 12px; color: #64748B; line-height: 1.6;
}
.cfg-save {
  float: right; width: auto; height: 36px; padding: 0 20px;
  font-size: 12px; font-weight: 600; border-radius: 4px;
}
.cfg-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 12px; }
.cfg-actions-btns { display: flex; gap: 8px; }
.cfg-actions .small.muted { font-size: 12px; color: #64748B; }

/* ---------------- emissão (design ref Figma) ---------------- */
.cfg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cfg-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; background: #EFF6FF; color: #2563EB; border-radius: 10px; font-size: 11px; font-weight: 700; }
.inline-select { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #64748B; }
.inline-select select { width: auto; min-width: 180px; height: 36px; padding: 0 12px; font-size: 12px; border: 1px solid #E2E8F0; border-radius: 4px; background: #fff; color: #1E293B; }
.prod-picker { padding: 6px 0 18px; border-bottom: 1px dashed #E2E8F0; margin-bottom: 16px; }
.prod-picker label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #64748B; margin-bottom: 12px; }
.prod-picker input, .prod-picker select { width: 100%; height: 38px; padding: 0 12px; font-size: 12px; border: 1px solid #E2E8F0; border-radius: 4px; background: #fff; color: #1E293B; }
.prod-picker input:focus, .prod-picker select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.cliente-card { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-bottom: 1px dashed #E2E8F0; }
.cliente-avatar { width: 40px; height: 40px; border-radius: 20px; background: #EFF6FF; color: #2563EB; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.cliente-main { min-width: 0; }
.cliente-nome { font-size: 14px; font-weight: 700; color: #1E293B; }
.cliente-doc { font-size: 12px; color: #64748B; margin-top: 4px; }
.cliente-extra { margin-left: auto; font-size: 11px; color: #64748B; line-height: 1.7; text-align: right; }
.emit-bar { display: flex; gap: 10px; margin-top: 8px; }
#view-config button.primary, #view-config button.ghost {
  border-radius: 4px; height: 36px; padding: 0 16px; font-size: 12px; font-weight: 600;
}
.cert-box {
  background: #F5F7FA; border: 1px solid #E2E8F0; border-radius: 6px;
  padding: 24px 20px; text-align: center; margin-bottom: 20px;
}
.cert-actions { justify-content: center; align-items: flex-end; margin: 14px 0 0; }

/* ---------------- emissao (design ref Figma) ---------------- */
#view-emissao .card { border-radius: 6px; border-color: #E2E8F0; padding: 24px 26px; }
#view-emissao .card h2 { font-size: 18px; font-weight: 600; letter-spacing: .01em; color: #1E293B; margin: 0 0 16px; }
#view-emissao .row { margin-bottom: 14px; }
#view-emissao label { font-size: 11px; color: #64748B; gap: 7px; }
#view-emissao input, #view-emissao select {
  background: #fff; color: #272C33; border: 1px solid #E2E8F0; border-radius: 4px;
  padding: 9px 12px; height: 39px; font-size: 13px; min-width: 90px; font-family: inherit;
}
#view-emissao input:focus, #view-emissao select:focus {
  outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
#view-emissao button.primary { border-radius: 4px; height: 36px; padding: 0 18px; font-size: 12px; font-weight: 600; }
#view-emissao button.big { height: 40px; padding: 0 26px; font-size: 13px; }
#view-emissao button.ghost { border-radius: 4px; height: 36px; padding: 0 18px; font-size: 12px; border-color: #E2E8F0; }
#view-emissao .card > table.tbl { margin: 0 0 12px; width: 100%; }
#view-emissao table.tbl { font-size: 12px; }
#view-emissao table.tbl th {
  color: #64748B; font-weight: 600; font-size: 11px; padding: 15px 12px;
  background: #F5F7FA; border-bottom: 1px solid #E2E8F0;
}
#view-emissao table.tbl td { padding: 14px 12px; border-bottom: 1px solid #E2E8F0; color: #1E293B; }
#view-emissao table.tbl th:first-child, #view-emissao table.tbl td:first-child { padding-left: 16px; }
#view-emissao .totalRow { font-size: 15px; }
#view-emissao .totalRow b { font-size: 22px; color: var(--accent); font-weight: 800; }

/* ---------------- produtos (design ref Figma) ---------------- */
#view-produtos .card { border-radius: 6px; border-color: #E2E8F0; }
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, .40); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-card { width: 560px; max-width: 100%; background: #fff; border-radius: 8px; box-shadow: 0 16px 48px rgba(15, 23, 42, .15); overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 0; }
.modal-title { font-size: 18px; font-weight: 600; color: #1E293B; margin: 4px 0 0; letter-spacing: .01em; }
.modal-close { background: transparent; border: none; font-size: 24px; line-height: 1; color: #616770; cursor: pointer; padding: 0 2px; }
.modal-close:hover { color: #1E293B; }
.modal-body { padding: 20px 24px 0; display: flex; flex-direction: column; gap: 16px; }
.mfield { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.mfield > span { font-size: 11px; color: #64748B; }
.mrow { display: flex; gap: 15px; }
.modal-body input, .modal-body select {
  width: 100%; background: #fff; border: 1px solid #E2E8F0; border-radius: 4px;
  height: 39px; padding: 0 12px; font-size: 13px; color: #1E293B; font-family: inherit;
}
.modal-body input:focus, .modal-body select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.modal-note { display: flex; align-items: center; gap: 12px; background: #EFF6FF; border-radius: 4px; padding: 11px 14px; font-size: 10px; color: #64748B; line-height: 1.5; }
.modal-note b { font-size: 9px; color: #64748B; font-weight: 700; white-space: nowrap; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 22px 24px 24px; }
.modal-foot button { border-radius: 4px; height: 36px; padding: 0 18px; font-size: 12px; font-weight: 700; }
.modal-foot button.primary { font-weight: 600; }
.modal-foot button.ghost { border-color: #E2E8F0; color: #64748B; }
.pname { display: block; font-weight: 600; color: #1E293B; }
.psub { display: block; font-size: 10px; color: #64748B; margin-top: 4px; }
.csosn-pill { display: inline-block; padding: 5px 9px; border-radius: 3px; font-size: 10px; background: #EFF6FF; color: #2563EB; white-space: nowrap; }
.btn-del { background: transparent; border: none; color: #DC2626; font-size: 10px; font-weight: 600; padding: 7px 4px; cursor: pointer; }
.btn-del:hover { opacity: .75; }
.listcount { font-size: 10px; color: #737880; white-space: nowrap; }
.nf-hint {
  display: flex; align-items: center; gap: 12px;
  background: #EFF6FF; border-radius: 4px; margin: 16px 20px;
  padding: 13px 16px; font-size: 11px; color: #64748B; line-height: 1.5;
}
.nf-hint b { font-size: 10px; color: #2563EB; font-weight: 700; white-space: nowrap; }
.cname { display: block; color: #1E293B; }
.csub { display: block; font-size: 10px; color: #64748B; margin-top: 4px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; }
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-dot.on { color: #047857; }
.status-dot.on::before { background: #10B981; }
.status-dot.off { color: #686C73; }
.status-dot.off::before { background: #CBD5E1; }
.op-current { margin-top: 14px; font-size: 12px; color: #64748B; }
.op-current .status-dot { font-size: 12px; }
.op-warn { background: #F5F7FA; border-radius: 4px; padding: 12px 16px; font-size: 12px; color: #64748B; line-height: 1.6; }

/* ---------------- help center (overlay, Figma 39_4402) ---------------- */
.help-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  background: #fff; border: 1px solid #E2E8F0; border-radius: 4px;
  color: #64748B; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.help-btn svg { width: 16px; height: 16px; }
.help-btn:hover { border-color: var(--accent); color: var(--accent); }

.help-center {
  position: fixed; inset: 0; z-index: 300; background: #F5F7FA;
  display: flex; flex-direction: column; overflow: hidden;
}
.hc-topbar {
  height: 70px; flex-shrink: 0; background: #fff; border-bottom: 1px solid #E2E8F0;
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
}
.hc-brand { display: flex; align-items: center; gap: 12px; }
.hc-brand .logo-mark { width: 30px; height: 30px; font-size: 22px; }
.hc-brand-name { font-size: 20px; font-weight: 700; color: #1E293B; letter-spacing: -.01em; }
.hc-tag { padding: 4px 10px; background: #EFF6FF; border-radius: 4px; color: #2563EB; font-size: 12px; }
.hc-topright { display: flex; align-items: center; gap: 12px; }
.hc-back {
  height: 36px; padding: 0 16px; background: #fff; border: 1px solid #E2E8F0; border-radius: 4px;
  color: #64748B; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.hc-back:hover { border-color: var(--accent); color: var(--accent); }

.hc-body { flex: 1; display: flex; min-height: 0; width: 100%; max-width: 1360px; margin: 0 auto; }
.hc-side {
  width: 240px; flex-shrink: 0; background: #fff; border-right: 1px solid #E2E8F0;
  display: flex; flex-direction: column; padding: 36px 20px 20px; overflow-y: auto;
}
.hc-side-title { font-size: 11px; letter-spacing: .04em; color: #64748B; padding: 0 10px 8px; }
.hc-cats { flex: 1; }
.hc-cat {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  height: 40px; padding: 0 10px; border: none; background: transparent; border-radius: 4px;
  color: #64748B; font-size: 13px; cursor: pointer; margin-bottom: 2px;
}
.hc-cat .cnt { margin-left: auto; font-size: 11px; opacity: .7; }
.hc-cat:hover { background: #F3F4F6; }
.hc-cat.active { background: #EFF6FF; color: #2563EB; font-weight: 600; box-shadow: inset 3px 0 0 #2563EB; }
.hc-cat.active .cnt { color: #2563EB; opacity: 1; }
.hc-side-note { border-top: 1px solid #E2E8F0; padding: 20px 10px 0; font-size: 11px; color: #64748B; line-height: 1.6; }

.hc-main { flex: 1; min-width: 0; overflow-y: auto; padding: 40px; }
.hc-pagehead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.hc-title { margin: 0; font-size: 28px; font-weight: 600; color: #1E293B; letter-spacing: -.01em; }

/* help doc list */
.hc-doclist { display: flex; flex-direction: column; gap: 12px; }
.hc-docitem {
  background: #fff; border: 1px solid #E2E8F0; border-radius: 6px; padding: 20px 24px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.hc-docitem:hover { box-shadow: 0 6px 18px rgba(15,23,42,.06); border-color: #cbd5e1; }
.hc-docitem-title { font-size: 15px; font-weight: 600; color: #1E293B; }
.hc-docitem-sub { font-size: 12px; color: #64748B; margin-top: 6px; }
.hc-docitem-meta { display: flex; gap: 14px; font-size: 11px; color: #9CA3AF; margin-top: 10px; }
.cat-chip { display: inline-block; padding: 3px 8px; border-radius: 3px; background: #EFF6FF; color: #2563EB; font-size: 10px; margin-bottom: 8px; }

/* help article (detail / form) */
.hc-backlink { background: transparent; border: none; color: #2563EB; font-size: 11px; font-weight: 900; cursor: pointer; padding: 0; margin-bottom: 14px; }
.hc-article { background: #fff; border: 1px solid #E2E8F0; border-radius: 6px; padding: 34px; max-width: 980px; }
.hc-article-cat { font-size: 11px; letter-spacing: .04em; color: #64748B; margin-bottom: 12px; }
.hc-article-title { margin: 0 0 10px; font-size: 28px; font-weight: 600; color: #1E293B; }
.hc-article-meta { font-size: 12px; color: #9CA3AF; margin-bottom: 20px; }
.hc-article-body { font-size: 14px; color: #64748B; line-height: 1.7; }
.hc-article-body h2 { font-size: 17px; color: #1E293B; margin: 26px 0 12px; font-weight: 600; }
.hc-article-body h3 { font-size: 15px; color: #1E293B; margin: 20px 0 10px; font-weight: 600; }
.hc-article-body p { margin: 0 0 12px; }
.hc-article-body ol, .hc-article-body ul { margin: 0 0 12px; padding-left: 20px; }
.hc-article-body li { margin-bottom: 8px; }
.hc-article-body table.tbl { margin: 0 0 16px; font-size: 12px; }
.hc-article-body table.tbl th { background: #F5F7FA; color: #64748B; font-weight: 600; font-size: 11px; }
.hc-article-body table.tbl td { color: #1E293B; font-size: 12px; }
.hc-article-body code { background: #F1F5F9; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.hc-article-body .muted { color: #9CA3AF; }
.hc-article-actions { display: flex; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #E2E8F0; }

/* ---------------- module selector (Figma 54_4524) ---------------- */
.module-selector {
  position: fixed; inset: 0; z-index: 100; background: #F5F7FA;
  display: flex; flex-direction: column; overflow-y: auto;
}
.ms-topbar {
  height: 68px; flex-shrink: 0; background: #fff; border-bottom: 1px solid #E2E8F0;
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
}
.ms-brand { display: flex; align-items: center; gap: 12px; }
.ms-brand .logo-mark { width: 30px; height: 30px; font-size: 22px; }
.ms-brand-name { font-size: 20px; font-weight: 700; color: #1E293B; letter-spacing: -.01em; }
.ms-topright { display: flex; align-items: center; gap: 12px; }
.ms-iconbtn {
  width: 35px; height: 35px; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #E2E8F0; border-radius: 4px; color: #64748B; cursor: pointer;
}
.ms-iconbtn svg { width: 19px; height: 19px; }
.ms-iconbtn:hover { border-color: var(--accent); color: var(--accent); }
.ms-logout { background: transparent; border: none; color: #2563EB; font-size: 11px; font-weight: 900; cursor: pointer; padding: 4px 6px; white-space: nowrap; }
.ms-logout:hover { text-decoration: underline; }

.ms-body { flex: 1; width: 100%; padding: 80px 24px 60px; text-align: center; }
.ms-eyebrow { font-size: 11px; letter-spacing: .04em; color: #64748B; }
.ms-title { margin: 10px 0 0; font-size: 30px; font-weight: 600; color: #1E293B; letter-spacing: -.01em; }
.ms-sub { margin: 10px 0 0; font-size: 14px; color: #64748B; }
.ms-cards {
  display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
  max-width: 1120px; margin: 36px auto 0;
}
.ms-card {
  width: 341px; min-height: 267px; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px;
  padding: 34px; text-align: left; display: flex; flex-direction: column; cursor: pointer;
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.ms-card:hover { border-color: #cbd5e1; box-shadow: 0 14px 34px rgba(15,23,42,.10); transform: translateY(-2px); }
.ms-card-icon {
  width: 56px; height: 56px; border-radius: 10px; background: #EFF6FF; color: #2563EB;
  display: flex; align-items: center; justify-content: center;
}
.ms-card-icon svg { width: 28px; height: 28px; }
.ms-card-title { margin-top: 16px; font-size: 22px; font-weight: 600; color: #1E293B; }
.ms-card-desc { margin-top: 8px; font-size: 13px; color: #64748B; line-height: 1.6; }
.ms-card-enter {
  margin-top: auto; padding-top: 20px; border-top: 1px solid #E2E8F0;
  display: flex; align-items: center; justify-content: space-between; color: #2563EB; font-size: 13px;
}
.ms-card-enter svg { width: 18px; height: 18px; }
.ms-card:hover .ms-card-enter { color: var(--accent2); }
.ms-card:hover .ms-card-enter svg { transform: translateX(3px); }
.ms-card-enter svg { transition: transform .15s; }
@media (max-width: 1100px) {
  .ms-card { width: 100%; max-width: 341px; }
}

/* ---------------- system management module (Figma 54_7957) ---------------- */
.sys-module {
  position: fixed; inset: 0; z-index: 110; background: #F5F7FA;
  display: flex; overflow: hidden;
}
.sm-side {
  width: 248px; flex-shrink: 0; background: #fff; border-right: 1px solid #E2E8F0;
  display: flex; flex-direction: column; padding: 24px 16px 16px;
}
.sm-brand { display: flex; align-items: center; gap: 10px; padding-left: 8px; height: 39px; }
.sm-brand .logo-mark { width: 27px; height: 27px; font-size: 23px; }
.sm-brand-name { font-size: 26px; font-weight: 900; color: #1E293B; letter-spacing: -.01em; }
.sm-ws { border-top: 1px solid #E2E8F0; border-bottom: 1px solid #E2E8F0; padding: 17px 8px; margin-top: 24px; }
.sm-ws-label { font-size: 11px; letter-spacing: .04em; color: #64748B; }
.sm-ws-name { margin-top: 8px; font-size: 13px; color: #1E293B; }
.sm-navsec { font-size: 11px; letter-spacing: .04em; color: #64748B; padding: 20px 10px 8px; }
.sm-nav { flex: 1; overflow-y: auto; }
.sm-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px;
  border: none; background: transparent; border-radius: 4px; color: #64748B;
  font-size: 13px; cursor: pointer; margin-bottom: 2px; text-align: left;
}
.sm-nav button em { font-style: normal; font-size: 10px; opacity: .65; width: 12px; flex-shrink: 0; }
.sm-nav button:hover { background: #F3F4F6; }
.sm-nav button.active { background: #EFF6FF; color: #2563EB; font-weight: 600; box-shadow: inset 3px 0 0 #2563EB; }
.sm-nav button.active em { color: #2563EB; opacity: 1; }
.sm-foot { border-top: 1px solid #E2E8F0; padding-top: 17px; }
.sm-back { background: transparent; border: none; color: #2563EB; font-size: 11px; font-weight: 900; cursor: pointer; padding: 0; }
.sm-back:hover { text-decoration: underline; }
.sm-user-wrap { position: relative; }
.sm-user {
  display: flex; align-items: center; gap: 10px;
  margin: 11px -8px 0; padding: 6px 8px; border-radius: 6px; cursor: pointer;
}
.sm-user:hover { background: #F3F4F6; }
.sm-user .chev { margin-left: auto; color: #9CA3AF; font-size: 11px; }
.sm-user-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; z-index: 20;
  background: #fff; border: 1px solid #E2E8F0; border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: 8px;
}
.sm-logout {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: #DC2626; font-size: 12px; font-weight: 400; padding: 8px 10px; border-radius: 4px; cursor: pointer;
}
.sm-logout:hover { background: #FEF2F2; }
.sm-avatar {
  width: 29px; height: 29px; border-radius: 50%; background: #EFF6FF; color: #2563EB;
  font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sm-user-meta { display: flex; flex-direction: column; line-height: 1.35; overflow: hidden; }
.sm-user-meta b { font-size: 12px; color: #1E293B; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-user-meta small { font-size: 11px; color: #64748B; }

.sm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sm-topbar {
  height: 84px; flex-shrink: 0; background: #fff; border-bottom: 1px solid #E2E8F0;
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}
.sm-content { flex: 1; overflow-y: auto; padding: 24px 32px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.sm-pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.sm-page { display: block; }
.sm-checks {
  display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px;
  border: 1px solid #E2E8F0; border-radius: 4px; max-height: 200px; overflow-y: auto;
}
.sm-checks .check { display: flex; align-items: center; gap: 8px; font-size: 12px; }

/* ---- role list (Figma 54_5399) ---- */
.sm-note {
  background: #EFF6FF; border: 1px solid #E2E8F0; border-radius: 6px;
  padding: 17px 22px; margin-bottom: 12px;
}
.sm-note b { display: block; color: #2563EB; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.sm-note span { display: block; color: #64748B; font-size: 12px; line-height: 1.55; }

.sm-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border: 1px solid #E2E8F0; border-radius: 6px;
  margin-bottom: 24px; overflow: hidden;
}
.sm-stat { padding: 20px 24px 22px; border-right: 1px solid #E2E8F0; }
.sm-stat:last-child { border-right: none; }
.sm-stat span { display: block; font-size: 12px; color: #64748B; }
.sm-stat b { display: block; margin-top: 8px; font-size: 27px; font-weight: 600; color: #1E293B; line-height: 1.15; }

.sm-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 70px; padding: 0 20px; border-bottom: 1px solid #E2E8F0; background: #fff;
}
.sm-toolbar .sm-search {
  width: 310px; max-width: 100%; height: 36px; border-radius: 4px;
  border: 1px solid #E2E8F0; background: #fff; font-size: 12px; padding: 0 12px;
}
.sm-toolbar .sm-search::placeholder { color: rgba(30, 41, 59, .50); }
.sm-toolbar .sm-search:focus { background: #fff; border-color: #2563EB; box-shadow: none; }
.sm-toolbar .sm-filter {
  width: 102px; height: 36px; min-width: 0; border-radius: 4px; border: 1px solid #E2E8F0;
  background: #fff; font-size: 12px; color: #64748B; padding: 0 6px;
}
.sm-toolbar .sm-filter:focus { background: #fff; border-color: #2563EB; box-shadow: none; }

.card-table .sm-toolbar + table.tbl th { padding-top: 15px; padding-bottom: 15px; }
.sm-tablefoot { padding: 13px 20px 14px; font-size: 10px; color: #737880; }
.sm-code { font-size: 12px; color: #1E293B; }
.sm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#smTblRoles { table-layout: fixed; }
#smTblRoles th:nth-child(1) { width: 29%; }
#smTblRoles th:nth-child(2) { width: 12%; }
#smTblRoles th:nth-child(3) { width: 37%; }
#smTblRoles th:nth-child(4) { width: 9%; }
#smTblRoles th:nth-child(5) { width: 13%; }
#smTblRoles td { overflow: hidden; }
.sm-chip {
  display: inline-flex; align-items: center; height: 21px; padding: 0 6px;
  background: #EFF6FF; color: #2563EB; font-size: 9px; border-radius: 3px; white-space: nowrap;
}
.sm-chip.more { background: #F1F5F9; color: #64748B; }
.status-tag.off { background: #F1F5F9; color: #686C73; }
.sm-acts { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.sm-del {
  background: transparent; border: none; color: #2563EB; font-size: 11px;
  font-weight: 900; padding: 0 5px; cursor: pointer;
}
.sm-del:hover { color: #1D4ED8; text-decoration: underline; }

/* ---- role form (modal) ---- */
.sm-form { display: flex; flex-direction: column; gap: 16px; }
.sm-form .mfield > span { font-size: 12px; color: #64748B; }
.sm-form input { height: 40px; border-radius: 4px; background: #fff; border-color: #E2E8F0; }
.sm-form label.check { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sm-scope { border: 1px solid #E2E8F0; border-radius: 4px; padding: 10px 14px 14px; margin: 0; }
.sm-scope legend { font-size: 12px; color: #64748B; padding: 0 6px; }
.sm-checks.grid2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px;
  border: none; padding: 4px 0 0; max-height: 200px; overflow-y: auto;
}
@media (max-width: 1000px) {
  .sm-stats { grid-template-columns: 1fr 1fr; }
  .sm-stat:nth-child(2) { border-right: none; }
  .sm-stat:nth-child(1), .sm-stat:nth-child(2) { border-bottom: 1px solid #E2E8F0; }
  .sm-checks.grid2 { grid-template-columns: 1fr; }
}
.modal-body label.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }

/* document edit */
.sm-dochead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.sm-docactions { display: flex; gap: 8px; }
.sm-docactions button, .sm-dochead button { border-radius: 4px; height: 36px; padding: 0 18px; font-size: 12px; font-weight: 600; }
.sm-docgrid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.sm-field2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sm-field2 label:nth-child(5), .sm-field2 label:nth-child(6) { grid-column: span 2; }
.sm-field2 textarea { width: 100%; }
.sm-docside label { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #64748B; }
.sm-docside label.check { flex-direction: row; align-items: center; gap: 8px; }
@media (max-width: 1000px) {
  .sm-docgrid { grid-template-columns: 1fr; }
  .sm-field2 { grid-template-columns: 1fr; }
  .sm-field2 label:nth-child(5), .sm-field2 label:nth-child(6) { grid-column: auto; }
}
@media (max-width: 860px) {
  .sm-side { display: none; }
  .sm-content { padding: 16px; }
}

/* ---------------- POS module (Figma 66_2) ---------------- */
.pos-module {
  position: fixed; inset: 0; z-index: 105; background: #F5F7FA;
  display: flex; flex-direction: column; overflow: hidden;
}
.pos-topbar {
  height: 70px; flex: 0 0 70px; background: #fff; border-bottom: 1px solid #E2E8F0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(14px, 1.5vw, 28px);
}
.pos-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pos-brand .logo-mark { width: 30px; height: 30px; font-size: 22px; border-radius: 6px; flex-shrink: 0; }
.pos-brand-name { font-size: 20px; font-weight: 700; color: #1E293B; letter-spacing: -.01em; white-space: nowrap; }
.pos-tag { padding: 4px 10px; background: #EFF6FF; border-radius: 4px; color: #2563EB; font-size: 12px; white-space: nowrap; }
.pos-topright { display: flex; align-items: center; gap: clamp(8px, 1vw, 16px); min-width: 0; }
.pos-topright .help-btn { width: 36px; height: 36px; padding: 0; justify-content: center; flex-shrink: 0; }
.pos-link { background: transparent; border: none; color: #2563EB; font-size: 11px; font-weight: 900; cursor: pointer; padding: 0; white-space: nowrap; }
.pos-link:hover { text-decoration: underline; }
.pos-ws { font-size: 12px; color: #64748B; white-space: nowrap; }
.pos-exit {
  height: 36px; padding: 0 16px; border-radius: 4px; background: #fff;
  border: 1px solid #E2E8F0; color: #64748B; font-size: 12px; font-weight: 700; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.pos-exit:hover { border-color: #2563EB; color: #2563EB; }
.pos-banner {
  flex: 0 0 auto; background: #EFF6FF; border-bottom: 1px solid #E2E8F0;
  padding: 9px clamp(14px, 1.5vw, 28px); font-size: 11px; color: #64748B; line-height: 1.4;
}
.pos-page { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* ---- 点单页：左栏收银清单固定，右栏铺满剩余空间 ---- */
.pos-order-page { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.pos-order {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: 360px minmax(0, 1fr);
}
.pos-eyebrow { display: block; font-size: 11px; letter-spacing: .04em; color: #64748B; }

.pos-cart {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: #fff; border-right: 1px solid #E2E8F0;
}
.pos-cart-head {
  flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 24px 24px 16px; border-bottom: 1px solid #E2E8F0;
}
.pos-cart-title { min-width: 0; }
.pos-cart-title h2 { margin: 6px 0 0; font-size: 19px; font-weight: 600; color: #1E293B; display: flex; align-items: baseline; gap: 6px; }
.pos-cart-title h2 b { font-size: 13px; font-weight: 400; color: #64748B; }
.pos-cart-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pos-clear { background: transparent; border: none; color: #2563EB; font-size: 11px; font-weight: 900; cursor: pointer; padding: 0; }
.pos-clear:hover { text-decoration: underline; }
.pos-cart-close {
  display: none; width: 28px; height: 28px; border-radius: 4px; border: 1px solid #E2E8F0;
  background: #fff; color: #64748B; font-size: 16px; line-height: 1; cursor: pointer; padding: 0;
}
.pos-cart-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 24px; }
.pos-cart-item { padding: 18px 0; border-bottom: 1px solid #E2E8F0; }
.pos-cart-item:last-child { border-bottom: none; }
.pos-cart-item .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pos-cart-item .row + .row { margin-top: 12px; }
.pos-cart-item .nm { flex: 1; min-width: 0; }
.pos-cart-item .nm b { display: block; font-size: 13px; font-weight: 600; color: #1E293B; line-height: 1.4; }
.pos-cart-item .nm small { display: block; margin-top: 6px; font-size: 11px; color: #64748B; }
.pos-cart-item .rm { background: transparent; border: none; color: #64748B; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.pos-cart-item .rm:hover { color: #DC2626; }
.pos-qty { display: inline-flex; align-items: center; height: 31px; border: 1px solid #E2E8F0; border-radius: 4px; overflow: hidden; background: #fff; }
.pos-qty button { width: 30px; height: 29px; border: none; background: #F5F7FA; color: #1E293B; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
.pos-qty button:hover { background: #EFF6FF; color: #2563EB; }
.pos-qty b { min-width: 34px; text-align: center; font-size: 12px; font-weight: 400; color: #1E293B; }
.pos-cart-item .amt { font-size: 13px; font-weight: 700; color: #1E293B; white-space: nowrap; }
.pos-cart-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 8px; text-align: center; color: #94A3B8; font-size: 12px; line-height: 1.6; }
.pos-cart-empty .ico {
  width: 44px; height: 44px; border-radius: 22px; background: #F5F7FA;
  color: #CBD5E1; font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.pos-cart-foot { flex: 0 0 auto; border-top: 1px solid #E2E8F0; background: #fff; padding: 18px 24px 22px; }
.pos-cart-sumline { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #64748B; }
.pos-cart-sumline b { font-size: 12px; font-weight: 700; color: #64748B; }
.pos-total-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 18px; }
.pos-total-row span { font-size: 15px; color: #1E293B; }
.pos-total-row b { font-size: 26px; font-weight: 600; color: #2563EB; letter-spacing: -.01em; white-space: nowrap; }
.pos-primary {
  width: 100%; height: 46px; border-radius: 4px; background: #2563EB; color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid #2563EB;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .14s, border-color .14s;
}
.pos-primary:hover:not(:disabled) { background: #1D4ED8; border-color: #1D4ED8; }
.pos-primary:disabled { opacity: .4; cursor: not-allowed; }

.pos-menu { min-width: 0; min-height: 0; overflow-y: auto; padding: 26px 28px 30px; }
.pos-menu-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.pos-menu-title h2 { margin: 6px 0 0; font-size: 24px; font-weight: 600; color: #1E293B; letter-spacing: -.01em; }
.pos-menu-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; max-width: 100%; }
.pos-search {
  width: 260px; max-width: 100%; height: 38px; border-radius: 5px;
  border: 1px solid #E2E8F0; background: #fff; font-size: 12px; padding: 0 14px; color: #1E293B;
}
.pos-search::placeholder { color: rgba(30, 41, 59, .5); }
.pos-search:focus { outline: none; background: #fff; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
.pos-cats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.pos-cat {
  height: 41px; padding: 0 17px; border-radius: 5px; background: #fff; border: 1px solid #E2E8F0;
  color: #64748B; font-size: 12px; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 9px;
  transition: border-color .12s, color .12s, background .12s;
}
.pos-cat .n { font-size: 11px; opacity: .7; }
.pos-cat:hover { border-color: #2563EB; color: #2563EB; }
.pos-cat.active { background: #2563EB; border-color: #2563EB; color: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.pos-dish {
  position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden;
  background: #fff; border: 1px solid #E2E8F0; border-radius: 7px;
  cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.pos-dish:hover { border-color: #2563EB; box-shadow: 0 6px 18px rgba(37, 99, 235, .12); transform: translateY(-1px); }
.pos-dish:active { transform: none; }
.pos-dish.in-cart { border-color: #2563EB; }
.pos-dish.in-cart:hover { box-shadow: 0 6px 18px rgba(37, 99, 235, .18); }
.pos-dish-media {
  position: relative; width: 100%; aspect-ratio: 1.45 / 1; background: #EFF6FF;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pos-dish-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pos-dish-media .ph { font-size: 26px; letter-spacing: 2px; color: #2563EB; opacity: .5; }
.pos-dish-badge {
  position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 12px; background: #2563EB; color: #fff; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pos-dish-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.pos-dish .code { font-size: 10px; color: #64748B; }
.pos-dish .nm {
  font-size: 13px; font-weight: 600; color: #1E293B; line-height: 1.45; min-height: 19px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pos-dish .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.pos-dish .pr { font-size: 16px; font-weight: 600; color: #2563EB; white-space: nowrap; }
.pos-dish .add {
  width: 26px; height: 26px; border-radius: 4px; background: #EFF6FF; color: #2563EB;
  font-size: 18px; line-height: 1; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .14s, color .14s;
}
.pos-dish:hover .add { background: #2563EB; color: #fff; }
.pos-grid-empty { grid-column: 1 / -1; text-align: center; color: #94A3B8; font-size: 12px; padding: 48px 0; }
.pos-menu-hint { margin: 22px 0 0; font-size: 11px; color: #64748B; }

/* 移动端订单抽屉 / 底部操作条（桌面隐藏） */
.pos-cart-backdrop { display: none; }
.pos-mobilebar { display: none; }

/* ---- 结算页（Figma 71_514）：左右两栏等高 ---- */
.pos-checkout { max-width: 1180px; margin: 0 auto; padding: clamp(18px, 2vw, 28px) clamp(16px, 2.2vw, 32px) 56px; }
.pos-back {
  display: inline-flex; align-items: center; height: 27px;
  background: transparent; border: none; color: #2563EB;
  font-size: 11px; font-weight: 900; cursor: pointer; padding: 0; letter-spacing: .02em;
}
.pos-back:hover { text-decoration: underline; }
.pos-co-head { margin-top: 20px; }
.pos-co-head .eyebrow, .pos-co-right .eyebrow { color: #64748B; letter-spacing: .04em; margin: 0 0 6px; }
.pos-co-head h2 { margin: 6px 0 0; font-size: 28px; font-weight: 600; color: #1E293B; letter-spacing: -.01em; }
.pos-co-head .sub { margin: 6px 0 0; font-size: 13px; color: #64748B; }

.pos-co-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 24px;
  margin-top: 26px; align-items: stretch;
}
.pos-co-left { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pos-card {
  display: flex; flex-direction: column;
  padding: 26px; border: 1px solid #E2E8F0; border-radius: 6px; background: #fff; margin: 0;
}
/* 让左栏最后一张可见卡片吸收多余高度，与右栏底部对齐 */
.pos-co-left > .pos-card:last-child { flex: 1 1 auto; }
.pos-co-left.no-cash > .pos-card:nth-child(2) { flex: 1 1 auto; }
.pos-step { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex: 0 0 auto; }
.pos-step span {
  width: 24px; height: 24px; border-radius: 12px; background: #EFF6FF; color: #2563EB;
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.pos-step h3 { margin: 0; font-size: 16px; font-weight: 600; color: #1E293B; }
.pos-payopts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pos-pay {
  position: relative; height: 97px; border-radius: 6px; background: #fff; border: 1px solid #E2E8F0;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 12px; padding: 0 14px; cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color .14s, background .14s;
}
.pos-pay b { font-size: 15px; font-weight: 700; color: #2563EB; }
.pos-pay span { font-size: 13px; font-weight: 600; color: #1E293B; }
.pos-pay::after {
  content: ''; position: absolute; top: 14px; right: 14px; width: 13px; height: 13px;
  border-radius: 50%; border: 1.5px solid #E2E8F0; box-sizing: border-box;
}
.pos-pay:hover { border-color: #2563EB; }
.pos-pay.active { background: #EFF6FF; border-color: #2563EB; }
.pos-pay.active::after { border: 3px solid #2563EB; }
.pos-roundopts { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-roundopts button {
  height: 39px; padding: 0 14px; border-radius: 5px; background: #fff; border: 1px solid #E2E8F0;
  color: #64748B; font-size: 12px; cursor: pointer; font-family: inherit;
  transition: border-color .14s, background .14s, color .14s;
}
.pos-roundopts button:hover { border-color: #2563EB; color: #2563EB; }
.pos-roundopts button.active { background: #EFF6FF; border-color: #2563EB; color: #2563EB; }
.pos-round-custom { margin-top: 12px; align-items: center; gap: 10px; display: flex; }
.pos-round-custom span { font-size: 12px; color: #64748B; }
.pos-round-custom input { width: 120px; height: 36px; border-radius: 4px; border: 1px solid #E2E8F0; background: #fff; padding: 0 10px; font-size: 13px; }
.pos-round-custom input:focus { background: #fff; border-color: #2563EB; box-shadow: none; }
.pos-hint { margin: 14px 0 0; font-size: 11px; color: #64748B; line-height: 1.5; flex: 0 0 auto; }
/* 卡片被拉伸时，说明文字贴底显示 */
.pos-co-left .pos-card > .pos-hint { margin-top: auto; padding-top: 14px; }
.pos-field { display: block; margin: 0 0 14px; }
.pos-field > span { display: block; font-size: 12px; color: #64748B; margin-bottom: 8px; }
.pos-money {
  width: 100%; height: 48px; border-radius: 4px; border: 1px solid #E2E8F0; background: #fff;
  padding: 0 16px; font-size: 21px; color: #1E293B;
}
.pos-money:focus { outline: none; background: #fff; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
.pos-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pos-quick button {
  height: 41px; padding: 0 16px; border-radius: 5px; background: #fff; border: 1px solid #E2E8F0;
  color: #64748B; font-size: 12px; cursor: pointer; font-family: inherit;
}
.pos-quick button:hover { border-color: #2563EB; color: #2563EB; }
.pos-change {
  height: 72px; padding: 0 18px; background: #EFF6FF; border-radius: 4px;
  display: flex; justify-content: space-between; align-items: center;
}
.pos-change span { font-size: 13px; color: #1E293B; }
.pos-change b { font-size: 24px; font-weight: 700; color: #2563EB; }
.pos-change.neg { background: #FEF2F2; }
.pos-change.neg b { color: #DC2626; }

.pos-co-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pos-co-count { margin: 8px 0 14px; font-size: 19px; font-weight: 600; color: #1E293B; flex: 0 0 auto; }
.pos-co-count b { font-weight: 600; }
.pos-co-items {
  flex: 1 1 auto; min-height: 120px; max-height: 340px; overflow-y: auto;
  border-top: 1px solid #E2E8F0; border-bottom: 1px solid #E2E8F0; padding: 6px 0;
}
.pos-co-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; }
.pos-co-item .nm { font-size: 12px; color: #1E293B; line-height: 1.4; min-width: 0; }
.pos-co-item .nm small { display: block; font-size: 11px; color: #64748B; margin-top: 6px; }
.pos-co-item .amt { font-size: 12px; color: #1E293B; white-space: nowrap; }
.pos-co-sum { flex: 0 0 auto; margin-top: auto; padding-top: 18px; }
.pos-co-sum .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pos-co-sum .row span { font-size: 12px; color: #64748B; }
.pos-co-sum .row b { font-size: 12px; font-weight: 600; color: #1E293B; }
.pos-co-sum .row.total { border-top: 1px solid #E2E8F0; padding-top: 20px; margin: 8px 0 20px; }
.pos-co-sum .row.total b { font-size: 27px; font-weight: 600; color: #2563EB; letter-spacing: -.01em; }
.pos-co-right .pos-primary { flex: 0 0 auto; height: 44px; font-size: 13px; }
.pos-co-right .pos-hint { flex: 0 0 auto; margin: 14px 0 0; }

.pos-done { text-align: center; padding: 40px 32px; width: 380px; }
.pos-done-icon {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%;
  background: #ECFDF5; color: #047857; font-size: 28px; display: flex; align-items: center; justify-content: center;
}
.pos-done h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; color: #1E293B; }
.pos-done p { margin: 0 0 24px; font-size: 13px; color: #64748B; }

/* ---- POS 自适应：桌面 / 平板 / 移动 ---- */
@media (max-width: 1440px) {
  .pos-order { grid-template-columns: 320px minmax(0, 1fr); }
  .pos-menu { padding: 22px 22px 26px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; }
}
@media (max-width: 1180px) {
  .pos-order { grid-template-columns: 300px minmax(0, 1fr); }
  .pos-cart-head { padding: 20px 18px 14px; }
  .pos-cart-list { padding: 0 18px; }
  .pos-cart-foot { padding: 16px 18px 18px; }
  .pos-total-row b { font-size: 22px; }
  .pos-menu-head h2 { font-size: 21px; }
  .pos-search { width: 210px; }
  .pos-ws { display: none; }
  .pos-co-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1000px) {
  .pos-co-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .pos-co-left > .pos-card:last-child { flex: 0 0 auto; }
  .pos-co-items { flex: 0 1 auto; min-height: 0; max-height: 320px; }
  .pos-checkout { padding: 22px 22px 48px; }
  .pos-payopts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pos-pay { height: 84px; padding: 0 12px; }
  .pos-pay b { font-size: 14px; }
  .pos-pay span { font-size: 12px; }
}
/* 平板竖屏 / 手机：收银清单改为抽屉，右侧菜品全宽 */
@media (max-width: 860px) {
  .pos-order { grid-template-columns: minmax(0, 1fr); }
  .pos-cart {
    position: absolute; top: 0; bottom: 0; left: 0; z-index: 60;
    width: min(88vw, 380px); border-right: 1px solid #E2E8F0;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
    transform: translateX(-102%); transition: transform .24s ease; will-change: transform;
  }
  .pos-order-page.cart-open .pos-cart { transform: none; }
  .pos-cart-backdrop {
    display: block; position: absolute; inset: 0; z-index: 50;
    background: rgba(15, 23, 42, .34); opacity: 0; pointer-events: none; transition: opacity .24s;
  }
  .pos-order-page.cart-open .pos-cart-backdrop { opacity: 1; pointer-events: auto; }
  .pos-cart-close { display: inline-flex; align-items: center; justify-content: center; }
  .pos-menu { padding: 18px 16px 104px; }
  .pos-menu-head { margin-bottom: 16px; }
  .pos-menu-tools { width: 100%; margin-left: 0; }
  .pos-search { width: 100%; flex: 1; }
  .pos-cats { gap: 8px; margin-bottom: 18px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; }
  .pos-cats::-webkit-scrollbar { display: none; }
  .pos-cat { flex: 0 0 auto; height: 36px; padding: 0 14px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px; }
  .pos-dish .nm { font-size: 12.5px; }
  .pos-mobilebar {
    display: block; position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid #E2E8F0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }
  .pos-mobilebar-btn {
    width: 100%; height: 48px; border: none; border-radius: 5px; background: #2563EB; color: #fff;
    display: flex; align-items: center; gap: 10px; padding: 0 16px;
    font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  }
  .pos-mobilebar-btn:disabled { opacity: .45; cursor: not-allowed; }
  .pos-mobilebar-btn .cnt {
    min-width: 22px; height: 22px; border-radius: 11px; background: rgba(255, 255, 255, .22);
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
  }
  .pos-mobilebar-btn b { margin-left: auto; font-size: 15px; font-weight: 600; }
}
@media (max-width: 720px) {
  .pos-topbar { height: 60px; flex-basis: 60px; gap: 10px; }
  .pos-brand { gap: 8px; }
  .pos-brand .logo-mark { width: 26px; height: 26px; font-size: 18px; }
  .pos-brand-name { font-size: 16px; }
  .pos-tag { display: none; }
  .pos-topright .help-btn { width: 32px; height: 32px; }
  .pos-exit { height: 32px; padding: 0 10px; font-size: 11px; }
  .pos-banner { font-size: 10px; padding: 8px 14px; }
  .pos-co-head h2 { font-size: 22px; }
  .pos-card { padding: 16px; }
  .pos-payopts { grid-template-columns: 1fr; }
  .pos-pay { height: 60px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; }
  .pos-checkout { padding: 16px 14px 44px; }
  .pos-done { width: min(92vw, 380px); padding: 32px 22px; }
}
@media (max-width: 480px) {
  .pos-brand-name { display: none; }
  .pos-menu { padding: 14px 12px 100px; }
  .pos-menu-title h2 { font-size: 19px; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pos-dish .foot { flex-wrap: wrap; }
  .pos-dish .pr { font-size: 15px; }
  .pos-cart-head { padding: 18px 16px 12px; }
  .pos-cart-list { padding: 0 16px; }
  .pos-cart-foot { padding: 14px 16px 16px; }
  .pos-total-row b { font-size: 20px; }
}
@media (max-width: 400px) {
  /* 极窄屏：隐藏非必要顶栏入口，避免横向溢出 */
  .pos-topright .help-btn, .pos-link { display: none; }
}

/* ---------------- impressoras (design ref Figma) ---------------- */
.pagehead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.info-banner { background: #EFF6FF; border: 1px solid #E2E8F0; border-radius: 6px; padding: 16px 22px; margin-bottom: 18px; }
.info-banner-title { font-size: 12px; font-weight: 700; color: #2563EB; margin-bottom: 6px; }
.info-banner-text { font-size: 12px; color: #64748B; line-height: 1.7; }
.mini-select { height: 36px; border: 1px solid #E2E8F0; border-radius: 4px; background: #fff; font-size: 12px; color: #64748B; padding: 0 10px; font-family: inherit; }
#view-printers .stat-value { font-size: 27px; }
#view-printers .card { border-radius: 6px; border-color: #E2E8F0; }
#view-printers .listfoot { justify-content: flex-start; }
.prn-name { display: block; font-weight: 600; color: #1E293B; }
.prn-sub { display: block; font-size: 10px; color: #64748B; margin-top: 4px; word-break: break-all; }
.uso-pill { display: inline-block; padding: 5px 9px; border-radius: 3px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.uso-pill.pos { background: #EFF6FF; color: #2563EB; }
.uso-pill.nfce { background: #ECFDF5; color: #047857; }
.uso-pill.ambos { background: #F5F3FF; color: #6D28D9; }
.conn { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #1E293B; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: #94A3B8; flex: none; }
.conn-dot.on { background: #10B981; }
.conn-dot.off { background: #EF4444; }
.conn small { color: #64748B; font-size: 10px; }
.test-note { font-size: 10px; color: #64748B; line-height: 1.5; }
.test-note.ok { color: #047857; }
.test-note.fail { color: #B91C1C; }
.mfield-hint { font-size: 10px; color: #64748B; line-height: 1.5; }
.mfield-hint.warn { color: #B45309; }
.checkline { display: flex; align-items: center; gap: 8px; height: 38px; font-size: 12px; color: #1E293B; }
.checkline input { width: auto !important; }
.hintline { margin-top: 12px; padding-top: 14px; border-top: 1px solid #E2E8F0; font-size: 11px; color: #64748B; line-height: 1.7; }
.empty-state b { display: block; font-size: 15px; color: #1E293B; margin-bottom: 8px; font-weight: 600; }
.empty-state span { display: block; font-size: 13px; color: #64748B; margin-bottom: 16px; }
.empty-state button { height: 36px; padding: 0 16px; border-radius: 4px; background: #fff; border: 1px solid #2563EB; color: #2563EB; font-size: 12px; font-weight: 700; cursor: pointer; }
.testcard { width: 800px; }
.testbody { flex-direction: row; align-items: flex-start; gap: 24px; }
.testpaper { width: 270px; flex: none; background: #F5F7FA; border: 1px solid #E2E8F0; border-radius: 4px; padding: 16px; }
.testpaper pre {
  margin: 0; background: #fff; padding: 14px 12px; border-radius: 2px; max-height: 460px; overflow: auto;
  font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
  font-size: 9.5px; line-height: 1.45; color: #1E293B; white-space: pre;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.testinfo { flex: 1; min-width: 0; }
.testinfo h4 { margin: 0 0 6px; font-size: 14px; color: #1E293B; font-weight: 600; }
.testinfo p { margin: 0 0 16px; font-size: 12px; color: #64748B; line-height: 1.7; }
@media (max-width: 860px) {
  .testcard { width: 100%; }
  .testbody { flex-direction: column; }
  .testpaper { width: 100%; }
}

/* ================= 收银设置：商品规格 / 商品属性 ================= */
.linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700; color: #2563EB;
}
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: #DC2626; }
.ghost.mini { height: 28px; padding: 0 10px; font-size: 11px; }

#view-pos-specs table.tbl td, #view-pos-attrs table.tbl td { padding-top: 14px; padding-bottom: 14px; }
.pg-name b { display: block; font-size: 12px; font-weight: 600; color: #1E293B; line-height: 1.4; }
.pg-name small { display: block; margin-top: 4px; font-size: 10px; color: #64748B; }
.pg-rule span { font-size: 12px; color: #1E293B; }
.pg-rule small { display: block; margin-top: 4px; font-size: 10px; color: #64748B; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-chip {
  display: inline-block; padding: 4px 8px; border-radius: 3px;
  background: #EFF6FF; color: #2563EB; font-size: 10px; line-height: 1.3; white-space: nowrap;
}
.pg-prodcell { font-size: 11px; color: #1E293B; line-height: 1.5; max-width: 280px; }
.pill.ok { background: #ECFDF5; color: #047857; }
.pill.off { background: #F1F5F9; color: #64748B; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.pg-empty { padding: 32px 0; text-align: center; font-size: 12px; color: #94A3B8; }

.modal-card.posset-card { width: 760px; max-height: min(92vh, 900px); display: flex; flex-direction: column; }
.posset-body { overflow-y: auto; padding-bottom: 6px; }
.posset-flags { display: flex; align-items: center; gap: 20px; }
.posset-flags .checkline { height: 38px; }
.posset-flags input[type="checkbox"], .pg-prod input[type="checkbox"] {
  width: 16px !important; height: 16px; min-width: 16px; padding: 0; margin: 0;
  accent-color: #2563EB; flex: none;
}
.posset-sec {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid #E2E8F0; padding-top: 14px;
}
.posset-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.posset-sec-head h4 { margin: 0; font-size: 14px; font-weight: 600; color: #1E293B; }
.posset-mini-actions { display: flex; align-items: center; gap: 14px; }
.posset-body .ghost, .posset-body .primary {
  height: 28px; padding: 0 12px; border-radius: 4px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.posset-body .ghost { background: #fff; border: 1px solid #E2E8F0; color: #2563EB; }

.pg-options { display: flex; flex-direction: column; gap: 10px; }
.pg-optrow {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 140px 30px;
  gap: 10px; align-items: end;
  background: #F5F7FA; border: 1px solid #E2E8F0; border-radius: 5px; padding: 12px;
}
.pg-optfield { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: #64748B; min-width: 0; }
.pg-optfield input {
  height: 34px; padding: 0 10px; border: 1px solid #E2E8F0; border-radius: 4px;
  background: #fff; color: #1E293B; font-size: 12px; font-family: inherit; box-sizing: border-box;
}
.pg-optfield input:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.pg-optprice input { text-align: right; }
.pg-optdel {
  width: 30px; height: 34px; border: none; background: transparent; cursor: pointer;
  color: #94A3B8; font-size: 20px; line-height: 1; padding: 0;
}
.pg-optdel:hover { color: #DC2626; }

.pg-products {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  max-height: 200px; overflow-y: auto; padding: 12px;
  border: 1px solid #E2E8F0; border-radius: 5px;
}
.pg-prod {
  display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0;
  padding: 8px 10px; border: 1px solid #E2E8F0; border-radius: 4px;
  font-size: 12px; color: #1E293B; cursor: pointer;
}
.pg-prod input { width: 16px !important; height: 16px; margin: 0; accent-color: #2563EB; flex: none; }
.pg-prod .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-prod .code { flex: none; font-size: 10px; color: #64748B; }
.pg-prod:hover { border-color: #2563EB; }
.pg-prod:has(input:checked) { border-color: #2563EB; background: #EFF6FF; }

/* POS: 菜品卡提示 / 购物车选项 / 结算选项 */
.pos-dish-opts {
  align-self: flex-start; padding: 2px 7px; border-radius: 3px;
  background: #EFF6FF; color: #2563EB; font-size: 9px; line-height: 1.4;
}
.pos-cart-item .nm small.opts { margin-top: 4px; color: #2563EB; font-size: 10px; line-height: 1.45; }
.pos-cart-item .itemacts { display: flex; align-items: center; gap: 8px; flex: none; }
.pos-cart-item .itemacts .edit {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 10px; font-weight: 700; color: #2563EB;
}
.pos-cart-item .itemacts .edit:hover { text-decoration: underline; }
.pos-co-item .nm .opts { display: block; margin-top: 4px; font-style: normal; font-size: 10px; color: #2563EB; line-height: 1.45; }

.modal-card.pos-opt-card { width: 560px; max-height: min(88vh, 860px); display: flex; flex-direction: column; }
.pos-opt-body { overflow-y: auto; gap: 14px; }
.pos-opt-prod {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid #E2E8F0;
}
.pos-opt-prod b { font-size: 15px; font-weight: 600; color: #1E293B; }
.pos-opt-prod span { font-size: 14px; font-weight: 600; color: #2563EB; white-space: nowrap; }
.pos-opt-groups { display: flex; flex-direction: column; gap: 16px; }
.pos-optgroup-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.pos-optgroup-head b { font-size: 13px; font-weight: 600; color: #1E293B; }
.pos-optgroup-head span { font-size: 10px; color: #64748B; }
.pos-optchips { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-optschip {
  height: 34px; padding: 0 14px; border-radius: 4px; cursor: pointer;
  border: 1px solid #E2E8F0; background: #fff; color: #1E293B;
  font-family: inherit; font-size: 12px;
}
.pos-optschip em { font-style: normal; margin-left: 6px; font-size: 11px; color: #2563EB; }
.pos-optschip:hover { border-color: #2563EB; color: #2563EB; }
.pos-optschip.active {
  background: #EFF6FF; border-color: #2563EB; color: #2563EB;
  box-shadow: 3px 0 0 #2563EB inset;
}
.pos-opt-foot { align-items: center; }
.pos-opt-sum { margin-right: auto; font-size: 13px; font-weight: 600; color: #2563EB; }

/* ---- NFC-e 按州自动配置（双环境） ---- */
.cfg-wide, .cfg-envbox, .cfg-adv { grid-column: 1 / -1; }
.cfg-envbox {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 18px; border: 1px solid #E2E8F0; border-radius: 6px; background: #FBFCFE;
}
.cfg-envbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.cfg-envbox-head b { font-size: 12px; font-weight: 600; color: #1E293B; }
.cfg-adv { border-top: 1px dashed #E2E8F0; padding-top: 12px; }
.cfg-adv summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #2563EB; }
.cfg-adv summary::marker { color: #94A3B8; }
.cfg-adv-body { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
.cfg-adv-env { border: 1px solid #E2E8F0; border-radius: 5px; padding: 14px; background: #fff; }
.cfg-adv-env h4 {
  margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #64748B;
}
.cfg-adv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cfg-adv-full { grid-column: 1 / -1; }
.cfg-adv .check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #1E293B; }
.cfg-adv .check input { width: 16px; height: 16px; accent-color: #2563EB; }

@media (max-width: 860px) {
  .cfg-adv-grid { grid-template-columns: 1fr; }
  .modal-card.posset-card, .modal-card.pos-opt-card { width: 100%; }
  .pg-optrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pg-optdel { grid-column: 2; justify-self: end; }
  .pg-products { grid-template-columns: 1fr; }
  .posset-flags { gap: 12px; }
}

/* ============ standalone admin (same visual as the in-app module) ============ */
html, body { height: 100%; overflow: hidden; }
.sys-module { position: fixed; inset: 0; }
.sys-module.hidden { display: none !important; }
.login-overlay.hidden { display: none !important; }
.login-form .login-hint { margin-top: 4px; }
.sm-content { padding-bottom: 40px; }

/* ---- contas: acoes da pagina + tabela sem quebra ---- */
.sm-pageactions { display: flex; align-items: center; gap: 8px; }
#smTblUsers th, #smTblUsers td { white-space: nowrap; }
#smTblUsers .sm-acts { flex-wrap: nowrap; }

/* ---------- 总览（overview） ---------- */
.ov-updated { font-size: 11px; color: #94A3B8; margin: -6px 0 14px; }
.ov-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.ov-stat {
  background: #fff; border: 1px solid #E2E8F0; border-radius: 6px;
  padding: 20px 22px; box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.ov-stat--blue { border-color: #DBEAFE; background: linear-gradient(180deg, #F8FAFF, #fff); }
.ov-stat-label { font-size: 12px; color: #64748B; margin-bottom: 10px; }
.ov-stat-value { font-size: 30px; font-weight: 700; color: #0F172A; line-height: 1.1; letter-spacing: -.02em; }
.ov-stat-value span { font-size: 12px; font-weight: 500; color: #94A3B8; margin-left: 6px; letter-spacing: 0; }
.ov-stat-sub { font-size: 11px; color: #94A3B8; margin-top: 10px; line-height: 1.5; }

.ov-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.ov-grid--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.ov-card { padding: 22px 24px; }
.ov-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ov-card-title { font-size: 15px; font-weight: 600; color: #0F172A; margin: 0; }
.ov-card-sub { font-size: 11px; color: #94A3B8; margin: 4px 0 0; }
.ov-seg { display: inline-flex; border: 1px solid #E2E8F0; border-radius: 5px; overflow: hidden; flex: 0 0 auto; }
.ov-seg button { border: 0; background: #fff; color: #64748B; font-size: 11px; padding: 6px 12px; cursor: pointer; }
.ov-seg button.on { background: #2563EB; color: #fff; }
.ov-chart { width: 100%; }
.ov-chart svg { width: 100%; height: auto; display: block; }
.ov-chart--sm { max-width: 430px; }
.ov-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #64748B; margin-top: 6px; }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; background: #2563EB; display: inline-block; }
.ov-legend-sep { color: #CBD5E1; }
.ov-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 10px; }
.ov-hint { font-size: 11px; color: #94A3B8; line-height: 1.6; margin: 10px 0 0; }
.ov-link { border: 0; background: none; color: #2563EB; font-size: 11px; cursor: pointer; padding: 0; white-space: nowrap; }
.ov-link:hover { text-decoration: underline; }

.ov-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.ov-kpis--3 { margin-bottom: 10px; }
.ov-kpi { background: #F8FAFC; border: 1px solid #EEF2F7; border-radius: 5px; padding: 12px 14px; }
.ov-kpi-label { font-size: 11px; color: #64748B; }
.ov-kpi-value { font-size: 22px; font-weight: 700; color: #0F172A; margin-top: 4px; }
.ov-kpi-value span { font-size: 11px; color: #94A3B8; font-weight: 500; margin-left: 4px; }
.ov-kpi-sub { font-size: 10.5px; color: #94A3B8; margin-top: 4px; line-height: 1.45; }

.ov-section { margin-top: 18px; }
.ov-table { margin-top: 10px; }
.ov-table--scroll { max-height: 360px; overflow: auto; }
.ov-table table { width: 100%; }
.ov-table .ov-cell-sub { display: block; font-size: 10px; color: #94A3B8; }
.ov-table .tbl th, .ov-table .tbl td { white-space: nowrap; }
.ov-search { width: 220px; height: 32px; border: 1px solid #E2E8F0; border-radius: 5px; padding: 0 10px; font-size: 12px; flex: 0 0 auto; }
.ov-search:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }

.ov-state { font-size: 11px; padding: 3px 8px; border-radius: 10px; background: #F1F5F9; color: #64748B; white-space: nowrap; }
.ov-state--today { background: #DCFCE7; color: #15803D; }
.ov-state--d7 { background: #DBEAFE; color: #1D4ED8; }
.ov-state--d30 { background: #FEF3C7; color: #B45309; }
.ov-state--idle { background: #F1F5F9; color: #94A3B8; }
.ov-loading { grid-column: 1 / -1; padding: 24px; text-align: center; color: #94A3B8; font-size: 12px; background: #fff; border: 1px solid #E2E8F0; border-radius: 6px; }

@media (max-width: 1280px) {
  .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid, .ov-grid--even { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ov-stats { grid-template-columns: 1fr; }
  .ov-kpis { grid-template-columns: 1fr; }
  .ov-search { width: 100%; }
  .ov-card-head { flex-direction: column; align-items: stretch; }
}

/* ---- papel: escopo em duas etapas (modulo -> menus) ---- */
.sm-scope-hint { font-size: 11px; color: #64748B; margin: 2px 0 8px; }
.sm-scope-split { display: flex; gap: 12px; align-items: stretch; }
.sm-scope-mods, .sm-scope-menus {
  border: 1px solid #E2E8F0; border-radius: 4px; padding: 10px 12px;
  max-height: 264px; overflow-y: auto;
}
.sm-scope-mods { width: 220px; flex-shrink: 0; }
.sm-scope-menus { flex: 1; min-width: 0; }
.sm-scope-mods .check, .sm-scope-checks .check {
  display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; cursor: pointer;
}
.sm-scope-group + .sm-scope-group { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #E2E8F0; }
.sm-scope-group-title { font-size: 11px; color: #64748B; margin-bottom: 6px; }
.sm-scope-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.sm-scope-empty { font-size: 12px; color: #94A3B8; padding: 6px 0; }
@media (max-width: 640px) {
  .sm-scope-split { flex-direction: column; }
  .sm-scope-mods { width: auto; }
}
