:root {
  --ink: #172033;
  --muted: #6d778b;
  --line: #e4e8ef;
  --soft: #f4f6fa;
  --paper: #ffffff;
  --navy: #101a2d;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #11865b;
  --amber: #b36a00;
  --red: #c93d4c;
  --shadow: 0 18px 50px rgba(20, 31, 51, .08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--soft); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.muted { color: var(--muted); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(380px, .85fr); }
.auth-brand { display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 8vw, 120px); color: white; background: radial-gradient(circle at 15% 15%, #2858aa 0, transparent 34%), radial-gradient(circle at 85% 85%, #1d7f7a 0, transparent 32%), var(--navy); }
.auth-brand .eyebrow { color: #92b8ff; margin-top: 30px; }
.auth-brand h1 { margin: 0; max-width: 720px; font-size: clamp(42px, 5.3vw, 78px); line-height: 1.07; letter-spacing: -.055em; }
.auth-brand > p:not(.eyebrow) { max-width: 620px; color: #c6d1e5; line-height: 1.8; font-size: 17px; }
.auth-features { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.auth-features span { border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 9px 15px; color: #dce6f8; font-size: 13px; }
.auth-card-wrap { display: grid; place-items: center; padding: 36px; background: #edf1f6; }
.auth-card { width: min(430px, 100%); padding: 42px; border-radius: 24px; background: white; box-shadow: var(--shadow); }
.auth-card h2, .dialog-card h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.03em; }
.auth-card .muted { margin: 0 0 28px; line-height: 1.65; }
label { display: grid; gap: 8px; margin-bottom: 18px; color: #344056; font-size: 13px; font-weight: 700; }
label small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; outline: none; color: var(--ink); background: white; transition: .18s border, .18s box-shadow; }
input:focus, select:focus, textarea:focus { border-color: #78a1f6; box-shadow: 0 0 0 3px rgba(37,99,235,.11); }
textarea { resize: vertical; }
.primary, .secondary, .danger, .white-button, .text-button, .icon-button, .menu-button { border: 0; border-radius: 10px; font-weight: 750; }
.primary { padding: 11px 16px; color: white; background: var(--blue); box-shadow: 0 8px 20px rgba(37,99,235,.18); }
.primary:hover { background: var(--blue-dark); }
.secondary { padding: 10px 14px; color: #334056; background: #eef2f7; border: 1px solid #e1e6ee; }
.secondary:hover { background: #e5eaf2; }
.danger { padding: 10px 14px; color: #a62234; background: #fdecef; border: 1px solid #f8d3d9; }
.danger:hover { color: white; background: #bd3042; }
.white-button { padding: 12px 18px; color: var(--navy); background: white; }
.wide { width: 100%; margin-top: 8px; padding: 13px; }
.text-button { padding: 7px 0; color: var(--blue); background: transparent; }
.icon-button, .menu-button { width: 38px; height: 38px; color: var(--muted); background: #eef2f7; font-size: 23px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 18px 20px; color: #d9e2f0; background: var(--navy); z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 27px; }
.brand strong { display: block; color: white; font-size: 18px; }
.brand small { display: block; margin-top: 3px; color: #8795ad; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: white; background: linear-gradient(135deg, #397af7, #21a38c); font-weight: 900; box-shadow: 0 8px 20px rgba(37,99,235,.3); }
.brand-mark.large { width: 55px; height: 55px; border-radius: 16px; font-size: 24px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 11px; padding: 11px 12px; color: #a9b5c7; background: transparent; text-align: left; font-weight: 700; }
.nav-item span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.06); font-size: 11px; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.09); }
.nav-item.active span { color: white; background: var(--blue); }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 18px 9px 0; }
.user-chip { display: flex; gap: 10px; align-items: center; }
.user-chip strong, .user-chip small { display: block; }
.user-chip small { margin-top: 2px; color: #7f8ca2; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: #34435d; font-weight: 800; }
.sidebar-foot .text-button { margin-top: 12px; color: #9babbe; }
.main { min-width: 0; padding: 0 clamp(22px, 4vw, 54px) 50px; }
.topbar { min-height: 112px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.topbar .eyebrow { margin-bottom: 5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.clock { color: var(--muted); font-size: 13px; }
.menu-button { display: none; }
.view { display: none; padding-top: 30px; }
.active-view { display: block; }
.hero-card { min-height: 210px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 38px; border-radius: 22px; color: white; background: radial-gradient(circle at 82% 18%, rgba(74,194,174,.55), transparent 31%), linear-gradient(125deg, #12203a, #234574); box-shadow: var(--shadow); }
.hero-card .eyebrow { color: #83b4ff; }
.hero-card h2 { max-width: 720px; margin: 0; font-size: clamp(28px, 3vw, 43px); line-height: 1.15; letter-spacing: -.045em; }
.hero-card p:not(.eyebrow) { margin: 13px 0 0; color: #cbd7e8; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.metric-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin-top: 10px; font-size: 30px; letter-spacing: -.03em; }
.metric-card em { display: inline-block; margin-top: 10px; color: var(--green); font-size: 12px; font-style: normal; }
.integrity-alert { display: grid; gap: 5px; margin: -4px 0 20px; border: 1px solid #f3c7ce; border-radius: 13px; padding: 14px 16px; color: #8f2232; background: #fff1f3; font-size: 12px; }
.integrity-alert strong { font-size: 13px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.panel { border: 1px solid var(--line); border-radius: 17px; padding: 24px; background: white; box-shadow: 0 8px 24px rgba(20,31,51,.035); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-head h3 { margin: 0; font-size: 19px; }
.panel-head .muted { margin: 5px 0 0; }
.panel-head.wrap { flex-wrap: wrap; }
.list-stack { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #edf0f4; }
.list-item:first-child { border-top: 0; }
.list-item .item-main { min-width: 0; flex: 1; }
.list-item strong, .list-item small { display: block; }
.list-item small { margin-top: 4px; color: var(--muted); }
.list-item .count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.color-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.title-line { display: flex; align-items: center; gap: 10px; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-toolbar p { margin: 0; }
.group-grid { display: grid; gap: 18px; }
.group-tree-node { min-width: 0; }
.group-node-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.group-children { display: grid; gap: 12px; margin: 12px 0 0 17px; padding-left: 27px; border-left: 2px solid #dce5f2; }
.group-children[hidden] { display: none; }
.group-toggle, .group-toggle-spacer { width: 34px; min-width: 34px; height: 44px; border: 0; border-radius: 10px; background: #edf3fb; color: var(--blue-dark); font-size: 18px; font-weight: 900; }
.group-toggle:hover { background: #dfeaf9; }
.group-toggle-spacer { display: block; background: transparent; }
.group-node-actions { display: grid; grid-template-columns: 96px 96px 92px; gap: 8px; }
.upload-group, .add-subgroup { min-height: 52px; border-radius: 14px; padding: 10px 9px; font-weight: 800; }
.upload-group { border: 1px solid #c8d8f4; color: white; background: var(--blue); }
.upload-group:hover { background: var(--blue-dark); }
.add-subgroup { min-width: 92px; border: 1px dashed #9eb1ce; color: var(--blue-dark); background: #f4f7fc; }
.add-subgroup:hover { border-color: var(--blue); background: #edf4ff; }
.group-card { border: 1px solid var(--line); border-radius: 16px; padding: 21px; background: white; text-align: left; transition: .18s transform, .18s box-shadow, .18s border; }
.group-card:hover, .group-card.selected { transform: translateY(-2px); border-color: #b8caf1; box-shadow: var(--shadow); }
.group-card .group-top { display: flex; align-items: center; justify-content: space-between; }
.group-card .group-top > span:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.group-level-tag { border-radius: 999px; padding: 4px 8px; color: #526078; background: #edf1f6; font-size: 10px; font-weight: 800; }
.group-card h3 { margin: 16px 0 6px; font-size: 18px; }
.group-card p { height: 38px; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.5; }
.group-card footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 19px; padding-top: 14px; border-top: 1px solid #edf0f4; color: var(--muted); font-size: 12px; }
.group-card .group-count { font-size: 24px; font-weight: 850; color: var(--ink); }
.group-count-wrap { display: grid; justify-items: end; gap: 1px; }
.group-count-wrap small { color: var(--muted); font-size: 10px; font-weight: 700; }
.group-breadcrumb { margin: 0 0 7px; color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.group-detail { margin-top: 20px; }
.trash-panel { margin-top: 20px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 20px; }
.mini-stat { padding: 13px; border-radius: 12px; background: var(--soft); }
.mini-stat span { display: block; color: var(--muted); font-size: 11px; }
.mini-stat strong { display: block; margin-top: 6px; font-size: 18px; }
.table-tools { display: flex; align-items: flex-end; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.table-tools label { margin: 0; }
.search-field { flex: 1; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 10px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; letter-spacing: .04em; }
td { padding: 14px 10px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.pending, .badge.neutral { color: #6e7787; background: #eef1f5; }
.badge.valid, .badge.success { color: #0b714c; background: #e4f6ef; }
.badge.invalid, .badge.failed { color: #b42f40; background: #fdecef; }
.badge.unknown { color: #925700; background: #fff3dc; }
.badge.duplicate { color: #6741a5; background: #f0eaff; }
.badge.problem { color: #a94b16; background: #fff0e5; }
.problem-analysis-grid { align-items: start; }
.analysis-bars, .insight-stack { display: grid; gap: 16px; }
.analysis-bar-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 13px; }
.analysis-bar-row span { color: var(--muted); font-size: 12px; }
.analysis-track { height: 9px; overflow: hidden; border-radius: 99px; background: #edf1f6; }
.analysis-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #78a8ff); }
.insight-item { display: grid; gap: 5px; padding: 14px; border-radius: 12px; background: var(--soft); }
.insight-item strong { font-size: 13px; }
.insight-item span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: 145px 110px 120px 1fr; gap: 16px; padding: 15px 0; border-top: 1px solid #edf0f4; }
.audit-row:first-child { border-top: 0; }
.audit-row time, .audit-row span { color: var(--muted); font-size: 12px; }
.audit-row strong { font-size: 13px; }
.audit-row .audit-actor { color: var(--blue-dark); }
.audit-list.compact .audit-row { grid-template-columns: 135px 100px 105px 1fr; padding: 11px 0; }
.employee-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(560px, 1fr); gap: 20px; align-items: start; }
.employee-form .muted { margin: -8px 0 22px; line-height: 1.6; }
.employee-list-panel { min-width: 0; }
.user-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.user-actions .secondary { padding: 7px 10px; font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-card { align-self: start; }
.settings-card .panel-head { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.security-description { margin: 0 0 20px; line-height: 1.65; }
.security-meta { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 0; }
.switch-row input { width: 44px; height: 24px; accent-color: var(--blue); }
.settings-save { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.flowpilot-hero { margin-bottom: 20px; background: radial-gradient(circle at 82% 18%, rgba(45, 212, 191, .48), transparent 31%), linear-gradient(125deg, #10233f, #185a65); }
.flowpilot-hero .button-row { justify-content: flex-end; }
.flowpilot-grid { align-items: start; }
.flowpilot-wide { margin-bottom: 20px; }
.flowpilot-route-form { grid-template-columns: minmax(160px, .8fr) minmax(150px, .6fr) minmax(240px, 1fr) minmax(240px, 1fr) auto; align-items: end; }
.flowpilot-route-form textarea { min-height: 70px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.inline-form input { min-width: 0; }
.inline-form input:first-child { flex: 1; }
.chip-list { display: flex; flex-wrap: wrap; gap: 9px; }
.flow-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #dce3ed; border-radius: 999px; padding: 6px 7px 6px 11px; color: #344056; background: #f5f7fa; font-size: 12px; font-weight: 700; }
.flow-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; color: #a62234; background: #fdecef; font-weight: 900; }
.compact-flow-table { max-height: 430px; margin-top: 18px; overflow: auto; }
.compact-flow-table th { position: sticky; top: 0; background: white; z-index: 1; }
.flowpilot-events { display: grid; max-height: 520px; overflow: auto; }
.flowpilot-event { display: grid; grid-template-columns: 92px minmax(120px, .7fr) minmax(200px, 1.3fr); gap: 12px; padding: 12px 0; border-top: 1px solid #edf0f4; font-size: 12px; }
.flowpilot-event:first-child { border-top: 0; }
.flowpilot-event time, .flowpilot-event span { color: var(--muted); }
.flowpilot-event.error strong { color: var(--red); }
.flowpilot-event.success strong { color: var(--green); }
dialog { width: min(520px, calc(100vw - 28px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 30px 90px rgba(11,21,39,.28); }
dialog::backdrop { background: rgba(13, 22, 37, .58); backdrop-filter: blur(4px); }
.dialog-card { padding: 28px; }
.dialog-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.setup-steps { margin: 0 0 22px; padding-left: 22px; color: #3d4960; font-size: 13px; line-height: 1.8; }
.secret-row { display: flex; align-items: center; gap: 10px; }
.secret-code { min-width: 0; flex: 1; border-radius: 10px; padding: 13px; overflow-wrap: anywhere; color: #173b7a; background: #edf4ff; font-family: Consolas, "Courier New", monospace; font-size: 15px; font-weight: 800; letter-spacing: .06em; }
.authenticator-link { display: inline-block; margin: -4px 0 14px; text-decoration: none; font-size: 13px; }
.small-note { margin: 0 0 18px; font-size: 12px; line-height: 1.6; }
.recovery-codes { font-family: Consolas, "Courier New", monospace; font-size: 15px; letter-spacing: .08em; line-height: 1.7; }
.delete-warning { border-radius: 11px; padding: 13px 14px; color: #9f2435; background: #fff0f2; font-size: 13px; line-height: 1.6; }
.drop-zone { position: relative; place-items: center; padding: 27px; border: 1.5px dashed #aebcd3; border-radius: 14px; background: #f7f9fc; text-align: center; cursor: pointer; }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-zone span { color: var(--muted); font-size: 12px; font-weight: 500; }
.quality-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; background: linear-gradient(135deg, #fff, #f3f7ff); }
.quality-hero h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.035em; }
.quality-hero p { max-width: 760px; margin: 0; line-height: 1.65; }
.quality-quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.quality-tabs { display: flex; gap: 6px; margin-bottom: 18px; padding: 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: white; }
.quality-tab { flex: 0 0 auto; border: 0; border-radius: 9px; padding: 10px 15px; color: var(--muted); background: transparent; font-weight: 800; }
.quality-tab.active { color: white; background: var(--navy); }
.quality-pane { display: none; }
.quality-pane.active { display: block; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; padding-bottom: 6px; }
.filter-grid label { margin: 0; }
.filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.compact-filter-grid { grid-template-columns: repeat(4, minmax(170px, 1fr)); }
.quality-notice { display: grid; gap: 5px; margin-bottom: 18px; border-left: 4px solid var(--blue); border-radius: 12px; padding: 13px 16px; color: #3f4c62; background: #edf4ff; font-size: 12px; line-height: 1.55; }
.quality-wide-table table { min-width: 1580px; }
.quality-analysis-grid { margin-top: 20px; align-items: start; }
.quality-trend { display: grid; gap: 8px; }
.quality-trend > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.quality-trend span { color: var(--muted); }
.quality-trend-bars { position: relative; height: 12px; overflow: hidden; border-radius: 99px; background: #edf1f6; }
.quality-trend-bars i, .quality-trend-bars b { position: absolute; inset-block: 0; left: 0; display: block; border-radius: inherit; }
.quality-trend-bars i { background: linear-gradient(90deg, #2563eb, #79a5fa); }
.quality-trend-bars b { height: 4px; top: auto; background: #c93d4c; }
.compact-metrics { grid-template-columns: repeat(5, minmax(115px, 1fr)); gap: 10px; }
.compact-metrics .metric-card { padding: 14px; }
.compact-metrics .metric-card strong { font-size: 22px; }
.quality-settings-card { max-width: 920px; margin-top: 20px; }
.wide-dialog { width: min(980px, calc(100vw - 28px)); }
.quality-import-card, .quality-batch-card { max-height: 88vh; overflow-y: auto; }
.quality-import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quality-import-grid label { min-width: 0; }
.quality-mapping { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--soft); }
.quality-mapping h3 { margin: 0 0 5px; }
.mapping-grid { grid-template-columns: repeat(5, 1fr); }
.quality-preview-table { max-height: 300px; margin-top: 14px; }
.quality-preview-table table { min-width: 720px; }
.quality-batch-card fieldset { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.quality-batch-card legend { padding: 0 6px; color: #344056; font-size: 13px; font-weight: 800; }
.channel-choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.channel-choice-grid label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 8px; margin: 0; border: 1px solid var(--line); border-radius: 11px; padding: 10px; background: white; }
.channel-choice-grid input { grid-row: 1 / 3; width: 18px; height: 18px; }
.channel-choice-grid small { margin: 0; }
.batch-confirm-switch { min-height: 70px; margin: 0; }
.quality-record-check, #qualityRecordSelectAll { width: 17px; height: 17px; accent-color: var(--blue); }
.loading-overlay { position: fixed; inset: 0; display: grid; place-content: center; gap: 14px; background: rgba(244,246,250,.82); backdrop-filter: blur(5px); z-index: 100; text-align: center; }
.spinner { width: 40px; height: 40px; margin: auto; border: 3px solid #dfe6f1; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; right: 22px; bottom: 22px; display: grid; gap: 10px; z-index: 120; }
.toast { min-width: 280px; max-width: 420px; border-left: 4px solid var(--blue); border-radius: 11px; padding: 14px 16px; color: white; background: #172238; box-shadow: var(--shadow); animation: enter .2s ease; }
.toast.error { border-left-color: #ff6b7a; }
@keyframes enter { from { transform: translateY(8px); opacity: 0; } }
.empty { padding: 34px 12px; color: var(--muted); text-align: center; }
@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .employee-grid { grid-template-columns: 1fr; }
  .filter-grid, .compact-filter-grid { grid-template-columns: 1fr 1fr; }
  .mapping-grid, .channel-choice-grid { grid-template-columns: 1fr 1fr; }
  .flowpilot-route-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 340px; padding: 45px 30px; }
  .auth-brand h1 { font-size: 42px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -270px; width: 250px; transition: left .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { left: 0; }
  .menu-button { display: grid; place-items: center; }
  .main { padding-inline: 18px; }
  .topbar { min-height: 94px; }
  .clock { display: none; }
  .two-column, .settings-grid { grid-template-columns: 1fr; }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .quality-hero { align-items: flex-start; flex-direction: column; }
  .quality-quick-actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .auth-card-wrap { padding: 20px; }
  .auth-card { padding: 28px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 16px; }
  .metric-card strong { font-size: 24px; }
  .group-node-row { grid-template-columns: 30px minmax(0, 1fr); }
  .group-node-actions { grid-column: 2; grid-template-columns: 1fr 1fr 1fr; }
  .group-children { margin-left: 14px; padding-left: 14px; }
  .top-actions .secondary { display: none; }
  .section-toolbar, .panel-head { align-items: flex-start; flex-direction: column; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .table-tools, .form-row { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .audit-row, .audit-list.compact .audit-row { grid-template-columns: 1fr; gap: 5px; }
  .quality-import-grid, .filter-grid, .compact-filter-grid, .mapping-grid, .channel-choice-grid { grid-template-columns: 1fr; }
  .compact-metrics { grid-template-columns: 1fr 1fr; }
  .flowpilot-route-form { grid-template-columns: 1fr; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .flowpilot-event { grid-template-columns: 1fr; gap: 4px; }
}
