:root {
  color-scheme: light;
  --ink: #182b25; --text: #263831; --muted: #64736c; --green: #21654b;
  --white: #fff; --paper: #f5f7f4; --line: #e2e9e3; --strong-line: #d3ded6;
  --lime: #dcf2a4; --deep: #172c25; --sidebar: #182c25;
  --soft: #eaf4e8; --danger: #a43b2b; --shadow: 0 12px 32px #213f2a08;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 16px; font-synthesis: none; background: var(--paper); color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #3a9067; outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; flex: none; }
h1, h2, h3, p { margin: 0; }
input, select { min-width: 0; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
.skip-link { position: fixed; left: 18px; top: -100px; z-index: 10; color: var(--deep); background: var(--lime); padding: 10px; }
.skip-link:focus { top: 10px; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--sidebar); color: white; display: flex; flex-direction: column; padding: 30px 18px 20px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px; }
.brand-mark { flex: 0 0 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: var(--lime); color: var(--deep); }
.brand-mark svg { width: 22px; height: 22px; }
.brand strong { font-size: 1.28rem; letter-spacing: .07em; display: block; line-height: 1.2; }
.sidebar .brand { padding: 0; }
.sidebar .brand strong { font-size: 1rem; letter-spacing: .025em; }
.nav { display: grid; gap: 6px; margin-top: 47px; }
.nav-caption { color: #a9bdb0; padding: 0 12px 5px; font-size: .75rem; }
.nav button { display: flex; width: 100%; align-items: center; gap: 10px; color: #dbe7df; border: 0; background: transparent; padding: 12px; border-radius: 9px; text-align: left; font-size: .92rem; }
.nav button svg { width: 18px; height: 18px; color: #a9c4b3; }
.nav button:hover { background: #ffffff10; }
.nav button[aria-current="page"] { background: #30483b; color: #e5f7c9; font-weight: 650; }
.nav button[aria-current="page"] svg { color: #d5efaa; }
.sidebar-footer { margin-top: auto; padding: 16px 5px 0; border-top: 1px solid #ffffff19; display: flex; gap: 9px; align-items: center; }
.admin-avatar { background: #d9ebcb; color: #274d38; border-radius: 9px; width: 34px; height: 34px; display: grid; place-items: center; font-weight: 750; font-size: .76rem; flex: none; }
.admin-text { display: grid; gap: 3px; }
.admin-text strong { font-size: .84rem; }
.admin-text span { color: #b1c5b8; font-size: .74rem; }
.logout { background: transparent; border: 0; color: #bed0c4; padding: 8px; margin-left: auto; border-radius: 8px; display: grid; place-items: center; }
.logout:hover { color: #fff; background: #ffffff12; }
.logout svg { width: 18px; height: 18px; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: white; border-bottom: 1px solid var(--line); gap: 16px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.breadcrumb svg { width: 15px; height: 15px; }
.breadcrumb strong { color: var(--ink); }
.month-picker { position: relative; display: flex; align-items: center; height: 39px; border: 1px solid var(--line); background: #fff; border-radius: 8px; overflow: hidden; white-space: nowrap; }
.month-picker button { display: grid; place-items: center; align-self: stretch; width: 34px; border: 0; background: #fff; color: var(--muted); padding: 0; }
.month-picker button:hover { background: var(--soft); color: var(--ink); }
.month-picker button svg { width: 16px; height: 16px; }
.month-field { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 8px; height: 100%; font-size: .88rem; font-weight: 650; color: var(--ink); }
.month-field svg { width: 16px; height: 16px; color: var(--green); }
.month-field input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.month-field:focus-within { outline: 2px solid #3a9067; outline-offset: -3px; }
.month-field input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.main { max-width: 1596px; margin: 0 auto; padding: 27px 32px 48px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 20px; isolation: isolate; position: relative; overflow: hidden; padding: 31px 31px 30px; min-height: 175px; border-radius: 15px; background: linear-gradient(110deg,#1d372d 47%,#215541 100%); color: white; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0 0 0 57%; background: radial-gradient(ellipse at 76% 12%, #7da57240, transparent 66%), linear-gradient(90deg, #1f4437 0, transparent 50%), repeating-linear-gradient(90deg,#e2f3bb17 0 1px,transparent 1px 32px), repeating-linear-gradient(#e2f3bb17 0 1px,transparent 1px 32px); mask-image: linear-gradient(90deg,transparent,#000 32%); }
.hero-art { position: absolute; z-index: -1; right: 10px; bottom: -4px; width: min(48%, 480px); height: 168px; color: #d3efac; opacity: .22; }
.hero .period { display: inline-flex; align-items: center; gap: 6px; color: #d7e9cd; font-size: .82rem; font-weight: 600; border: 1px solid #c8e5b940; background: #c9dfb213; border-radius: 6px; padding: 5px 8px; margin-bottom: 9px; }
.period svg { width: 13px; height: 13px; }
.hero h1 { font-size: clamp(1.65rem, 3vw, 2.22rem); letter-spacing: .045em; line-height: 1.28; margin-bottom: 8px; }
.hero p { color: #deebdf; font-size: .94rem; }
.hero-actions { display: flex; gap: 9px; flex: none; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--strong-line); border-radius: 8px; min-height: 38px; padding: 8px 12px; background: white; color: var(--ink); font-size: .875rem; font-weight: 640; text-decoration: none; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: #f1f7ef; border-color: #b8cdbc; }
.btn.primary { background: #216449; border-color: #216449; color: white; }
.btn.primary:hover { background: #174d37; }
.btn.lime { color: #213827; background: var(--lime); border-color: var(--lime); }
.btn.lime:hover { background: #e6f7bc; }
.btn.hero-outline { color: #edf5ec; background: #214635bc; border-color: #e3f5d15c; }
.btn.hero-outline:hover { background: #2b5942; }
.btn.danger { color: var(--danger); border-color: #e7c9c1; }
.btn.danger:hover { background: #fff1ed; }
.btn.small { font-size: .81rem; padding: 5px 8px; min-height: 31px; }
.btn.small svg { width: 15px; height: 15px; }
.icon-button { display: inline-grid; place-items: center; border: 1px solid var(--line); background: white; padding: 6px; border-radius: 7px; color: var(--muted); }
.icon-button:hover { color: var(--green); background: #eff5ee; }
.icon-button svg { width: 16px; height: 16px; }
.metrics { margin: 17px 0; display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { border: 1px solid var(--line); background: white; box-shadow: var(--shadow); border-radius: 12px; padding: 15px 17px 14px; min-width: 0; }
.metric-top { color: #53645a; display: flex; align-items: center; gap: 8px; font-size: .87rem; font-weight: 650; }
.metric-icon { display: grid; place-items: center; background: #edf5e9; color: #347256; border-radius: 8px; width: 32px; height: 32px; }
.metric-icon svg { width: 17px; height: 17px; }
.metric-value { margin-top: 7px; overflow-wrap: anywhere; font-size: clamp(1.38rem, 2.4vw, 1.85rem); line-height: 1.1; font-weight: 740; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.metric small { display: block; margin-top: 7px; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.dashboard-grid { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) 244px; gap: 15px; }
.side-panels { display: grid; gap: 14px; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel-header { min-height: 71px; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 15px 17px; }
.panel-header h2 { font-size: 1.08rem; color: var(--ink); }
.panel-header p { color: var(--muted); font-size: .81rem; margin-top: 4px; }
.panel-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filter { display: flex; gap: 8px; align-items: center; }
.filter-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.filter > select, .search { height: 35px; background-color: #fff; border: 1px solid var(--line); border-radius: 7px; color: var(--text); font-size: .83rem; }
.search { display: flex; align-items: center; padding: 0 8px; width: 150px; gap: 6px; }
.search svg { width: 15px; height: 15px; color: var(--muted); }
.search input { color: var(--text); background: transparent; border: 0; width: 100%; outline: 0; padding: 5px 0; }
.search:focus-within { outline: 2px solid #3a9067; }
.filter > select { padding: 0 26px 0 8px; }
select { appearance: none; padding-right: 29px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16' fill='none' stroke='%235d7063' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6 3.5 3.5L11.5 6'/%3E%3C/svg%3E"); background-position: right 7px center; background-repeat: no-repeat; }
.table-scroll { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; text-align: left; font-size: .86rem; font-variant-numeric: tabular-nums; }
thead { background: #f1f5f0; color: #53675b; font-size: .78rem; }
th, td { padding: 11px 9px; }
th:first-child, td:first-child { padding-left: 17px; }
th:last-child, td:last-child { padding-right: 17px; }
td { border-bottom: 1px solid #edf0ec; height: 52px; }
tbody tr:hover { background: #f9fbf8; }
tbody tr:last-child td { border-bottom: none; }
.person { display: flex; gap: 8px; align-items: center; }
.person strong { color: var(--ink); font-size: .87rem; }
.person .muted { display: block; margin-top: 2px; font-size: .72rem; }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 650; font-size: .82rem; background: var(--avatar-bg, #e4eee4); color: var(--avatar-ink, #315943); }
.tag { display: inline-flex; align-items: center; border-radius: 5px; padding: 3px 6px; font-size: .73rem; font-weight: 620; background: #eaf2eb; color: #386349; }
.tag.note { background: #f2f1e9; color: #685b2e; }
.tag.grey { background: #edf0ee; color: #55635c; }
.tag.role-1 { background: #e8eff7; color: #3f5f84; }
.tag.role-2 { background: #eeeaf7; color: #604d81; }
.tag.role-3 { background: #f7f0e2; color: #795325; }
.sub { display: block; font-size: .73rem; margin-top: 3px; color: var(--muted); }
.muted { color: var(--muted); }
.net { font-weight: 750; color: var(--ink); }
.row-actions { display: flex; gap: 5px; align-items: center; }
.table-foot { min-height: 42px; display: flex; align-items: center; padding: 11px 17px; color: var(--muted); border-top: 1px solid var(--line); font-size: .78rem; }
.empty { text-align: center; padding: 35px 15px; color: var(--muted); white-space: normal; }
.empty strong { color: var(--ink); display: block; font-size: 1rem; margin-bottom: 6px; }
.mini-panel { padding: 15px; }
.mini-heading { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 12px; }
.mini-heading h2 { font-size: .97rem; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.mini-heading h2 svg { width: 16px; height: 16px; color: var(--green); }
.text-button { background: none; border: 0; padding: 2px; color: var(--green); font-size: .84rem; font-weight: 690; }
.text-button:hover { text-decoration: underline; }
.rate-line { display: flex; gap: 6px; align-items: center; justify-content: space-between; border-bottom: 1px solid #edf0ec; padding: 8px 0; font-size: .82rem; }
.rate-line:last-child { border-bottom: 0; }
.currency-code { display: inline-grid; place-items: center; background: #eef4ed; color: #356448; min-width: 34px; padding: 3px 5px; border-radius: 5px; font-size: .71rem; font-weight: 750; }
.role-count { margin: 11px 0 0; }
.role-count div { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 5px; }
.role-count strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { width: 100%; height: 5px; border-radius: 5px; background: #eef1ed; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 5px; background: #87b79a; }
.sample-box { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; border: 1px solid #dfe8db; background: #eef4ea; color: #4e6854; padding: 8px 13px; border-radius: 8px; font-size: .8rem; align-items: center; }
.sample-box div { display: flex; align-items: center; gap: 7px; }
.sample-box svg { width: 15px; height: 15px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 17px; }
.page-head h1 { font-size: 1.8rem; color: var(--ink); margin-bottom: 5px; }
.page-head p { font-size: .9rem; color: var(--muted); }
.page-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-bottom: 17px; }
.rate-card { padding: 18px; }
.rate-card h2 { font-size: 1.02rem; margin-bottom: 8px; }
.rate-card .metric-value { margin: 0 0 8px; }
.rate-card p { font-size: .86rem; color: var(--muted); }
.formula { padding: 19px; }
.formula h2 { font-size: 1.03rem; }
.formula p { margin-top: 9px; font-size: .9rem; line-height: 1.7; color: var(--muted); }
.formula code { font-family: inherit; color: var(--green); font-weight: 650; }
.mobile-toggle { display: none; }
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); min-height: 100dvh; }
.login-brand { color: white; background: radial-gradient(ellipse at 75% 87%, #386f53 0%, transparent 65%), #1b352a; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(25px, 5vw, 66px); position: relative; overflow: hidden; isolation: isolate; }
.login-brand::after { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(90deg,#e2f3bb1c 0 1px,transparent 1px 49px),repeating-linear-gradient(#e2f3bb1c 0 1px,transparent 1px 49px); mask-image: radial-gradient(ellipse at 70% 85%, #000, transparent 70%); }
.login-brand .brand { padding: 0; }
.login-brand h1 { font-size: clamp(2rem, 4.4vw, 4.25rem); letter-spacing: .07em; line-height: 1.22; }
.login-brand .signin-art { width: min(100%, 490px); height: auto; max-height: 31vh; color: #cbe9a7; opacity: .35; }
.login-main { display: grid; place-items: center; padding: 22px; background: #f6f8f4; }
.login-form { width: min(100%, 397px); display: grid; gap: 17px; padding: 29px; background: white; border: 1px solid var(--line); box-shadow: 0 25px 65px #213f2a0b; border-radius: 15px; }
.login-form h2 { font-size: 1.65rem; color: var(--ink); }
.login-form p { color: var(--muted); font-size: .9rem; }
.login-form .btn { min-height: 43px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-field { display: grid; gap: 6px; font-size: .88rem; color: var(--ink); font-weight: 650; min-width: 0; }
.form-field input, .form-field select { width: 100%; height: 41px; border: 1px solid var(--strong-line); border-radius: 7px; background-color: white; color: var(--ink); padding: 7px 9px; font-weight: 500; }
.form-field input:read-only { background: #f0f4ee; }
.form-field small { color: var(--muted); font-size: .8rem; font-weight: 400; line-height: 1.45; }
.form-field.wide { grid-column: 1 / -1; }
.input-group { position: relative; }
.input-group input { padding-right: 51px; }
.input-group span { position: absolute; top: 50%; transform: translateY(-50%); right: 10px; color: var(--muted); font-size: .81rem; font-weight: 600; pointer-events: none; }
dialog { width: min(95vw, 570px); max-height: 91dvh; padding: 0; border: 1px solid var(--line); border-radius: 15px; color: var(--text); box-shadow: 0 18px 80px #182b2540; }
dialog::backdrop { background: #12271fb0; backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 19px 20px 15px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.24rem; color: var(--ink); }
.dialog-head p { font-size: .84rem; color: var(--muted); margin-top: 5px; line-height: 1.55; }
.dialog-body { padding: 19px 20px; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); }
.dialog-footer .push { margin-right: auto; }
.form-note { font-size: .84rem; color: var(--muted); line-height: 1.6; }
.field-error { color: var(--danger) !important; font-size: .86rem; font-weight: 600; margin-top: 9px; }
.notice { background: #f4f7ef; border: 1px solid #e0ead8; border-radius: 8px; padding: 10px 11px; color: #41634e; font-size: .84rem; line-height: 1.6; }
.notice.warn { background: #f9f4e9; border-color: #eddfbe; color: #765629; }
.toast { position: fixed; z-index: 6; bottom: 20px; right: 20px; max-width: min(460px,calc(100vw - 40px)); padding: 11px 15px; border: 1px solid #416951; color: white; background: #234a38; border-radius: 8px; box-shadow: 0 8px 36px #182b2536; font-size: .89rem; }
.toast.error { background: #813328; border-color: #873f34; }
.slip { border: 1px solid var(--line); border-radius: 10px; padding: 17px; background: #fff; }
.slip-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 2px solid #2b6249; }
.slip-head h3 { font-size: 1.16rem; color: var(--ink); }
.slip-head small { color: var(--muted); }
.slip dl { margin: 9px 0; }
.slip dl > div { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.slip dt { color: var(--muted); font-size: .85rem; }
.slip dd { text-align: right; margin: 0; overflow-wrap: anywhere; font-size: .86rem; }
.slip-total { display: flex; gap: 12px; justify-content: space-between; align-items: center; background: #eaf4e8; padding: 10px; border-radius: 6px; color: #214d38; font-size: .9rem; }
.slip-total strong { font-size: 1.22rem; }
.slip-meta { margin-top: 9px; color: var(--muted); line-height: 1.6; font-size: .75rem; }
.print-area { display: none; }
@media(max-width: 1310px) {
  .layout { grid-template-columns: 192px minmax(0,1fr); }
  .main { padding-inline: 22px; } .topbar { padding-inline: 22px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 213px; gap: 12px; }
  .panel-header { padding-inline: 13px; }
  th, td { padding-inline: 6px; }
  th:first-child, td:first-child { padding-left: 12px; } th:last-child, td:last-child { padding-right: 12px; }
  .search { width: 120px; }
}
@media(max-width: 1130px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .side-panels { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width: 760px) {
  .layout { display: block; }
  .main { padding: 14px 12px 28px; } .topbar { height: 58px; padding-inline: 11px; }
  .topbar-left { display: flex; gap: 7px; align-items: center; }
  .mobile-toggle { display: inline-grid; }
  .sidebar { position: fixed; z-index: 4; width: min(78vw,230px); inset: 0 auto 0 0; transform: translateX(-105%); visibility: hidden; }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .nav-scrim { position: fixed; z-index: 3; inset: 0; background: #14291f80; border: 0; }
  .hero { padding: 19px 14px; flex-direction: column; align-items: start; min-height: auto; gap: 12px; }
  .hero p { font-size: .85rem; }
  .hero-art { opacity: .16; }
  .metrics { gap: 7px; margin-block: 10px; }
  .metric { padding: 9px 8px; }
  .metric-icon { width: 23px; height: 23px; }
  .metric-icon svg { width: 14px; height: 14px; }
  .metric-top { gap: 4px; font-size: .73rem; }
  .metric-value { font-size: clamp(.9rem, 3.6vw, 1.4rem); }
  .metric small { font-size: .72rem; }
  .panel-header { flex-wrap: wrap; min-height: auto; }
  .side-panels { gap: 8px; }
  .mini-panel { padding: 9px; }
  .page-cards { gap: 7px; }
  .rate-card { padding: 9px; }
  .rate-card h2, .rate-card p { font-size: .8rem; }
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { gap: 25px; padding: 22px; }
  .login-brand .signin-art { display: none; }
}
@media(max-width: 410px) {
  .breadcrumb .crumb-root, .breadcrumb svg { display: none; }
  .hero-actions .btn { font-size: .8rem; }
  .page-head { flex-wrap: wrap; }
}
@media print {
  body { background: #fff; }
  body > :not(#print-area) { display: none !important; }
  .print-area { display: block; width: min(100%, 172mm); margin: 12mm auto; }
  .slip { border: none; }
  .slip-total { border: 1px solid #2b6249; }
}

.usd-stack { display: grid; gap: 15px; }
.usd-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.usd-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0 24px; justify-content: space-between; }
.usd-context { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; padding: 14px; }
.usd-context label { min-width: 140px; }
.usd-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; }
.usd-tabs button { background: transparent; border: 0; border-radius: 7px; font-weight: 650; color: var(--muted); padding: 9px 12px; }
.usd-tabs button[aria-current] { background: #e6f0e4; color: #255d45; }
.usd-keyrow { display: inline-flex; gap: 5px; align-items: center; }
.usd-keybox { font-family: Consolas,monospace; letter-spacing: .035em; }
.usd-note { max-width: 30ch; white-space: normal; overflow-wrap: anywhere; }
.usd-employee { display: inline-flex; gap: 8px; align-items: center; }
.usd-staff { max-width: 1240px; }
.usd-brandbar { background: #182c25; color: white; min-height: 70px; }
.usd-brandbar .brand { padding: 0; }
.usd-payout { padding: 15px; }
.usd-payout .slip { border: 0; padding: 0; }
.usd-key-display { margin-top: 10px; }
.usd-key-display input { font-family: Consolas,monospace; }
.usd-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.usd-deductions { margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; }
.usd-deductions legend { font-weight: 650; padding: 0 4px; }
.usd-deductions label { display: block; padding: 4px 0; font-size: .88rem; }
.usd-deductions input { accent-color: #216449; }
.fx-rate[hidden] { display: none; }
.fx-preview { grid-column: 1 / -1; min-height: 1.1em; margin: 0; }
.fx-pending { padding: 24px; }
.fx-pending p { margin: 8px 0 16px; color: var(--muted); }
@media(max-width:920px) {
  .usd-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .usd-top { padding-inline: 10px; }
  .usd-context { padding: 10px; }
  .usd-context label { flex: 1; }
}
.usd-maintenance { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; }
.dialog:has(.chart-scroll), dialog:has(.chart-scroll) { width: min(960px, calc(100% - 28px)); }
.chart-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.chart-scroll canvas { display: block; width: 100%; height: auto; min-width: 640px; }
.chart-values { margin-top: 12px; }
.finance-note { margin-top: 12px; }
.finance-note textarea { min-height: 82px; resize: vertical; }
.finance-option-field { display: flex; gap: 6px; min-width: 0; }
.finance-option-field :is(input, select) { flex: 1; min-width: 0; width: auto; }
.finance-option-add { width: 36px; height: 41px; flex: none; }
.finance-option-editor { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-tint); }
.finance-option-error { color: var(--danger); font-size: .82rem; }
form[data-form="finance-save"] input[name="title"]::placeholder { color: var(--muted); opacity: .82; }
.finance-filters { justify-content: flex-end; }
.finance-forecast { display: flex; flex-wrap: wrap; gap: 12px 36px; padding: 14px 18px; }
.finance-forecast div { display: grid; gap: 4px; }
.finance-forecast span { color: var(--muted); }
.finance-forecast .finance-negative, .finance-negative { color: var(--danger); font-weight: 700; }
.finance-forecast .finance-positive, .finance-positive { color: #23644b; font-weight: 700; }
.finance-version { padding: 13px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.finance-version:last-child { border-bottom: 0; }
.finance-version p { margin-top: 5px; }
.finance-remark { white-space: pre-wrap; }
.finance-projects > summary { cursor: pointer; padding: 12px 16px; font-weight: 650; }
.finance-projects > section { border: 0; box-shadow: none; }
@media (max-width: 660px) { .topbar.usd-top { height: auto; min-height: 58px; padding-block: 8px; } }
.nav .nav-lock { margin-inline-start: auto; display: inline-flex; }
.nav .nav-lock svg { width: 14px; height: 14px; }
.access-notice { padding: clamp(24px, 5vw, 48px); }
.access-notice h1 { margin: 0 0 8px; }
.access-notice p { margin: 0; color: var(--muted); }
.access-list { padding: 0; margin: 0; list-style: none; }
.access-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 10px 0;
}
.access-row + .access-row { border-top: 1px solid var(--line); }
.access-label, .access-actions { display: inline-flex; align-items: center; gap: 8px; }
.access-label { font-weight: 600; }
.access-label svg { width: 17px; height: 17px; color: var(--muted); }
.access-actions .btn { min-width: 68px; justify-content: center; }

:root {
  --ink: #25242a;
  --text: #393740;
  --muted: #66636b;
  --green: #79525e;
  --paper: #f7f6f5;
  --line: #e8e5e6;
  --strong-line: #d8d4d6;
  --soft: #f1e8e9;
  --sidebar: #29262d;
  --deep: #593b46;
  --lime: #e8d6d9;
  --danger: #9c303c;
  --shadow: 0 1px 2px #29232c06, 0 3px 12px #29232c05;
  --accent: #835563;
  --accent-hover: #6f4451;
  --focus: #906574;
  --surface-tint: #f8f3f4;
}

.layout, .site-frame { min-height: 100dvh; background: var(--paper); }
.site-frame, .workspace-frame { display: flex; flex-direction: column; min-width: 0; }
.site-frame > .login { min-height: 0; flex: 1; }
.site-frame > .main, .workspace-frame > .main { width: 100%; flex: 1; }
.page-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px clamp(12px, 2.4vw, 32px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .045em;
}
.page-footer img { flex: none; }
.boot-brand { display: grid; justify-items: center; gap: 14px; }

.sidebar {
  background: linear-gradient(175deg, #29262e 0%, #302a32 76%, #393038 100%);
  color: #f8f4f6;
  overflow-y: auto;
  border-right: 1px solid #27232a;
}
.sidebar .brand { min-height: 42px; }
.brand { gap: 8px; }
.brand strong { letter-spacing: .025em; white-space: nowrap; }
.sidebar .brand strong { font-size: .86rem; }
.brand-mark {
  flex: none;
  width: 87px;
  height: 35px;
  padding: 4px 6px;
  border-radius: 7px;
  background: #faf7f5;
  box-shadow: inset 0 1px 0 #ffffff90;
}
.brand-mark img { width: 100%; height: auto; }
.login-brand .brand-mark { width: 104px; height: 39px; }
.usd-brandbar .brand-mark { padding: 0; background: none; box-shadow: none; }
.nav { gap: 5px; margin-top: 38px; }
.nav button {
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #e1dbe1;
  font-weight: 550;
}
.nav button svg, .logout, .admin-text span { color: #c8bbc6; }
.nav button:hover, .logout:hover { background: #ffffff0d; }
.nav button[aria-current="page"] {
  background: #463b46;
  color: #fff9fb;
  border-color: #594952;
  box-shadow: inset 2px 0 #d3aab2;
}
.nav button[aria-current="page"] svg { color: #e5bdc6; }
.sidebar-footer { min-height: 57px; border-top-color: #ffffff20; }
.admin-avatar { background: transparent; }
.nav-scrim { background: #28242c88; }

.topbar.usd-top, .usd-brandbar {
  height: auto;
  min-height: 66px;
  padding-block: 10px;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.breadcrumb strong { font-weight: 700; }
.usd-brandbar { padding-inline: clamp(14px, 3.4vw, 42px); }
.topbar.usd-top .usd-actions, .usd-brandbar .usd-actions { gap: 6px; }

:focus-visible { outline-color: var(--focus); }
.sidebar :focus-visible { outline-color: #e4bfc9; }
.btn, .icon-button, .nav button, .usd-tabs button, .logout {
  transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s, translate .12s;
}
.btn, .icon-button {
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px #28232b09;
}
.btn { padding-inline: 13px; border-color: var(--strong-line); }
.btn.small { padding-inline: 10px; min-height: 33px; }
.btn svg, .icon-button svg { color: #6b626b; }
.icon-button { min-width: 34px; min-height: 34px; }
.btn:hover, .icon-button:hover { color: var(--ink); background: #f5f3f4; border-color: #beb7bd; }
.btn:active:not(:disabled), .icon-button:active:not(:disabled) { translate: 0 1px; }
.btn.primary, .btn.lime {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px #38272e19, inset 0 1px 0 #ffffff20;
}
.btn.primary:hover, .btn.lime:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary svg, .btn.lime svg, .btn.danger svg { color: inherit; }
.btn.export-btn, .btn.admin-shortcut, .btn.finance-account-btn, .btn.hero-outline {
  background: var(--surface-tint);
  border-color: #e5d9de;
  color: var(--deep);
}
.btn.export-btn:hover, .btn.admin-shortcut:hover, .btn.finance-account-btn:hover, .btn.hero-outline:hover {
  background: var(--soft);
  border-color: #ccb3bc;
}
.btn.danger { color: var(--danger); background: #fff; border-color: #eed9de; }
.btn.danger:hover { background: #fff0f2; border-color: #d6a2a9; }
tbody .btn.primary { background: var(--surface-tint); color: var(--deep); border-color: #e4d6dd; box-shadow: none; }
tbody .btn.primary:hover { background: var(--soft); border-color: #c9aeb9; }
.btn:disabled, .icon-button:disabled { box-shadow: none; }

.page-head, .hero {
  align-items: flex-end;
  padding: 4px 0 10px;
}
.usd-stack > .page-head { margin-bottom: 0; }
.hero {
  min-height: 0;
  background: none;
  color: var(--text);
  overflow: visible;
}
.hero::after { content: none; }
.hero h1, .page-head h1 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: clamp(1.48rem, 2.45vw, 2.12rem);
  line-height: 1.25;
  letter-spacing: .012em;
  overflow-wrap: anywhere;
}
.hero p, .page-head p { color: var(--muted); line-height: 1.55; }
.finance-tail { color: var(--green); font-family: Consolas, monospace; letter-spacing: .05em; font-weight: 650; }
.usd-context { padding: 15px 17px; gap: 14px; }

.panel, .metric { border-radius: 11px; }
.usd-stack > .usd-summary { margin-block: 1px; }
.metric { background: #fff; padding: 17px 16px 15px; }
.metric-top { color: var(--muted); }
.metric-icon { background: var(--soft); color: var(--green); border-radius: 8px; flex: none; }
.metric-value { margin-top: 10px; }
.panel-header { min-height: 58px; }
.panel-header h2 { letter-spacing: .015em; }
.table-scroll { border-radius: 0 0 10px 10px; }
.table-scroll thead { background: #f5f3f4; color: #514a55; }
.table-scroll th { font-weight: 700; border-block: 1px solid var(--line); }
td, .rate-line { border-bottom-color: #efedef; }
.table-scroll tbody tr:nth-child(even) { background: #fdfcfc; }
.table-scroll tbody tr:hover, .chart-values tbody tr:hover { background: #f7f1f3; }
.avatar { flex: none; background: transparent; }
.tag { border-radius: 999px; padding-inline: 8px; }
.tag:not(.note, .grey, .role-1, .role-2, .role-3) { background: #e8f1eb; color: #325e46; }
.tag.grey { background: #f1eeef; color: #605962; }
.usd-tabs { gap: 3px; padding: 5px; }
.usd-tabs button { min-height: 34px; }
.usd-tabs button:hover { background: #f5f3f4; color: var(--ink); }
.usd-tabs button[aria-current] { background: var(--soft); color: var(--deep); box-shadow: inset 0 -2px #c5a4b0; }
.finance-projects > summary:hover { background: #f8f6f7; }
.finance-projects > summary::marker, .chart-values > summary::marker { color: var(--green); }

.login {
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 1fr);
  padding: 14px;
  gap: 14px;
}
.login-brand {
  --shape-size: clamp(285px, 37vw, 525px);
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 92% 14%, #9b7b8160 0, transparent 65%),
    linear-gradient(146deg, #29262d 10%, #3b3139 61%, #584047 100%);
}
.login-brand::before, .login-brand::after {
  content: "";
  position: absolute;
  left: auto;
  top: 15%;
  right: -19%;
  bottom: auto;
  z-index: -1;
  width: var(--shape-size);
  aspect-ratio: 1;
  pointer-events: none;
  border-radius: 25%;
  transform: rotate(-28deg);
  mask-image: none;
}
.login-brand::before {
  background: linear-gradient(136deg, #e1c1c22e, #c799a017 49%, #dfb9b025);
  border: 1px solid #e3cac731;
  box-shadow: 0 32px 65px #1c141d33;
}
.login-brand::after {
  top: 25%;
  right: -3%;
  border: 1px solid #efc9ce2b;
  background: linear-gradient(115deg, #a077815c, #c4979a18 55%, #ddadb264);
  box-shadow: 0 22px 48px #21172128;
}
.login-brand h1 { color: #fffaf9; text-wrap: balance; font-size: clamp(1.95rem, 3.8vw, 3.8rem); letter-spacing: .035em; }
.login-main { padding: clamp(20px, 4vw, 48px); background: none; }
.login-form {
  width: min(100%, 422px);
  padding: clamp(22px, 3.4vw, 34px);
  border-radius: 15px;
  box-shadow: 0 3px 22px #33293209;
}
.login-form h2 { font-size: clamp(1.35rem, 2.15vw, 1.65rem); letter-spacing: .01em; }
.login-form .btn { min-height: 44px; }
.login-form .btn:not(.primary) { background: #fff; color: var(--green); }
.login-form .btn:not(.primary):hover { background: var(--surface-tint); }

.form-field input, .form-field select, .form-field textarea, .filter > select {
  border: 1px solid var(--strong-line);
  border-radius: 8px;
  background-color: #fff;
  color: var(--ink);
}
.form-field textarea { width: 100%; padding: 8px 10px; font: inherit; font-weight: 500; }
.form-field input:read-only { background-color: #f4f2f3; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--focus); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16' fill='none' stroke='%2366636b' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6 3.5 3.5L11.5 6'/%3E%3C/svg%3E");
}
.search:focus-within, .month-field:focus-within { outline-color: var(--focus); }
.usd-deductions input, .form-field input { accent-color: var(--accent); }
.currency-code { background: var(--soft); color: var(--deep); }

dialog { border-radius: 13px; box-shadow: 0 20px 70px #2b242d45; }
dialog::backdrop { background: #2a242d8c; }
.dialog-head, .dialog-footer { background: #faf9f9; }
.dialog-head p:empty, .dialog-footer:empty { display: none; }
.dialog-head .btn { box-shadow: none; }
.dialog-body > .panel { margin-top: 12px; }
.notice { background: var(--surface-tint); border-color: #e8dce0; color: var(--deep); }
.notice.warn { background: #fcf5e8; border-color: #eddfbe; color: #765629; }
.toast { background: #4d3c49; border-color: #695565; }
.toast.error { background: #8b2936; border-color: #a34354; }
.chart-scroll { border-radius: 9px; }

@media screen {
  .slip-head { border-bottom-color: #aa818f; }
  .slip-total { background: var(--surface-tint); color: var(--deep); }
}
@media (max-width: 760px) {
  .topbar.usd-top { min-height: 58px; }
  .hero, .page-head { align-items: flex-start; }
  .hero { padding: 4px 0 8px; }
  .usd-context { padding: 12px; }
  .metric { padding: 11px 10px; }
  .metric-value { margin-top: 7px; }
  .btn.small { padding-inline: 8px; }
  .login { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 0; }
  .login-brand { min-height: 168px; padding: 20px; }
  .login-brand::before, .login-brand::after { top: -32%; right: -18%; }
  .login-brand::after { top: -22%; right: -8%; }
  .login-main { padding: 18px 8px 22px; }
}
@media (max-width: 410px) {
  .page-head { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .icon-button, .nav button, .usd-tabs button, .logout { transition: none; }
  .btn:active:not(:disabled), .icon-button:active:not(:disabled) { translate: none; }
}

.manual { display: grid; gap: 18px; }
.manual-header { padding: clamp(20px, 3vw, 34px); }
.manual-header h1 { color: var(--ink); font-size: clamp(1.65rem, 3vw, 2.25rem); }
.manual-header p { margin-top: 8px; color: var(--muted); line-height: 1.65; }
.manual-layout {
  display: grid;
  grid-template-columns: minmax(190px, 224px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}
.manual-toc {
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 17px;
}
.manual-toc h2 { color: var(--ink); font-size: 1rem; }
.manual-toc ol { margin: 11px 0 0; padding: 0 0 0 24px; color: var(--muted); font-size: .85rem; }
.manual-toc li + li { margin-top: 3px; }
.manual-toc a {
  display: block;
  padding: 6px 4px;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
}
.manual-toc a:hover { background: var(--surface-tint); color: var(--deep); text-decoration: underline; }
.manual-content { padding: clamp(16px, 3.4vw, 38px); }
.manual-content section {
  max-width: 760px;
  margin-inline: auto;
  scroll-margin-top: 16px;
  line-height: 1.82;
  overflow-wrap: anywhere;
}
.manual-content section + section { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.manual-content h2 { color: var(--ink); font-size: clamp(1.19rem, 2.4vw, 1.53rem); line-height: 1.4; }
.manual-content h3 { color: var(--ink); font-size: 1.03rem; margin-top: 19px; }
.manual-content p, .manual-content ol, .manual-content ul, .manual-table { margin: 9px 0 0; }
.manual-content ol, .manual-content ul { padding-inline-start: 1.55em; }
.manual-content li + li { margin-top: 5px; }
.manual-content a { color: var(--green); text-underline-offset: 3px; }
.manual-content .manual-note { margin-top: 14px; padding: 11px 13px; background: var(--surface-tint); border-left: 3px solid var(--accent); }
.manual-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.manual-table table { white-space: normal; }
.manual-table th { text-align: left; }
.manual-table th[scope="row"] { width: 29%; color: var(--ink); }
.manual-table thead { background: var(--surface-tint); color: var(--ink); }
.manual-table tbody tr:hover { background: #fff; }
.manual-table tr + tr { border-top: 1px solid var(--line); }
.manual-questions dt { margin-top: 13px; color: var(--ink); font-weight: 700; }
.manual-questions dd { margin: 3px 0 0; }
.manual-content .manual-back { margin-top: 18px; font-weight: 650; }

@media (max-width: 930px) {
  .manual-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .manual-toc { position: static; max-height: none; }
}
@media (min-width: 440px) and (max-width: 930px) {
  .manual-toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 26px; }
  .manual-toc li + li { margin-top: 0; }
}
