/* Shared primitives, limited to migrated surfaces. */
body.core-app{margin:0;min-width:320px;background:#f5f8fb}
.core-surface{color:#172238;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif}
.core-surface{--ui-bg:#f5f8fb;--ui-surface:#fff;--ui-ink:#172238;--ui-secondary:#69788c;--ui-line:#e2e7ef;--ui-accent:#0668e8;--ui-soft:#edf4ff;color-scheme:light}
.core-surface *{box-sizing:border-box}
:where(.core-surface) button,:where(.core-surface) input,:where(.core-surface) select,:where(.core-surface) textarea{font:inherit}
:where(.core-surface) a{color:var(--ui-accent)}
:where(.core-surface) button,:where(.core-surface) .button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:34px;padding:7px 12px;border:1px solid #d5deea;border-radius:8px;background:#fff;color:var(--ui-accent);text-decoration:none;cursor:pointer}
:where(.core-surface) button:hover,:where(.core-surface) .button:hover{background:#f0f5fc}
:where(.core-surface) button:disabled{opacity:.5;cursor:not-allowed}
.core-surface .primary,:where(.core-surface) button.primary,:where(.core-surface) .button.primary{background:var(--ui-accent);border-color:var(--ui-accent);color:#fff}
.core-surface .primary:hover{background:#0058ca}
.core-surface .danger,.core-surface .error,.core-surface [role=alert]{color:#b42318}
:where(.core-surface) input,:where(.core-surface) select,:where(.core-surface) textarea{min-width:0;min-height:36px;padding:8px 10px;border:1px solid #d1dbe8;border-radius:8px;background:#fff;color:var(--ui-ink)}
:where(.core-surface) input[type=checkbox],:where(.core-surface) input[type=radio]{min-height:0;accent-color:var(--ui-accent)}
:where(.core-surface) input[readonly],:where(.core-surface) input:disabled,:where(.core-surface) select:disabled,:where(.core-surface) textarea:disabled{background:#f1f4f8;color:var(--ui-secondary)}
:where(.core-surface) textarea{resize:vertical}
.core-surface :is(a,button,input,select,textarea,[tabindex]):focus-visible{outline:3px solid #2285ff80;outline-offset:3px}
.core-surface h1,.core-surface h2,.core-surface h3,.core-surface p{overflow-wrap:anywhere}
.core-surface h1{font-size:34px;line-height:1.3;letter-spacing:-.025em;margin:0 0 8px}
.core-surface h2{font-size:18px;margin:0 0 12px}
.core-surface h3{font-size:15px}
.core-surface p{margin:10px 0}
.core-surface small,.core-surface .muted{color:var(--ui-secondary);font-size:12px}
.core-surface .grow{flex:1}
.core-surface .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.core-surface .intro{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:24px}
.core-surface .intro p{margin:4px 0;color:var(--ui-secondary)}
.core-surface .toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.core-surface .panel{padding:20px;border:1px solid var(--ui-line);border-radius:12px;background:#fff;margin-bottom:16px;min-width:0}
.core-surface .tag,.core-surface .badge{display:inline-block;padding:4px 9px;border-radius:7px;background:#edf4ff;font-size:12px;color:#3c628a}
.core-surface .tag.green{background:#eaf7f1;color:#18704d}
.core-surface .tag.amber,.core-surface .overdue{background:#fff5df;color:#966109}
.core-surface .tag.red{background:#fff0ef;color:#b42318}
.core-surface .field{display:flex;flex-direction:column;gap:7px}
.core-surface .form-grid,.core-surface .fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.core-surface .full,.core-surface .wide{grid-column:1/-1}
.core-surface .error:empty{display:none}
.core-surface .summary-card{display:flex;flex-direction:column;align-items:stretch;text-align:left;padding:20px;gap:14px;background:#fff;border:1px solid var(--ui-line);border-radius:12px;color:var(--ui-ink);min-width:0;box-shadow:0 2px 8px #273d5c03;transition:transform .16s,background .16s,box-shadow .16s,border-color .16s}
.core-surface .summary-card:hover{background:#f7faff;border-color:#b8d3f6;box-shadow:0 5px 16px #2341670d;transform:translateY(-2px)}
.core-surface .summary-card strong{font-size:17px;line-height:1.5}
.core-surface .summary-card small{font-size:12px}
.core-surface table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
.core-surface th,.core-surface td{text-align:left;border-bottom:1px solid var(--ui-line);padding:10px 12px}
.core-surface th{background:#f5f7fa;color:var(--ui-secondary);font-weight:500}
.core-surface .hyd-scroll-frame{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 16px;grid-template-rows:minmax(0,1fr) 16px;min-width:0;min-height:0;gap:3px}
.core-surface .hyd-scroll-viewport{grid-area:1/1;min-width:0;min-height:0;overflow:auto;scrollbar-width:none}
.core-surface .hyd-scroll-viewport::-webkit-scrollbar{display:none}
.core-surface .hyd-scroll-rail-x{grid-area:2/1}
.core-surface .hyd-scroll-rail-y{grid-area:1/2}
.core-surface .hyd-scroll-rail-x,.core-surface .hyd-scroll-rail-y{display:flex;min-width:0;min-height:0;background:#edf1f6;border-radius:7px}
.core-surface .hyd-scrollbar{appearance:auto;accent-color:#8d9db1;border:0;background:transparent;min-height:0;min-width:0;width:100%;height:14px;padding:0;margin:0;cursor:pointer}
.core-surface .hyd-scroll-rail-y input{writing-mode:vertical-lr;direction:ltr;width:14px;height:100%}
.core-surface .hyd-scroll-frame:has(.hyd-scroll-rail-y[hidden]){grid-template-columns:minmax(0,1fr)}
.core-surface .hyd-scroll-frame:has(.hyd-scroll-rail-x[hidden]){grid-template-rows:minmax(0,1fr)}
.core-surface .ui-toasts{position:fixed;right:24px;bottom:24px;z-index:10000;display:grid;gap:8px;width:min(380px,calc(100vw - 32px));pointer-events:none}
.core-surface .ui-toast{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border:1px solid var(--ui-line);border-radius:10px;background:#fff;box-shadow:0 8px 30px #17223822;pointer-events:auto}
.core-surface .ui-toast-icon{display:grid;place-items:center;flex:none;width:24px;height:24px;border-radius:50%;background:#edf4ff;color:var(--ui-accent)}
.core-surface .ui-toast-icon svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.core-surface .ui-toast-content{flex:1;min-width:0}
.core-surface .ui-toast-title{font-size:13px}
.core-surface .ui-toast-description{font-size:12px;color:var(--ui-secondary);margin-top:4px}
.core-surface .ui-toast-close{border:0;min-height:24px;padding:0 5px;color:var(--ui-secondary);background:transparent}
.core-surface .ui-toast-action{margin-top:8px;font-size:12px}
.core-surface .hyd-scroll-frame:not(:has(.hyd-scroll-rail-x)){grid-template-rows:minmax(0,1fr)}
.core-surface .hyd-scroll-rail-y{position:relative}
.core-surface .hyd-scroll-frame input.hyd-scrollbar{display:block;appearance:none;-webkit-appearance:none;width:100%;height:16px;min-height:0;min-width:0;margin:0;padding:0;border:0;border-radius:8px;background:#edf0f5;box-shadow:none;cursor:ew-resize}
.core-surface .hyd-scroll-frame input.finance-scrollbar-vertical{position:absolute;inset:0;width:16px;height:100%;writing-mode:vertical-lr;direction:ltr;cursor:ns-resize}
.core-surface .hyd-scrollbar::-webkit-slider-runnable-track{height:8px;border-radius:6px;background:#e8ecf2}
.core-surface .hyd-scrollbar::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:var(--scroll-thumb,160px);height:8px;border:0;border-radius:6px;background:#939dab}
.core-surface .finance-scrollbar-vertical::-webkit-slider-runnable-track{width:8px;height:100%}
.core-surface .finance-scrollbar-vertical::-webkit-slider-thumb{width:8px;height:var(--scroll-thumb,42px)}
@media(max-width:800px){.core-surface h1{font-size:26px}
.core-surface .form-grid,.core-surface .fields{grid-template-columns:1fr}
.core-surface .panel{padding:16px}
.core-surface .intro{gap:12px}
:where(.core-surface) button,:where(.core-surface) .button{min-height:40px}
}
@media(prefers-reduced-motion:reduce){.core-surface *,.core-surface *::before,.core-surface *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
.core-surface .summary-card:hover{transform:none}
}
