/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--color-accent); border-radius: var(--radius-ctl); background: var(--color-accent); color: var(--color-on-accent);
  font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.outline { background: var(--white); color: var(--color-neutral-800); border-color: var(--color-border-strong); }
.btn.outline:hover { background: var(--bg-hover); border-color: var(--color-neutral-400); }
.btn.ghost { background: none; border-color: transparent; color: var(--color-neutral-700); }
.btn.ghost:hover { background: var(--bg-hover); }
.btn.danger { background: var(--white); color: var(--bad); border-color: var(--bad-border); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.danger.solid { background: var(--white); color: var(--bad); border-color: var(--bad-border); }
/* per-row actions are always secondary: only the page (or the open dialog) gets a green fill */
table.tbl td .btn:not(.danger):not(.ghost), .notif-item .btn:not(.danger):not(.ghost), .rule-card .btn:not(.danger):not(.ghost), .inbox-list .btn:not(.danger):not(.ghost), .table-card .btn:not(.danger):not(.ghost) { background: var(--white); color: var(--color-neutral-800); border-color: var(--color-border-strong); }
table.tbl td .btn:not(.danger):not(.ghost):hover, .notif-item .btn:not(.danger):not(.ghost):hover, .rule-card .btn:not(.danger):not(.ghost):hover, .inbox-list .btn:not(.danger):not(.ghost):hover, .table-card .btn:not(.danger):not(.ghost):hover { background: var(--bg-hover); border-color: var(--color-neutral-400); }
.btn.sm { height: 28px; padding: 0 10px; font-size: var(--fs-table); }
.btn.full { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--color-link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- form controls ---------- */
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=email], select, textarea, .input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-ctl);
  background: var(--white); color: var(--color-text); font: inherit;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
select { padding-right: 24px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }
input:disabled, select:disabled, textarea:disabled { background: var(--color-neutral-100); color: var(--color-text-muted); }
label.field { display: block; font-size: var(--fs-label); color: var(--color-neutral-700); font-weight: 500; }
label.field > .input, label.field > input, label.field > select, label.field > textarea { margin-top: 4px; font-weight: 400; }
.field-hint { font-size: var(--fs-label); color: var(--color-text-muted); margin-top: 4px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 160px; }
.form-error { color: var(--bad); font-size: var(--fs-label); margin-top: 6px; }

.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: var(--radius-lg); background: var(--color-neutral-300); transition: background .12s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--radius-full); background: var(--white); transition: transform .12s; }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--color-accent-500); outline-offset: 2px; }

/* ---------- badges: pale tint of the status colour ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: var(--radius-pill); border: 1px solid transparent; background: var(--n50); color: var(--ink); font-size: var(--fs-label); font-weight: 500; white-space: nowrap; line-height: 18px; }
.badge.grey { color: var(--n600); }
.badge.tier-gold { background: var(--green-tint); border-color: var(--green); }
.badge.tier-silver { background: var(--green-tint); }
.badge.tier-bronze { background: var(--n50); }
.dot-s { display: inline-block; width: 8px; height: 8px; border-radius: var(--radius-full); flex: none; background: var(--n600); }
.dot-s.green, .badge.s-green::before { background: var(--green-text); }
.dot-s.amber, .badge.s-amber::before { background: var(--amber); }
.dot-s.alert, .badge.s-alert::before { background: var(--alert); }
.badge.s-green::before, .badge.s-amber::before, .badge.s-alert::before { content: ''; width: 7px; height: 7px; border-radius: var(--radius-full); flex: none; }
.next-order { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.badge.good::before, .badge.bad::before { content: ''; width: 7px; height: 7px; border-radius: var(--radius-full); flex: none; }
.badge.good::before { background: var(--green-text); }
.badge.bad::before { background: var(--alert); }   /* dots: good and at-risk only. Medium, New and the rest get none */

/* ---------- panels, cards ---------- */
.panel { background: var(--bg-panel); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 16px; margin-bottom: 16px; }
.panel > h2, .panel-head h2 { margin-bottom: 4px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel.flush { padding: 0; overflow: hidden; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { background: var(--bg-panel); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 14px 16px; }
.metric .label { font-size: var(--fs-label); color: var(--color-text-muted); }
.metric .value { font-size: 24px; font-weight: 600; margin: 2px 0 6px; letter-spacing: -0.02em; }
.metric .cmp { font-size: var(--fs-label); color: var(--color-text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.up { color: var(--good); } .down { color: var(--bad); }

/* ---------- data table ---------- */
.table-wrap { background: var(--bg-panel); border: 1px solid var(--color-border); border-radius: var(--radius-card); overflow: hidden; position: relative; }
.table-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.table-toolbar .grow { flex: 1; min-width: 0; }
.table-toolbar .search { position: relative; width: 260px; max-width: 100%; }
.table-toolbar .search .i { position: absolute; left: 10px; top: 9px; color: var(--color-text-muted); }
.table-toolbar .search input { padding-left: 32px; }
.table-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-table); }
table.tbl th { text-align: left; font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); padding: 0 12px; height: 38px; background: var(--color-neutral-100); border-bottom: 1px solid var(--color-border); white-space: nowrap; user-select: none; }
table.tbl th.sortable { cursor: pointer; }
table.tbl th.sortable:hover { color: var(--color-text); }
table.tbl th .sort { display: inline-block; width: 10px; color: var(--ink); }
table.tbl td { padding: 0 12px; height: var(--row-h); border-bottom: 1px solid var(--color-border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.clickable:hover td { background: var(--bg-hover); }
table.tbl tbody tr.selected td { background: var(--n50); }
table.tbl tbody tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--green); }
table.tbl td a { color: var(--ink); font-weight: 500; }
table.tbl td a:hover { text-decoration: underline; }
table.tbl td.chk, table.tbl th.chk { width: 40px; padding-right: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl td.state { height: 120px; text-align: center; color: var(--color-text-muted); }
.cell-main { font-weight: 500; }
.cell-sub { color: var(--color-text-muted); font-size: var(--fs-label); line-height: 1.3; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--color-border); font-size: var(--fs-table); color: var(--color-text-muted); }
.pager { display: flex; align-items: center; gap: 6px; }
.bulk-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--color-neutral-800); color: var(--white);
  border-radius: var(--radius-card); transition: transform .15s ease, opacity .15s ease; max-width: calc(100vw - 24px); flex-wrap: wrap;
}
.bulk-bar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.bulk-bar .count { font-weight: 600; margin-right: 6px; }
.bulk-bar .btn { background: transparent; border-color: color-mix(in srgb, var(--white) 35%, transparent); color: var(--white); height: 30px; }
.bulk-bar .btn:hover { background: color-mix(in srgb, var(--white) 12%, transparent); }
.bulk-bar .btn:disabled { opacity: .45; }

/* ---------- menus (columns, views, row actions) ---------- */
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 200px; z-index: 50; background: var(--white); border: 1px solid var(--color-border-strong); border-radius: var(--radius-card); padding: 4px; box-shadow: var(--shadow); }
.menu.left { right: auto; left: 0; }
.menu button, .menu .menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--radius-md); color: var(--color-text); }
.menu button:hover { background: var(--bg-hover); }
.menu button.danger { color: var(--bad); }
.menu button:disabled { color: var(--color-neutral-400); cursor: not-allowed; }
.menu hr { border: 0; border-top: 1px solid var(--color-border); margin: 4px 0; }
.menu label { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; }
.menu .menu-title { padding: 6px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }

/* ---------- filter panel + layout with it ---------- */
.with-filters { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 16px; align-items: start; }
.with-filters.no-filters { grid-template-columns: minmax(0, 1fr); }
.filters { background: var(--bg-panel); border: 1px solid var(--color-border); border-radius: var(--radius-card); position: sticky; top: 12px; max-height: calc(100vh - var(--topbar-h) - 28px); overflow-y: auto; }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.filters-head .n { background: var(--ink); color: var(--white); border-radius: var(--radius-pill); padding: 0 7px; font-size: 11px; margin-left: 6px; }
.filter-sec { border-bottom: 1px solid var(--color-border); }
.filter-sec:last-of-type { border-bottom: 0; }
.filter-sec > button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 14px; border: 0; background: none; cursor: pointer; font-weight: 500; color: var(--color-text); }
.filter-sec .body { padding: 0 14px 12px; display: none; }
.filter-sec.open .body { display: block; }
.filter-sec.open > button .i { transform: rotate(180deg); }
.filter-sec .opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: var(--fs-table); }
.filter-sec .range { display: flex; gap: 6px; align-items: center; }
.filter-sec .range input { height: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 4px 1px 8px; border-radius: var(--radius-pill); background: var(--color-accent-100); border: 1px solid var(--color-accent-300); color: var(--ink); font-size: var(--fs-label); }
.chip button { border: 0; background: none; cursor: pointer; color: inherit; display: grid; place-items: center; padding: 2px; border-radius: var(--radius-full); }
.chip button:hover { background: var(--color-accent-200); }
.filters-foot { padding: 12px 14px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 1100px) { .with-filters { grid-template-columns: minmax(0, 1fr); } .filters { position: static; max-height: none; } }

/* ---------- side panel, modal ---------- */
.overlay { position: fixed; inset: 0; background: var(--scrim); z-index: 70; opacity: 0; transition: opacity .15s; }
.overlay.show { opacity: 1; }
.sidepanel { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100vw; z-index: 71; background: var(--white); border-left: 1px solid var(--color-border-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .18s ease; }
.sidepanel.show { transform: none; }
.sidepanel header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--color-border); }
.sidepanel .sp-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.sidepanel .sp-foot { padding: 12px 18px; border-top: 1px solid var(--color-border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal { position: fixed; z-index: 80; left: 50%; top: 14vh; transform: translateX(-50%); width: 440px; max-width: calc(100vw - 24px); background: var(--white); border: 1px solid var(--color-border-strong); border-radius: var(--radius-card); padding: 20px; box-shadow: var(--shadow); }
.modal h2 { margin-bottom: 8px; }
.modal .m-body { color: var(--color-neutral-700); margin-bottom: 18px; }
.modal .m-body ul { margin: 8px 0 0; padding-left: 18px; }
.modal .m-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.palette { top: 12vh; width: 600px; padding: 0; overflow: hidden; }
.palette input { height: 48px; border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; font-size: 15px; padding: 0 16px; }
.palette input:focus { outline: none; }
.palette .results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette .group { padding: 6px 10px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }
.palette .row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-ctl); cursor: pointer; }
.palette .row.active, .palette .row:hover { background: var(--n50); }
.palette .row .sub { margin-left: auto; color: var(--color-text-muted); font-size: var(--fs-label); }

/* ---------- toasts, banners, empty ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--color-neutral-800); color: var(--white); border-radius: var(--radius-card); max-width: 380px; animation: toast-in .16s ease; }
.toast.error::before { content: ''; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--alert); flex: none; }
.toast button { background: none; border: 0; color: var(--white); text-decoration: underline; cursor: pointer; padding: 0; font-weight: 600; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; border-radius: var(--radius-card); border: 1px solid var(--color-border); background: var(--n50); color: var(--ink); }
.banner:not(.info)::before { content: ''; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--alert); flex: none; }
.banner:not(.info) > svg.i { display: none; }   /* the alert dot is the signal, not an icon */
.banner .grow { flex: 1; }
.banner a, .banner .link-btn { color: inherit; font-weight: 600; text-decoration: underline; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--color-text-muted); }
.empty-state .ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--color-neutral-200); margin-bottom: 10px; }
.empty-state p { margin: 0 0 14px; }
.state-msg { padding: 28px; text-align: center; color: var(--color-text-muted); }

/* ---------- tabs, key-value, steps ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs button:hover { color: var(--color-text); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--color-accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--color-text-muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.split.wide { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 1000px) { .split, .split.wide { grid-template-columns: minmax(0, 1fr); } }
.step { padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.step:last-child { border-bottom: 0; }
.step h3 { display: flex; align-items: center; gap: 10px; font-size: var(--fs-section); margin-bottom: 10px; }
.step h3 .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-full); background: var(--ink); color: var(--white); font-size: 12px; }

/* ---------- WhatsApp bubble preview ---------- */
.wa-phone { background: var(--wa-chat-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 14px; min-height: 160px; }
.wa-bubble { background: var(--white); border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md); padding: 8px 10px 6px; max-width: 290px; white-space: pre-wrap; }
.wa-bubble .time { text-align: right; font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.wa-caption { font-size: var(--fs-label); color: var(--color-text-muted); margin-bottom: 8px; }

/* ---------- sentence cards ---------- */
.sentence { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--bg-panel); margin-bottom: 8px; }
.sentence select, .sentence input { width: auto; height: 28px; border: 0; border-bottom: 2px solid var(--color-accent-300); border-radius: 0; background: transparent; color: var(--ink); font-weight: 600; padding: 0 2px; }
.sentence .rm { margin-left: auto; }
.sentence-read { padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.sentence-read:last-child { border-bottom: 0; }
.sentence-read u { text-decoration: none; border-bottom: 2px solid var(--color-accent-300); color: var(--ink); font-weight: 600; }

/* ---------- notifications panel ---------- */
.notif-panel { position: absolute; right: 0; top: 44px; width: 380px; max-width: calc(100vw - 24px); max-height: 480px; overflow-y: auto; z-index: 60; background: var(--white); border: 1px solid var(--color-border-strong); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--color-border); position: sticky; top: 0; background: var(--white); }
.notif-item { padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.notif-item.unread { background: var(--color-accent-50); }
.notif-item .t { font-weight: 600; }
.notif-item .b { color: var(--color-text-muted); margin-top: 2px; font-size: var(--fs-table); }
.notif-item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.notif-item .w { font-size: var(--fs-label); color: var(--color-text-muted); }

/* ---------- inbox (reviews) ---------- */
.inbox { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 0; background: var(--bg-panel); border: 1px solid var(--color-border); border-radius: var(--radius-card); overflow: hidden; min-height: 520px; }
.inbox-list { border-right: 1px solid var(--color-border); overflow-y: auto; max-height: calc(100vh - 230px); }
.inbox-item { padding: 12px 14px; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.inbox-item:hover { background: var(--bg-hover); }
.inbox-item.active { background: var(--color-accent-50); box-shadow: inset 3px 0 0 var(--color-accent); }
.inbox-detail { padding: 20px; }
.stars { color: var(--ink); letter-spacing: 1px; }
@media (max-width: 900px) { .inbox { grid-template-columns: 1fr; } .inbox-list { max-height: 320px; border-right: 0; border-bottom: 1px solid var(--color-border); } }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 28px; }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: -2px; width: 1px; background: var(--color-border); }
.timeline li:last-child::before { display: none; }
.timeline li .dot { position: absolute; left: 0; top: 4px; width: 15px; height: 15px; border-radius: var(--radius-full); background: var(--white); border: 2px solid var(--color-accent-300); }
.timeline li.order .dot { border-color: var(--color-accent); }
.timeline li.review .dot { border-color: var(--ink); }
.timeline li.message .dot { border-color: var(--color-neutral-400); }

/* ---------- misc ---------- */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-menu { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; }
.settings-menu button { text-align: left; padding: 8px 12px; border: 0; background: none; border-radius: var(--radius-ctl); cursor: pointer; color: var(--color-neutral-700); }
.settings-menu button:hover { background: var(--bg-hover); }
.settings-menu button.active { background: var(--color-accent-100); color: var(--ink); font-weight: 600; }
@media (max-width: 860px) { .settings-layout { grid-template-columns: 1fr; } .settings-menu { position: static; flex-direction: row; overflow-x: auto; } }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hr { border: 0; border-top: 1px solid var(--color-border); margin: 14px 0; }
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.table-card { display: block; border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 12px; color: inherit; background: var(--white); }
.table-card:hover { border-color: var(--color-accent-300); text-decoration: none; }
.table-card .t-name { font-weight: 600; }
.table-card .t-amount { margin-top: 6px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.filter-chips button { border: 1px solid var(--color-border); background: var(--white); border-radius: var(--radius-full); padding: 3px 11px; font-size: 12.5px; cursor: pointer; color: var(--color-text); }
.filter-chips button.active { background: var(--n50); border-color: var(--ink); color: var(--ink); font-weight: 600; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat-row > div { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 8px 14px; min-width: 96px; }
.stat-row b { display: block; font-size: 18px; }
.cond-builder .cond, .cond-builder .cond-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--white); }
.cond-builder .cond-group { flex-direction: column; align-items: stretch; background: var(--color-neutral-50); }
.cond-builder .cond-group .cond { margin-bottom: 0; }
.cond-builder .cond-val { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cond-builder .cond-join { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cond-builder .w { color: var(--color-text-muted); font-size: 13px; }
.cond-builder .cond-actions { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.cond-builder select, .cond-builder input[type=text], .cond-builder input[type=number], .cond-builder input[type=date] { height: 32px; }
.cond-builder .icon-btn { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--color-text-muted); font-size: 14px; }
.chip-checks { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip-check { border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: 2px 10px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.counts-card { display: flex; gap: 22px; margin-bottom: 10px; }
.counts-card b { display: block; font-size: 26px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } }
.cond-builder .cond select, .cond-builder .cond input[type=text], .cond-builder .cond input[type=number], .cond-builder .cond input[type=date] { width: auto; min-width: 120px; max-width: 260px; }
.cond-builder .cond-join select { width: auto; min-width: 190px; }
.cond-builder input[type=number] { min-width: 90px; max-width: 120px; }
.wa-btns { border-top: 1px solid var(--n200); margin: 8px -10px -6px; }
.wa-btn { text-align: center; color: var(--wa-link); padding: 7px 4px; border-top: 1px solid var(--n200); font-size: 13px; }
.wa-btn:first-child { border-top: 0; }
.wa-img { background: var(--wa-media-bg); border-radius: var(--radius-md); min-height: 80px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; color: var(--wa-media-fg); font-size: 12px; overflow: hidden; }
.field-label { font-size: 13px; font-weight: 500; }
.steps-list { margin: 6px 0 0 18px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.rule-card { display: flex; gap: 12px; align-items: flex-start; background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 14px 16px; position: relative; }
.rule-card[draggable="true"] { cursor: grab; }
.rule-lead { font-weight: 600; color: var(--ink); min-width: 44px; padding-top: 4px; }
.rule-body { flex: 1; line-height: 2.1; }
.rule-handle { color: var(--color-text-muted); cursor: grab; padding-top: 4px; user-select: none; }
.rule-tools { display: flex; gap: 2px; }
.rule-plus { display: flex; justify-content: center; padding: 2px 0; }
.rule-plus .btn { border-radius: var(--radius-full); padding: 0 10px; height: 24px; line-height: 1; }
.rule-vars { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.rule-check { margin-top: 4px; padding-left: 10px; border-left: 3px solid var(--color-border); }
select.uline, input.uline { width: auto; display: inline-block; border: 0; border-bottom: 2px solid var(--color-accent); border-radius: 0; background: transparent; padding: 2px 4px; font: inherit; color: var(--ink); height: auto; min-width: 0; }
input.uline[type="number"] { text-align: center; }

.table-toolbar.boxed { background: var(--bg-panel); border: 1px solid var(--color-border); border-radius: var(--radius-card); }
