/* RJ workspace: semantic tokens, task-first layouts, and accessible controls.
   Screen only. report-print.css remains the independent print authority. */
:root {
  --navy: #111e2d;
  --blue: #246bdb;
  --ink: #172c40;
  --muted: #52677d;
  --line: #dce4ec;
  --bg: #f3f6f9;
  --radius: 12px;
  --shadow: none;
  --ui-text: #172c40;
  --ui-text-secondary: #52677d;
  --ui-text-on-dark: #b6c8d9;
  --ui-surface: #ffffff;
  --ui-surface-subtle: #f6f8fb;
  --ui-border: #dce4ec;
  --ui-control-border: #8495a7;
  --ui-focus: #326fb7;
  --ui-accent: #e1ad58;
  --ui-danger: #ad3042;
  --ui-positive: #146c55;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 24px;
  --ui-space-6: 32px;
  --ui-space-7: 48px;
}
[hidden] { display: none !important; }
html.auth-history-restore body { visibility: hidden !important; pointer-events: none !important; }
html { scroll-padding-top: 90px; }
body { line-height: 1.6; }
::selection { background: #dceaff; color: #153c70; }
input, textarea { caret-color: var(--blue); }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { text-underline-offset: 4px; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 3px solid var(--ui-focus); outline-offset: 3px;
}
input, select, textarea {
  max-width: 100%; min-height: 44px; border-color: var(--ui-control-border); border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ui-focus); box-shadow: 0 0 0 2px #dceaff; outline: 1px solid var(--ui-focus);
}
input::placeholder, textarea::placeholder { color: var(--ui-text-secondary); opacity: 1; font-weight: 400; }
input.field-invalid, select.field-invalid, textarea.field-invalid {
  border-color: var(--ui-danger); outline: 1px solid var(--ui-danger); background: #fffafb;
}
.skip-link {
  position: fixed; left: 20px; top: -100px; padding: 12px 18px; z-index: 2000;
  color: #fff; background: var(--navy); border-radius: 8px;
}
.skip-link:focus { top: 12px; }
.btn, .btn.small, .text-button { min-height: 44px; }
.btn { padding: 10px 16px; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.btn.small { font-size: 12px; padding: 8px 12px; }
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--blue); }
.btn.primary:hover { background: #1858bd; }
.btn.secondary { border-color: #b6c5d4; color: #38536e; }
.btn.secondary:hover { background: #f0f5fb; border-color: #829db9; }
.btn.danger { border-color: #d7a1ab; color: var(--ui-danger); }
.btn.danger:hover { background: #fff1f3; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:active, .text-button:active { transform: translateY(1px); }
.ui-icon { flex: none; }
.field-label { gap: 7px; }
.field-label .ui-icon, th .ui-icon { color: #56718c; }
th .ui-icon { margin-right: 5px; }
.app-body { background: var(--bg); }
.sidebar { z-index: 50; width: 248px; flex-basis: 248px; background: var(--navy); padding-top: 25px; }
.brand { gap: 11px; }
.brand-mark { border-radius: 10px; }
.nav-label { color: #a3b8cc; letter-spacing: .08em; font-size: 11px; }
.nav { gap: 3px; }
.nav a { min-height: 44px; font-size: 13px; padding: 10px 13px; border-radius: 7px; color: #b6c8d9; }
.nav a.active { background: #2a425a; box-shadow: none; color: #fff; }
.nav a.active .ui-icon { color: var(--ui-accent); }
.nav a:hover { transform: none; background: #22394e; }
.sidebar-close { display: none; }
.sidebar-foot { padding: 14px 10px 0; color: var(--ui-text-on-dark); }
.session-facts dt { color: #a3b8cc; }
.session-facts dd { line-height: 1.55; font-size: 11px; overflow-wrap: anywhere; }
.copyright { color: #a3b8cc; }
.topbar { min-height: 72px; height: auto; padding: 13px 36px; gap: 16px; background: #fff; box-shadow: none; }
.breadcrumb, .breadcrumb a { color: var(--ui-text-secondary); font-size: 13px; }
.breadcrumb { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-actions { flex-shrink: 0; gap: 12px; }
.top-actions .avatar { width: 40px; height: 40px; flex: none; }
.top-actions .text-button { min-width: 44px; justify-content: center; }
.content { max-width: 1640px; width: 100%; padding: 32px 36px 56px; margin: 0 auto; }
.page-head { align-items: center; gap: 20px; margin-bottom: 24px; }
.page-head > div { min-width: 0; }
h1 { font-size: clamp(25px, 2.2vw, 30px); letter-spacing: -.025em; line-height: 1.35; overflow-wrap: anywhere; }
h2 { font-size: 17px; line-height: 1.5; letter-spacing: -.01em; }
.page-head p { color: var(--ui-text-secondary); font-size: 14px; line-height: 1.7; max-width: 75ch; margin-bottom: 0; }
.document-meta { display: block; margin: 0 0 8px; color: var(--ui-text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.date-pill { color: #435e79; background: #e8eef5; font-size: 12px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.panel { background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--radius); box-shadow: none; margin-bottom: 24px; }
.panel-head { min-width: 0; padding: 18px 20px; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { min-width: 0; }
.panel-head .count { margin-left: auto; }
.panel-head a { display: inline-flex; align-items: center; min-height: 44px; }
.count { background: #edf2f7; color: var(--ui-text-secondary); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.muted, .block, .empty { color: var(--ui-text-secondary); }
.block { font-size: 12px; line-height: 1.65; }
.info-note { color: #3c5873; background: #f0f5fa; border: 1px solid #d9e4ef; line-height: 1.7; overflow-wrap: anywhere; font-size: 13px; }
.metrics, .metrics.two, .metrics.three {
  border: 1px solid var(--ui-border); border-radius: var(--radius); gap: 0; overflow: hidden; margin-bottom: 24px; background: #fff;
}
.metric {
  border: 0; border-radius: 0; box-shadow: none; padding: 22px; min-width: 0; min-height: 138px;
  border-inline-end: 1px solid var(--ui-border); background: #fff; justify-content: flex-start;
}
.metric:last-child { border-inline-end: 0; }
.metric > span { color: var(--ui-text-secondary); font-size: 13px; font-weight: 600; }
.metric strong { font-size: 29px; margin-top: 10px; line-height: 1.3; letter-spacing: -.025em; white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric strong:has(.currency-unit) { display: grid; gap: 1px; }
.currency-unit { display: block; font-size: 11px; line-height: 1.5; letter-spacing: .02em; font-weight: 600; color: var(--ui-text-secondary); }
.metric-value { font-size: clamp(18px, 1.9vw, 27px); }
.metric small { color: var(--ui-text-secondary); font-size: 12px; line-height: 1.6; margin-top: 7px; }
.metric em { color: var(--ui-text-secondary); }
.badge.neutral { color: #52677d; }
.badge.pending { color: #80500a; }
.asset-label span { color: var(--ui-text-secondary); font-size: 11px; }
.metric.accent { background: #edf4fc; }
.positive { color: var(--ui-positive); }
.negative, .error-text { color: var(--ui-danger); }
.quick-actions { gap: 16px; margin-bottom: 28px; }
.action-card { box-shadow: none; border-radius: 10px; border-color: var(--ui-border); padding: 18px; }
.action-card:hover { transform: none; border-color: #8eaac8; background: #f9fbfe; }
.action-card strong { font-size: 15px; }
.action-card b { color: #4b729b; }
.action-card small { color: var(--ui-text-secondary); line-height: 1.6; }
.form-panel { padding: 0 24px 24px; }
.form-panel .panel-head { padding: 19px 0; }
.form-grid { padding-top: 24px; gap: 20px 24px; }
.form-grid > *, .asset-filters > *, .contact-row > *, .split-panels > *, .report-grid > * { min-width: 0; }
.form-grid label, .form-stack label, .asset-filters label, .filter-row label { color: #405a73; font-size: 13px; line-height: 1.6; gap: 7px; }
.form-grid label small, .form-stack label small, .asset-filters small { color: var(--ui-text-secondary); font-size: 12px; line-height: 1.6; font-weight: 400; }
.form-stack { gap: 18px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.filter-row { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.filter-row label { min-width: 0; width: min(100%, 340px); }
.review-form { gap: 8px; flex-wrap: wrap; }
.review-form input, .review-form select, .review-form .input-with-icon { min-width: 100px; }
.inline-actions { flex-wrap: wrap; gap: 8px; }
.unsaved-indicator { display: inline-flex; gap: 6px; align-items: center; color: #80530c; font-size: 12px; margin: 8px 12px; }
.form-error-review { margin-bottom: 16px; color: var(--ui-danger); }
.is-submitting button[type="submit"], .is-submitting button:not([type]) { opacity: .7; pointer-events: none; cursor: wait; }
.is-submitting button > .ui-icon { animation: ui-wait 1s linear infinite; }
@keyframes ui-wait { to { transform: rotate(360deg); } }
.task-disclosure { margin-bottom: 24px; border: 1px solid var(--ui-border); border-radius: var(--radius); background: #fff; scroll-margin-top: 90px; overflow: hidden; }
.task-summary { display: flex; align-items: center; gap: 12px; padding: 17px 20px; min-height: 64px; cursor: pointer; list-style: none; color: var(--ui-text); }
.task-summary::-webkit-details-marker, .advanced-filters summary::-webkit-details-marker { display: none; }
.task-summary > .ui-icon { color: var(--blue); }
.task-summary-copy { display: grid; gap: 3px; min-width: 0; }
.task-summary-copy strong { font-size: 15px; font-weight: 700; }
.task-summary-copy > span { color: var(--ui-text-secondary); font-size: 12px; line-height: 1.6; }
.disclosure-arrow { margin-left: auto; color: var(--ui-text-secondary); }
details[open] > summary .disclosure-arrow { transform: rotate(90deg); }
.task-disclosure[open] > .task-summary { border-bottom: 1px solid var(--ui-border); }
.task-disclosure > .disclosure-content { border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.task-disclosure > .disclosure-content > .panel-head { display: none; }
.task-disclosure .settlement-note { margin-top: 20px; margin-bottom: 0; }
.lot-issue-form { padding: 0 20px 20px; }
[data-page="materials.index"] .panel > .task-disclosure { border: 0; border-top: 1px solid var(--ui-border); border-radius: 0; margin: 20px -24px -24px; }
.section-nav { display: flex; gap: 8px 20px; flex-wrap: wrap; margin: -5px 0 24px; padding-bottom: 8px; border-bottom: 1px solid var(--ui-border); }
.section-nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 13px; color: #405d7a; font-weight: 600; }
.panel[id] { scroll-margin-top: 90px; }
.table-wrap, .chart-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #8fa6bd #eef3f7; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: -3px; }
table { font-size: 13px; }
th { color: #455f79; background: #f5f8fb; font-size: 12px; font-weight: 700; letter-spacing: 0; padding: 13px 18px; text-transform: none; }
td { padding: 15px 18px; color: #3e5267; line-height: 1.65; }
tbody tr:hover { background: #f9fbfd; }
.number-column { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .badge { white-space: normal; }
.keep-table { min-width: 680px; }
.compact-table, .keep-table:has(thead th:last-child:nth-child(-n+3)) { min-width: 0; }
.table-scroll-hint { display: flex; align-items: center; gap: 7px; padding: 9px 18px; color: #3f6389; background: #edf4fc; border-bottom: 1px solid #dae6f1; font-size: 12px; }
.list-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--ui-border); }
.list-tools label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: #405a73; min-width: 0; }
.list-search { flex: 1 1 220px; max-width: 400px; }
.list-status { flex: 0 1 160px; }
.list-result { margin-left: auto; align-self: end; padding-bottom: 11px; color: var(--ui-text-secondary); font-size: 12px; white-space: nowrap; }
.list-clear { color: var(--ui-text-secondary); min-height: 44px; }
.list-empty { color: var(--ui-text-secondary); text-align: center; padding: 28px 20px; margin: 0; font-size: 13px; }
.row-details-toggle { display: none; }
.row-action { min-width: 126px; }
.row-action summary { display: inline-flex; gap: 7px; align-items: center; min-height: 44px; cursor: pointer; color: #205da6; font-size: 13px; font-weight: 600; list-style: none; }
.row-action summary::-webkit-details-marker { display: none; }
.row-action[open] { min-width: 270px; }
.row-action[open] summary { margin-bottom: 8px; }
.row-action .review-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.row-action .review-form .input-with-icon { width: 100%; min-width: 0; max-width: none; }
.row-action .review-form input { min-width: 0; width: 100%; max-width: none; }
.row-action .review-form > button { grid-column: 1 / -1; }
.validation-summary { text-align: left; margin: 0; padding-left: 22px; font-size: 14px; }
.validation-summary li { padding: 5px 0; }
.empty { line-height: 1.8; font-size: 13px; }
.asset-table { min-width: 1180px; }
.asset-code { font-size: 12px !important; font-variant-numeric: tabular-nums; }
.asset-filter-panel { padding-bottom: 24px; }
.asset-filters { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 20px; }
.asset-filter-hint { color: var(--ui-text-secondary); line-height: 1.6; }
.asset-filter-toggle { display: none; }
.asset-filter-actions, .operation-filter-actions { gap: 8px; flex-wrap: wrap; }
.advanced-filters { grid-column: 1 / -1; border-block: 1px solid var(--ui-border); }
.advanced-filters summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; color: #3f5f80; font-size: 13px; font-weight: 600; cursor: pointer; }
.advanced-filter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 24px; padding: 8px 0 20px; }
.pagination { color: var(--ui-text-secondary); gap: 12px; flex-wrap: wrap; padding: 18px; font-size: 12px; }
.report-controls { box-shadow: none; }
.report-filter-disclosure { margin-bottom: 24px; }
.report-filter-disclosure > summary { display: none; }
.report-filter-disclosure > .report-controls { margin-bottom: 0; }
.report-control-header { background: #fff; padding: 22px 24px; gap: 14px; }
.report-control-icon { width: 44px; height: 44px; border-radius: 10px; }
.report-control-heading h2 { font-size: 18px; }
.report-control-heading p { font-size: 13px; color: var(--ui-text-secondary); }
.report-current-period { color: var(--ui-text-secondary); border-color: var(--ui-border); border-radius: 8px; font-size: 12px; }
.report-control-form { padding: 22px 24px 18px; }
.report-period-options legend { font-size: 13px; color: #405a73; }
.report-period-pill span { font-size: 13px; font-weight: 600; color: #405a73; border-color: #a7b8c8; min-height: 44px; }
.report-control-bottom { margin-top: 20px; padding-top: 18px; min-height: 0; }
.report-controls .report-filter-field { color: #405a73; font-size: 13px; }
.report-controls .report-filter-field input { border-color: var(--ui-control-border); }
.report-control-footnote { margin: 0 24px 20px; font-size: 12px; color: var(--ui-text-secondary); background: #f4f7fb; }
.report-period-title { align-items: center; margin: 28px 0 16px; }
.report-period-title h2 { font-size: 21px; }
.report-period-title > span { color: var(--ui-text-secondary); font-size: 12px; }
.report-metrics .metric { min-height: 150px; }
.report-metrics .metric strong { font-size: 26px; }
.report-grid { gap: 20px; }
.report-trend .panel-head small, .chart-legend { color: var(--ui-text-secondary); font-size: 12px; }
.chart-axis, .chart-label { fill: #526b84; font-family: "Segoe UI","Microsoft JhengHei",sans-serif; font-size: 12px; }
.chart-wrap { padding: 16px; }
.chart-legend { flex-wrap: wrap; gap: 10px; }
.cost-row > div:first-child, .cost-row span, .cost-row strong { font-size: 12px; color: #405a73; }
.cost-row .negative { color: var(--ui-danger); }
.report-note { font-size: 13px; line-height: 1.8; }
.report-columns-toggle { display: none; }
.contact-row { gap: 12px; padding: 18px 0; border: 0; border-bottom: 1px solid var(--ui-border); border-radius: 0; background: transparent; align-items: end; }
.contact-row label { display: grid; gap: 7px; font-size: 13px; color: #405a73; }
.contact-row .text-button { color: var(--ui-danger); justify-content: center; }
.avatar-panel { padding: 24px; gap: 24px; background: #fff; }
.avatar-trigger, .avatar-trigger .avatar-preview { width: 88px; height: 88px; }
.avatar-trigger .avatar-preview { border: 3px solid #fff; box-shadow: none; outline: 1px solid var(--ui-border); }
.avatar-trigger:hover .avatar-preview, .avatar-trigger:focus-visible .avatar-preview { transform: none; box-shadow: none; outline: 2px solid var(--ui-focus); }
.avatar-photo-hint { color: var(--ui-text-secondary); }
.avatar-copy h2 { font-size: 18px; }
.avatar-copy p { font-size: 13px; color: var(--ui-text-secondary); margin-bottom: 12px; }
.avatar-actions > span { color: var(--ui-text-secondary); font-size: 12px; }
.password-input { display: block; position: relative; width: 100%; min-width: 0; }
.password-input > input { padding-right: 49px; }
.password-toggle { position: absolute; top: 0; right: 0; bottom: 0; display: grid; place-items: center; width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: #526f8c; }
.password-toggle:hover { background: #edf3fb; color: var(--blue); }
.password-strength, .password-strength small { color: var(--ui-text-secondary); font-size: 12px; line-height: 1.6; }
.password-strength-head strong { color: var(--ui-text-secondary); }
.auth-body { background: #14283b; min-height: 100dvh; padding: 32px 20px; }
.auth-shell, .auth-body:is([data-page="main.login"],[data-page="main.register"]) .auth-shell { width: min(100%,640px); max-width: 640px; }
.auth-card, .compact-auth-card.auth-card { padding: 30px 32px; border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.16); }
.auth-card-header { margin-bottom: 24px; text-align: center; }
.auth-card-header .auth-brand { justify-content: center; gap: 11px; margin: 0 0 18px; padding: 0; color: var(--ui-text); text-align: left; }
.auth-card-header .auth-brand:hover { text-decoration: none; }
.auth-card-header .brand-mark { width: 40px; height: 40px; border-radius: 10px; }
.auth-card-header .auth-brand strong { font-size: 15px; }
.auth-card-header .auth-brand small { font-size: 11px; color: var(--ui-text-secondary); letter-spacing: .04em; }
.auth-card-header h1 { margin: 0; font-size: 26px; }
.compact-auth-card .compact-auth-form { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 20px; padding-top: 0; }
.compact-auth-form > .captcha-field, .compact-auth-form > .btn { grid-column: 1 / -1; }
.compact-auth-form > label { min-width: 0; }
.captcha-field { background: #f6f8fb; border-color: var(--ui-border); padding: 14px; }
.compact-auth-card .captcha-field, .password-auth .captcha-field { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); grid-template-areas: "label label" "image answer"; gap: 9px 16px; }
.captcha-field > label { grid-area: label; }
.compact-auth-card .captcha-image-button, .password-auth .captcha-image-button { grid-area: image; height: 64px; }
.compact-auth-card .captcha-field > input:not([type="hidden"]), .compact-auth-card .captcha-field > .input-with-icon,
.password-auth .captcha-field > input:not([type="hidden"]), .password-auth .captcha-field > .input-with-icon { grid-area: answer; align-self: center; min-width: 0; }
.captcha-image-button { border-color: #91a9c2; }
.auth-utility { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; margin: 4px 0; font-size: 13px; color: var(--ui-text-secondary); }
.auth-utility a, .auth-link a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; font-weight: 600; }
.auth-link a { gap: 6px; }
.auth-home-link { margin-top: 8px; background: #f5f8fc; }
.auth-footer { color: #b6c8d9; font-size: 12px; margin-top: 20px; }
.auth-card .muted, .auth-card .auth-link { color: var(--ui-text-secondary); }
.register-card .register-password { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 20px; align-items: center; }
.register-password > .field-label { grid-column: 1 / -1; }
.register-password .password-strength { margin: 0; min-width: 0; }
.register-card .auth-utility { justify-content: center; }
.registration-steps { display: flex; justify-content: space-between; gap: 10px; padding: 0 0 20px; margin: 0 0 22px; border-bottom: 1px solid var(--ui-border); list-style: none; }
.registration-steps li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ui-text-secondary); }
.registration-steps strong { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #eaf0f6; color: #405a73; }
.registration-steps [aria-current] { color: #234e88; font-weight: 600; }
.registration-steps [aria-current] strong { background: #dceaff; color: #234e88; }
.auth-format-hint { display: flex; align-items: flex-start; gap: 5px; margin-top: 6px; font-size: 12px; line-height: 1.65; color: #52677d; overflow-wrap: anywhere; }
.auth-format-hint .ui-icon { flex: none; margin-top: 3px; }
.auth-format-hint[data-state="invalid"] { color: #a62f3c; }
.auth-format-hint[data-state="valid"] { color: #246650; }
.error-gallery-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; padding: 20px; }
.error-gallery-card { padding: 20px; border: 1px solid var(--ui-border); border-radius: 12px; background: #fff; min-width: 0; display: flex; flex-direction: column; }
.error-gallery-code { color: #3d668f; font-size: 30px; font-weight: 700; }
.error-gallery-card h3 { font-size: 16px; line-height: 1.6; }
.error-gallery-card p { font-size: 13px; color: var(--ui-text-secondary); line-height: 1.7; }
.error-gallery-card .btn { margin-top: auto; align-self: flex-start; }
.operation-tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 24px; padding-bottom: 8px; border-bottom: 1px solid var(--ui-border); }
.operation-tabs a { display: inline-flex; gap: 7px; align-items: center; min-height: 44px; padding: 8px 2px; font-size: 13px; color: #405a73; border-bottom: 2px solid transparent; }
.operation-tabs a.active { color: #1d59ad; border-bottom-color: #246bdb; font-weight: 700; }
.operation-tabs a:hover { text-decoration: none; color: #1d59ad; }
.permission-section { scroll-margin-top: 90px; }
.permission-section > p { font-size: 13px; line-height: 1.8; color: var(--ui-text-secondary); }
.permission-section-foot { padding: 16px 20px; border-top: 1px solid var(--ui-border); }
.permission-pending-table .review-form { align-items: end; flex-wrap: wrap; }
.permission-pending-table .review-form label { display: grid; gap: 7px; min-width: 0; max-width: 240px; font-size: 13px; color: #405a73; }
.permission-history-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(130px,.6fr) auto; align-items: end; gap: 16px; }
.permission-history-filters label { display: grid; gap: 7px; min-width: 0; font-size: 13px; color: #405a73; }
.operation-filters { grid-template-columns: repeat(3,minmax(0,1fr)); }
.operation-filter-actions { display: flex; align-items: end; grid-column: 1 / -1; }
.operation-table td { vertical-align: top; }
.operation-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.operation-route { display: flex; align-items: start; gap: 7px; margin-bottom: 6px; }
.operation-route .badge { flex: none; }
.operation-route code { overflow-wrap: anywhere; white-space: normal; max-width: 360px; color: #274b73; font-size: 12px; }
.operation-table .block { max-width: 440px; overflow-wrap: anywhere; }
.operation-note { font-size: 13px; line-height: 1.8; }
.operation-metrics .metric { min-height: 112px; }
.operation-facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; margin: 0; padding: 24px; }
.operation-facts > div { min-width: 0; }
.operation-facts dt { display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--ui-text-secondary); margin-bottom: 8px; }
.operation-facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; font-size: 13px; line-height: 1.7; }
.operation-facts .operation-wide { grid-column: 1 / -1; }
.operation-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.operation-detail-grid > * { min-width: 0; }
.operation-pre { margin: 0; padding: 22px; max-height: 520px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f8fb; color: #24415f; font: 12px/1.8 Consolas,monospace; }
@media (max-width: 1200px) {
  .content { padding-inline: 24px; }
  .review-form { flex-wrap: wrap; }
  .operation-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .operation-detail-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
  .error-gallery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .report-filter-disclosure { border: 1px solid var(--ui-border); border-radius: 12px; background: #fff; overflow: hidden; }
  .report-filter-disclosure > summary { display: flex; }
  .report-filter-disclosure > .report-controls { border: 0; border-radius: 0; }
  .report-filter-disclosure[open] > summary { border-bottom: 1px solid var(--ui-border); }
  input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), select, textarea { min-height: 46px; font-size: 16px; }
  .sidebar { width: min(290px,calc(100vw - 28px)); height: 100dvh; min-height: 0; padding-top: 24px; }
  .sidebar.open { box-shadow: 14px 0 45px rgba(0,0,0,.18); }
  .sidebar > .brand { padding-right: 32px; }
  .sidebar-close { position: absolute; top: 20px; right: 9px; display: grid; place-items: center; width: 44px; height: 44px; color: #c7d9e8; background: transparent; border: 0; border-radius: 8px; }
  .sidebar-close:hover { background: #253f57; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; border: 0; padding: 0; background: rgba(10,23,39,.55); }
  .nav-open { overflow: hidden; }
  .topbar { position: sticky; top: 0; z-index: 30; height: 64px; min-height: 64px; padding: 0 16px; gap: 12px; }
  .menu-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ui-border); border-radius: 8px; background: #f6f8fb; }
  .menu-btn .ui-icon { width: 20px; height: 20px; }
  .breadcrumb { margin: 0 auto 0 0; }
  .top-actions { gap: 6px; }
  .top-actions .avatar { width: 44px; height: 44px; }
  .content { padding: 24px 20px 44px; }
  .mobile-card-wrap { overflow: visible; padding: 0; background: #fff; }
  table.mobile-card-table { display: block; min-width: 0 !important; width: 100%; }
  .mobile-card-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .mobile-card-table tbody { display: block; width: 100%; }
  .mobile-card-table tbody tr { display: block; width: 100%; margin: 0; padding: 4px 0; border: 0; border-bottom: 1px solid var(--ui-border); border-radius: 0; background: #fff; }
  .mobile-card-table tbody tr:last-child { border-bottom: 0; }
  .mobile-card-table td { position: relative; display: block; min-height: 43px; padding: 11px 16px 11px 112px; font-size: 14px; line-height: 1.65; border: 0; overflow-wrap: anywhere; white-space: normal; text-align: left; }
  .mobile-card-table td::before { content: attr(data-label); position: absolute; left: 16px; top: 12px; width: 84px; font-size: 12px; font-weight: 600; line-height: 1.6; color: var(--ui-text-secondary); text-align: left; }
  .mobile-card-table td:first-child { padding-top: 15px; padding-bottom: 15px; font-weight: 700; color: var(--ui-text); }
  .mobile-card-table td:first-child::before { top: 16px; }
  .mobile-card-table td.cell-controls { padding: 12px 16px; }
  .mobile-card-table td.cell-controls::before { display: block; position: static; width: auto; margin-bottom: 8px; }
  .mobile-card-table td.empty { padding: 28px 16px; }
  .mobile-card-table td.empty::before { display: none; }
  .mobile-card-table td > a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
  .mobile-card-table .review-form { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .mobile-card-table .review-form .input-with-icon { min-width: 0; max-width: none; flex: 1 0 100%; }
  .mobile-card-table .review-form input { max-width: none; width: 100%; min-width: 0; }
  .mobile-card-table .review-form .btn, .mobile-card-table .inline-actions .btn { flex: 1; }
  .mobile-card-table .block { margin-top: 4px; font-size: 12px; }
  .mobile-card-table .asset-code { font-family: Consolas,monospace; font-size: 12px !important; }
  .mobile-card-table tr:not(.record-expanded) .record-secondary { display: none; }
  .row-details-toggle { display: flex; align-items: center; gap: 5px; padding: 3px 0; color: #245c9c; font-size: 12px; background: transparent; border: 0; }
  .record-expanded .row-details-toggle .ui-icon { transform: rotate(90deg); }
  [data-page="main.reports"] .context-column { position: sticky; left: 0; z-index: 1; background: #f5f8fb; min-width: 86px; max-width: 160px; }
  [data-page="main.reports"] td.context-column { background: #fff; }
  table.report-compact-table:not(.show-all-columns) { min-width: 0; }
  .report-compact-table:not(.show-all-columns) .report-detail-column { display: none; }
  .report-columns-toggle { display: inline-flex; }
  .report-trend .panel-head { align-items: start; }
  .finance-chart { min-width: 600px; }
  .asset-filters, .operation-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .advanced-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .content { padding: 24px 14px 40px; }
  .topbar { padding: 0 10px; gap: 9px; }
  .breadcrumb { font-size: 12px; }
  .top-actions { gap: 4px; }
  .logout-label { display: none; }
  .top-actions .logout-button { padding: 0; width: 44px; height: 44px; border-radius: 8px; background: #f2f6fa; }
  .page-head { align-items: stretch; gap: 16px; margin-bottom: 22px; }
  .page-head p { font-size: 14px; }
  .page-head > .date-pill, .page-head > .badge { align-self: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; white-space: normal; }
  .panel { margin-bottom: 20px; }
  .panel-head { padding: 16px; gap: 9px; }
  .panel-head h2 { font-size: 16px; }
  .panel-head .count { font-size: 12px; }
  .form-panel { padding: 0 16px 20px; }
  .form-panel .panel-head { padding: 18px 0; }
  .form-grid { grid-template-columns: minmax(0,1fr); gap: 18px; padding-top: 20px; }
  .span-2 { grid-column: 1; }
  .form-actions { margin-top: 20px; padding-top: 20px; }
  .form-grid > .span-2:has(> .btn) > .btn, .form-actions > .btn { width: 100%; }
  .btn { padding: 11px 14px; font-size: 13px; }
  input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), select, textarea { min-height: 48px; font-size: 16px; }
  input[type="file"] { font-size: 13px; padding: 9px; }
  input[type="file"]::file-selector-button { min-height: 30px; border: 0; border-radius: 6px; background: #eaf2ff; color: #215fbb; padding: 6px 9px; margin-right: 8px; }
  input[type="date"] { min-width: 0; -webkit-appearance: none; appearance: none; }
  .input-with-icon > input, .input-with-icon > select { padding-left: 36px; }
  .metrics, .metrics.two, .metrics.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { padding: 16px; min-height: 132px; border-bottom: 1px solid var(--ui-border); }
  .metric:nth-child(2n) { border-inline-end: 0; }
  .metric:nth-last-child(-n+2) { border-bottom: 0; }
  .metrics.three > .metric:last-child { grid-column: 1 / -1; border-top: 1px solid var(--ui-border); border-inline-end: 0; }
  .metric > span, .metric small { font-size: 12px; }
  .metric strong { font-size: 26px; }
  .metric-value { font-size: 18px; }
  .report-metrics .metric { min-height: 164px; }
  .quick-actions { gap: 10px; }
  .action-card { padding: 16px; }
  .task-summary { padding: 16px; align-items: start; }
  .task-summary-copy > span { font-size: 12px; }
  .section-nav { gap: 4px 16px; margin-bottom: 20px; }
  .section-nav a { font-size: 12px; }
  .list-tools { padding: 14px 16px; gap: 10px; }
  .list-search { flex: 1 0 100%; max-width: none; }
  .list-status { flex: 1 1 130px; }
  .list-result { padding-bottom: 11px; }
  .asset-filters, .operation-filters, .advanced-filter-grid { grid-template-columns: minmax(0,1fr); }
  .asset-filter-toggle { display: inline-flex; }
  .asset-filter-panel .panel-head .asset-filter-toggle { flex-basis: 100%; }
  .asset-filter-panel.is-collapsed { padding-bottom: 0; }
  .asset-filter-panel.is-collapsed .panel-head { border-bottom: 0; }
  .asset-filter-panel.is-collapsed .asset-filters { display: none; }
  .asset-filter-actions { display: flex; }
  .asset-filter-actions .btn, .operation-filter-actions .btn { flex: 1; }
  .asset-filter-hint { font-size: 12px; }
  .report-control-header { padding: 20px 16px; display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 12px; }
  .report-control-heading { flex: 1; }
  .report-control-heading p { font-size: 13px; }
  .report-current-period { grid-column: 1 / -1; justify-self: start; margin-left: 0; flex-shrink: 1; max-width: 100%; white-space: normal; }
  .report-control-form { padding: 20px 16px; }
  .report-period-pills { display: flex; flex-wrap: wrap; gap: 8px; }
  .report-period-pill { flex: 1 1 28%; }
  .report-period-pill span { width: 100%; min-width: 0; padding-inline: 10px; }
  .report-control-bottom { flex-direction: column; align-items: stretch; gap: 16px; }
  .report-control-bottom .report-filter-field { width: 100%; }
  .report-control-bottom .report-control-actions { margin-left: 0; display: flex; flex-wrap: wrap; }
  .report-control-actions .btn { flex: 1; }
  .report-control-footnote { margin: 0 16px 20px; align-items: start; }
  .report-period-title { align-items: start; gap: 12px; flex-wrap: wrap; }
  .report-period-title h2 { font-size: 20px; }
  .report-trend .panel-head > div:first-child { flex-basis: 100%; }
  .report-compact-table th, .report-compact-table td { padding-inline: 10px; font-size: 12px; }
  .contact-row { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .contact-row .text-button { border: 1px solid #d7a1ab; border-radius: 8px; }
  .avatar-panel { display: flex; flex-direction: row; align-items: start; padding: 22px 16px; gap: 16px; text-align: left; }
  .avatar-trigger, .avatar-trigger .avatar-preview { width: 76px; height: 76px; }
  .avatar-copy { width: auto; min-width: 0; }
  .avatar-copy h2 { font-size: 17px; }
  .avatar-copy p { font-size: 13px; }
  .avatar-actions { justify-content: start; gap: 8px; }
  .avatar-photo-hint, .avatar-actions > span { font-size: 11px; }
  .password-panel { max-width: none; }
  .auth-body { padding: 24px 16px; }
  .auth-card, .compact-auth-card.auth-card { padding: 26px 20px; }
  .auth-card-header h1 { font-size: 25px; }
  .compact-auth-card .compact-auth-form { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .compact-auth-card .captcha-field, .password-auth .captcha-field { grid-template-columns: minmax(0,1fr); grid-template-areas: "label" "image" "answer"; padding: 12px; gap: 9px; }
  .compact-auth-card .captcha-image-button, .password-auth .captcha-image-button { height: 68px; }
  .register-card .register-password { grid-template-columns: minmax(0,1fr); }
  .auth-utility { font-size: 12px; }
  .registration-steps { gap: 7px; }
  .registration-steps li { gap: 5px; font-size: 12px; }
  .registration-steps strong { width: 22px; height: 22px; flex: none; }
  .error-gallery-grid { grid-template-columns: minmax(0,1fr); padding: 16px; }
  .permission-history-filters, .operation-facts { grid-template-columns: minmax(0,1fr); }
  .permission-pending-table .review-form label { max-width: none; width: 100%; }
  .operation-pre { padding: 16px; font-size: 12px; max-height: 440px; }
  .operation-facts { padding: 20px; gap: 18px; }
  .operation-tabs { gap: 4px 12px; }
  .operation-tabs a { font-size: 12px; }
  .label-shell { padding: 24px 14px; }
  .label-toolbar { gap: 20px; }
  .label-controls { width: 100%; gap: 8px; }
  .label-controls form { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .label-controls form > label { flex: 1; min-width: 0; }
  .label-controls form input { width: 100%; }
  .label-controls form button, .label-controls > .btn { flex: 1; }
  .asset-label { padding: 14px; gap: 12px; }
  .asset-label img { width: 100px; height: 100px; }
  .asset-label b { font-size: 12px; }
}
@media (max-width: 374px) {
  .metrics, .metrics.two, .metrics.three { grid-template-columns: minmax(0,1fr); }
  .metric, .metric:nth-child(2n) { border-inline-end: 0; border-bottom: 1px solid var(--ui-border); }
  .metric:last-child { border-bottom: 0; }
  .avatar-panel { flex-wrap: wrap; }
  .registration-steps { flex-wrap: wrap; }
}
@media (max-height: 680px) and (max-width: 900px) {
  .sidebar { padding-top: 18px; }
  .sidebar > .nav-label { margin-top: 20px; margin-bottom: 7px; }
  .sidebar-foot .session-title { display: none; }
  .sidebar-foot .session-facts { gap: 4px; margin: 0 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar, .btn, .text-button, .password-toggle, .report-period-pill span, .avatar-preview { transition: none; }
  .is-submitting button > .ui-icon { animation: none; }
}

