/* Shared presentation layer. Business fields, routes and calculations are unchanged. */
@font-face {
  font-family: 'Pretendard Variable';
  src: url('/fonts/PretendardVariable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ui-font: 'Pretendard Variable', 'Pretendard', 'Segoe UI', 'Malgun Gothic', sans-serif;
  --ui-border: #d9e2dc;
  --ui-muted: #64746b;
  --ui-focus: #397357;
}
body, button, input, select, textarea { font-family: var(--ui-font); }
body { line-height: 1.55; }
button, input, select, textarea { letter-spacing: -.15px; }
button, .wf-button, .bw-button, .buttonlink, .admin-button, .admin-outline {
  line-height: 1.4;
  font-weight: 600;
}
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; }
#toast:not(.visible) { opacity: 0; visibility: hidden; pointer-events: none; }
input[type=file]:not(.fileinput) { padding: 6px; font-size: 13px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: #365844; background: #f2f6f3; border: 1px solid var(--ui-border); border-radius: 5px; padding: 8px 12px; margin-right: 12px; cursor: pointer; }
.wf-upload { display: grid; gap: 14px; }
.wf-upload .field { gap: 8px; }
.wf-upload.receipt-upload { margin-top: 4px; padding: 18px; border: 1px solid var(--ui-border); border-radius: 8px; background: #f8faf9; gap: 12px; }
.receipt-upload > strong { color: #34483d; font-size: 14px; font-weight: 600; }
.receipt-upload-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.receipt-upload-actions > button { min-height: 46px; min-width: 130px; font-size: 14px; padding: 11px 18px; }
.receipt-upload-actions > .receipt-upload-camera { background: #edf4ef; border-color: #9fb7a8; color: #234f39; }
.receipt-upload-actions > .receipt-upload-camera:hover { background: #e0ece4; border-color: #608b70; }
.receipt-upload #wf-attachments:empty { display: none; }
@media(max-width:600px) { .receipt-upload-actions > button { flex: 1 1 110px; min-width: 0; padding-inline: 10px; } }
.workspace, .workspace > *, .fields > *, .filters > *, .actions > * { min-width: 0; }
.fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { line-height: 1.5; font-weight: 500; }
.field input, .field select, .field textarea { font-weight: 400; }
.field textarea { line-height: 1.75; }
.field input::placeholder, .field textarea::placeholder { color: #88958e; opacity: 1; }
.actions, .formfoot, .filebtns, .pagehead { gap: 12px; }
.formfoot, .filebtns { flex-wrap: wrap; }
.pagehead { flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.pagehead h1 { font-size: 30px; font-weight: 700; line-height: 1.35; letter-spacing: -.9px; }
.pagehead > .actions { margin-left: auto; }
.topbar { line-height: 1.5; }
.cardhead, .rd-card-head, .admin-panel-title { flex-wrap: wrap; }
.card h2, .wf .card h2, .rd h2, .admin-panel h2 { font-size: 18px; line-height: 1.5; letter-spacing: -.35px; }
.mainnav .navgroup a { line-height: 1.45; }
.navgroup .navlabel { font-weight: 600; }
.bw-subtitle, .rd-subtitle, .admin-description { font-size: 14px; line-height: 1.65; }
.record-list-summary { border-radius: 6px; padding: 13px 16px; font-size: 13px; gap: 12px 24px; align-items: center; }
.filters, .bw-filters, .client-filters { gap: 12px; }
.filters { align-items: end; }
.filters input, .filters select, .bw-filters input, .bw-filters select,
.date-query input, .date-query select, .admin-control select,
.admin-form-row input, .admin-form-row select { min-height: 44px; }
.date-query { gap: 12px; padding: 16px; align-items: end; }
.date-query label { font-weight: 500; }
.filebtns label { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 600; }
.attachment { gap: 12px; }
.attachment > span { min-width: 0; }
.attachment button { flex-shrink: 0; padding: 8px 12px; }
.wf-setting { gap: 16px; }
.wf-setting input { flex: 0 0 20px; min-height: 20px; }
.checkfield, .wf-actor-checks label, .fleet-fuel-actors label { line-height: 1.5; }
.checkfield input, .wf-actor-checks input, .fleet-fuel-actors input { flex-shrink: 0; margin: 0; }
.tablewrap { max-width: 100%; }
th { font-weight: 600; }
td { vertical-align: middle; line-height: 1.65; }
.wf-table th, .record-list-table th, .client-table th { color: #63716a; font-weight: 600; }
.wf-table td { line-height: 1.65; }
.wf-actions-cell { width: 1%; white-space: nowrap; }
.wf-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; width: max-content; }
.wf-row-actions > .textlink, .wf-row-actions > .wf-toggle, .bw-contract-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 12px; border: 1px solid var(--ui-border);
  border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 20px;
  white-space: nowrap; background: #fff; color: #365844;
}
.wf-row-actions > .textlink:hover, .wf-row-actions > .wf-toggle:hover, .bw-contract-toggle:hover {
  background: #f2f6f3; border-color: #a4bdad;
}
.wf-row-actions > .wf-toggle[aria-expanded=true], .bw-contract-toggle[aria-expanded=true] {
  background: #edf4ee; border-color: #799e87; color: #245238;
}
.wf-row-actions .wf-toggle > span { display: inline-flex; align-items: center; width: 28px; height: 16px; padding: 2px; background: #ccd8cf; }
.wf-row-actions .wf-toggle[aria-expanded=true] > span { background: #497a5b; }
.wf-row-actions .wf-toggle i { width: 12px; height: 12px; flex-shrink: 0; }
.record-list-table td > .wf-button + .textlink { margin-left: 12px; display: inline-flex; align-items: center; min-height: 38px; }
.record-facts dt, .contract-fact dt { color: var(--ui-muted); }
.record-facts dd, .contract-fact dd { line-height: 1.75; }
.record-paper .field, .contract-editor .field { color: #53675b; }
.record-section > .field + .field, #client-allowance-input > .field + .field { margin-top: 16px; }
.contract-editor .wf-check { justify-content: flex-start; gap: 10px; }
#client-work-time { margin-top: 18px; }
#client-return-form { border-top: 1px solid var(--ui-border); padding-top: 20px; margin-top: 20px; }
#client-return-form > button { margin-top: 14px; }
.record-toolbar, .contract-toolbar, .bw-contract-detail-actions { gap: 12px; }
.client-time-row { align-items: end; }
.client-time-row > strong { align-self: end; display: flex; align-items: center; min-height: 44px; }
.client-time-row > span { padding: 0; min-height: 44px; display: grid; place-items: center; }
.client-time-row > [hidden] { display: none !important; }
.contract-payment-row .checkfield, .contract-payment-row .wf-check { min-height: 44px; margin: 0; }
.admin-permission-check input:focus-visible { outline-offset: 4px; }
.admin-account-actions, .admin-save-actions { gap: 10px; }
.admin-password-eye { align-self: stretch; }
.rd-stat strong, .stat strong, .heroamount { font-variant-numeric: tabular-nums; }
.rd-stat > div > span { font-size: 14px; }
.rd-review-buttons button { font-size: 14px; }
.rd-detail-content { align-items: start; }
.rd-detail-content > .record-section { margin-bottom: 0; }
.rd-review-buttons { padding-top: 36px; }

@media screen and (min-width: 801px) {
  .workspace { padding-top: 28px; }
  .topbar { margin-bottom: 18px; }
  .card, .wf .card, .rd-card { border-radius: 8px; }
  .workspace button:not(.quiet):not(.wf-toggle):not(.admin-password-eye):not(.rd-back),
  .workspace .wf-button, .workspace .bw-button, .workspace .buttonlink { font-size: 13px; }
  .workspace .tabs button, .workspace .rd-tabs button { font-size: 13px; }
  .bw-ledger-desktop table { font-size: 14px; }
  .bw-ledger-desktop td small { font-size: 12px; }
  .bw-ledger-guides strong, .bw-ledger-shortcuts strong, .bw-info strong { font-size: 15px; }
  .bw-ledger-total { font-size: 18px; }
  .record-list-table td { padding-top: 16px; padding-bottom: 16px; }
}
@media screen and (max-width: 1100px) and (min-width: 801px) {
  .client-time-row { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 8px minmax(0, 1fr); gap: 10px; }
  .client-time-row > strong { grid-column: 1; grid-row: 1 / 3; align-self: center; }
  .client-time-row .field:nth-child(2) { grid-column: 2 / -1; }
  .client-time-row .field:nth-child(3) { grid-column: 2; }
}
@media screen and (max-width: 800px) {
  .pagehead { gap: 14px; margin-bottom: 18px; }
  .pagehead h1 { font-size: 25px; line-height: 1.4; letter-spacing: -.6px; }
  .pagehead > .actions { margin-left: 0; justify-content: flex-start; gap: 8px; }
  .card h2, .wf .card h2, .rd h2, .admin-panel h2 { font-size: 17px; }
  .workspace .field input, .workspace .field select, .workspace .field textarea,
  .workspace .filters input, .workspace .filters select, .workspace .bw-filters input, .workspace .bw-filters select,
  .workspace .admin-control select, .workspace .admin-form-row input, .workspace .admin-form-row select,
  .logincard input { font-size: 16px; }
  .workspace .field input:not([type=checkbox]):not([type=radio]), .workspace .field select { min-height: 44px; }
  .filters input[type=search] { max-width: none; flex-basis: 100%; }
  .filters select { flex: 1; min-width: 0; }
  .wf-actions-cell { width: 100%; padding-top: 12px !important; }
  .wf-row-actions { width: 100%; gap: 10px; }
  .wf-row-actions > .textlink, .wf-row-actions > .wf-toggle, .bw-contract-toggle { min-height: 44px; }
  .wf-table td { font-size: 13px; }
  .wf-table td:before { font-size: 11px; color: var(--ui-muted); }
  .record-facts dt, .contract-fact dt { font-size: 12px; }
  .record-facts dd, .contract-fact dd { font-size: 13px; }
  .record-list-table td > .wf-button + .textlink { margin-left: 0; min-height: 44px; }
  .record-list-table td:not([data-label]) { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
  .formfoot { gap: 10px; }
  .formfoot > button, .formfoot > a, .pagehead > .actions > button, .pagehead > .actions > a,
  .workspace .actions > button, .workspace .actions > a,
  .record-toolbar > button, .record-toolbar > a, .contract-toolbar > button, .contract-toolbar > a,
  .admin-account-actions > button, .admin-account-actions > a { min-height: 44px; }
  .filebtns { gap: 10px; }
  .filebtns > * { flex: 1 1 110px; }
  .client-filters { flex-wrap: wrap; }
  .client-filters .field { flex: 1 1 130px; }
  .admin-permission-check { min-height: 36px; }
  .admin-permission-options { gap: 8px; }
  .admin-user-card .admin-outline, .admin-user-card .admin-button { font-size: 13px; }
  .admin-save-actions button { min-width: 0; }
  .admin-save-actions .primary { min-width: 0; flex: 1; }
  .rd-detail-content > .record-section { width: 100%; margin-bottom: 20px; }
  .rd-review-buttons { padding-top: 0; }
}
@media screen and (max-width: 680px) {
  .client-time-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 8px minmax(0, 1fr); gap: 8px; }
  .client-time-row > strong { grid-column: 1/-1; min-height: 0; }
  .client-time-row .field:nth-child(2) { grid-column: 1/-1; }
  .client-time-row .field:nth-child(3) { grid-column: 1; }
  .client-time-row > span { padding: 0; min-height: 44px; }
  .client-time-row select { padding-left: 10px; padding-right: 5px; }
}
@media screen and (max-width: 480px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .field.full { grid-column: auto; }
  .record-paper, .contract-paper { padding-left: 16px; padding-right: 16px; }
  .record-list-summary { padding: 12px 14px; }
  .date-query label { flex-basis: 100%; }
  .date-query { gap: 12px; padding: 14px; }
  .bw-contract-detail .contract-paper { padding-left: 12px; padding-right: 12px; }
  .rd-review-buttons button { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .wf-toggle i { transition: none; }
}
@media print {
  .wf-row-actions { display: none; }
}
