:root {
  --ink: #101114;
  --muted: #74767c;
  --canvas: #f7f7f6;
  --surface: #ffffff;
  --line: #e4e4e2;
  --forest: #111214;
  --forest2: #26272a;
  --lime: #dedede;
  --green: #17181a;
  --green-bg: #f0f0ef;
  --amber: #47484d;
  --amber-bg: #f2f2f1;
  --red: #17181a;
  --red-bg: #ededec;
  --blue: #17181a;
  --shadow: 0 14px 38px rgba(0, 0, 0, .07);
}

body { background: var(--canvas); }
/* Only the hidden attribute owns screen visibility. Body classes from an
   older cached script must not hide both the login and the workspace. */

/* Login: dark editorial panel and a quiet white sign-in side. */
.auth-shell { min-height: 100vh; display: grid; place-items: stretch; grid-template-columns: minmax(540px, 54%) 1fr; background: #fff; }
.auth-visual { position: relative; display: grid; place-items: center; overflow: hidden; color: #b2b2b5; background: radial-gradient(circle at 70% 90%, #27282c 0, transparent 43%), linear-gradient(145deg, #16171a, #202125); }
.auth-visual-logo { z-index: 1; display: grid; place-items: center; width: 104px; height: 104px; padding: 11px; border-radius: 24px; background: #fff; box-shadow: 0 20px 48px rgba(0,0,0,.28); }
.auth-visual-logo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 15px; }
.auth-visual > p { position: absolute; left: 34px; bottom: 27px; margin: 0; color: #a5a5a8; font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 2px; }
.auth-orbit { position: absolute; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.auth-orbit-one { transform: translate(-12px, -10px); }
.auth-orbit-two { width: 340px; height: 340px; transform: translate(-26px, -20px); border-color: rgba(255,255,255,.08); }
.auth-orbit-three { width: 294px; height: 294px; transform: translate(23px, 58px); border-color: rgba(255,255,255,.055); }
.auth-panel { display: grid; place-items: center; padding: 48px 30px; background: #fff; }
.auth-card { width: min(390px, 100%); padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.auth-brand-lockup { display: flex; align-items: center; gap: 9px; margin-bottom: 44px; }
.auth-brand-lockup b { color: #101114; font: 800 15px Inter, "Segoe UI", sans-serif; letter-spacing: -.45px; }
.auth-mark, .brand-mark { display: grid; place-items: center; padding: 0; overflow: hidden; background: #fff; }
.auth-mark { width: 29px; height: 29px; margin: 0; border: 1px solid #e4e4e2; border-radius: 8px; box-shadow: none; }
.auth-mark img, .brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.auth-card .eyebrow { margin-bottom: 9px; color: #8b8d92; letter-spacing: 1.45px; }
.auth-card h1 { margin-bottom: 9px; color: #16171a; font-size: 27px; letter-spacing: -.75px; }
.auth-card .muted { font-size: 12px; }
.auth-card form { gap: 15px; margin-top: 27px; }
/* Author component rules must never override native hidden state. */
[hidden] { display: none !important; }
.auth-card label, .field { color: #37383c; }
.auth-card input, .field input, .field select, .control select { border-color: #e1e1df; background: #fff; color: #101114; }
.auth-card input:focus, .field input:focus, .field select:focus, .control select:focus { border-color: #111214; box-shadow: 0 0 0 3px rgba(17,18,20,.09); }
.primary, button.primary { border-color: #111214; background: #111214; color: #fff; }
.primary:hover, button.primary:hover { border-color: #35363a; background: #35363a; }
.form-message { color: #26272a; }
.auth-retry { display: inline-block; margin-top: 8px; color: #74767c; font-size: 12px; }
.auth-language { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0; font-size: 12px; }
.auth-language select { padding: 7px 10px; border: 1px solid #e1e1df; border-radius: 6px; color: #101114; background: #fff; }
.auth-card :disabled { opacity: .55; cursor: not-allowed; }

/* Workspace: monochrome navigation, controls, cards and alerts. */
.sidebar { background: #111214; color: #d9d9da; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.sidebar .nav-item { color: #b9b9bd; }
.sidebar .nav-item span { color: #d7d7d9; }
.sidebar .nav-item.active { color: #111214; background: #fff; box-shadow: 0 7px 20px rgba(0,0,0,.2); }
.sidebar .nav-item.active span { color: #111214; }
.sidebar .nav-item:hover:not(.active) { background: rgba(255,255,255,.1); color: #fff; }
.sidebar .nav-label, .sidebar .brand-lockup small, .sidebar-user small { color: #85858a; }
.sidebar .sidebar-bottom, .sidebar-user { border-top-color: rgba(255,255,255,.12); }
.avatar { background: #fff; color: #111214; }
.nav-count { background: #fff; color: #111214; }
.topbar { background: rgba(255,255,255,.93); }
.data-status { color: #202124; background: #f0f0ef; }
.tab.active { color: #111214; border-color: #111214; }
.outline:hover { color: #111214; border-color: #aaa; background: #f5f5f4; }
.text-button, .page-kicker, .eyebrow { color: #37383c; }
.store-card .store-initial { color: #fff; background: #111214; }
.brand-chip { color: #25262a; background: #ededec; }
.status-dot.CONNECTED, .status-dot.ERROR, .status-dot.CONFIGURING { background: #202124; }
.attention:hover { border-color: #a9a9a7; }
.attention-dot, .attention.warning .attention-dot, .attention.info .attention-dot { background: #202124; }
.badge.UNASSIGNED, .badge.NEW, .badge.PENDING_APPROVAL, .badge.IN_PROGRESS, .badge.APPROVED, .badge.RESOLVED, .badge.REJECTED, .badge.CRITICAL { color: #25262a; background: #ededec; }
.rule-sign, .rule-sign.penalty { color: #fff; background: #17181a; }
.toast { background: #17181a; }

@media (max-width: 850px) {
  .auth-shell { display: block; background: #fff; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 36px 24px; }
  .auth-brand-lockup { margin-bottom: 38px; }
}

/* Operations workspace: consistent typography, line icons and a quieter rail. */
body { font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; background:#f5f5f6; }
button,input,select,textarea { font-family:inherit; }
button { font-size:13px; font-weight:600; }
button:disabled { cursor:not-allowed; opacity:.45; }
button:focus-visible,a:focus-visible { outline:2px solid #777; outline-offset:3px; }
.ui-icon { width:20px; height:20px; flex:0 0 20px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.sidebar { width:244px; padding:27px 15px 18px; background:#141416; border-right:1px solid #262629; }
.brand-lockup { padding:0 10px 24px; gap:12px; }
.brand-lockup b { font-size:15px; letter-spacing:1.2px; }
.brand-lockup small { display:block; font-size:10px; margin-top:5px; letter-spacing:.2px; }
.brand-mark { width:37px; height:37px; border-radius:10px; }
.sidebar-scroll { scrollbar-color:#414145 transparent; }
.nav-label { font:600 11px/1.5 "Segoe UI","Microsoft YaHei",sans-serif; color:#76767e; letter-spacing:.7px; margin:24px 12px 9px; }
.nav-label:first-child { margin-top:5px; }
.sidebar .nav-item { position:relative; min-height:40px; padding:9px 12px; gap:12px; margin:3px 0; color:#aaaab2; border:1px solid transparent; border-radius:8px; font:500 13px/1.4 "Segoe UI","Microsoft YaHei",sans-serif; }
.sidebar .nav-item .ui-icon { width:18px; height:18px; flex-basis:18px; }
.sidebar .nav-item.active { color:#fff; background:#29292e; border-color:#37373e; box-shadow:none; }
.sidebar .nav-item.active::before { content:""; position:absolute; left:-6px; width:2px; height:17px; border-radius:2px; background:#f5f5f5; }
.sidebar .nav-item:hover:not(.active) { color:#eee; background:#202024; }
.sidebar-user { padding:18px 8px 0; gap:10px; }
.sidebar-user>div:nth-child(2) { min-width:0; }
.sidebar-user b { max-width:132px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.sidebar-user small { display:block; margin-top:4px; }
.sidebar-user button { display:grid; place-items:center; width:28px; height:32px; color:#aaa; }
.avatar { width:32px; height:32px; flex:0 0 32px; border-radius:10px; font-size:12px; background:#323237; color:#fff; }
.main { margin-left:244px; }
.topbar { min-height:72px; height:auto; background:#fff; padding:0 36px; }
.breadcrumb { font-size:13px; font-weight:600; color:#68686f; }
.page { padding:36px; max-width:1640px; }
.page-heading { margin-bottom:27px; }
.page-heading h1 { font-size:29px; font-weight:650; letter-spacing:-.8px; }
.page-heading .muted { font-size:13px; margin-top:8px; }
.eyebrow { font:600 10px/1.5 "Segoe UI","Microsoft YaHei",sans-serif; letter-spacing:1.2px; color:#898990; margin-bottom:10px; }
.top-actions { gap:10px; flex-wrap:wrap; }
.custom-dates { display:flex; gap:8px; }
.custom-dates[hidden] { display:none; }
.custom-dates label { display:flex; align-items:center; gap:5px; font-size:11px; color:#71717a; }
.custom-dates input { padding:6px; width:126px; border:1px solid #dedee4; border-radius:6px; font:inherit; }
.control select,.locale,.filter-select { min-height:36px; max-width:245px; padding:7px 11px; border:1px solid #e4e4e7; border-radius:8px; background:#fff; color:#34343a; font-size:12px; }
.locale { width:104px; }
.primary,.outline { border-radius:8px; padding:10px 15px; font-size:12px; line-height:1.5; }
.outline { color:#36363b; background:#fff; border-color:#dedee2; }
.text-button { color:#333339; font-size:12px; font-weight:600; }
.panel,.table-panel,.store-card,.kpi { box-shadow:none; border-color:#e6e6e9; border-radius:12px; background:#fff; }
.panel { padding:24px; }
.panel h2 { font-size:14px; font-weight:650; }
.panel p { font-size:12px; }
.setting-row { padding:17px 0; border-color:#eeeef0; align-items:center; }
.setting-row small { font-size:11px; line-height:1.7; margin-top:7px; }
.setting-row b { font-size:12px; }
.settings-grid { grid-template-columns:1fr 1fr; gap:20px; }
.rules-panel { margin-top:20px; }
#addRuleButton { margin-top:14px; }
.badge { padding:5px 9px; background:#f0f0f2; color:#62626a; border:1px solid #e8e8eb; font-size:10px; font-weight:600; line-height:1.4; white-space:nowrap; }
.badge.APPROVED,.badge.ACTIVE,.badge.ACCEPTED { color:#24242a; background:#ededf0; border-color:#dddde1; }
.badge.INACTIVE,.badge.VOIDED { color:#8e8e96; background:#fafafa; }
.badge.PENDING_APPROVAL,.badge.REQUESTED,.badge.REVIEWING { color:#313138; border-style:dashed; background:#fff; }
.badge.NOT_CONNECTED { color:#73737b; background:#f7f7f8; }
.rating { color:#424249; }
.tab-row { gap:24px; align-items:center; flex-wrap:wrap; }
.tab { font-family:inherit; font-size:12px; font-weight:600; padding:14px 2px; }
.tab-row .filter-select { margin-left:auto; margin-bottom:7px; }
th { background:#fafafb; color:#8a8a92; font-size:11px; font-weight:500; text-transform:none; letter-spacing:0; }
th,td { padding:16px 18px; border-color:#f0f0f2; }
td { font-size:12px; line-height:1.65; }
td .text-button,td .outline { margin-top:4px; white-space:nowrap; }
.review-text { max-width:380px; white-space:pre-wrap; overflow-wrap:anywhere; }
.kpi { padding:20px; }
.kpi b { font:650 23px/1.4 "Segoe UI",sans-serif; letter-spacing:-.5px; font-variant-numeric:tabular-nums; }
.kpi label { font-size:11px; }
.kpi small { color:#8b8b94; }
.workflow-strip { display:flex; gap:0; margin:6px 0 24px; border:1px solid #e4e4e8; border-radius:10px; background:#fff; }
.workflow-strip>span { flex:1; display:flex; gap:12px; align-items:center; padding:16px 20px; border-right:1px solid #ebebed; }
.workflow-strip>span:last-child { border-right:0; }
.workflow-strip b { color:#a4a4ad; font-size:11px; font-weight:500; }
.workflow-strip i { color:#53535d; font-size:13px; font-style:normal; }
.incentive-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.incentive-tabs { margin-bottom:24px; }
.module-note { color:#8b8b94; font-size:11px; line-height:1.8; margin:22px 0 0; }
.rule-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.rule-card { padding:22px 22px 0; background:#fff; border:1px solid #e4e4e8; border-radius:12px; min-width:0; }
.rule-card-top { display:flex; gap:12px; align-items:flex-start; }
.rule-kind { display:grid; place-items:center; width:35px; height:35px; flex:0 0 35px; background:#f0f0f3; border-radius:9px; color:#44444b; font-size:21px; }
.rule-card h3 { font-size:13px; margin:0 0 5px; font-weight:650; }
.rule-card p { color:#85858e; font-size:11px; margin:0; }
.rule-card-top>.badge { margin-left:auto; }
.rule-card-amount { font-size:26px; font-weight:650; letter-spacing:-.7px; margin:28px 0 19px; font-variant-numeric:tabular-nums; }
.rule-card-amount small { display:block; color:#9999a0; font-size:11px; font-weight:400; letter-spacing:0; margin-top:5px; }
.rule-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; color:#93939b; font-size:10px; padding-bottom:20px; }
.rule-card footer { display:flex; gap:20px; padding:14px 0; border-top:1px solid #eeeef0; }
.rule-card footer button:last-child { margin-left:auto; color:#898992; }
.rule-card.is-inactive { background:#fafafa; }
.designed-empty { padding:54px 24px; text-align:center; background:#fff; border:1px solid #e6e6e9; border-radius:12px; }
.designed-empty>.ui-icon { width:34px; height:34px; color:#aaaab4; margin-bottom:12px; }
.designed-empty h3 { color:#575760; font-size:14px; font-weight:600; margin:0 0 8px; }
.designed-empty p { font-size:12px; color:#96969f; line-height:1.8; max-width:480px; margin:0 auto; }
.review-cards { display:grid; gap:14px; }
.review-card { background:#fff; border:1px solid #e3e3e8; border-radius:12px; overflow:hidden; }
.review-card footer { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 22px; border-top:1px solid #eeeef1; color:#85858e; font-size:12px; }
.review-card .review-evidence { border:0; margin:0; border-radius:0; }
.review-card-body { padding:22px; }
.review-card-body h3 { font-size:14px; font-weight:500; line-height:1.7; }
.ledger-amount { font-variant-numeric:tabular-nums; white-space:nowrap; font-weight:600; }
.empty-state,.empty-panel { background:#fff; border-color:#e3e3e7; color:#91919a; }
.empty-state>span { color:#a1a1aa; }
#formDialog { width:min(500px,calc(100vw - 32px)); max-height:88vh; border:1px solid #e6e6e9; border-radius:16px; box-shadow:0 30px 100px #0003; }
#formDialog.wide { width:min(680px,calc(100vw - 32px)); }
dialog::backdrop { background:rgba(18,18,23,.48); backdrop-filter:blur(3px); }
.dialog-head { padding:26px 28px 18px; border-bottom:1px solid #ededf0; align-items:flex-start; background:#fff; position:sticky; top:0; z-index:2; }
.dialog-head .eyebrow { font-size:9px; }
.dialog-head h2 { font-size:21px; font-weight:650; }
.icon-close { color:#94949c; font-size:24px; }
.dialog-fields { padding:23px 28px; gap:19px 18px; }
.wide .dialog-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
.field { min-width:0; gap:8px; color:#53535d; font-size:12px; font-weight:500; }
.field input,.field select,.field textarea { width:100%; min-height:43px; padding:10px 12px; border:1px solid #dedee4; border-radius:8px; color:#303038; background:#fff; font:400 13px/1.5 "Segoe UI","Microsoft YaHei",sans-serif; }
.field textarea { resize:vertical; }
.field input:focus,.field select:focus,.field textarea:focus { outline:0; border-color:#92929d; box-shadow:0 0 0 3px #e9e9ed; }
.field input::placeholder,.field textarea::placeholder { color:#b1b1b8; }
.span-all { grid-column:1/-1; }
.dialog-intro { margin:0; font-size:12px; color:#666670; line-height:1.8; }
.field-hint,.notice { color:#666672; font-size:12px; font-weight:400; line-height:1.8; margin:0; }
.notice { padding:13px 15px; background:#f4f4f6; border-radius:8px; }
.rule-preview { padding:20px; border:1px solid #e3e3e8; border-radius:10px; background:#f8f8fa; }
.rule-preview>small { color:#9797a2; font-size:10px; }
.rule-preview h3 { font-size:14px; margin:10px 0 9px; font-weight:600; }
.rule-preview p { font-size:12px; color:#94949e; margin:10px 0; }
.rule-preview strong { color:#222229; font-size:25px; font-weight:650; font-variant-numeric:tabular-nums; }
.rule-preview>span { color:#64646f; font-size:11px; line-height:1.8; display:block; }
.dialog-actions { position:sticky; bottom:0; border-top:1px solid #ededf0; background:#fff; padding:17px 28px; z-index:2; }
#dialogMessage { padding:0 28px; margin:0; color:#44444f; font-size:12px; min-height:0; }
#dialogMessage:not(:empty) { padding-bottom:20px; }
.review-evidence { border:1px solid #e4e4e9; border-radius:10px; background:#fafafb; padding:20px; }
.review-evidence>div { display:flex; justify-content:space-between; gap:12px; color:#7b7b87; font-size:11px; }
.review-evidence b { color:#444450; font-size:12px; }
.review-evidence blockquote { white-space:pre-wrap; overflow-wrap:anywhere; margin:18px 0; color:#494956; font-size:13px; line-height:1.9; }
.review-evidence small { color:#9a9aa5; font-size:10px; }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; margin:0; gap:18px; }
.detail-grid dt { font-size:10px; color:#a0a0aa; margin-bottom:7px; }
.detail-grid dd { margin:0; color:#53535f; font-size:12px; line-height:1.8; overflow-wrap:anywhere; }
.timeline article { display:flex; gap:15px; padding:16px 0; border-bottom:1px solid #eeeef1; }
.timeline h3 { font-size:13px; margin:0; }
.timeline p,.timeline small { font-size:11px; line-height:1.8; color:#8f8f9a; }
.version-tag { font-size:10px; border:1px solid #dedee5; border-radius:6px; padding:6px 8px; height:fit-content; }
@media(max-width:1100px) { .rule-cards { grid-template-columns:1fr; } .incentive-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } .topbar { padding:0 24px; } .page { padding:28px; } }
@media(max-width:760px) {
  .main { margin-left:0; } .sidebar { width:244px; box-shadow:20px 0 60px #0003; }
  .topbar { padding:12px 16px; height:auto; min-height:66px; flex-wrap:wrap; gap:12px; }
  .breadcrumb { margin-right:auto; } .top-actions { width:100%; gap:7px; } .control select { max-width:150px; }
  .date-control { display:block; } .date-control select { max-width:113px; } .locale { width:83px; padding:7px; }
  .page { padding:24px 16px; } .page-heading h1 { font-size:25px; } .page-heading { gap:10px; flex-wrap:wrap; }
  .settings-grid,.rule-cards { grid-template-columns:1fr; } .panel { padding:20px; }
  .workflow-strip>span { padding:13px 10px; display:block; } .workflow-strip i { display:block; margin-top:6px; font-size:10px; }
  .kpi { padding:15px; } .kpi b { font-size:20px; } .incentive-stats { gap:10px; }
  .tab-row { gap:18px; } .tab-row .filter-select { width:100%; margin-left:0; }
  .wide .dialog-fields { grid-template-columns:1fr; } .dialog-fields { padding:20px; }
  .dialog-head { padding:23px 20px 16px; } .dialog-actions { padding:16px 20px; }
  .review-evidence>div,.review-card footer { flex-wrap:wrap; } .detail-grid { grid-template-columns:1fr; }
}
