@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

:root {
  font-family: 'DM Sans', 'Noto Sans KR', sans-serif;
  color: #19253b;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy: #17243a;
  --muted: #8490a3;
  --line: #e9edf3;
  --blue: #4568e8;
  --blue-pale: #eef2ff;
  --green: #16a477;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 360px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.sidebar { width: 244px; position: fixed; inset: 0 auto 0 0; padding: 14px 12px 10px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 3; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px; color: var(--navy); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#647ff4,#3b58d3); font-weight: 700; font-size: 20px; box-shadow: 0 5px 12px #526ce43d; }
.brand strong { display: block; font-size: 16px; letter-spacing: -.45px; }
.brand small { color: #9aa4b4; display: block; font-size: 8px; letter-spacing: 1.2px; margin-top: 3px; }
.workspace-label,.nav-section { color: #a0aaba; font-size: 10px; letter-spacing: 1.1px; font-weight: 700; }
.workspace-label { padding: 16px 12px 6px; }
.main-nav { display: grid; align-content: start; grid-auto-rows: min-content; flex: 1 1 auto; min-height: 0; gap: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; }
.nav-section { padding: 10px 12px 3px; }
.nav-item { height: 30px; border: 0; background: transparent; color: #67758a; border-radius: 8px; text-align: left; padding: 0 12px; font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.nav-item:hover { background: #f7f8fc; }
.nav-item.active { background: var(--blue-pale); color: var(--blue); font-weight: 700; }
.nav-tree { display: grid; gap: 1px; }
.nav-tree-toggle { width: 100%; }
.nav-tree-label { flex: 1; }
.tree-chevron { color: #97a2b2; font-size: 11px; transition: transform .15s ease; }
.nav-tree-toggle[aria-expanded="true"] .tree-chevron { transform: rotate(180deg); }
.nav-tree-toggle.section-active { color: var(--blue); font-weight: 700; }
.nav-tree-children { display: grid; gap: 0; margin-left: 16px; padding-left: 10px; border-left: 1px solid #e7ebf2; }
.nav-tree-children[hidden] { display: none; }
.nav-item.nav-child { height: 26px; padding-left: 9px; font-size: 11px; gap: 8px; }
.nav-item.nav-child .nav-icon { width: 15px; font-size: 15px; }
.nav-icon { display: inline-grid; place-items: center; width: 17px; font-size: 18px; font-family: Arial,sans-serif; }
.sidebar-bottom { margin-top: auto; padding: 12px 6px 0; }
.local-badge { padding: 10px; color: #68778c; background: #f7f9fc; border: 1px solid #edf0f5; border-radius: 8px; font-size: 10px; }
.local-badge span { display: inline-block; width: 7px; height: 7px; background: #20b481; border-radius: 50%; margin-right: 6px; }
.sidebar-bottom p { padding: 14px 4px 0; margin: 0; color: #8590a0; font-size: 10px; }
.sidebar-bottom p span { float: right; color: #aeb6c2; }
.main-area { margin-left: 244px; min-height: 100vh; }
.topbar { height: 68px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 38px; }
.breadcrumb { display: flex; gap: 11px; align-items: center; color: #99a3b1; font-size: 12px; }
.breadcrumb b { color: #d1d7e0; font-weight: 400; }
.breadcrumb strong { color: #344159; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 15px; }
.today-label { color: #718096; font-size: 11px; }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; background: #e9edff; color: #5368d7; border-radius: 50%; font-weight: 700; font-size: 12px; }
.content { max-width: 1440px; margin: auto; padding: 34px 38px 52px; }
.page-heading > div:first-child { flex: 1; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 25px; }
.eyebrow { color: #8490a3; font-size: 10px; letter-spacing: 1px; font-weight: 700; margin-bottom: 7px; }
h1 { margin: 0; font-size: 24px; letter-spacing: -.7px; color: var(--navy); }
.page-subtitle { margin: 7px 0 0; color: #8b96a8; font-size: 12px; }
.primary-btn,.secondary-btn,.danger-btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; height: 37px; border-radius: 7px; padding: 0 13px; font-size: 11px; font-weight: 600; transition: .15s ease; }
.primary-btn { color: #fff; border: 1px solid var(--blue); background: var(--blue); box-shadow: 0 3px 7px #4568e82b; }
.primary-btn:hover { background: #3859d3; }
.secondary-btn { color: #56647a; border: 1px solid #e0e5ed; background: #fff; }
.secondary-btn:hover { background: #f7f8fc; }
.danger-btn { color: #d55757; border: 1px solid #f0dada; background: #fff; }
.small-btn { height: 30px; padding: 0 9px; font-size: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card,.panel,.table-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px #17243a05; }
.stat-card { padding: 17px 18px; min-height: 114px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #79869a; font-size: 11px; }
.stat-icon { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; }
.stat-icon.blue { color: #5570e7; background: #eef1ff; }
.stat-icon.green { color: #13a276; background: #e9f8f2; }
.stat-icon.orange { color: #db9345; background: #fff5e9; }
.stat-icon.purple { color: #9170d2; background: #f4efff; }
.stat-value { font-size: 23px; font-weight: 700; letter-spacing: -.8px; margin-top: 14px; }
.stat-caption { font-size: 10px; color: #a1aaba; margin-top: 3px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(250px,.8fr); gap: 16px; }
.panel { padding: 19px 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.panel-heading h2 { margin: 0; font-size: 14px; }
.panel-heading span { color: #a0aaba; font-size: 10px; }
.quick-links { display: grid; gap: 9px; }
.quick-link { border: 1px solid #edf0f5; padding: 12px; border-radius: 8px; display: flex; align-items: center; gap: 11px; cursor: pointer; background: #fff; text-align: left; }
.quick-link:hover { border-color: #cdd6ff; background: #fafbff; }
.quick-link .quick-icon { width: 31px; height: 31px; border-radius: 8px; color: var(--blue); background: var(--blue-pale); display: grid; place-items: center; }
.quick-link strong { display: block; font-size: 11px; }
.quick-link small { display: block; color: #95a0b1; font-size: 9px; margin-top: 3px; }
.quick-link .arrow { margin-left: auto; color: #aab3c1; }
.table-card { overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.toolbar .spacer { flex: 1; }
.search-input,.filter-select,.date-input { height: 33px; border: 1px solid #e5e9f0; border-radius: 6px; padding: 0 10px; color: #425068; background: #fff; outline: none; font-size: 10px; }
.search-input { width: 190px; }
.search-input:focus,.filter-select:focus,.date-input:focus,input:focus,select:focus,textarea:focus { border-color: #8ea0f3; box-shadow: 0 0 0 3px #4568e817; outline: none; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { height: 39px; text-align: left; padding: 0 14px; color: #929daf; font-size: 9px; background: #fafbfd; font-weight: 600; border-bottom: 1px solid var(--line); }
td { height: 49px; padding: 0 14px; border-bottom: 1px solid #f0f2f6; color: #59667a; font-size: 10px; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: #29364c; font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.muted { color: #a1aaba; }
.badge { display: inline-flex; align-items: center; border-radius: 20px; padding: 4px 8px; font-size: 9px; font-weight: 600; }
.badge.blue { color: #4c63d2; background: #eef1ff; }
.badge.green { color: #10805d; background: #e8f7f0; }
.badge.gray { color: #737f91; background: #f0f2f5; }
.badge.orange { color: #b97529; background: #fff3e4; }
.badge.red { color: #c14f4f; background: #fff0f0; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.icon-btn { border: 0; background: transparent; color: #8995a7; padding: 5px; font-size: 11px; border-radius: 5px; }
.icon-btn:hover { color: var(--blue); background: #f0f3ff; }
.invoice-number-link { border: 0; padding: 2px 0; color: var(--blue); background: transparent; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.invoice-number-link:hover { color: #2949c5; }
.empty-state { text-align: center; padding: 42px 20px; color: #97a1b0; font-size: 11px; }
.empty-state strong { display: block; color: #536078; font-size: 13px; margin-bottom: 5px; }
.empty-state .empty-icon { width: 40px; height: 40px; border-radius: 12px; background: #f2f4f9; display: grid; place-items: center; margin: 0 auto 11px; font-size: 18px; color: #8491a5; }
.list-footer { color: #9aa4b1; font-size: 10px; padding: 11px 15px; border-top: 1px solid var(--line); }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-label { color: #8b96a8; font-size: 10px; }
.balance-strip { display: flex; justify-content: flex-end; gap: 25px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfd; font-size: 10px; color: #7a8698; }
.balance-strip strong { color: #3a4860; margin-left: 5px; }
.balance-strip .unbalanced { color: #d55151; }
.closing-carryforward-table .closing-account-total { background: #f0f3fa; font-weight: 700; }
.closing-carryforward-table .closing-account-total th { color: #354256; }
.closing-carryforward-table tbody tr:not(.closing-account-total) td:first-child,
.closing-carryforward-table tbody tr:not(.closing-account-total) td:nth-child(2) { color: #718097; }
.receipt-history-entry { white-space: nowrap; color: #526179; font-size: 9px; line-height: 1.6; }
.receivable-toolbar .search-input { width: 220px; }
.receivable-summary { display: flex; justify-content: flex-end; gap: 22px; padding: 11px 15px; color: #7a8698; font-size: 10px; background: #fff; border-bottom: 1px solid var(--line); }
.receivable-summary strong { color: #3a4860; margin-left: 5px; }
.receipt-checkbox { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: #69768a; font-size: 10px; cursor: pointer; }
.receipt-checkbox input { accent-color: var(--blue); margin: 0; }
.approval-label-field { max-width: 650px; }
.financial-statement-document .approval { width: 50%; margin: 0 0 12px auto; border-collapse: collapse; table-layout: fixed; }
.financial-statement-document .approval th, .financial-statement-document .approval td { border: 1px solid #697386; text-align: center; padding: 4px; font-size: 11px; }
.financial-statement-document .approval th { background: #f2f4f7; }
.financial-statement-document .approval td { height: 56px; }
.approval-preview { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; margin-top: 18px; }
.approval-preview-cell { min-width: 0; height: 88px; border: 1px solid #dfe4ec; border-radius: 5px; text-align: center; color: #536078; font-size: 10px; }
.approval-preview-cell strong { display: block; padding: 7px 3px; border-bottom: 1px solid #dfe4ec; overflow-wrap: anywhere; }
.approval-preview-cell span { display: block; height: 58px; }
.print-preview-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: #17243a99; }
.print-preview-dialog { display: flex; flex-direction: column; width: min(1120px,100%); height: min(850px,calc(100vh - 36px)); background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px #11182755; }
.print-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: #344258; font-size: 13px; }
.print-preview-header > div { display: flex; gap: 8px; }
.print-preview-header button { min-height: 34px; }
.print-preview-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.modal-backdrop { position: fixed; inset: 0; background: #17243a73; z-index: 9; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; width: min(680px,100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 12px; box-shadow: 0 20px 70px #111c3233; }
.modal.wide { width: min(920px,100%); }
.modal-header { padding: 20px 23px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-header p { color: #929daf; margin: 5px 0 0; font-size: 10px; }
.modal-close { border: 0; color: #8d98a8; background: transparent; font-size: 21px; line-height: 1; }
.modal-body { padding: 19px 23px; }
.modal-footer { padding: 13px 23px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 14px; }
.form-grid.cols-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.searchable-control { display: block; width: 100%; min-width: 0; }
.searchable-control .searchable-lookup { width: 100%; height: 30px; min-width: 100px; border: 1px solid #e6eaf0; border-radius: 4px; padding: 0 7px; color: #47556b; font-size: 9px; background: #fff; }
.field .searchable-control .searchable-lookup { height: 35px; padding: 0 10px; font-size: 10px; }
.lookup-popup { position: fixed; z-index: 30; display: none; overflow-y: auto; border: 1px solid #dce2ec; border-radius: 7px; background: #fff; box-shadow: 0 8px 24px #17243a26; padding: 4px; }
.lookup-option { display: block; width: 100%; min-height: 32px; border: 0; border-radius: 4px; padding: 7px 9px; background: #fff; color: #3d4a60; text-align: left; font-size: 10px; cursor: pointer; }
.lookup-option:hover,.lookup-option:focus { outline: none; background: #eef2ff; color: #3859d3; }
.lookup-empty,.lookup-note { padding: 9px; color: #8b96a8; font-size: 10px; }
.lookup-note { border-top: 1px solid #edf0f5; }
.field.full { grid-column: 1/-1; }
.field label { font-size: 10px; color: #69768a; font-weight: 600; }
.required { color: #df6262; }
.field input,.field select,.field textarea { width: 100%; height: 35px; padding: 0 10px; border: 1px solid #e2e7ee; border-radius: 6px; color: #344159; font-size: 10px; background: #fff; }
.field textarea { min-height: 64px; padding-top: 9px; resize: vertical; }
.section-title { font-size: 11px; color: #536078; font-weight: 700; margin: 20px 0 11px; padding-bottom: 8px; border-bottom: 1px solid #f0f2f6; }
.section-title:first-child { margin-top: 0; }
.line-items { border: 1px solid var(--line); border-radius: 7px; overflow-x: auto; }
.line-items table { min-width: 760px; }
.line-items th { padding: 0 7px; font-size: 9px; }
.line-items td { padding: 5px 4px; height: auto; }
.line-items input,.line-items select { height: 30px; width: 100%; min-width: 64px; border: 1px solid #e6eaf0; border-radius: 4px; padding: 0 6px; color: #47556b; font-size: 9px; }
.line-items input:disabled { color: #aab2bf; background: #f2f4f7; cursor: not-allowed; box-shadow: none; }
.line-items input[type=number] { text-align: right; }
.line-items .calc-cell { text-align: right; padding-right: 8px; color: #58667a; font-size: 9px; min-width: 75px; }
.line-items .item-name { min-width: 100px; }
.line-items .tax-select { min-width: 81px; }
.line-items .memo-input { min-width: 170px; }
.bank-import-lines { margin-top: 8px; max-height: 45vh; overflow: auto; }
.bank-import-lines table { min-width: 1000px; }
.bank-import-lines input[type=checkbox] { width: auto; min-width: 0; height: auto; }
.line-items:has(#journal-lines) table { min-width: 1100px; }
.memo-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #47556b; }
.modal.wide { width: min(1100px,100%); }
.receipt-currency-entry { display: grid; grid-template-columns: minmax(100px,.8fr) minmax(120px,1fr); gap: 6px; }
.receipt-currency-entry select,.receipt-currency-entry input { width: 100%; height: 30px; border: 1px solid #e6eaf0; border-radius: 4px; padding: 0 6px; color: #47556b; font-size: 9px; }
.invoice-line-items table { min-width: 1450px; table-layout: fixed; }
.invoice-line-items .col-item-code { width: 7%; }
.invoice-line-items .col-item-name { width: 8%; }
.invoice-line-items .col-account { width: 10%; }
.invoice-line-items .col-subaccount { width: 7%; }
.invoice-line-items .col-qty { width: 5%; }
.invoice-line-items .col-price { width: 7%; }
.invoice-line-items .col-currency { width: 6%; }
.invoice-line-items .col-rate { width: 7%; }
.invoice-line-items .col-foreign { width: 9%; }
.invoice-line-items .col-krw { width: 9%; }
.invoice-line-items .col-tax { width: 7%; }
.invoice-line-items .col-vat { width: 8%; }
.invoice-line-items .col-remove { width: 5%; }
.invoice-line-items input,.invoice-line-items select { min-width: 0; }
.ledger-account { margin-top: 18px; }
.ledger-account:first-of-type { margin-top: 8px; }
.ledger-account .panel-heading { margin-bottom: 8px; }
.ledger-account .panel-heading h2 { margin: 0; font-size: 13px; }
.ledger-toolbar { display: grid; grid-template-columns: minmax(290px,1.2fr) minmax(190px,1fr) minmax(150px,.75fr); }
.ledger-toolbar .filter-row { min-width: 0; flex-wrap: nowrap; }
.ledger-toolbar .date-input { min-width: 0; width: 135px; }
.ledger-toolbar .filter-select { width: 100%; min-width: 0; }
.ledger-table { min-width: 920px; table-layout: fixed; white-space: normal; }
.ledger-table th,.ledger-table td { overflow: hidden; text-overflow: ellipsis; }
.ledger-table th { white-space: normal; line-height: 1.35; padding: 7px 9px; }
.ledger-table td { padding: 7px 9px; }
.ledger-table .ledger-opening-row { background: #f5f7fc; font-weight: 600; }
.ledger-table .ledger-opening-row td:first-child { color: #4568e8; }
.ledger-table .ledger-month-total-row { background: #fafbfe; }
.ledger-table .ledger-cumulative-total-row { background: #f0f3fa; font-weight: 700; }
.ledger-table .ledger-date { width: 10%; }
.ledger-table .ledger-voucher { width: 8%; }
.ledger-table .ledger-type { width: 8%; }
.ledger-table .ledger-sub { width: 13%; }
.ledger-table .ledger-party { width: 16%; }
.ledger-table .ledger-amount { width: 13%; }
.ledger-table .ledger-balance { width: 19%; }
.ledger-table td:nth-child(6),.ledger-table td:nth-child(7),.ledger-table td:nth-child(8) { white-space: nowrap; }
.ledger-table td:nth-child(8) { overflow: visible; }
.trial-balance-document { padding: 20px; background: #fff; }
.trial-balance-meta { display: grid; grid-template-columns: 1fr 1.2fr 1.5fr; margin-bottom: 13px; border: 1px solid #aeb7c4; }
.trial-balance-meta > div { display: grid; grid-template-columns: auto minmax(0,1fr); min-height: 35px; border-right: 1px solid #c9ced6; }
.trial-balance-meta > div:last-child { border-right: 0; }
.trial-balance-meta span,.trial-balance-meta strong { display: flex; align-items: center; padding: 6px 8px; font-size: 10px; }
.trial-balance-meta span { justify-content: center; background: #f5f6f8; border-right: 1px solid #c9ced6; color: #596579; font-weight: 600; }
.trial-balance-meta strong { min-width: 0; overflow-wrap: anywhere; color: #344258; font-weight: 500; }
.trial-balance-as-of { margin: 0 0 12px; text-align: center; color: #4d5869; font-size: 11px; letter-spacing: 2px; }
.trial-balance-table { min-width: 860px; table-layout: fixed; }
.trial-balance-table col:nth-child(1),.trial-balance-table col:nth-child(2),.trial-balance-table col:nth-child(4),.trial-balance-table col:nth-child(5) { width: 18%; }
.trial-balance-table col:nth-child(3) { width: 28%; }
.trial-balance-table th,.trial-balance-table td { padding: 6px 9px; }
.trial-balance-table th { text-align: center; }
.trial-balance-table thead tr:first-child th { height: 34px; }
.trial-balance-table tbody td { height: 31px; }
.trial-balance-table .trial-account-name { text-align: center; color: #354256; }
.trial-balance-table .trial-balance-group th { height: 29px; background: #f5f6f8; color: #354256; }
.trial-balance-table .trial-balance-subgroup th { height: 26px; background: #fafbfd; color: #596579; font-weight: 600; }
.trial-balance-table tfoot th { background: #f0f3fa; font-weight: 700; }
.trial-balance-table tfoot th:nth-child(3) { text-align: center; }
.financial-statement-document { padding: 20px; background: #fff; }
.sales-total-document { padding: 20px; background: #fff; }
.sales-total-title { margin: 0; text-align: center; font-size: 20px; letter-spacing: 2px; color: #263248; }
.sales-total-period { margin: 8px 0 24px; text-align: center; color: #58667a; font-size: 11px; font-weight: 600; }
.sales-total-section { margin-top: 20px; }
.sales-total-section h3 { margin: 0 0 8px; padding: 0 0 7px; border-bottom: 1px solid #778294; color: #354256; font-size: 12px; }
.sales-total-company { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid #c9ced6; border-left: 1px solid #c9ced6; }
.sales-total-company > div { display: grid; grid-template-columns: minmax(110px,.7fr) minmax(0,1.3fr); min-height: 38px; border-right: 1px solid #c9ced6; border-bottom: 1px solid #c9ced6; }
.sales-total-company span,.sales-total-company strong { display: flex; align-items: center; padding: 7px 9px; font-size: 10px; }
.sales-total-company span { background: #f5f6f8; border-right: 1px solid #c9ced6; color: #596579; font-weight: 600; }
.sales-total-company strong { min-width: 0; overflow-wrap: anywhere; color: #344258; font-weight: 500; }
.sales-total-table { min-width: 760px; }
.sales-total-table th,.sales-total-table td { height: 38px; padding: 6px 10px; }
.sales-total-table thead th,.sales-total-table tbody th { background: #f5f6f8; color: #46536a; }
.sales-total-table tbody th { text-align: left; font-size: 10px; font-weight: 600; }
.sales-total-table tfoot th { background: #f0f3fa; color: #354256; }
.sales-total-details-table th:nth-child(1) { width: 5%; }
.sales-total-details-table th:nth-child(2) { width: 20%; }
.sales-total-details-table th:nth-child(3) { width: 17%; }
.sales-total-details-table th:nth-child(4) { width: 8%; }
.sales-total-details-table th:nth-child(5) { width: 18%; }
.sales-total-details-table th:nth-child(6) { width: 15%; }
.sales-total-details-table th:nth-child(7) { width: 17%; }
.sales-total-details-table .sales-total-row-number { padding-right: 2px; padding-left: 2px; text-align: center; }
.sales-total-document .receivable-summary { margin-top: 18px; border: 1px solid var(--line); }
.sales-total-print .sales-total-document { width: 100%; }
.voucher-link { border: 0; background: none; padding: 0; color: #2f5fd0; font: inherit; text-decoration: underline; cursor: pointer; }
.financial-statement-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.statement-major-heading { margin: 14px 0 8px; padding: 9px 11px; border-bottom: 2px solid #66748a; color: #344258; font-size: 14px; }
.statement-section { margin: 10px 0 16px; }
.statement-section h2 { margin: 0; padding: 8px 10px; background: #f4f6fa; color: #4b586d; font-size: 11px; }
.statement-table { table-layout: fixed; }
.statement-table td,.statement-table th { height: 33px; padding: 6px 10px; }
.statement-table tfoot th { background: #fafbfd; color: #38465b; font-weight: 700; }
.statement-total { display: flex; align-items: center; justify-content: space-between; margin: 7px 0; padding: 10px 12px; border: 1px solid #e2e7ef; border-radius: 5px; color: #425068; font-size: 11px; }
.statement-total strong { color: #29364c; font-variant-numeric: tabular-nums; }
.statement-net-income { margin-top: 14px; background: #f0f3fa; font-weight: 700; }
.statement-balance-check { margin-top: 10px; padding: 9px 12px; text-align: right; color: #16805f; font-size: 10px; font-weight: 600; }
.statement-balance-check.unbalanced { color: #c14f4f; }
.income-statement-content { max-width: 850px; margin: 0 auto; }
.subsidiary-ledger-toolbar { grid-template-columns: minmax(290px,1.2fr) minmax(170px,1fr) minmax(130px,.8fr) minmax(170px,1fr) minmax(150px,.8fr); }
.subsidiary-ledger-toolbar .filter-select:disabled { color: #aab2bf; background: #f2f4f7; }
.subsidiary-ledger-table .ledger-party { width: 15%; }
.subsidiary-ledger-table .ledger-memo { width: 20%; }
.subsidiary-ledger-table .ledger-amount { width: 11%; }
.subsidiary-ledger-table .ledger-balance { width: 14%; }
.party-ledger-toolbar { grid-template-columns: minmax(290px,1.2fr) minmax(170px,1fr) minmax(180px,1.1fr) minmax(150px,.9fr) minmax(170px,1fr) minmax(150px,.8fr); }
.party-ledger-toolbar .filter-select { width: 100%; min-width: 0; }
.party-ledger-toolbar .filter-select:disabled { color: #aab2bf; background: #f2f4f7; }
.party-ledger-table .ledger-sub { width: 12%; }
.party-ledger-table .ledger-memo { width: 20%; }
.party-ledger-table .ledger-amount { width: 11%; }
.party-ledger-table .ledger-balance { width: 14%; }
.foreign-ledger-toolbar { grid-template-columns: minmax(280px,1.2fr) minmax(170px,1fr) minmax(120px,.65fr) minmax(140px,.8fr) minmax(170px,1fr) minmax(150px,.8fr); }
.foreign-ledger-toolbar .filter-select { width: 100%; min-width: 0; }
.foreign-ledger-toolbar .filter-select:disabled { color: #aab2bf; background: #f2f4f7; }
.foreign-ledger-table { min-width: 1120px; }
.foreign-ledger-table .ledger-sub { width: 10%; }
.foreign-ledger-table .ledger-party { width: 13%; }
.foreign-ledger-table .ledger-amount { width: 11%; }
.foreign-ledger-table .ledger-balance { width: 16%; }
.foreign-ledger-table .ledger-krw { width: 11%; }
.invoice-line-items input[name="qty"],.invoice-line-items input[name="price"],.invoice-line-items input[name="exchangeRate"],.invoice-line-items input[name="foreignAmount"],.invoice-line-items input[name="krwAmount"],.invoice-line-items input[name="vatAmount"] { text-align: right; }
.invoice-line-items th { white-space: normal; line-height: 1.35; }
.invoice-sent-controls { display: flex; align-items: flex-end; gap: 16px; }
.invoice-sent-controls .field { width: min(240px,100%); }
.invoice-sent-controls > label { display: flex; align-items: center; gap: 6px; min-height: 35px; }
.add-line { border: 1px dashed #dce2ec; border-radius: 6px; background: #fff; width: 100%; height: 32px; color: #738099; font-size: 10px; margin-top: 7px; }
.add-line:hover { border-color: #94a4f1; color: var(--blue); }
.totals-box { display: flex; justify-content: flex-end; gap: 22px; padding: 13px 2px 0; font-size: 10px; color: #8792a3; }
.totals-box strong { color: #39465c; margin-left: 5px; }
.totals-box .grand-total { color: var(--blue); font-size: 12px; }
.journal-hint { padding: 10px 12px; margin-top: 12px; border-radius: 6px; background: #f7f9fc; color: #778499; font-size: 10px; }
.journal-hint.valid { background: #eaf8f2; color: #13805d; }
.journal-hint.invalid { background: #fff3f0; color: #c55649; }
.toggle-sent { border: 0; padding: 0; color: #5070d9; background: none; font-size: 10px; text-decoration: underline; }
.notice { display: flex; gap: 9px; color: #738097; background: #f6f8fc; padding: 12px; border-radius: 7px; font-size: 10px; line-height: 1.6; margin-bottom: 15px; }
.notice strong { color: #506079; }
.toast-region { position: fixed; right: 24px; bottom: 22px; z-index: 20; display: grid; gap: 8px; }
.toast { background: #1d2b42; color: #fff; border-radius: 7px; padding: 11px 15px; font-size: 11px; box-shadow: 0 6px 18px #17243a26; animation: toast-in .2s ease-out; }
.toast.error { background: #a94444; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.settings-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.settings-card header { padding: 15px 17px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.settings-card h2 { margin: 0; font-size: 13px; }
.settings-card .settings-content { padding: 14px 17px; }
.settings-card table td { padding: 0 8px; height: 41px; }
.settings-card table th { padding: 0 8px; }
.account-chart-card { grid-column: 1 / -1; }
.account-chart-card header { gap: 14px; }
.card-caption { color: #929daf; font-size: 10px; margin: 5px 0 0; }
.chart-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.chart-toolbar { min-height: 57px; }
.chart-toolbar .search-input { max-width: 260px; }
.chart-count { white-space: nowrap; }
.title-split { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 16px; align-items: start; }
.title-list { max-height: 78vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.title-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 2px 10px; line-height: 1.2; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; font: inherit; font-size: 11px; }
.title-item .badge { padding: 0 6px; font-size: 10px; line-height: 16px; }
.title-item:hover { background: #f4f7fb; }
.title-item.active { background: #e8f0fe; }
.title-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-detail { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.title-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.title-detail-head h3 { margin: 0 0 6px; font-size: 15px; }
.sub-scroll { max-height: 55vh; overflow-y: auto; }
.sub-scroll thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
@media (max-width: 900px) { .title-split { grid-template-columns: 1fr; } }
.chart-content { padding-top: 0 !important; }
.account-code { color: #5268d7; font-variant-numeric: tabular-nums; }
.sub-badge { margin: 2px; }
.company-form { display: grid; gap: 15px; }
.company-panel { padding: 19px 20px; }
.company-panel .panel-heading { margin-bottom: 18px; }
.company-wide { grid-column: span 2; }
.field-help { color: #9aa4b1; font-size: 9px; line-height: 1.5; }
.readonly-value { min-height: 35px; display: flex; align-items: center; padding: 0 10px; border: 1px solid #e2e7ee; border-radius: 6px; color: #344159; font-size: 10px; background: #f8f9fc; }
.company-notice { margin: 17px 0 0; }
.mssql-panel { max-width: 1050px; }
.mssql-option { max-width: 220px; }
.mssql-notice { margin: 18px 0 0; }
.company-actions { display: flex; justify-content: space-between; align-items: center; }
.account-detail { color: #9ba5b3; font-size: 9px; margin-top: 4px; }
.nowrap { white-space: nowrap; }
@media (max-width: 1050px) {
  .sidebar { width: 210px; }
  .main-area { margin-left: 210px; }
  .content { padding-left: 24px; padding-right: 24px; }
  .ledger-toolbar { grid-template-columns: minmax(0,1fr) minmax(160px,1fr); }
  .ledger-toolbar .filter-row { grid-column: 1/-1; }
  .subsidiary-ledger-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .subsidiary-ledger-toolbar .filter-row { grid-column: 1/-1; }
  .party-ledger-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .party-ledger-toolbar .filter-row { grid-column: 1/-1; }
  .foreign-ledger-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .foreign-ledger-toolbar .filter-row { grid-column: 1/-1; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .ledger-toolbar { grid-template-columns: minmax(0,1fr); }
  .ledger-toolbar .filter-row { grid-column: auto; flex-wrap: wrap; }
  .ledger-toolbar .date-input { flex: 1 1 120px; }
  .subsidiary-ledger-toolbar { grid-template-columns: minmax(0,1fr); }
  .subsidiary-ledger-toolbar .filter-row { grid-column: auto; }
  .party-ledger-toolbar { grid-template-columns: minmax(0,1fr); }
  .party-ledger-toolbar .filter-row { grid-column: auto; }
  .foreign-ledger-toolbar { grid-template-columns: minmax(0,1fr); }
  .foreign-ledger-toolbar .filter-row { grid-column: auto; }
  .trial-balance-document,.financial-statement-document,.sales-total-document { padding: 12px; }
  .financial-statement-columns { grid-template-columns: minmax(0,1fr); gap: 0; }
  .trial-balance-meta { grid-template-columns: minmax(0,1fr); }
  .trial-balance-meta > div { border-right: 0; border-bottom: 1px solid #c9ced6; }
  .trial-balance-meta > div:last-child { border-bottom: 0; }
  .sales-total-company { grid-template-columns: minmax(0,1fr); }
  .trial-balance-table { min-width: 720px; }
  .sidebar { position: sticky; inset: 0 0 auto; width: 100%; height: auto; padding: 10px 14px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 2px; }
  .workspace-label,.nav-section,.sidebar-bottom { display: none; }
  .main-nav { display: flex; flex: 0 0 auto; min-height: 0; gap: 5px; margin-top: 9px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; padding-bottom: 2px; }
  .nav-item,.nav-item:not(.active) { display: flex; flex: 0 0 auto; width: auto; height: 36px; justify-content: flex-start; padding: 0 10px; gap: 7px; font-size: 11px; white-space: nowrap; }
  .nav-tree { display: flex; flex: 0 0 auto; align-items: flex-start; gap: 0; }
  .nav-tree-toggle { width: auto; }
  .nav-tree-children { display: flex; gap: 4px; margin: 0 0 0 5px; padding: 0 0 0 5px; border-left: 1px solid #e7ebf2; }
  .nav-tree-children[hidden] { display: none; }
  .nav-item.nav-child { flex: 0 0 auto; width: auto; height: 36px; padding: 0 8px; font-size: 10px; }
  .nav-icon { width: 15px; font-size: 15px; }
  .main-area { min-width: 0; margin-left: 0; }
  .topbar { padding: 0 16px; height: 58px; }
  .content { padding: 25px 14px 36px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .receivable-summary { justify-content: flex-start; gap: 14px; flex-wrap: wrap; }
  .approval-preview { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .print-preview-overlay { padding: 0; }
  .print-preview-dialog { width: 100%; height: 100vh; border-radius: 0; }
  .print-preview-header { align-items: flex-start; }
  .print-preview-header > div { flex-wrap: wrap; justify-content: flex-end; }
  .page-heading .primary-btn { align-self: flex-start; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 13px; min-height: 100px; }
  .stat-value { font-size: 19px; }
  .dashboard-grid,.settings-grid { grid-template-columns: 1fr; }
  .search-input { width: 150px; }
  .today-label { display: none; }
  .form-grid,.form-grid.cols-3 { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .company-wide { grid-column: auto; }
  .company-actions { align-items: flex-start; flex-direction: column; gap: 10px; }
  .modal-backdrop { padding: 9px; }
  .modal { max-height: calc(100vh - 18px); }
  .modal-header,.modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-footer { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 1050px) {
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .dashboard-grid > * { min-width: 0; }
}
@media (max-width: 600px) {
  body { min-width: 320px; }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .topbar { padding: 0 12px; }
  .content { padding: 21px 12px 30px; }
  .page-heading { margin-bottom: 18px; gap: 12px; }
  h1 { font-size: 21px; }
  .page-subtitle { max-width: 100%; line-height: 1.55; }
  .panel { padding: 15px 13px; }
  .table-card { min-width: 0; }
  .toolbar { align-items: stretch; padding: 11px; }
  .toolbar .spacer { display: none; }
  .filter-row { width: 100%; }
  .date-input { min-width: 0; flex: 1 1 110px; }
  .search-input { width: 100%; min-width: 0; }
  .filter-select { max-width: 100%; }
  .panel-heading { gap: 8px; }
  .panel-heading h2 { font-size: 13px; }
  .panel-heading > span { text-align: right; }
  .stat-card { min-width: 0; }
  .stat-value { font-size: clamp(17px,5vw,20px); }
  .company-panel { padding: 15px 13px; }
  .company-panel .panel-heading { align-items: flex-start; flex-direction: column; margin-bottom: 14px; }
  .company-notice { margin-top: 13px; }
  .company-actions { width: 100%; }
  .company-actions .primary-btn { width: 100%; }
  .invoice-sent-controls { align-items: flex-start; flex-direction: column; gap: 8px; }
  .invoice-sent-controls .field { width: 100%; }
  .account-chart-card header { align-items: flex-start; flex-direction: column; }
  .chart-header-actions { width: 100%; justify-content: flex-start; }
  .chart-header-actions button { flex: 1 1 auto; }
  .chart-toolbar .search-input { max-width: none; }
  .chart-toolbar .spacer { display: none; }
  .chart-count { width: 100%; }
  .modal-backdrop { padding: 6px; }
  .modal { width: 100%; max-height: calc(100dvh - 12px); }
  .modal-header { padding-top: 15px; padding-bottom: 13px; }
  .modal-body { padding-top: 15px; padding-bottom: 15px; }
  .modal-footer { position: sticky; bottom: 0; background: #fff; }
}
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: minmax(0,1fr); }
  .stat-card { min-height: 88px; }
  .stat-value { margin-top: 10px; }
  .breadcrumb { gap: 7px; font-size: 11px; }
  .avatar { width: 28px; height: 28px; flex: 0 0 28px; }
  .nav-item,.nav-item:not(.active) { padding: 0 8px; font-size: 10px; }
}
