/* User-selected navy sidebar dashboard, with neutral working surfaces. */
:root {
  --bg: #f3f6fa;
  --surface: #fff;
  --ink: #192b43;
  --muted: #66758b;
  --line: #e7ecf3;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-number: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --green: #1677ff;
  --green-dark: #0958d9;
  --green-soft: #e6f4ff;
  --amber: #946713;
  --amber-soft: #fff8e8;
  --red: #bd433c;
  --red-soft: #fff0ef;
  --blue: #1677ff;
  --radius: 8px;
  --shadow: none;
}

body {
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.6;
  font-weight: 400;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
input:focus, select:focus, textarea:focus { border-color: #7da3ed !important; outline: 2px solid #1677ff12; }
button:focus-visible, a:focus-visible { outline: 2px solid #7399e2; outline-offset: 2px; }
h1 {font-size: 24px; font-weight: 600; letter-spacing: 0; margin-bottom: 4px; line-height: 1.4;}
h2 {font-size: 16px; font-weight: 600; line-height: 1.5;}
h3 {font-size: 15px; line-height: 1.5; font-weight: 600;}
.eyebrow, .sidebar-note, .empty-icon, .quick-arrow { display: none; }
.sidebar { width: 216px; top: 56px; padding: 19px 0 12px; background: #142238; border-right: 0; }
.brand { gap: 10px; font-size: 17px; padding: 0 18px 22px; }
.brand-mark { width: 31px; height: 33px; border-radius: 4px; font-size: 20px; background: #1677ff; }
.brand small { font-size: 12px; margin-top: 3px; color: #88909c; letter-spacing: 0; }
.nav-caption { font-size: 12px; margin: 6px 22px 11px; color: #929aa6; letter-spacing: 0; }
.nav-link { padding: 11px 14px; border-radius: 5px; margin: 0 10px 9px; gap: 13px; font-size: 14px; color: #b5c2d5; line-height: 22px; }
.nav-link svg { width: 17px; height: 17px; }
.nav-link:hover { background: #20334f; color: #fff; }
.nav-link.active { background: #1677ff; color: #fff; box-shadow: none; font-weight: 500; }
.nav-link.active:after { display: none; }
.sidebar-bottom { padding: 18px 24px 0; }
.sidebar-caption { font-size: 12px; color: #71849f; }
.sidebar-toggle { position: absolute; top: 19px; right: -13px; width: 25px; height: 25px; display: grid; place-items: center; background: #fff; border: 1px solid #f0f0f0; border-radius: 50%; padding: 0; color: #bfbfbf; z-index: 2; }
.sidebar-toggle:hover { color: #1677ff; }
.sidebar-toggle svg { width: 14px; height: 14px; }
.sidebar-collapsed .sidebar { width: 64px; }
.sidebar-collapsed .app-body { margin-left: 64px; }
.sidebar-collapsed .nav-link { justify-content: center; padding: 10px; margin-left: 8px; margin-right: 8px; }
.sidebar-collapsed .nav-link span, .sidebar-collapsed .sidebar-caption { display: none; }
.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.user-button { font-size: 12px; padding: 13px 3px 7px; color: #595959; }
.logout-label { font-size: 12px; color: #87909c; }
.app-body { margin-left: 216px; padding-top: 56px; min-height: 100dvh; }
.topbar { position: fixed; inset: 0 0 auto; z-index: 40; height: 56px; padding: 0 24px 0 0; background: #fff; border-bottom: 1px solid #e8edf4; }
.header-brand { display: flex; align-items: center; gap: 11px; color: #fff; font-size: 20px; font-weight: 600; width: 216px; padding: 0 21px; align-self: stretch; background: #142238; min-width: 0; }
.header-brand img { flex-shrink: 0; }
.header-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-brand { flex-shrink: 0; }
.header-page-title { font-size: 14px; font-weight: 500; color: #566a84; margin-left: 22px; }
.header-user { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #595959; padding-left: 4px; }
.header-avatar { width: 26px; height: 26px; display: grid; place-items: center; color: #1677ff; background: #e6f4ff; border-radius: 50%; font-size: 12px; }
.header-logout { border: 0; background: transparent; padding: 4px; color: #66758b; font-size: 12px; }
.header-logout:hover { color: #1677ff; }
.more-account { border-top: 1px solid #f0f0f0; padding: 12px 18px; text-align: right; }
.breadcrumb { font-size: 12px; gap: 12px; color: #818b99; }
.breadcrumb strong { color: #595959; }
.topbar-actions { gap: 17px; margin-left: auto; }
.sync-status { color: #66758b; }
.online-dot { background: #24a16a; }
.month-picker input { border-radius: 4px; width: 148px; font-size: 12px; color: #595959; padding: 5px 9px; }
.icon-button { border-radius: 4px; color: #77818f; }
#main { padding: 24px; }
.page-heading { margin-bottom: 20px; gap: 16px; }
.page-heading p {font-size: 13px; color: #66758b; line-height: 1.7;}
.button { min-height: 36px; padding: 7px 15px; border-radius: 6px; font-size: 14px; font-weight: 500; box-shadow: none !important; }
.button.primary { background: #1677ff; border-color: #1677ff; }
.button.primary:hover { background: #0958d9; }
.button.secondary { color: #595959; border-color: #d7dde5; }
.button.secondary:hover { background: #f6f8fb; }
.button.ghost { color: #1769d1; padding: 4px 7px; min-height: 32px; font-size: 13px;}
.button.small { border-radius: 3px; }
.heading-actions { gap: 8px; }
.panel, .supplier-card { border-color: #f0f0f0; border-radius: 8px; box-shadow: none; margin-bottom: 20px; }
.panel-head { padding: 20px 20px 0; }
.panel-head h2 { font-size: 16px; }
.panel-head p { font-size: 12px; color: #66758b; }
.panel-body { padding: 20px; }
.panel-link { color: #6c7686; font-size: 12px; }
.overview-grid { gap: 18px; grid-template-columns: minmax(0,1.6fr) minmax(290px,1fr); }
.metric-grid { gap: 0; background: #fff; border: 1px solid #f0f0f0; border-radius: 8px; margin-bottom: 14px; padding: 20px 0; }
.metric, .metric.featured { border: 0; border-right: 1px solid #f0f0f0; border-radius: 0; padding: 0 22px; min-height: 90px; background: transparent; color: #262626; }
.metric:last-child { border-right: 0; }
.metric-top, .metric.featured .metric-top { color: #66758b; font-size: 13px; }
.metric-icon { display: none; }
.metric-number { font-size: 25px; font-weight: 600; letter-spacing: -.4px; margin: 8px 0 6px; font-family: var(--font-number); }
.currency { font-size: 14px; color: #7a8593; opacity: 1; }
.metric-foot, .metric.featured .metric-foot {font-size: 12px; color: #66758b; line-height: 1.6;}
.quick-grid { display: flex; gap: 22px; margin: 0 0 19px; align-items: center; flex-wrap: wrap; }
.quick-card { display: inline-flex; width: auto; padding: 0; border: 0; background: transparent; gap: 6px; border-radius: 0; color: #526174; }
.quick-card:hover { background: transparent; color: #1677ff; }
.quick-card strong { font-size: 12px; font-weight: 400; }
.quick-card .quick-icon { padding: 0; background: transparent; border-radius: 0; color: #7c8b9f; }
.quick-icon svg { width: 15px; height: 15px; }
.quick-card small { display: none; }
.legend { font-size: 12px; color: #7d8796; }
.legend-dot { background: #5e87c8; }
.legend-dot.amber { background: #adb9cd; }
.chart { height: 142px; gap: 5px; }
.chart-bar { background: #5e87c8; border-radius: 1px 1px 0 0; }
.chart-bar.out { background: #adb9cd; }
.chart-summary { gap: 28px; }
.chart-summary strong { color: #465569; font-size: 15px; font-weight: 500; }
.chart-summary span, .chart-labels { color: #8b94a1; }
.category-list { gap: 14px; }
.category-row { font-size: 14px; color: #566174; }
.category-row strong {font-family: var(--font-number); font-variant-numeric: tabular-nums lining-nums;}
.category-track { background: #f0f2f5; height: 3px; border-radius: 0; margin-top: 6px; }
.category-track span { border-radius: 0; }
.category-percent { font-size: 12px; color: #66758b; }
table {font-size: 14px; font-variant-numeric: tabular-nums lining-nums;}
th { color: #526177; background: #f5f7fb; font-size: 13px; letter-spacing: 0; padding: 13px 18px; font-weight: 500; border-top: 0; }
td { color: #34465e; font-size: 14px; padding: 14px 18px; border-bottom-color: #f0f0f0; line-height: 1.6;}
tbody tr:hover { background: #f8faff; }
.table-main { color: #24364f; font-weight: 500; font-size: 14px;}
.table-sub { color: #66758b; font-size: 12px; margin-top: 3px; line-height: 1.6;}
.mobile-account { display: none; }
.amount {font-size: 15px; font-weight: 600; font-family: var(--font-number); font-variant-numeric: tabular-nums lining-nums;}
.positive { color: #19805b; }
.negative { color: #bd433c; }
.badge { padding: 3px 7px; border-radius: 3px; font-size: 12px; color: #697587; background: #f1f3f6; }
.badge.green { color: #358362; background: #edf7f1; }
.badge.amber { color: #98711e; background: #fff7e7; }
.badge.red { color: #bd5149; background: #fff0ef; }
.badge.blue { color: #4c71ad; background: #eef3fb; }
.badge.neutral { color: #8b95a1; background: #f2f4f6; }
.filters { padding: 14px 16px; gap: 10px; }
.filters input, .filters select { border-radius: 4px; font-size: 14px; min-height: 38px; color: #595959; padding: 7px 10px; }
.search svg { top: 10px; color: #929dac; }
.filter-count { font-size: 12px; color: #66758b; }
.table-footer {font-size: 12px; color: #7a8595; padding: 14px 18px; line-height: 1.7;}
.empty { padding: 34px 20px; }
.empty h3 { font-size: 15px; color: #778393; font-weight: 400; }
.empty p {color: #66758b; font-size: 13px; line-height: 1.8;}
.notice { font-size: 13px; background: #f6f8fb; color: #6e7b8e; border: 1px solid #e5eaf1; border-radius: 4px; padding: 12px 15px; line-height: 1.8; margin-bottom: 16px; }
.notice strong { color: #4b5e78; font-weight: 600; }
.notice.danger { border-color: #f1d8d5; }
.notice.blue { background: #f0f5fc; color: #6580a5; border-color: #e1e9f5; }
.supplier-table .supplier-name { font-size: 15px; font-weight: 500; color: #3a4657; }
.supplier-table .supplier-actions { white-space: nowrap; }
.supplier-table td { padding-top: 14px; padding-bottom: 14px; }
.supplier-card { border-radius: 4px; }
.document-icon { background: transparent; color: #8c9db2; border-radius: 0; padding: 2px; }
.document-icon svg { width: 18px; height: 18px; }
.photo-count { color: #7189ae; }
.mini-stat { padding: 13px; border-radius: 3px; background: #fafafa; }
.mini-stat span { color: #7f8997; font-size: 12px; }
.mini-stat strong { font-size: 21px; font-weight: 500; }
.section-title { font-size: 16px; font-weight: 600; color: #34465e; }
.calendar-toolbar { padding: 14px 18px; }
.calendar-toolbar select {border-radius: 4px; color: #58677b; font-size: 14px; padding: 8px 10px;}
.calendar-week span { background: #fafafa; color: #788495; font-size: 12px; padding: 9px; }
.calendar-cell { min-height: 85px; padding: 10px; color: #4e5f76; }
.calendar-cell.blank { background: #fafafa; }
.calendar-cell.rest { background: #f6f8fb; }
.calendar-cell:hover:not(.blank) { background: #edf3fc; }
.calendar-cell.today { box-shadow: inset 0 0 0 1px #84a5da; }
.calendar-cell.today .day-number { color: #fff; background: #4e79bb; border-radius: 3px; }
.day-status { font-size: 12px; color: #66758b; }
.day-status.holiday { color: #ad8443; }
.day-status.compensatory { color: #5c83a8; }
.day-leave {background: #fbf1df; color: #a58247; font-size: 12px; border-radius: 2px; white-space: normal; overflow-wrap: anywhere;}
.calendar-legend { color: #66758b; font-size: 12px; }
.event-row { padding: 12px 0; gap: 10px; }
.event-day { background: #f0f3f8; color: #6380a5; border-radius: 3px; }
.event-day small { color: #66758b; }
.event-copy strong { font-size: 14px; color: #54647a; font-weight: 500; }
.event-copy small {color: #66758b; font-size: 12px; line-height: 1.7;}
.field { gap: 6px; }
.field>span { color: #34465e; font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea, .plain-input { min-height: 40px; padding: 9px 12px; border-radius: 6px; border-color: #d6dfea; font-size: 14px; color: #434343; }
.field .money-input { font-size: 28px; font-weight: 600; letter-spacing: 0; padding: 10px; font-family: var(--font-number); font-variant-numeric: tabular-nums lining-nums;}
.field small {color: #66758b; font-size: 12px; line-height: 1.75;}
.checkbox-label { color: #6e7a8b; font-size: 12px; }
.checkbox-label input { accent-color: #1677ff; }
summary { color: #8391a4; font-size: 12px; }
.attachment-tile { border-radius: 4px; background: #f4f6f9; }
.editor { border-radius: 6px; border-color: #dfe5ed; box-shadow: 0 14px 50px #1f2e442b; }
.editor::backdrop, .more-dialog::backdrop { background: #15253b55; backdrop-filter: none; }
.modal-header { padding: 20px 22px 16px; }
.modal-header h2 { font-size: 18px; font-weight: 600; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; background: #f8fafc; }
.modal-header .eyebrow { display: none; }
.toast { background: #334e74; border-color: #466389; border-radius: 4px; box-shadow: 0 3px 12px #1f2e441a; font-size: 12px; }
.toast.error { background: #8a514e; }
.upload-drop { padding: 26px 18px; border-color: #cbd5e3; border-radius: 4px; background: #fafbfe; color: #8595ad; }
.upload-drop strong { font-size: 15px; font-weight: 500; color: #607da6; }
.upload-drop small { color: #66758b; font-size: 12px; }
.upload-drop svg { color: #6b89b5; }
.import-step { color: #66758b; font-size: 12px; }
.import-step b { border-radius: 3px; border-color: #dce3ed; }
.import-table select { border-radius: 3px; color: #5e718b; }
.account-row { padding: 13px 0; }
.account-row strong { color: #4a596e; font-weight: 500; font-size: 14px; }
.account-row small {font-size: 12px; color: #66758b; line-height: 1.7;}
.account-row .amount { font-size: 15px; }
.app-footer { justify-content: flex-end; font-size: 12px; color: #66758b; padding: 0 24px 15px; }

/* A direct sign-in form, without a promotional cover. */
.auth-screen { min-height: 100dvh; display: flex; flex-direction: column; background: #f5f5f5; }
.auth-header { display: flex; align-items: center; height: 56px; padding: 0 24px; background: #fff; border-bottom: 1px solid #f0f0f0; }
.auth-header .brand { margin: 0; padding: 0; font-size: 19px; }
.auth-header .brand-mark { width: 30px; height: 32px; }
.auth-header-note { margin-left: auto; font-size: 12px; color: #66758b; }
.auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 24px 80px; }
.auth-form { max-width: 410px; width: 100%; background: #fff; border: 1px solid #f0f0f0; border-radius: 8px; padding: 31px 34px; }
.auth-form h2 { font-size: 24px; font-weight: 600; margin-bottom: 7px; }
.auth-form>p { font-size: 13px; color: #66758b; margin-bottom: 26px; }
.auth-form .field { margin-bottom: 18px; }
.auth-form .field>span { font-size: 14px; }
.auth-form .field input { min-height: 40px; }
.auth-form .button { min-height: 40px; border-radius: 4px; padding: 10px; margin-top: 8px; }
.auth-note { font-size: 12px; color: #66758b; margin-top: 20px; line-height: 1.9; }
.auth-footer { text-align: center; font-size: 12px; padding: 0 20px 24px; color: #66758b; }

@media (max-width:1200px) {
  .sidebar { width: 200px; }
  .app-body { margin-left: 200px; }
  .header-brand { width: 200px; }
  #main { padding: 20px; }
  .topbar { padding: 0 20px 0 0; }
  .metric { padding: 0 17px; }
  .metric-number {font-size: 24px; font-family: var(--font-number); font-weight: 600;}
  .overview-grid { grid-template-columns: minmax(0,1.3fr) minmax(270px,1fr); gap: 16px; }
}
@media (max-width:960px) {
  .sidebar { width: 200px; }
  .app-body { margin-left: 200px; }
  .brand { padding-left: 15px; font-size: 16px; }
  .brand small { font-size: 12px; }
  .nav-link { padding-left: 12px; font-size: 13px; }
  .metric-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .metric { padding: 0 12px; min-height: 80px; }
  .metric-number {font-size: 20px; font-family: var(--font-number); font-weight: 600;}
  .metric-top { font-size: 12px; }
  .metric-foot { font-size: 12px; }
  .overview-grid { grid-template-columns: 1fr; }
  .page-heading h1 { font-size: 24px; }
}
@media (max-width:700px) {
  .sidebar { display: none; }
  .app-body, .app-shell.sidebar-collapsed .app-body { margin-left: 0; padding-top: 56px; }
  .topbar { height: 56px; padding: 0 12px; gap: 8px; }
  .header-brand { font-size: 15px; gap: 7px; max-width: 145px; width: auto; padding: 0; color: #142238; background: transparent; }
  .header-brand img { width: 25px; height: 25px; }
  .header-user { display: none; }
  .topbar-actions { gap: 6px; }
  .month-picker input { width: 138px; padding: 5px 8px; border-radius: 4px; }
  #main { padding: 19px 13px; }
  .page-heading { gap: 12px; margin-bottom: 16px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p {font-size: 13px; line-height: 1.7;}
  .heading-actions .button { min-height: 40px; padding: 8px 13px; font-size: 13px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); border-radius: 8px; padding: 0; margin-bottom: 13px; }
  .metric, .metric.featured { padding: 15px 14px 13px; min-height: 110px; border-right: 1px solid #f0f0f0; }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid #f0f0f0; }
  .metric-top, .metric.featured .metric-top { font-size: 13px; }
  .metric-number {font-size: 24px; margin: 8px 0 5px; font-family: var(--font-number); font-weight: 600;}
  .metric-foot, .metric.featured .metric-foot {font-size: 12px; line-height: 1.6;}
  .metric-icon { display: none; }
  .quick-grid { display: flex; gap: 19px; margin: 0 0 16px; }
  .quick-card { flex-direction: row; gap: 5px; padding: 0; text-align: left; }
  .quick-card .quick-icon { padding: 0; }
  .quick-card strong { font-size: 12px; }
  .quick-card svg { width: 14px; height: 14px; }
  .panel { border-radius: 8px; margin-bottom: 16px; }
  .panel-head { padding: 20px 20px 0; }
  .panel-head h2 { font-size: 16px; }
  .panel-body { padding: 20px; }
  .panel-head p { font-size: 12px; }
  .panel-link { font-size: 12px; }
  td {padding: 14px 18px; font-size: 14px; line-height: 1.6; color: #34465e;}
  th { padding: 13px 18px; font-size: 13px; font-weight: 500; color: #526177; background: #f5f7fb;}
  .table-sub {font-size: 12px; line-height: 1.6; color: #66758b;}
  .badge {font-size: 12px; padding: 3px 7px;}
  .amount {font-size: 15px; font-weight: 600; font-family: var(--font-number); font-variant-numeric: tabular-nums lining-nums;}
  .table-wrap:has(.record-amount) { overflow: visible; }
  table:has(.record-amount) { white-space: normal; }
  table:has(.record-amount) thead { display: none; }
  table:has(.record-amount) tbody { display: block; }
  table:has(.record-amount) tr {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "party amount" "date amount" "category actions";
    gap: 5px 12px;
    border-bottom: 1px solid #e9edf2;
    padding: 14px;
  }
  table:has(.record-amount) tr:last-child { border-bottom: 0; }
  table:has(.record-amount) td { border: 0; padding: 0; min-width: 0; }
  .record-party { grid-area: party; }
  .record-party .table-main { font-size: 15px; overflow-wrap: anywhere; }
  .record-party .table-sub {white-space: normal; overflow-wrap: anywhere; font-size: 12px;}
  .record-date { grid-area: date; font-size: 12px; color: #8a95a5; }
  .mobile-account { display: inline; }
  .record-category { grid-area: category; align-self: center; }
  .record-amount { grid-area: amount; text-align: right; align-self: start; }
  .record-amount .amount { font-size: 17px; }
  .record-amount .table-sub { font-size: 12px; }
  .record-account { display: none; }
  .record-actions { grid-area: actions; text-align: right; }
  .record-actions .button { min-height: 40px; padding: 8px 10px; font-size: 13px; }
  .notice {font-size: 13px; padding: 12px 15px; line-height: 1.8;}
  .filters { padding: 12px; }
  .filters input, .filters select {font-size: 14px; border-radius: 4px; min-height: 38px;}
  .table-footer { padding: 14px 18px; font-size: 12px; line-height: 1.7;}
  .supplier-table .table-wrap { overflow: visible; }
  .supplier-table table { white-space: normal; }
  .supplier-table thead { display: none; }
  .supplier-table tbody { display: block; }
  .supplier-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 14px; border-bottom: 1px solid #e3e7ed; }
  .supplier-table tr:last-child { border-bottom: 0; }
  .supplier-table td { display: block; border: 0; padding: 6px 0; font-size: 12px; }
  .supplier-table td[data-label]:before { content: attr(data-label); display: block; color: #66758b; font-size: 12px; margin-bottom: 3px; }
  .supplier-table .supplier-identity { grid-column: 1/-1; }
  .supplier-table .supplier-identity .supplier-name { font-size: 14px; }
  .supplier-table .supplier-actions { grid-column: 1/-1; padding-top: 9px; margin-top: 8px; border-top: 1px solid #f0f0f0; }
  .supplier-table .supplier-mode { display: none; }
  .field input, .field select, .field textarea { font-size: 16px; min-height: 42px; border-radius: 4px; }
  .field>span {font-size: 14px; font-weight: 500; color: #34465e;}
  .field small {font-size: 12px; line-height: 1.75;}
  .field .money-input { font-size: 28px; font-family: var(--font-number); font-weight: 600; font-variant-numeric: tabular-nums lining-nums;}
  .editor, .editor.wide { border-radius: 6px; }
  .modal-header { padding: 20px 22px 16px; }
  .modal-body { padding: 22px; }
  .modal-footer {padding: 14px 22px; background: #f8fafc;}
  .calendar-toolbar { padding: 13px; }
  .calendar-cell { min-height: 73px; padding: 7px 4px; }
  .calendar-week span { font-size: 12px; padding: 8px 2px; }
  .day-number { font-size: 12px; }
  .day-status { font-size: 12px; }
  .day-leave {font-size: 12px; white-space: normal; overflow-wrap: anywhere;}
  .calendar-legend { font-size: 12px; padding: 12px; }
  .event-copy strong {font-size: 14px; font-weight: 500;}
  .event-copy small {font-size: 12px; line-height: 1.7;}
  .app-body { padding-bottom: calc(114px + env(safe-area-inset-bottom, 0px)); }
  .mobile-nav {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: 500px;
    margin: 0 auto;
    min-height: 74px;
    padding: 7px 8px 6px;
    border: 1px solid #e5ebf4;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 8px 28px #193a6524, 0 2px 7px #193a650a;
    backdrop-filter: none;
    transition: transform .2s ease, opacity .2s ease;
    will-change: transform;
  }
  .mobile-nav.nav-hidden { transform: translateY(calc(100% + 28px + env(safe-area-inset-bottom, 0px))); opacity: 0; pointer-events: none; }
  .header-page-title { display: none; }
  .mobile-nav a, .mobile-nav button {
    min-width: 0;
    min-height: 58px;
    justify-content: center;
    gap: 2px;
    padding: 0;
    color: #6c7c92; font-size: 11px;
    line-height: 1.5;
    border-radius: 15px;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav svg {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 12px;
    stroke-width: 1.9;
    transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
  }
  .mobile-nav .active { color: #1269dc; font-weight: 500; }
  .mobile-nav .active svg {
    color: #fff;
    background: #1677ff;
    box-shadow: 0 5px 11px #1677ff40, inset 0 1px 0 #ffffff30;
    transform: translateY(-3px);
  }
  .mobile-nav a:focus-visible, .mobile-nav button:focus-visible { outline: 2px solid #1677ff; outline-offset: 1px; }
  .toast { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
  .more-dialog { border-radius: 7px; }
  .more-dialog .nav-link { background: #f5f7fb; border-radius: 4px; }
  .app-footer { padding: 0 14px 14px; }
  .toast { font-size: 12px; }
  .auth-header { height: 62px; padding: 0 20px; }
  .auth-header-note { font-size: 12px; }
  .auth-form-wrap { padding: 35px 17px 60px; align-items: flex-start; }
  .auth-form { max-width: 410px; padding: 26px 23px; border-radius: 4px; }
  .auth-form h2 {font-size: 24px; font-weight: 600;}
  .auth-form .field input { min-height: 43px; font-size: 16px; }
  .auth-form .button { min-height: 43px; }
  .auth-note {font-size: 12px; color: #66758b;}
}

@media (min-width:701px) {
  .sidebar-collapsed .header-brand { width: 64px; padding: 0; justify-content: center; }
  .sidebar-collapsed .header-brand span { display: none; }
}
@media (prefers-reduced-motion:reduce) {
  .mobile-nav { transition: none; }
}

/* Readable typography and finishing details across the working pages. */
button, input, select, textarea { font-family: var(--font-ui); }
.page-heading { align-items: flex-start; margin-bottom: 22px; }
.heading-actions { flex-wrap: wrap; }
.table-main, .supplier-name, .account-row strong { letter-spacing: 0; }
.record-party { min-width: 140px; max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
.record-amount { text-align: right; }
.supplier-table .supplier-identity { min-width: 150px; max-width: 250px; white-space: normal; overflow-wrap: anywhere; }
.supplier-name { line-height: 1.65; }
.flow-row { font-size: 14px; line-height: 1.7; padding: 15px 0; }
.flow-row small { font-size: 12px; color: var(--muted); }
.mini-stat span { font-size: 12px; line-height: 1.7; color: var(--muted); }
.mini-stat strong { font-family: var(--font-number); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.field { gap: 8px; }
.field input::placeholder, .field textarea::placeholder, .search input::placeholder { color: #78869b; opacity: 1; }
.field input[type=file], .upload-drop input { max-width: 100%; font-size: 13px; line-height: 1.7; padding: 4px; }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; font-weight: 500; color: #3e5676; background: #f1f5fa; border: 1px solid #d8e1ed; border-radius: 5px; padding: 7px 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: #e8f0fc; border-color: #9ebde8; }
.import-table td, .import-table th { font-size: 13px; line-height: 1.7; padding: 13px 14px; }
.import-table select { font-size: 13px; min-height: 36px; padding: 6px 9px; }
.import-table .table-sub { font-size: 12px; }
.import-controls small { font-size: 12px; color: var(--muted); line-height: 1.7; }
.import-controls .button { min-height: 40px; }
.upload-drop { border-radius: 8px; }
.calendar-cell { min-height: 110px; }
.day-number { font-size: 15px; font-weight: 500; }
.day-leave-summary { display: none; }
.day-status-short { display: none; }
.day-leave { white-space: normal; overflow-wrap: anywhere; }
.event-day { flex-shrink: 0; }
.event-copy small { overflow-wrap: anywhere; }
.modal-footer .button { min-height: 40px; }
.sidebar-caption { color: #91a3be; }
@media (min-width:701px) {
  td:has(>.amount), .supplier-table td[data-label] { text-align: right; }
  table:has(.record-amount) th:nth-child(5), table:has(.document-number) th:nth-child(4), .supplier-table th:nth-child(n+3):nth-child(-n+6) { text-align: right; }
}
@media (max-width:1100px) {
  .topbar .sync-status { display: none; }
}
@media (max-width:900px) {
  .topbar .header-user { display: none; }
}
@media (max-width:700px) {
  body { font-size: 15px; }
  #main { padding: 22px 16px; }
  .topbar { gap: 8px; }
  .header-brand { flex: 1 1 0; min-width: 0; max-width: 180px; font-size: 15px; }
  .header-brand img { width: 25px; height: 25px; }
  .topbar-actions { flex: 0 0 auto; gap: 6px; }
  .month-picker input { width: 136px; min-height: 38px; font-size: 13px; padding: 7px 9px; }
  .topbar .icon-button { width: 40px; height: 40px; }
  .topbar .icon-button svg { width: 18px; height: 18px; }
  .page-heading { gap: 15px; margin-bottom: 18px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 13px; }
  .button { min-height: 42px; font-size: 14px; }
  .button.ghost { min-height: 40px; font-size: 13px; padding: 8px 10px; }
  .heading-actions .button { min-height: 42px; font-size: 13px; padding: 8px 13px; }
  .panel-head { padding: 18px 18px 0; }
  .panel-body { padding: 18px; }
  .panel-head h2 { font-size: 16px; }
  .panel-head p { font-size: 12px; }
  .panel-link { min-height: 36px; display: inline-flex; align-items: center; }
  .notice { font-size: 13px; padding: 12px 14px; }
  .filters input, .filters select { min-height: 42px; font-size: 14px; }
  .filter-count { font-size: 12px; }
  table:has(.record-amount) tr { padding: 16px; gap: 8px 12px; }
  table:has(.record-amount) td { min-width: 0; }
  .record-party { min-width: 0; max-width: none; }
  .record-party .table-main { font-size: 15px; font-weight: 500; }
  .record-date, .record-party .table-sub, .record-amount .table-sub { font-size: 12px; }
  .record-amount .amount { font-size: 17px; }
  .record-actions .button { min-height: 42px; font-size: 13px; padding: 8px 10px; }
  .supplier-table tr { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 18px; gap: 4px 14px; }
  .supplier-table .supplier-identity { min-width: 0; max-width: none; }
  .supplier-table td { min-width: 0; font-size: 14px; }
  .supplier-table .supplier-identity .supplier-name { font-size: 15px; }
  .supplier-table td[data-label]:before { font-size: 12px; margin-bottom: 5px; }
  .supplier-table .amount { font-size: 16px; }
  .field>span { font-size: 14px; }
  .field input, .field select, .field textarea { min-width: 0; min-height: 44px; font-size: 16px; padding: 10px; }
  .field small { font-size: 12px; }
  .field input[type=file] { font-size: 13px; padding: 5px; }
  .field select[multiple] { font-size: 14px; min-height: 110px; }
  .modal-body { padding: 20px 18px; }
  .modal-header { padding: 19px 18px 15px; }
  .modal-footer { padding: 14px 18px; }
  .modal-footer .button { min-height: 44px; }
  .calendar-toolbar { padding: 16px 13px; }
  .calendar-toolbar h2 { font-size: 16px; }
  .calendar-toolbar select { font-size: 13px; min-height: 40px; padding: 8px; }
  .calendar-week span { font-size: 12px; padding: 10px 2px; }
  .calendar-cell { min-height: 94px; padding: 8px 4px; }
  .day-number { font-size: 14px; line-height: 1.5; margin-bottom: 5px; }
  .day-status { font-size: 11px; color: #5c6e86; line-height: 1.45; }
  .day-status-full { display: none; }
  .day-status-short { display: inline; }
  .day-leave { display: none; }
  .day-leave-overflow { display: none; }
  .day-leave-summary { display: inline-block; margin-top: 4px; padding: 2px 3px; border-radius: 3px; background: #fff2d9; color: #815414; font-size: 10px; line-height: 1.4; }
  .calendar-legend { font-size: 12px; gap: 10px 14px; padding: 14px; }
  .event-copy strong { font-size: 14px; }
  .event-copy small { font-size: 12px; }
  .import-table select { min-height: 40px; font-size: 14px; }
  .import-controls .button { min-height: 44px; }
  .app-footer { font-size: 12px; }
}
@media (max-width:370px) {
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .modal-body { padding: 18px 16px; }
  .calendar-toolbar { flex-wrap: wrap; }
}
