:root {
  --ink: #19211c;
  --muted: #6d756f;
  --faint: #98a09a;
  --line: #e4e8e3;
  --canvas: #f5f7f4;
  --paper: #ffffff;
  --green-950: #14372c;
  --green-900: #1c4939;
  --green-800: #245a47;
  --green-100: #e8f2ed;
  --lime: #d9f39e;
  --orange: #f5a623;
  --danger: #c95b50;
  --shadow: 0 1px 2px rgba(20, 55, 44, .04), 0 12px 28px rgba(20, 55, 44, .05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.5 "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(62, 122, 94, .22); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.sidebar { width: 246px; position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; padding: 27px 18px 18px; color: #dce7df; background: var(--green-950); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 29px; color: white; text-decoration: none; font: 700 24px/1 "Manrope", sans-serif; letter-spacing: -.8px; }
.brand-mark { width: 25px; height: 25px; position: relative; display: inline-block; }
.brand-mark i { position: absolute; width: 11px; height: 20px; top: 2px; border-radius: 10px 2px 10px 2px; transform: rotate(45deg); background: var(--lime); }
.brand-mark i:first-child { left: 3px; }
.brand-mark i:last-child { right: 3px; transform: rotate(225deg); opacity: .78; }
.brand-mark.small { transform: scale(.72); }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 9px; color: #b8c9bf; background: transparent; cursor: pointer; text-align: left; transition: .18s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); }
.nav-item.is-active { color: white; background: rgba(255,255,255,.1); box-shadow: inset 3px 0 0 var(--lime); }
.nav-icon { width: 18px; height: 18px; display: grid; place-items: center; }
[data-icon] svg { width: 18px; height: 18px; display: block; }
.nav-count { margin-left: auto; min-width: 23px; height: 22px; display: grid; place-items: center; border-radius: 12px; color: var(--green-950); background: var(--lime); font-size: 11px; font-weight: 700; }
.sidebar-bottom { margin-top: auto; }
.mode-card { margin: 16px 0 14px; padding: 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; background: rgba(255,255,255,.045); }
.mode-top { display: flex; align-items: center; gap: 8px; color: white; font-weight: 600; font-size: 12px; }
.signal-dot { width: 7px; height: 7px; border-radius: 50%; background: #8edba7; box-shadow: 0 0 0 4px rgba(142,219,167,.12); }
.mode-card p { margin: 7px 0 0 15px; color: #92a99c; font-size: 11px; line-height: 1.45; }
.profile { display: flex; align-items: center; gap: 10px; padding: 13px 5px 0; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--green-950); background: #f0c98b; font-weight: 700; font-size: 11px; }
.profile div:nth-child(2) { display: grid; }
.profile strong { color: white; font-size: 12px; font-weight: 600; }
.profile span { color: #8fa69a; font-size: 10px; }
.profile button { margin-left: auto; border: 0; color: #90a69b; background: transparent; cursor: pointer; }

.main { min-height: 100vh; margin-left: 246px; }
.topbar { height: 70px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.breadcrumb b { color: #c9ceca; font-weight: 400; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.icon-button { width: 38px; height: 38px; position: relative; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.icon-button i { width: 6px; height: 6px; position: absolute; top: 8px; right: 8px; border: 1px solid white; border-radius: 50%; background: var(--orange); }
.primary-button, .secondary-button, .inverted-button, .ghost-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border-radius: 9px; font-weight: 600; font-size: 12px; cursor: pointer; transition: .18s ease; }
.primary-button { border: 1px solid var(--green-900); color: white; background: var(--green-900); box-shadow: 0 4px 10px rgba(28,73,57,.14); }
.primary-button:hover { background: var(--green-800); transform: translateY(-1px); }
.primary-button.compact { min-height: 38px; }
.secondary-button { border: 1px solid #d9ded9; color: #36443b; background: white; }
.secondary-button:hover { border-color: #bfc8c1; background: #fbfcfb; }
.inverted-button { border: 0; color: var(--green-950); background: white; }
.ghost-button { border: 1px solid rgba(255,255,255,.28); color: white; background: transparent; }
.ghost-button:hover { background: rgba(255,255,255,.08); }
.mobile-menu { display: none; }

.content { max-width: 1560px; margin: 0 auto; padding: 36px 38px 60px; }
.view { display: none; animation: viewIn .25s ease; }
.view.is-visible { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 25px; }
.page-heading h1 { margin: 4px 0 4px; font: 700 clamp(25px, 2.1vw, 34px)/1.2 "Manrope", sans-serif; letter-spacing: -1.2px; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow, .overline { color: #6d7a71; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.heading-actions { display: flex; align-items: center; gap: 16px; }
.last-sync { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 11px; }
.last-sync i { width: 7px; height: 7px; border-radius: 50%; background: #5db57e; }
.last-sync b { color: var(--muted); font-weight: 500; }
.compact-heading { align-items: center; margin-bottom: 28px; }
.compact-heading h1 { margin-top: 3px; }

.flow-card { min-height: 254px; position: relative; display: grid; grid-template-columns: 45% 55%; overflow: hidden; border-radius: 15px; color: white; background: radial-gradient(circle at 80% 20%, rgba(113,171,133,.16), transparent 32%), linear-gradient(125deg, #183c30, #1d4a39); box-shadow: 0 18px 40px rgba(20,55,44,.12); }
.flow-card::after { content: ""; position: absolute; width: 300px; height: 300px; right: -140px; bottom: -170px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.flow-copy { padding: 36px 40px; }
.flow-copy .overline { color: #a8d2b5; }
.flow-copy h2 { max-width: 420px; margin: 8px 0 10px; font: 600 clamp(22px, 2vw, 30px)/1.2 "Manrope", sans-serif; letter-spacing: -.8px; }
.flow-copy p { max-width: 525px; margin: 0; color: #bad0c4; font-size: 13px; line-height: 1.7; }
.flow-actions { display: flex; gap: 10px; margin-top: 23px; }
.flow-visual { position: relative; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 35px 34px; }
.flow-visual::before { content: ""; position: absolute; width: 72%; height: 1px; background: rgba(255,255,255,.14); }
.system-node { min-width: 145px; height: 82px; position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: rgba(255,255,255,.075); box-shadow: 0 12px 22px rgba(5,24,17,.16); backdrop-filter: blur(9px); }
.system-node div { display: grid; }
.system-node b { font: 600 14px "Manrope", sans-serif; }
.system-node small { color: #9db8aa; font-size: 10px; }
.clockify-logo, .payday-logo { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; }
.clockify-logo { position: relative; background: #eef4ff; }
.clockify-logo::before { content: ""; width: 15px; height: 15px; border: 3px solid #527ac8; border-right-color: transparent; border-radius: 50%; }
.clockify-logo i { width: 5px; height: 5px; position: absolute; left: 19px; border-radius: 50%; background: #527ac8; }
.payday-logo { color: white; background: linear-gradient(135deg,#00a99d,#45c7b9); font: 700 18px "Manrope", sans-serif; }
.relay-node { width: 67px; height: 67px; z-index: 3; display: grid; place-items: center; padding-top: 6px; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; background: #2e6650; box-shadow: 0 0 0 8px rgba(46,102,80,.35); }
.relay-node small { margin-top: -10px; color: #cde1d5; font-size: 9px; }
.connector { width: 48px; position: relative; z-index: 2; display: flex; justify-content: space-around; }
.connector i { width: 4px; height: 4px; border-radius: 50%; background: #79a68d; }
.connector span { display: none; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.metric-card { min-height: 122px; display: flex; align-items: flex-start; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; }
.metric-icon.amber { color: #936515; background: #fff3d8; }
.metric-icon.mint { color: #307a54; background: #e3f5ea; }
.metric-icon.blue { color: #486eaf; background: #e8effb; }
.metric-icon.violet { color: #7652b2; background: #f0e8fa; }
.metric-card > div:last-child { display: grid; }
.metric-card p { margin: 0 0 3px; color: var(--muted); font-size: 11px; }
.metric-card strong { font: 700 24px/1.25 "Manrope", sans-serif; letter-spacing: -.8px; }
.metric-note { margin-top: 7px; color: var(--faint); font-size: 9px; }
.metric-note.positive { color: #37825b; }
.overview-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 15px; border-bottom: 1px solid #edf0ed; }
.panel-header h3, .settings-title h3 { margin: 0; font: 600 14px "Manrope", sans-serif; }
.panel-header p, .settings-title p { margin: 2px 0 0; color: var(--faint); font-size: 10px; }
.text-button { border: 0; color: var(--green-800); background: none; cursor: pointer; font-size: 11px; font-weight: 600; }
.text-button span { margin-left: 4px; }
.mini-list, .activity-list { padding: 2px 22px 10px; }
.mini-invoice { display: grid; grid-template-columns: 36px minmax(120px, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf0ed; }
.mini-invoice:last-child, .activity-item:last-child { border-bottom: 0; }
.client-initial { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #395947; background: #edf3ef; font-weight: 700; font-size: 10px; }
.mini-invoice div:nth-child(2) { min-width: 0; display: grid; }
.mini-invoice strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.mini-invoice small { color: var(--faint); font-size: 9px; }
.mini-invoice > span { color: var(--ink); font-size: 11px; font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; width: max-content; padding: 4px 8px; border-radius: 14px; font-size: 9px; font-weight: 600; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.status-pill.ready, .status-pill.good { color: #2f7150; background: #e9f5ed; }
.status-pill.ready::before, .status-pill.good::before { background: #5daf7d; }
.status-pill.synced { color: #536f9d; background: #edf2fa; }
.status-pill.synced::before { background: #7f9cc8; }
.status-pill.blocked { color: #986b25; background: #fff3dc; }
.status-pill.blocked::before { background: #e0a13b; }
.status-pill.ignored { color: #737b75; background: #eff1ef; }
.status-pill.ignored::before { background: #a5aca7; }
.activity-item { display: grid; grid-template-columns: 27px 1fr auto; align-items: start; gap: 11px; padding: 13px 0; border-bottom: 1px solid #edf0ed; }
.activity-dot { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.activity-dot.success { color: #347855; background: #e5f3ea; }
.activity-dot.info { color: #4e70a8; background: #e9eff9; }
.activity-dot.warning { color: #9a6a1d; background: #fff1d6; }
.activity-item div:nth-child(2) { display: grid; }
.activity-item strong { font-size: 10px; font-weight: 600; }
.activity-item small { color: var(--faint); font-size: 9px; }
.activity-item time { padding-top: 2px; color: var(--faint); font-size: 8px; }
.skeleton { height: 51px; border-bottom: 1px solid #edf0ed; background: linear-gradient(90deg, transparent, rgba(232,236,232,.5), transparent); background-size: 200% 100%; animation: shine 1.4s infinite; }
@keyframes shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.toolbar { display: flex; justify-content: space-between; gap: 20px; padding: 12px; margin-bottom: 14px; }
.search-box { min-width: 280px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--faint); background: #fafbfa; }
.search-box input { width: 100%; height: 38px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter-group { display: flex; align-items: center; gap: 3px; padding: 3px; border-radius: 8px; background: #f2f4f2; }
.filter { height: 32px; padding: 0 11px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 600; }
.filter.is-active { color: var(--green-900); background: white; box-shadow: 0 1px 4px rgba(20,55,44,.08); }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 43px; padding: 0 14px; color: var(--faint); background: #fbfcfb; font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .7px; }
td { height: 64px; padding: 0 14px; border-top: 1px solid #edf0ed; font-size: 11px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fbfcfb; }
.check-cell { width: 44px; text-align: center; }
input[type="checkbox"] { accent-color: var(--green-800); }
.invoice-cell { display: grid; }
.invoice-cell strong { font-size: 11px; }
.invoice-cell span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--faint); font-size: 9px; white-space: nowrap; }
.client-cell { display: flex; align-items: center; gap: 8px; }
.client-cell .client-initial { width: 27px; height: 27px; border-radius: 7px; }
.source-status { padding: 3px 7px; border-radius: 5px; color: #59645d; background: #f0f2f0; font-size: 9px; }
.amount-cell { font-weight: 600; }
.row-action { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; cursor: pointer; }
.row-action:hover { background: #eef2ef; }
.table-footer { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 16px 0 22px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination button, .pagination span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: white; }
.pagination span { border-color: var(--green-800); color: white; background: var(--green-800); }

.notice { display: flex; gap: 13px; padding: 15px 17px; margin-bottom: 15px; border: 1px solid #cfdfd4; border-radius: 10px; color: #355a45; background: #edf6f0; }
.notice strong { font-size: 11px; }
.notice p { margin: 1px 0 0; color: #688070; font-size: 10px; }
.mapping-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.create-missing { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; cursor: pointer; }
.mapping-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.mapping-summary article, .mapping-summary button.mapping-stat { display: grid; padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.mapping-summary button.mapping-stat { width: 100%; text-align: left; font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.mapping-summary button.mapping-stat:hover { border-color: var(--green-900); }
.mapping-summary button.mapping-stat.is-active { border-color: var(--green-900); background: #f2f7f4; }
.mapping-summary span { color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .6px; }
.mapping-summary strong { margin-top: 3px; font: 700 20px "Manrope", sans-serif; }
.mapping-summary button.mapping-stat.is-active span { color: var(--green-900); }
.mapping-panel { overflow: hidden; }
.mapping-head, .mapping-row { display: grid; grid-template-columns: minmax(180px,1fr) 60px minmax(180px,1fr) 120px; align-items: center; gap: 18px; padding: 0 23px; }
.mapping-head { height: 43px; color: var(--faint); background: #fbfcfb; font-size: 9px; text-transform: uppercase; letter-spacing: .7px; }
.mapping-row { min-height: 72px; border-top: 1px solid #edf0ed; }
.mapping-client { display: flex; align-items: center; gap: 10px; }
.mapping-client div { display: grid; }
.mapping-client strong { font-size: 11px; }
.mapping-client small { color: var(--faint); font-size: 9px; }
.mapping-arrow { width: 34px; height: 1px; position: relative; background: #cbd3cd; }
.mapping-arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border-top: 1px solid #9dab9f; border-right: 1px solid #9dab9f; transform: rotate(45deg); }
.unmapped { color: #a97422; font-size: 10px; font-weight: 600; }
.unmatched-payday { color: #596d8f; }
.match-method { display: grid; gap: 5px; }
.match-method strong { color: #4b5d51; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.confidence { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.confidence-track { width: 60px; height: 5px; overflow: hidden; border-radius: 5px; background: #edf0ed; }
.confidence-track i { display: block; height: 100%; border-radius: inherit; background: #6eb088; }
.full-activity { padding: 12px 24px; }
.full-activity .activity-item { min-height: 66px; align-items: center; }
.full-activity .activity-dot { width: 34px; height: 34px; }
.full-activity .activity-item strong { font-size: 12px; }
.full-activity .activity-item small { font-size: 10px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-card { padding: 21px; }
.settings-card.wide { grid-column: 1 / -1; }
.settings-title { display: flex; align-items: center; gap: 11px; }
.settings-title > div:nth-child(2) { display: grid; }
.settings-title .status-pill { margin-left: auto; }
.integration-badge { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; }
.integration-badge .clockify-logo, .integration-badge .payday-logo { width: 34px; height: 34px; }
.clockify-bg { background: #eef3fc; }
.payday-bg { background: #e6f7f5; }
.schedule-bg { color: #427255; background: #e7f3eb; }
.rules-bg { color: #856629; background: #fbf0d9; }
.settings-fields, .schedule-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.settings-fields label, .schedule-row label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 600; }
.settings-fields input, .settings-fields select, .schedule-row input, .schedule-row select { height: 39px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: #425047; background: #fafbfa; font-size: 11px; }
.settings-fields input:not(:disabled):focus, .schedule-row input:not(:disabled):focus, .settings-fields select:focus, .schedule-row select:focus { border-color: #7fa28f; background: white; outline: 3px solid rgba(62,122,94,.12); }
.settings-fields input:disabled, .schedule-row input:disabled { color: #66736a; opacity: 1; }
.field-wide { grid-column: 1 / -1; }
.settings-save-actions { display: flex; align-items: center; gap: 12px; }
.config-file-label { margin-left: auto; padding: 5px 9px; border-radius: 6px; color: #647168; background: #f1f4f2; font: 500 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.mode-row { grid-template-columns: 180px 1fr; align-items: end; }
.security-note { min-height: 39px; display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid #dce8df; border-radius: 8px; color: #4b6857; background: #f3f8f5; }
.security-note p { margin: 0; font-size: 9px; }
.checkbox-setting { align-content: end; }
.checkbox-setting input { width: 18px; height: 18px; margin: 5px 0 8px; }
.status-pill:not(.good):not(.ready):not(.synced):not(.blocked):not(.ignored) { color: #6c746f; background: #eff1ef; }
.test-button { width: 100%; margin-top: 14px; }
.schedule-row { grid-template-columns: 1fr 1fr 1.5fr; }
.rules-list { display: grid; margin-top: 15px; }
.rules-list label { min-height: 58px; display: flex; align-items: center; gap: 16px; border-top: 1px solid #edf0ed; }
.rules-list label > div { display: grid; }
.rules-list strong { font-size: 11px; }
.rules-list span { color: var(--faint); font-size: 9px; }
.rules-list input { margin-left: auto; }
.save-state { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 10px; }
.save-state i { width: 6px; height: 6px; border-radius: 50%; background: #69b386; }
.save-state i.error-dot { background: var(--danger); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 39; pointer-events: none; opacity: 0; background: rgba(14,29,23,.25); transition: .25s; }
.drawer-backdrop.is-open { pointer-events: auto; opacity: 1; }
.drawer { width: min(470px, 100vw); position: fixed; z-index: 40; inset: 0 0 0 auto; overflow-y: auto; padding: 28px; background: white; box-shadow: -20px 0 45px rgba(20,55,44,.12); transform: translateX(102%); transition: .28s ease; }
.drawer.is-open { transform: translateX(0); }
.drawer-close { width: 34px; height: 34px; display: grid; place-items: center; margin-left: auto; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; }
.drawer .eyebrow { display: block; margin-top: 25px; }
.drawer h2 { margin: 4px 0; font: 700 25px "Manrope", sans-serif; }
.drawer-subject { margin: 0 0 22px; color: var(--muted); }
.drawer-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; border-radius: 10px; background: #f7f9f7; }
.drawer-meta div { display: grid; }
.drawer-meta span { color: var(--faint); font-size: 9px; text-transform: uppercase; }
.drawer-meta strong { margin-top: 2px; font-size: 11px; }
.drawer h3 { margin: 25px 0 8px; font: 600 13px "Manrope", sans-serif; }
.line-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.line-item div { display: grid; }
.line-item strong { font-size: 11px; }
.line-item small { color: var(--faint); font-size: 9px; }
.drawer-total { display: flex; justify-content: space-between; padding: 16px 0; font-size: 12px; }
.drawer-total strong { font: 700 17px "Manrope", sans-serif; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; pointer-events: none; opacity: 0; background: rgba(11,30,23,.55); backdrop-filter: blur(4px); transition: .2s; }
.modal-backdrop.is-open { pointer-events: auto; opacity: 1; }
.modal { width: min(470px, 100%); position: relative; padding: 30px; border-radius: 16px; background: white; box-shadow: 0 30px 80px rgba(10,31,22,.25); transform: translateY(8px) scale(.98); transition: .2s; }
.modal-backdrop.is-open .modal { transform: none; }
.modal-close { position: absolute; top: 17px; right: 17px; border: 0; color: var(--faint); background: transparent; font-size: 23px; cursor: pointer; }
.modal-icon { width: 43px; height: 43px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 11px; color: #397053; background: #e8f3ec; }
.modal h2 { margin: 4px 0 6px; font: 700 22px "Manrope", sans-serif; }
.modal > p { margin: 0; color: var(--muted); font-size: 11px; }
.run-summary { display: grid; grid-template-columns: 1fr 30px 1fr; align-items: center; margin: 22px 0 14px; padding: 15px; border-radius: 10px; background: #f6f8f6; }
.run-summary div { display: grid; }
.run-summary span { color: var(--faint); font-size: 9px; }
.run-summary strong { font-size: 11px; }
.run-summary i { color: #9da7a0; font-style: normal; text-align: center; }
.dry-run { display: flex; align-items: center; position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.dry-run div { display: grid; }
.dry-run strong { font-size: 11px; }
.dry-run span { color: var(--faint); font-size: 9px; }
.dry-run input { position: absolute; opacity: 0; }
.switch-ui { width: 38px; height: 22px; position: relative; margin-left: auto; border-radius: 13px; background: #cbd2cd; }
.switch-ui::after { content: ""; width: 16px; height: 16px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.dry-run input:checked + .switch-ui { background: var(--green-800); }
.dry-run input:checked + .switch-ui::after { left: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.auth-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: var(--green-950); }
.auth-screen[hidden] { display: none; }
.auth-card { width: min(360px, 100%); display: grid; justify-items: center; gap: 10px; padding: 40px 32px; text-align: center; border-radius: 18px; background: white; box-shadow: 0 30px 80px rgba(10,31,22,.35); }
.auth-card .brand-mark { transform: scale(1.3); margin-bottom: 6px; }
.auth-card h1 { margin: 0; font: 700 26px "Manrope", sans-serif; letter-spacing: -1px; color: var(--ink); }
.auth-card p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.auth-card .primary-button { width: 100%; text-decoration: none; }
.auth-note { color: var(--danger) !important; font-size: 11px; min-height: 14px; }
.role-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.role-badge { padding: 3px 8px; border-radius: 12px; color: #536f9d; background: #edf2fa; font-size: 9px; font-weight: 600; white-space: nowrap; }
.role-toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.role-toggle input { width: 14px; height: 14px; margin: 0; }
.user-head, .user-row { display: grid; grid-template-columns: minmax(180px,1.3fr) minmax(220px,1.4fr) 110px 90px; align-items: center; gap: 18px; padding: 14px 23px; border-bottom: 1px solid var(--line); }
.user-head { padding: 0 23px; height: 43px; border-bottom: none; }
.user-row:last-child { border-bottom: none; }
.user-row small { display: block; color: var(--faint); font-size: 9px; }
.user-row .text-button { color: var(--danger); }
[disabled].primary-button, [disabled].secondary-button, [disabled].inverted-button { opacity: .45; cursor: not-allowed; }
[disabled].primary-button:hover { background: var(--green-900); transform: none; }
.toast-region { position: fixed; z-index: 70; right: 24px; bottom: 24px; display: grid; gap: 9px; }
.toast { min-width: 300px; display: flex; align-items: center; gap: 11px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 14px 40px rgba(20,55,44,.16); animation: toastIn .25s ease; }
.toast i { width: 9px; height: 9px; border-radius: 50%; background: #65ad80; }
.toast.error i { background: var(--danger); }
.toast div { display: grid; }
.toast strong { font-size: 11px; }
.toast span { color: var(--faint); font-size: 9px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .flow-card { grid-template-columns: 1fr; }
  .flow-visual { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: .25s; }
  .sidebar.is-open { transform: none; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .main { margin-left: 0; }
  .mobile-menu { width: 34px; height: 34px; display: grid; place-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: white; }
  .mobile-menu span { width: 15px; height: 1px; background: var(--ink); }
  .breadcrumb { display: none; }
  .topbar { padding: 0 18px; }
  .content { padding: 28px 18px 50px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-save-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .settings-card.wide { grid-column: auto; }
  .schedule-row { grid-template-columns: 1fr; }
  .mode-row { grid-template-columns: 1fr; }
  .mapping-head, .mapping-row { grid-template-columns: 1fr 30px 1fr; }
  .mapping-head span:last-child, .mapping-row .confidence { display: none; }
  .mapping-summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 580px) {
  .top-actions .icon-button { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; justify-content: space-between; }
  .flow-copy { padding: 29px 24px; }
  .flow-actions { flex-wrap: wrap; }
  .metrics { grid-template-columns: 1fr; }
  .metric-card { min-height: 104px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { min-width: 0; }
  .filter-group { overflow-x: auto; }
  .mini-invoice { grid-template-columns: 35px 1fr auto; }
  .mini-invoice .status-pill { display: none; }
  .mapping-head { display: none; }
  .mapping-row { grid-template-columns: 1fr; gap: 8px; padding: 16px 18px; }
  .mapping-actions { justify-content: flex-start; }
  .mapping-arrow { transform: rotate(90deg); margin-left: 15px; }
  .settings-fields { grid-template-columns: 1fr; }
  .top-actions .primary-button { padding: 0 12px; }
}
