:root{--wine:#713d4c;--deep:#30202b;--copper:#be9278;--paper:#fff;--canvas:#f8f6f3;--ink:#352d32;--muted:#80787e;--line:#ebe5e1;--green:#287b61;--amber:#a86e32;--red:#a74d5a;--shadow:0 7px 30px rgba(66,36,45,.045)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--canvas);color:var(--ink);font:14px/1.55 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.43;cursor:not-allowed}a{color:inherit;text-decoration:none}a:hover{color:var(--wine)}:focus-visible{outline:3px solid #D4A489;outline-offset:3px}[hidden]{display:none!important}.skip{position:absolute;z-index:100;top:-80px;background:white;padding:10px}.skip:focus{top:0}
.app{display:flex;min-height:100vh}.sidebar{flex:none;width:254px;background:var(--deep);color:#dfd3d9;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:27px 15px 23px;z-index:50}.identity{display:flex;align-items:center;gap:12px;padding:0 9px 37px}.mark{width:44px;height:44px;flex:none;display:grid;place-items:center;border:1px solid #b17d73;background:linear-gradient(135deg,#8b5a5c,#53323e);border-radius:12px;font-size:28px;font-weight:900;color:#f7dac2;position:relative}.mark span{position:absolute;font-size:9px;top:0;right:5px}.identity-name{letter-spacing:.045em;font-size:15px;font-weight:900;color:white}.identity-name b{color:#e7ad8a}.identity-caption{color:#c2aeb3;font-size:9px;letter-spacing:.13em;margin-top:2px}.side-kicker{color:#bd9fa4;font-size:10px;letter-spacing:.14em;font-weight:800;padding:0 12px 13px}.nav{display:flex;flex-direction:column;gap:5px}.nav button{width:100%;border:0;border-radius:10px;background:transparent;text-align:left;color:#d8ccd2;padding:12px;display:flex;align-items:center;gap:12px;font-size:12px;font-weight:650}.nav button:hover{background:#46303e;color:white}.nav button.active{background:#754957;color:white}.symbol{font-size:18px;color:#e1baaa;width:22px;display:inline-block;text-align:center}.count{margin-left:auto;border-radius:20px;background:#533645;padding:1px 7px;font-size:10px}.sidebar-bottom{margin-top:auto;border-top:1px solid #54404a;padding:20px 10px 0}.micro-pill{display:inline-block;padding:6px 9px;border:1px solid #654756;border-radius:20px;font-size:10px}.live-dot{display:inline-block;height:6px;width:6px;background:#80cbab;border-radius:50%;margin-right:5px}.sidebar-bottom p{color:#bbaaaf;font-size:11px;margin:12px 0;line-height:1.65}.sidebar-bottom a{color:#e9b9a5;font-weight:700;font-size:11px}
.app-main{flex:1;min-width:0;display:flex;flex-direction:column}.topbar{height:77px;background:rgba(255,255,255,.96);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px clamp(20px,3vw,46px);position:sticky;top:0;z-index:30;backdrop-filter:blur(10px)}.top-left,.top-right{display:flex;align-items:center;gap:10px}.top-left strong{font-size:12px}.crumb{font-weight:850;letter-spacing:.12em;color:#9a7679;font-size:10px}.slash{color:#bcb1b5}.demo-pill{color:#896952;background:#f9f1e9;border:1px solid #ebdaca;border-radius:20px;font-weight:850;font-size:10px;letter-spacing:.07em;padding:7px 10px;white-space:nowrap}.role-select{font-size:11px;color:#716469;font-weight:700;display:flex;align-items:center;gap:7px}.role-select select{background:#fff;border:1px solid var(--line);padding:9px;border-radius:9px;font-weight:750;color:#4d363f;font-size:11px;max-width:147px}.mobile-menu{display:none;background:white;border:1px solid var(--line);border-radius:9px;width:41px;height:40px;color:#634250}
.content{width:min(100%,1420px);margin:0 auto;flex:1;padding:clamp(22px,3vw,45px)}footer{border-top:1px solid var(--line);padding:21px clamp(20px,3vw,46px);display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap;font-size:10px;color:#9b8c92}.pagehead{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:22px}.eyebrow{font-size:10px;color:#a17866;letter-spacing:.17em;font-weight:850}.pagehead h1{margin:6px 0 9px;font-size:clamp(26px,3vw,38px);line-height:1.17;letter-spacing:-.045em;font-weight:850}.pagehead p{margin:0;color:var(--muted);font-size:13px;max-width:660px}.page-actions{display:flex;gap:9px;flex-wrap:wrap}.btn{min-height:42px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;padding:10px 16px;font-size:12px;font-weight:780;white-space:nowrap}.btn:hover:not(:disabled){filter:brightness(.94)}.btn-primary{color:white;background:#774453}.btn-primary:hover{color:white}.btn-outline{background:white;border-color:#e3d8d5;color:#6c4a57}.btn-soft{background:#f2e9e6;color:#714453}.btn-ok{background:#287b61;color:white}.btn-bad{color:#9e4650;background:#fff1f0;border-color:#ebc6c9}.btn-sm{font-size:11px;min-height:36px;padding:8px 11px}.notice{background:#fdf6eb;border:1px solid #eddfce;padding:14px 17px;border-radius:11px;color:#866950;font-size:12px;margin-bottom:23px}.notice strong{color:#6c5140}.notice.success{border-color:#c7e4d5;background:#f0faf4;color:#2e7857}.notice.danger{border-color:#f2c9d0;background:#fff5f5;color:#9c4150}
.grid{display:grid;gap:18px}.cols4{grid-template-columns:repeat(4,minmax(0,1fr))}.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}.cols2{grid-template-columns:repeat(2,minmax(0,1fr))}.panel{background:white;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}.pad{padding:23px}.panelhead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}.panelhead h2{font-size:15px;margin:0;letter-spacing:-.02em}.kpi{padding:21px 22px}.kpi label{color:#897b81;font-size:11px;font-weight:700;display:block}.kpi strong{font-size:clamp(23px,2.5vw,30px);font-weight:850;letter-spacing:-.04em;display:block;margin:3px 0 2px}.kpi small{font-size:10px;color:#9e8d91}.kpi.highlight{background:linear-gradient(115deg,#794554,#442d3b);color:#fff;border-color:#794554}.kpi.highlight label,.kpi.highlight small{color:#efdae0}.section{margin-top:21px}.small{font-size:11px;color:var(--muted)}.pill{display:inline-flex;gap:5px;align-items:center;border-radius:7px;padding:4px 8px;background:#f2eeec;font-size:10px;font-weight:750;color:#71656a}.pill.green{background:#e8f5ee;color:#287754}.pill.amber{background:#fff1dd;color:#986327}.pill.red{background:#fff0f1;color:#a44858}.pill.blue{background:#edf2fb;color:#4d6996}.mini-bar{background:#f0ece9;border-radius:20px;height:9px;overflow:hidden}.mini-bar div{height:100%;border-radius:20px;background:#a66a71}.project-line{padding:14px 0;border-bottom:1px solid #f1eae7}.project-line:last-child{border:0}.pair{display:flex;justify-content:space-between;gap:12px;align-items:center}.pair strong{font-size:12px}.pair small{color:var(--muted);font-size:11px}.muted{color:var(--muted)}.text-sm{font-size:12px}.empty{padding:30px 16px;text-align:center;color:var(--muted);font-size:12px}
.table-scroll{max-width:100%;overflow-x:auto}table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap;font-size:11px}th{padding:11px 12px;color:#92858b;font-size:10px;font-weight:850;letter-spacing:.07em;text-transform:uppercase;border-bottom:1px solid #ece7e4}td{padding:14px 12px;border-bottom:1px solid #f2eeeb}tr:last-child td{border-bottom:0}td strong{font-weight:770}td .btn{margin-right:5px}.doc-icon{width:31px;height:33px;border-radius:9px;background:#f3e6e1;color:#7d4654;display:inline-grid;place-items:center;margin-right:9px;font-size:15px}.doc-cell{display:inline-flex;align-items:center}.actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.field{display:flex;flex-direction:column;gap:6px;font-size:11px;color:#6d5d64;font-weight:750}.field input,.field textarea,.field select,.filters input,.filters select{width:100%;min-height:41px;border:1px solid #e5ded9;border-radius:9px;background:#fff;color:#382f33;font-size:12px;padding:10px 12px;outline:none}.field :is(input,textarea,select):focus,.filters :is(input,select):focus{border-color:#b68c80;box-shadow:0 0 0 3px #b48e8126}.field textarea{min-height:84px;resize:vertical}.form-buttons{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin-top:18px}.full{grid-column:1/-1}.filters{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-bottom:17px}.filters .field{min-width:145px;flex:1}.filters .field.search{flex:2;min-width:210px}
.upload{border:1.5px dashed #d7beb9;border-radius:12px;background:linear-gradient(140deg,#fefcf9,#fbf4ef);padding:26px 18px;text-align:center}.upload .upload-icon{font-size:30px;color:#865664}.upload p{font-size:13px;color:#776971;margin:5px 0 10px}.upload small{font-size:10px;color:#a09191}.upload input{display:block;margin:14px auto 0;max-width:100%;font-size:11px}.preview{margin-top:12px;border:1px solid #e9e0dc;border-radius:12px;overflow:hidden;background:#faf7f4;min-height:124px}.preview img{display:block;width:100%;max-height:400px;object-fit:contain}.preview-placeholder{padding:30px 16px;text-align:center;color:#93878a;font-size:12px}.preview-meta{font-size:11px;color:#78686d;background:white;border-top:1px solid #ede5e0;padding:9px 12px;overflow-wrap:anywhere}.toolbar{display:flex;gap:8px;justify-content:flex-end;align-items:center;flex-wrap:wrap}.steps{display:flex;gap:8px;margin-bottom:17px;flex-wrap:wrap}.step{padding:7px 11px;background:#f0eae7;border-radius:20px;font-size:10px;color:#80676b;font-weight:780}.step.on{background:#764453;color:#fff}.info{background:#f6f3ef;border-radius:10px;padding:16px;color:#73666b;font-size:11px;line-height:1.7}.info h3{color:#4e3d44;margin:0 0 6px;font-size:12px}.info p{margin:0}.label-inline{font-size:10px;font-weight:800;letter-spacing:.05em;color:#897d81}.stat-list{display:grid;gap:11px}.stat-item{border-bottom:1px solid #f0ebe8;padding-bottom:11px}.stat-item:last-child{border:0;padding:0}.stat-item strong{display:block;font-size:13px}.stat-item small{font-size:10px;color:#95888c}
.is-alert{background:#fff5f3;border:1px solid #eac9c1;border-radius:11px;padding:12px 14px;color:#984b50;font-size:11px;margin-top:11px}.is-ok{background:#f0f9f3;border:1px solid #c5e3cf;color:#2e805b;border-radius:11px;padding:12px 14px;font-size:11px;margin-top:11px}.record{border-bottom:1px solid #f1eae7;padding:15px 0}.record:last-child{border:0}.record h3{font-size:13px;margin:0 0 4px}.record p{margin:0;color:#8e8085;font-size:11px}.record .actions{margin-top:11px}.watermark{font-size:10px;color:#9a7c7f;letter-spacing:.05em;font-weight:850}
.toast{position:fixed;right:20px;bottom:20px;z-index:100;max-width:min(420px,calc(100vw - 32px));background:#31222c;color:#fff;padding:15px 19px;border-radius:11px;font-size:12px;font-weight:750;box-shadow:0 12px 30px #33192530}.scrim{position:fixed;inset:0;background:#271c2366;z-index:45}
@media(max-width:1140px){.cols4{grid-template-columns:repeat(2,minmax(0,1fr))}.sidebar{width:225px}.demo-pill{display:none}}
@media(max-width:800px){.sidebar{position:fixed;left:0;top:0;height:100dvh;width:252px;transform:translateX(-110%);transition:transform .2s}.sidebar.open{transform:none}.mobile-menu{display:block}.content{padding:25px 18px}.topbar{min-height:69px;height:auto;padding:10px 17px}.cols3{grid-template-columns:repeat(2,minmax(0,1fr))}.pagehead{align-items:start;flex-direction:column}.pagehead h1{font-size:30px}}
@media(max-width:590px){.crumb,.slash,.topbar #reset{display:none}.role-select{font-size:10px}.role-select select{max-width:130px}.cols4,.cols3,.cols2,.form-grid{grid-template-columns:1fr}.panel.pad{padding:18px}.content{padding:22px 14px}.filters .field,.filters .field.search{min-width:100%}.kpi{padding:18px}.pagehead h1{font-size:27px}.page-actions{width:100%}.page-actions .btn{flex:1}.top-right{gap:6px}footer{padding:18px 14px}.upload{padding:20px 12px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.sidebar{transition:none}}

/* OCR experimental */
.ocr-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0 8px}.ocr-controls .small{flex:1;min-width:190px}.ocr-panel{background:#fbf9f7;border:1px solid #e9e0dc;border-radius:11px;padding:14px;margin-bottom:14px}.ocr-panel .pair{gap:8px}.ocr-status{font-size:11px;color:#805866;padding:8px 0;min-height:26px}.ocr-raw summary{font-size:11px;font-weight:750;cursor:pointer;color:#805866;padding:6px 0}.ocr-raw pre{max-height:200px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;background:#fff;border:1px solid #ece7e2;border-radius:9px;padding:10px}

/* Anti-white-screen startup fallback */
.boot-fallback{max-width:690px;margin:clamp(22px,5vw,65px) auto;padding:clamp(24px,4vw,46px)!important}.boot-fallback h1{font-size:clamp(24px,3vw,31px);letter-spacing:-.04em;margin:12px 0}.boot-fallback p{font-size:13px;color:#80787e;line-height:1.7}.boot-fallback .actions{margin:22px 0 12px}
