:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20302b;
  background: #f5f7f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #20302b;
  --muted: #7c8984;
  --green: #187a59;
  --mint: #e9f2ef;
  --line: #e9edeb;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100vh; background: #f5f7f6; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-color: #5aa287; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }
.loading { padding: 10vh 8vw; color: var(--muted); }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 245px; flex-shrink: 0; display: flex; flex-direction: column; padding: 27px 17px 17px; background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 8px 28px; font: 700 17px "Segoe UI", sans-serif; letter-spacing: -.5px; }
.brand-logo { display: block; width: min(100%, 190px); height: auto; border-radius: 5px; }
.brand b { color: #6d7974; font-weight: 500; }
.brand-mark { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 15px; background: #dff0e8; color: #146e4f; font: 800 24px "Segoe UI", sans-serif; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 11px; font-size: 19px; }
.nav-caption, .eyebrow { color: #85928c; font: 700 10px "Segoe UI", sans-serif; letter-spacing: 1.4px; }
.nav-caption { margin: 0 12px 13px; }
.side-nav { display: grid; gap: 6px; }
.nav-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px; border: 0; border-radius: 9px; background: transparent; color: #68766f; text-align: left; font-size: 13px; }
.nav-item > span { width: 18px; font-size: 17px; text-align: center; }
.nav-item.selected { background: #eaf3ef; color: #176c4f; font-weight: 700; }
.nav-count { margin-left: auto; font-size: 11px; }
.sidebar-bottom { margin-top: auto; }
.sidebar-note { display: grid; grid-template-columns: 30px 1fr; gap: 0 8px; margin: 0 4px 22px; padding: 14px 10px; border: 1px solid #e9efeb; border-radius: 11px; background: #f9fbfa; }
.note-icon { grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #eaf3ef; color: var(--green); }
.sidebar-note strong { font-size: 11px; }
.sidebar-note small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.user-menu { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 8px 4px; background: transparent; border: 0; text-align: left; }
.avatar { display: grid; flex-shrink: 0; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #dfede7; color: #286e53; font-size: 13px; font-weight: 700; }
.user-meta { display: grid; gap: 3px; min-width: 0; }
.user-meta b { overflow: hidden; color: #37443f; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: var(--muted); font-size: 10px; }
.logout-icon { margin-left: auto; color: #829088; font-size: 18px; }
.main { min-width: 0; flex: 1; }
.topbar { height: 60px; display: flex; justify-content: space-between; align-items: center; padding: 0 4.4%; border-bottom: 1px solid var(--line); background: #fff; color: #89948f; font-size: 11px; }
.crumb span { padding: 0 8px; color: #c1cac5; }
.top-user { display: flex; gap: 8px; align-items: center; color: #66736d; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #57aa7e; }
.page { max-width: 1540px; margin: 0 auto; padding: 37px 4.4% 40px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 8px; }
h1, h2, p { margin-top: 0; }
h1, h2 { color: #24332d; font-family: "Segoe UI", sans-serif; }
h1 { margin-bottom: 6px; font-size: clamp(23px, 2.2vw, 30px); letter-spacing: -1px; }
h2 { margin-bottom: 0; font-size: 16px; letter-spacing: -.3px; }
.heading-period { color: #a4b2aa; }
.muted { color: var(--muted); font-size: 12px; }
.page-heading .muted { margin: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; transition: background .15s, transform .15s; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .55; cursor: wait; }
.button.primary { background: #197653; color: white; box-shadow: 0 2px 4px #176c4f1c; }
.button.primary:hover { background: #126546; }
.button.secondary { border-color: #dce5e0; background: #fff; color: #3d5148; }
.button.danger { border-color: #f1d7d1; background: #fff7f5; color: #ae4937; }
.button.wide { width: 100%; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; margin-bottom: 22px; }
.stat-card { padding: 17px 19px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #75827c; font-size: 11px; }
.stat-symbol { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-weight: 700; }
.stat-symbol.green { background: #e8f4ed; color: #32815d; }
.stat-symbol.amber { background: #fff3dd; color: #bd8532; }
.stat-symbol.blue { background: #eaf1fa; color: #557cb0; }
.stat-card > strong { display: block; margin: 10px 0 2px; color: #24332d; font: 700 23px "Segoe UI", sans-serif; letter-spacing: -.5px; }
.stat-card > small { color: #a0aaa4; font-size: 10px; }
.mileage-rate-summary { display: flex; align-items: center; gap: 11px; margin: -8px 0 18px; padding: 12px 15px; border: 1px solid #dcebe2; border-radius: 10px; background: #f8fcf9; }
.mileage-rate-summary-icon { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 9px; background: #e8f4ec; color: #24744f; font-size: 17px; font-weight: 800; }
.mileage-rate-summary > span:nth-child(2) { display: grid; gap: 3px; }
.mileage-rate-summary small { color: #809087; font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.mileage-rate-summary strong { color: #2e4f3c; font-size: 13px; }
.mileage-rate-summary .button { margin-left: auto; }
.expense-tax-id { color: #557463 !important; font-weight: 600; }
.content-grid { display: grid; grid-template-columns: minmax(0,1fr) 355px; align-items: start; gap: 17px; }
.panel, .new-panel { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.expense-panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; }
.panel-heading .eyebrow, .new-panel-heading .eyebrow { margin-bottom: 4px; font-size: 9px; }
.panel-heading h2, .new-panel h2 { font-size: 15px; }
.text-link { color: #317b5e; font-size: 11px; font-weight: 700; white-space: nowrap; }
.filters { display: flex; gap: 5px; margin: 0 20px; padding-bottom: 12px; border-bottom: 1px solid #f0f2f1; }
.filter { padding: 7px 11px; border: 0; border-radius: 6px; background: transparent; color: #849089; font-size: 10px; }
.filter.active { background: #e9f3ee; color: #226e50; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 12px 10px; color: #9aa59f; font-size: 9px; font-weight: 600; }
th:first-child, td:first-child { padding-left: 20px; }
td { padding: 12px 10px; border-top: 1px solid #f1f3f2; color: #697770; font-size: 10px; }
.expense-row { cursor: pointer; transition: background .12s; }
.expense-row:hover { background: #fbfcfb; }
td b { color: #36443e; font-size: 10px; }
.table-sub { display: block; margin-top: 4px; color: #a1aba5; font-size: 9px; }
.person-cell { display: flex; align-items: center; gap: 7px; }
.avatar.mini { width: 25px; height: 25px; font-size: 10px; }
.category-pill { padding: 5px 7px; border-radius: 5px; background: #f3f6f4; color: #637269; font-size: 9px; }
.amount-cell { color: #35433d; font-weight: 700; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 20px; font-size: 9px; }
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-draft { background: #f1f3f2; color: #687770; }
.status-open { background: #e9f3ee; color: #226e50; }
.status-submitted { background: #fff5df; color: #a87420; }
.status-in_review { background: #fff5df; color: #a87420; }
.status-approved { background: #e7f4ec; color: #347b55; }
.status-processed { background: #e7f0fa; color: #456d9b; }
.status-rejected { background: #fff0ed; color: #a94b3b; }
.expense-cards, .mobile-new-expense { display: none; }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 38px 12px; color: #98a39d; text-align: center; }
.empty-state > span { color: #9ab9a9; font-size: 26px; }
.empty-state > b { color: #53635b; font-size: 11px; }
.empty-state > small { font-size: 10px; }
.expense-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px 10px; width: 100%; padding: 14px 15px; border: 0; border-top: 1px solid #f0f2f1; background: #fff; color: inherit; text-align: left; }
.expense-card:active { background: #f8faf8; }
.expense-card-main { display: grid; gap: 4px; min-width: 0; }
.expense-card-main b { overflow: hidden; color: #36443e; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.expense-card-main small, .expense-card-owner { color: #929e96; font-size: 10px; }
.expense-card-amount { color: #35433d; font-size: 13px; font-weight: 700; white-space: nowrap; }
.expense-card-meta { display: flex; grid-column: 1 / -1; justify-content: space-between; align-items: center; color: #89958e; font-size: 10px; }
.expense-card-owner { grid-column: 1 / -1; }
.new-expense-page { width: min(100%, 760px); padding: 22px; }
.new-expense-page .expense-form { gap: 15px; }
.new-expense-page .expense-form label { font-size: 12px; }
.new-expense-page .expense-form input, .new-expense-page .expense-form select, .new-expense-page .expense-form textarea { padding: 12px; font-size: 14px; }
.new-expense-page .field-caption, .new-expense-page .ocr-status, .new-expense-page .form-foot { font-size: 11px; }
.new-expense-page .camera-button { min-height: 52px; }
.mileage-fields[hidden], .mileage-hint[hidden] { display: none; }
.edit-mileage-fields[hidden], .edit-mileage-rate[hidden], .edit-ticket-fields[hidden] { display: none; }
.mileage-hint { margin: -7px 0 0; color: #8b978f; font-size: 10px; line-height: 1.5; }
.edit-mileage-rate { margin: -5px 0 0; color: #78877f; font-size: 11px; line-height: 1.5; }
.new-sheet-form { display: flex; align-items: end; gap: 10px; margin-bottom: 16px; padding: 14px; }
.new-sheet-form label { margin-right: auto; color: #53635a; font-size: 11px; font-weight: 700; }
.new-sheet-form input, #attach-sheet { min-height: 39px; padding: 8px 10px; border: 1px solid #e4eae6; border-radius: 7px; color: #36433d; }
.sheet-list { display: grid; gap: 9px; }
.sheet-card { display: grid; grid-template-columns: 40px minmax(0,1fr) auto auto; align-items: center; gap: 9px 12px; width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: inherit; text-align: left; }
.sheet-card:hover { border-color: #c6ddd0; background: #fbfdfb; }
.sheet-card-icon { display: grid; grid-row: span 2; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #eaf3ef; color: var(--green); font-size: 19px; }
.sheet-card-main { display: grid; gap: 4px; }
.sheet-card-main b { color: #34443b; font-size: 13px; }
.sheet-card-main small, .sheet-review-count { color: #98a39d; font-size: 10px; }
.sheet-card-total { color: #33423a; font-size: 13px; font-weight: 700; }
.sheet-card-status { grid-column: 2 / 3; width: fit-content; }
.sheet-review-count { grid-column: 3 / -1; text-align: right; }
.sheet-detail { overflow: hidden; padding: 18px; }
.sheet-detail-summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid #edf0ee; }
.sheet-detail-summary > div { display: grid; justify-items: start; gap: 7px; }
.sheet-detail-summary small { color: #929e96; font-size: 10px; }
.sheet-detail-summary > strong { color: #26372e; font-size: 23px; }
.sheet-expense-list { display: grid; }
.sheet-expense-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px 12px; padding: 14px 2px; border-bottom: 1px solid #edf0ee; }
.sheet-expense-open { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.sheet-expense-title { display: grid; gap: 4px; }
.sheet-expense-title b { color: #34443b; font-size: 12px; }
.sheet-expense-title small, .sheet-expense-date, .sheet-expense-route { color: #8f9b94; font-size: 10px; }
.sheet-expense-open > strong { color: #35443c; font-size: 12px; white-space: nowrap; }
.sheet-expense-date, .sheet-expense-route { grid-column: 1 / -1; }
.sheet-expense-card > .status-pill { grid-column: 1 / -1; width: fit-content; }
.sheet-item-actions { display: flex; flex-wrap: wrap; gap: 7px; grid-column: 1 / -1; }
.sheet-item-actions .button, .sheet-actions .button { min-height: 38px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 15px; }
.sheet-actions:empty { display: none; }
.notification-panel { width: min(100%, 700px); padding: 20px; }
.notification-panel fieldset { display: grid; gap: 10px; margin: 0 0 16px; padding: 0 0 14px; border: 0; border-bottom: 1px solid #edf0ee; }
.notification-panel legend { margin-bottom: 12px; color: #34443b; font-size: 13px; font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 10px; color: #56645c; font-size: 12px; }
.check-row input { width: 17px; height: 17px; accent-color: var(--green); }
.review-notification { margin: 0 0 18px; }
.notice-warning { margin: 0 0 14px; padding: 11px 12px; border: 1px solid #f1e1bd; border-radius: 8px; background: #fff9ea; color: #80652a; font-size: 11px; line-height: 1.5; }
.inline-link { display: inline; min-height: 0; padding: 0; border: 0; background: transparent; font-size: inherit; }
.cost-center-panel { margin-top: 16px; }
.cost-center-form { display: flex; align-items: end; gap: 10px; }
.cost-center-form label { display: grid; flex: 1; gap: 5px; color: #526059; font-size: 10px; font-weight: 700; }
.cost-center-form input { min-height: 38px; padding: 8px 10px; border: 1px solid #e4eae6; border-radius: 7px; font-size: 11px; }
.cost-center-list { display: grid; gap: 8px; margin-top: 12px; }
.cost-center-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid #f0f2f1; color: #53635a; font-size: 11px; }
.cost-center-row .button { min-height: 32px; font-size: 10px; }
.row-open { padding: 4px 8px; border: 0; border-radius: 5px; background: transparent; color: #8b9891; font-size: 15px; }
.row-open:hover { background: #e9f3ee; color: var(--green); }
.empty-cell { padding: 40px 12px; text-align: center; white-space: normal; }
.empty-cell > * { display: block; margin: 4px auto; }
.empty-cell > span { color: #9ab9a9; font-size: 26px; }
.empty-cell > b { color: #53635b; }
.empty-cell > small { color: #98a39d; font-size: 10px; }
.new-panel { padding: 19px; background: #fff; }
.new-panel-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.form-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e7f3ec; color: #22734f; font-size: 18px; }
.expense-form, .stack-form { display: grid; gap: 11px; }
.expense-form label, .stack-form label, .user-form label { display: grid; gap: 5px; color: #526059; font-size: 10px; font-weight: 700; }
.expense-form label > span { color: #23815c; }
.expense-form input, .expense-form select, .expense-form textarea, .stack-form input, .user-form input, .user-form select, .review-actions textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #e4eae6; border-radius: 7px; background: #fff; color: #36433d; font-size: 11px; font-weight: 400; }
.expense-form input::placeholder, .expense-form textarea::placeholder { color: #b3bdb7; }
.expense-form textarea, .review-actions textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-drop { position: relative; display: flex !important; align-items: center; gap: 9px !important; min-height: 50px; padding: 8px 10px; border: 1px dashed #d4e1d9; border-radius: 8px; background: #f9fbfa; cursor: pointer; }
.file-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop b { display: block; color: #53635a; font-size: 10px; }
.file-drop small { display: block; margin-top: 3px; color: #9ba7a0; font-size: 9px; font-weight: 400; }
.file-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #edf5f0; color: #38815f; font-size: 16px; }
.field-caption { color: #526059; font-size: 10px; font-weight: 700; }
.field-caption b { color: #23815c; }
.receipt-picker { display: grid; gap: 7px; }
.receipt-picker-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.camera-button { min-height: 46px; }
.camera-button > span { font-size: 17px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.receipt-preview[hidden] { display: none; }
.receipt-preview-card { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px; border: 1px solid #e7ede9; border-radius: 8px; background: #fbfcfb; }
.receipt-preview-card > span:nth-child(2) { display: grid; min-width: 0; flex: 1; gap: 3px; }
.receipt-preview-card b { overflow: hidden; color: #53635a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.receipt-preview-card small { color: #9ba7a0; font-size: 9px; }
.receipt-thumbnail { width: 40px; height: 40px; flex-shrink: 0; border-radius: 5px; object-fit: cover; }
.preview-remove { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: #8c9991; font-size: 18px; }
.preview-remove:hover { background: #fff0ed; color: #a94b3b; }
.ocr-status { margin: 0; color: #829087; font-size: 9px; line-height: 1.5; }
.ocr-tax-id-result { display: grid; gap: 4px; margin: 0; padding: 11px 12px; border: 1px solid #b8dfc7; border-radius: 8px; background: #eff9f2; color: #345c43; }
.ocr-tax-id-result[hidden] { display: none; }
.ocr-tax-id-result strong { font-size: 11px; }
.ocr-tax-id-result span { color: #174f31; font-size: 16px; font-weight: 800; letter-spacing: .3px; }
.ocr-tax-id-result small { color: #6c8975; font-size: 10px; }
.mileage-rate-panel { width: min(100%, 720px); }
.mileage-rate-panel .team-content { display: grid; gap: 12px; }
.mileage-rate-panel .team-content > .muted { line-height: 1.6; }
.mileage-rate-current { margin: 2px 0 0; color: #65736a; font-size: 12px; }
.mileage-rate-current strong { color: #1b6849; }
.form-foot { margin: -3px 0 0; color: #a2aba6; font-size: 9px; text-align: center; }
.team-panel { margin-top: 0; }
.team-panel .panel-heading { padding-top: 21px; }
.team-content { padding: 0 20px 20px; }
.team-content > .muted { margin: 0 0 14px; }
.user-form { display: grid; grid-template-columns: 1.1fr 1.3fr 1.2fr .8fr auto; align-items: end; gap: 10px; }
.team-list { display: grid; gap: 7px; margin-top: 17px; }
.team-member { display: grid; grid-template-columns: 28px minmax(100px,.8fr) minmax(150px,1.5fr) auto; align-items: center; gap: 9px; padding-top: 8px; border-top: 1px solid #f0f2f1; color: #748078; font-size: 10px; }
.team-member > b { overflow: hidden; color: #44534a; text-overflow: ellipsis; white-space: nowrap; }
.role-tag { padding: 4px 7px; border-radius: 5px; background: #f1f5f2; color: #68796e; font-size: 9px; }
.footer { display: flex; justify-content: space-between; gap: 16px; padding: 0 4.4% 20px; color: #99a49e; font-size: 9px; }
.footer b { padding: 0 3px; color: #6eaa8a; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: min(430px, calc(100% - 30px)); padding: 12px 16px; transform: translateY(12px); border: 1px solid #cbe4d4; border-radius: 9px; background: #edf8f1; color: #286d48; box-shadow: 0 8px 26px #1d35231a; font-size: 12px; opacity: 0; pointer-events: none; transition: .18s; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { border-color: #f0d1ca; background: #fff3f0; color: #a44032; }
.detail-dialog { width: min(570px, calc(100% - 24px)); max-height: min(90vh, 850px); padding: 0; overflow: auto; border: 1px solid #e1e9e4; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 20px 70px #182b2240; }
.detail-dialog::backdrop { background: #10201970; backdrop-filter: blur(2px); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 18px 21px 15px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-head h2 { max-width: 450px; overflow-wrap: anywhere; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: #f1f5f2; color: #637268; font-size: 20px; }
.dialog-body { padding: 18px 21px 21px; }
.detail-status { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.detail-status strong { font: 700 23px "Segoe UI", sans-serif; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 12px; padding: 16px; border: 1px solid #eef1ef; border-radius: 9px; background: #fbfcfb; }
.detail-grid small, .detail-grid b { display: block; }
.detail-grid small { margin-bottom: 5px; color: #93a098; font-size: 9px; }
.detail-grid b { overflow-wrap: anywhere; color: #46554d; font-size: 11px; }
.edit-expense-panel { display: grid; gap: 10px; margin-top: 14px; padding: 13px; border: 1px solid #e7ede9; border-radius: 9px; background: #fbfcfb; }
.edit-expense-panel[hidden] { display: none; }
.edit-expense-panel > label { display: grid; gap: 5px; color: #526059; font-size: 10px; font-weight: 700; }
.edit-expense-panel input, .edit-expense-panel select, .edit-expense-panel textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #e4eae6; border-radius: 7px; background: #fff; color: #36433d; font-size: 11px; font-weight: 400; }
.edit-toggle { margin-top: 12px; }
.detail-notes, .rejection-note { margin-top: 15px; padding: 12px; border-radius: 8px; background: #f7f9f7; font-size: 10px; }
.detail-notes p, .rejection-note p { margin: 5px 0 0; color: #68766e; white-space: pre-wrap; overflow-wrap: anywhere; }
.rejection-note { background: #fff4f1; color: #95483b; }
.receipt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; }
.file-drop.compact { flex: 1; min-width: 210px; }
.receipt-history { display: grid; gap: 8px; margin-top: 14px; color: #4b5a51; font-size: 10px; }
.receipt-history > a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid #ebefec; border-radius: 8px; color: #37805d; }
.receipt-history > a > span:first-child { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #edf5f0; }
.receipt-history > a b, .receipt-history > a small { display: block; }
.receipt-history > a b { max-width: 430px; overflow: hidden; color: #53635a; font-size: 10px; text-overflow: ellipsis; }
.receipt-history > a small { margin-top: 3px; color: #98a39c; font-size: 9px; }
.expense-receipt-preview { display: grid; gap: 8px; margin: 14px 0; padding: 12px; border: 1px solid #eef1ef; border-radius: 9px; background: #fbfcfb; }
.expense-receipt-preview figcaption { color: #53635a; font-size: 11px; font-weight: 700; }
.expense-receipt-preview a { display: block; overflow: hidden; border-radius: 6px; text-align: center; }
.expense-receipt-preview img { display: block; max-width: 100%; max-height: 62vh; margin: 0 auto; object-fit: contain; }
.review-actions { display: grid; gap: 10px; padding: 14px; border: 1px solid #e9eeea; border-radius: 9px; background: #fafcfa; }
.review-actions > label { display: grid; gap: 6px; color: #526059; font-size: 10px; font-weight: 700; }
.review-actions > .check-row { display: flex; align-items: center; }
.review-actions > .check-row input { width: 17px; flex: 0 0 17px; }
.review-actions > .muted { margin: 0; }
.review-actions > div { display: flex; justify-content: flex-end; gap: 8px; }
.history { display: grid; gap: 11px; margin-top: 20px; color: #4b5a51; font-size: 11px; }
.history-item { display: flex; align-items: flex-start; gap: 10px; }
.history-item > i { width: 8px; height: 8px; flex-shrink: 0; margin-top: 4px; border: 2px solid #83ba99; border-radius: 50%; }
.history-item b, .history-item small { display: block; }
.history-item small { margin-top: 4px; color: #929e96; font-size: 9px; }
.login-wrap { display: grid; grid-template-columns: 1fr .9fr; min-height: 100vh; background: #fff; }
.login-card { display: flex; flex-direction: column; justify-content: center; width: min(410px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0; }
.login-logo { width: min(100%, 220px); margin-bottom: 28px; }
.login-card h1 { margin-bottom: 8px; font-size: 31px; }
.login-card h1 span { color: #7d8b82; font-weight: 500; }
.login-card > .muted { margin: 0 0 28px; font-size: 12px; }
.login-card .stack-form { gap: 15px; }
.login-card .stack-form label { gap: 7px; font-size: 11px; }
.login-card .stack-form input { padding: 12px; font-size: 13px; }
.login-card .button { min-height: 44px; margin-top: 5px; font-size: 12px; }
.login-foot { margin: 18px 0 0; color: #a5afa9; font-size: 10px; text-align: center; }
.inline-error { padding: 10px; border-radius: 7px; background: #fff1ef; color: #a44032; font-size: 11px; }
.login-art { position: relative; display: grid; overflow: hidden; place-items: center; background: #eaf3ee; }
.login-art::before, .login-art::after { position: absolute; width: 440px; height: 440px; border: 1px solid #d7e8dd; border-radius: 50%; content: ""; }
.login-art::after { width: 600px; height: 600px; }
.art-orbit { position: absolute; width: 275px; height: 275px; border: 1px dashed #cbded1; border-radius: 50%; }
.receipt-card { position: relative; z-index: 1; display: grid; gap: 14px; width: 250px; padding: 24px; transform: rotate(-4deg); border: 1px solid #e6ece8; border-radius: 12px; background: white; box-shadow: 0 17px 45px #274f3821; }
.receipt-card span { color: #91a097; font-size: 9px; letter-spacing: 1px; }
.receipt-card strong { color: #245b42; font: 700 29px "Segoe UI", sans-serif; }
.receipt-card i { width: fit-content; padding: 6px 9px; border-radius: 20px; background: #e8f4ec; color: #38815b; font-size: 10px; font-style: normal; }

@media (min-width: 1500px) { .content-grid { grid-template-columns: minmax(0,1fr) 385px; } }
@media (max-width: 1100px) {
  .sidebar { width: 205px; }
  .content-grid { grid-template-columns: minmax(0,1fr) 320px; gap: 12px; }
  .page { padding-right: 3%; padding-left: 3%; }
  .user-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 850px) {
  .content-grid { grid-template-columns: 1fr; }
  .new-panel { grid-row: 1; }
  .expense-form { grid-template-columns: 1fr 1fr; }
  .new-expense-page .expense-form { grid-template-columns: 1fr; }
  .expense-form > label:first-child, .expense-form > label:nth-last-child(3), .expense-form > label:nth-last-child(2), .expense-form > button, .expense-form > .form-foot { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  html, body, .app-shell { max-width: 100%; overflow-x: clip; }
  .layout { display: block; min-width: 0; }
  .sidebar { position: sticky; top: 0; z-index: 4; width: 100%; height: 57px; min-width: 0; flex-direction: row; align-items: center; justify-content: space-between; gap: 7px; padding: 0 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 76px; flex: 0 0 76px; margin: 0; font-size: 15px; }
  .sidebar .brand-logo { width: 76px; }
  .sidebar .nav-caption, .sidebar-note { display: none; }
  .side-nav { display: flex; flex: 1 1 auto; justify-content: flex-end; gap: 2px; min-width: 0; }
  .nav-item { flex: 0 1 38px; justify-content: center; width: 38px; min-width: 30px; height: 38px; padding: 0; font-size: 0; }
  .nav-item > span { font-size: 17px; }
  .nav-count { display: none; }
  .sidebar-bottom { margin: 0; }
  .user-menu { flex: 0 0 auto; width: auto; padding: 0; }
  .user-meta, .logout-icon { display: none; }
  .topbar { height: 42px; min-width: 0; gap: 10px; padding: 0 16px; }
  .crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-user { flex: 0 1 auto; min-width: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .page { width: 100%; min-width: 0; padding: 24px 14px 28px; }
  .page > *, .panel, .sheet-detail, .notification-panel { min-width: 0; max-width: 100%; }
  .page-expenses { padding-bottom: 94px; }
  .page-heading { min-width: 0; align-items: flex-start; gap: 10px; }
  .page-heading > div { min-width: 0; }
  .page-heading .button { flex-shrink: 0; padding: 0 11px; }
  .desktop-new-expense { display: none; }
  h1 { font-size: 23px; }
  .stats { gap: 8px; }
  .stat-card { padding: 12px 10px; }
  .stat-top { font-size: 9px; }
  .stat-symbol { width: 23px; height: 23px; }
  .stat-card > strong { font-size: 17px; }
  .stat-card > small { font-size: 8px; }
  .mileage-rate-summary { margin: -8px 0 14px; padding: 10px; }
  .mileage-rate-summary .button { min-height: 35px; padding: 0 9px; font-size: 10px; }
  .mileage-rate-summary small { font-size: 8px; }
  .mileage-rate-summary strong { font-size: 12px; }
  .new-panel { padding: 15px; }
  .expense-form { grid-template-columns: 1fr; }
  .expense-form > label:first-child, .expense-form > label:nth-last-child(3), .expense-form > label:nth-last-child(2), .expense-form > button, .expense-form > .form-foot { grid-column: auto; }
  .form-row { gap: 8px; }
  .filters { gap: 1px; margin: 0 12px; }
  .filter { padding: 7px; font-size: 9px; }
  .panel-heading { padding-right: 13px; padding-left: 13px; }
  .text-link { font-size: 9px; }
  .table-wrap { display: none; }
  .expense-cards { display: block; }
  .mobile-new-expense { position: fixed; right: 17px; bottom: max(17px, env(safe-area-inset-bottom)); z-index: 5; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 19px; border: 0; border-radius: 28px; background: #197653; color: #fff; box-shadow: 0 5px 18px #123c2b40; font-size: 13px; font-weight: 700; }
  .mobile-new-expense > span { display: inline; }
  .new-expense-page { padding: 16px; }
  .new-expense-page .expense-form { gap: 14px; }
  .new-expense-page .expense-form label { font-size: 12px; }
  .new-expense-page .expense-form input, .new-expense-page .expense-form select, .new-expense-page .expense-form textarea { min-height: 46px; font-size: 16px; }
  .new-expense-page .expense-form textarea { min-height: 74px; }
  .new-expense-page .camera-button, .new-expense-page .receipt-picker-actions .button { min-height: 50px; }
  .team-content { padding-right: 13px; padding-left: 13px; }
  .new-sheet-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; padding: 12px; }
  .new-sheet-form label { grid-column: 1 / -1; }
  .new-sheet-form input { min-width: 0; width: 100%; }
  .sheet-card { grid-template-columns: 35px minmax(0,1fr) auto; gap: 8px; padding: 12px; }
  .sheet-card-icon { width: 33px; height: 33px; }
  .sheet-card-status { grid-column: 2 / 3; font-size: 9px; }
  .sheet-review-count { grid-column: 3 / -1; font-size: 9px; }
  .sheet-detail { padding: 13px; }
  .sheet-expense-card { gap: 8px; }
  .sheet-actions .button, .sheet-item-actions .button { flex: 1; }
  .notification-panel { padding: 15px; }
  .cost-center-form { align-items: stretch; flex-direction: column; }
  .cost-center-form .button { width: 100%; }
  .user-form { grid-template-columns: 1fr 1fr; }
  .user-form .button { grid-column: 1 / -1; }
  .receipt-picker-actions { grid-template-columns: 1fr 1fr; }
  .team-member { grid-template-columns: 28px minmax(70px,1fr) auto; }
  .team-member > span:nth-last-child(2) { display: none; }
  .detail-dialog { width: calc(100% - 20px); max-width: 570px; }
  .dialog-head, .dialog-body { min-width: 0; padding-right: 14px; padding-left: 14px; }
  .detail-grid { grid-template-columns: minmax(0,1fr); }
  .file-drop.compact { min-width: 0; }
  .receipt-history > a { min-width: 0; }
  .receipt-history > a > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
  .sheet-actions .button, .sheet-item-actions .button { min-width: 0; white-space: normal; }
  .footer { display: grid; padding: 0 14px 14px; font-size: 8px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-card { min-height: 100vh; width: min(410px, calc(100% - 42px)); }
  .login-art { display: none; }
}
@media (max-width: 370px) {
  .sidebar { gap: 5px; padding-right: 8px; padding-left: 8px; }
  .brand, .sidebar .brand-logo { width: 68px; }
  .brand { flex-basis: 68px; }
  .nav-item { min-width: 28px; }
  .topbar { padding-right: 12px; padding-left: 12px; }
  .page { padding-right: 10px; padding-left: 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-card:last-child { grid-column: 1 / -1; }
  .receipt-picker-actions { grid-template-columns: minmax(0,1fr); }
}
