:root {
  --ink: #1d2b3c;
  --muted: #738094;
  --muted-2: #9da7b6;
  --line: #e6ebf1;
  --canvas: #f3f6f2;
  --surface: #ffffff;
  --navy: #21483b;
  --navy-2: #2c6753;
  --blue: #2e7a67;
  --blue-soft: #e6f3ed;
  --orange: #c78338;
  --orange-soft: #fff1e7;
  --purple: #8b6be5;
  --purple-soft: #f0ebff;
  --green: #3f9869;
  --green-soft: #e7f7f0;
  --red: #db5b63;
  --shadow: 0 9px 24px rgba(23, 50, 77, 0.05);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; }
.app-shell.auth-locked { display: none; }
.sidebar { background: var(--navy); color: #dce8f2; width: 242px; flex: 0 0 242px; padding: 22px 14px 16px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 25px; }
.brand-mark { background: #f0bd74; color: var(--navy); border-radius: 7px; width: 30px; height: 30px; display: grid; place-items: center; font-weight: 900; font-size: 16px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .2px; color: #fff; }
.brand span { display: block; margin-top: 3px; font-size: 10px; color: #91a9bc; }
.workspace-switcher { margin: 0 8px 22px; padding: 12px 11px 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.06); border-radius: 7px; }
.workspace-label { display: block; color: #91a9bc; font-size: 10px; margin-bottom: 8px; }
.workspace-button { border: 0; background: transparent; color: #fff; display: flex; width: 100%; align-items: center; justify-content: space-between; font-size: 12px; padding: 0; }
.nav-list { flex: 1; }
.nav-caption { text-transform: uppercase; color: #7690a6; letter-spacing: 1.25px; font-size: 10px; padding: 13px 13px 7px; margin: 0; }
.nav-item { width: 100%; background: transparent; border: 0; border-radius: 6px; padding: 11px 12px; color: #adbfce; display: flex; align-items: center; gap: 12px; text-align: left; font-size: 13px; margin: 2px 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { color: #fff; background: #29516d; box-shadow: inset 3px 0 0 #f0bd74; }
.nav-icon { width: 16px; text-align: center; font-size: 15px; color: #9fb7c9; }
.nav-item.active .nav-icon { color: #f0bd74; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; background: #eea05c; color: #fff; font-size: 10px; font-weight: 700; }
.nav-badge.empty { display: none; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 8px 0; display: flex; align-items: center; gap: 9px; }
.user-avatar, .avatar-button { width: 30px; height: 30px; border-radius: 50%; background: #7e9bb0; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.user-info { flex: 1; min-width: 0; }
.user-info strong, .user-info span { display: block; }
.user-info strong { color: #f1f5f8; font-size: 12px; font-weight: 600; }
.user-info span { color: #8097a9; font-size: 10px; margin-top: 3px; }
.sidebar-more { color: #87a1b4 !important; }

.mobile-bar { display: none; }
.mobile-nav { display: none; }
.app-main { flex: 1; min-width: 0; }
.topbar { height: 67px; border-bottom: 1px solid var(--line); padding: 0 38px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.7); }
.breadcrumb { color: var(--muted); font-size: 12px; display: flex; gap: 9px; align-items: center; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.breadcrumb-separator { color: #c2cad4; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.period-button, .icon-button, .avatar-button { border: 0; background: transparent; color: var(--muted); }
.clock-display { display: flex; gap: 7px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; color: var(--ink); background: var(--surface); white-space: nowrap; font-variant-numeric: tabular-nums; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); display: inline-block; }
.status-dot.green { background: var(--green); }
.icon-button { font-size: 19px; min-width: 26px; min-height: 28px; position: relative; }
.notification-dot { display: block; position: absolute; background: var(--orange); width: 5px; height: 5px; border-radius: 50%; top: 4px; right: 2px; border: 1px solid #fff; }
.avatar-button { background: #7e9bb0; color: #fff; font-size: 12px; }

.view { display: none; max-width: 1500px; margin: 0 auto; padding: 31px 38px 54px; }
.view.active-view { display: block; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 27px; gap: 20px; }
.page-heading h1 { margin: 2px 0 7px; font-size: 27px; letter-spacing: -.5px; font-weight: 700; }
.page-heading.compact-heading h1 { font-size: 25px; }
.eyebrow { color: #96a1b2; font-size: 10px; letter-spacing: 1.4px; margin: 0 0 6px; font-weight: 700; }
.page-subtitle { color: var(--muted); font-size: 12px; margin: 0; }
.primary-button, .secondary-button { border-radius: 5px; padding: 11px 15px; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.primary-button { background: var(--navy); color: #fff; box-shadow: 0 4px 8px rgba(23,50,77,.12); }
.primary-button:hover { background: var(--navy-2); }
.secondary-button { background: #fff; border-color: var(--line); color: var(--ink); }
.secondary-button:hover { border-color: #b6c7d8; }
.text-button { background: transparent; border: 0; color: var(--blue); font-size: 11px; padding: 4px 0; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 19px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 7px; padding: 17px 18px 15px; box-shadow: var(--shadow); min-width: 0; }
.metric-receivable { border-top-color: var(--orange); }
.metric-payable { border-top-color: var(--purple); }
.metric-cost { border-top-color: var(--green); }
.metric-receipt { border-top-color: var(--blue); }
.metric-payment { border-top-color: var(--orange); }
.metric-top, .metric-foot { display: flex; align-items: center; justify-content: space-between; }
.metric-top { font-size: 12px; color: var(--muted); margin-bottom: 11px; }
.metric-icon { font-size: 16px; color: #94a2b3; }
.metric-card > strong { display: block; color: var(--ink); font-size: 23px; letter-spacing: -.6px; margin-bottom: 12px; }
.metric-foot { font-size: 10px; color: var(--muted-2); }
.trend { padding: 3px 6px; border-radius: 3px; font-weight: 700; }
.trend.positive { color: var(--green); background: var(--green-soft); }
.trend.warning { color: var(--orange); background: var(--orange-soft); }
.trend.neutral { color: var(--purple); background: var(--purple-soft); }
.dashboard-grid, .dashboard-bottom { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, 1fr); gap: 19px; margin-bottom: 19px; }
.dashboard-bottom { grid-template-columns: minmax(0, 1.75fr) minmax(310px, 1fr); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); min-width: 0; }
.panel-header { padding: 17px 19px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.panel-header h2 { font-size: 14px; margin: 0 0 5px; font-weight: 700; }
.panel-header p { font-size: 11px; color: var(--muted); margin: 0; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 11px; }
.data-table th { background: #fafbfd; color: #8e9aaa; font-size: 10px; font-weight: 600; text-align: left; padding: 10px 15px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-table td { color: #4d5b6d; padding: 12px 15px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfe; }
.cell-primary { color: var(--ink); font-weight: 600; }
.cell-muted { color: var(--muted); }
.cell-number { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.type-chip, .status-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; padding: 4px 6px; border-radius: 3px; font-weight: 600; }
.type-chip.inbound { color: var(--blue); background: var(--blue-soft); }
.type-chip.outbound { color: var(--orange); background: var(--orange-soft); }
.type-chip.material { color: var(--purple); background: var(--purple-soft); }
.type-chip.production { color: var(--green); background: var(--green-soft); }
.status-chip.done { color: var(--green); background: var(--green-soft); }
.status-chip.pending { color: var(--orange); background: var(--orange-soft); }
.status-chip.partial { color: var(--blue); background: var(--blue-soft); }
.cash-summary { padding: 2px 20px 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cash-summary > div { border-left: 2px solid var(--orange); padding-left: 11px; }
.cash-summary > div + div { border-left-color: var(--blue); }
.cash-summary span, .cash-summary small { display: block; color: var(--muted); font-size: 11px; }
.cash-summary strong { display: block; font-size: 20px; margin: 7px 0 4px; color: var(--ink); }
.cash-summary small { color: var(--muted-2); font-size: 10px; }
.mini-progress { padding: 14px 20px 16px; border-top: 1px solid var(--line); }
.progress-label { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.progress-label strong { color: var(--blue); }
.progress-track { height: 6px; background: #edf1f5; border-radius: 3px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--blue); width: 0; border-radius: 3px; transition: width .25s; }
.cash-note { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 8px; align-items: center; font-size: 10px; color: var(--muted); }
.note-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.quick-panel, .alert-panel { min-height: 195px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 18px 18px; }
.quick-actions button { display: flex; align-items: center; gap: 9px; text-align: left; padding: 11px 10px; border: 1px solid #edf0f4; background: #fff; border-radius: 5px; color: var(--ink); }
.quick-actions button:hover { border-color: #c6d2df; background: #fbfcfe; }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions strong { font-size: 11px; }
.quick-actions small { color: var(--muted); font-size: 9px; margin-top: 4px; }
.quick-arrow { margin-left: auto; color: #9aa7b6; }
.quick-icon { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.quick-icon.blue, .blue-bg { color: var(--blue); background: var(--blue-soft); }
.quick-icon.orange, .orange-bg { color: var(--orange); background: var(--orange-soft); }
.quick-icon.purple { color: var(--purple); background: var(--purple-soft); }
.quick-icon.green, .green-bg { color: var(--green); background: var(--green-soft); }
.alert-count { background: var(--orange-soft); color: var(--orange); min-width: 21px; height: 21px; border-radius: 11px; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.alert-list { padding: 0 19px 15px; }
.alert-item { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid #f0f2f5; align-items: flex-start; }
.alert-item:last-child { border-bottom: 0; }
.alert-mark { width: 6px; height: 6px; background: var(--orange); border-radius: 50%; margin-top: 5px; flex: 0 0 auto; }
.alert-item strong { display: block; font-size: 11px; font-weight: 600; }
.alert-item small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.empty-state { color: var(--muted); text-align: center; padding: 28px 15px !important; }

.warehouse-shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 19px; }
.warehouse-shortcuts button { border: 1px solid var(--line); background: #fff; border-radius: 7px; box-shadow: var(--shadow); padding: 13px 15px; display: grid; grid-template-columns: 34px 1fr; text-align: left; align-items: center; column-gap: 10px; }
.warehouse-shortcuts button:hover { border-color: #c3d0df; }
.warehouse-shortcuts .quick-icon { grid-row: span 2; width: 34px; height: 34px; }
.warehouse-shortcuts b { font-size: 12px; align-self: end; }
.warehouse-shortcuts small { color: var(--muted); font-size: 10px; margin-top: 4px; align-self: start; }
.table-panel { overflow: hidden; }
.table-toolbar { align-items: center; }
.toolbar-controls { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.segmented-control { display: flex; border: 1px solid var(--line); border-radius: 5px; padding: 2px; background: #fafbfd; }
.segmented-control button { border: 0; background: transparent; padding: 6px 9px; border-radius: 3px; color: var(--muted); font-size: 10px; }
.segmented-control button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(23,50,77,.09); font-weight: 600; }
.search-field { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 5px; padding: 0 9px; background: #fff; }
.search-field span { color: #9ba8b8; font-size: 17px; }
.search-field input { border: 0; outline: 0; padding: 7px 0; width: 150px; font-size: 10px; color: var(--ink); }

.finance-tabs, .report-tabs { display: flex; border-bottom: 1px solid var(--line); gap: 24px; margin-bottom: 17px; }
.finance-tabs button, .report-tabs button { border: 0; background: transparent; color: var(--muted); padding: 0 2px 12px; font-size: 12px; position: relative; }
.finance-tabs button.active, .report-tabs button.active { color: var(--ink); font-weight: 700; }
.finance-tabs button.active::after, .report-tabs button.active::after { position: absolute; content: ""; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blue); }
.report-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: -3px 0 17px; padding: 12px 14px; background: #fbfcfe; border: 1px solid var(--line); border-radius: 6px; }
.report-filters label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 10px; min-width: 145px; }
.report-filters select { border: 1px solid #dbe2ea; border-radius: 4px; background: #fff; color: var(--ink); padding: 7px 8px; font-size: 11px; outline: 0; }
.report-filters select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53,120,246,.1); }
.report-filters .secondary-button { margin-left: auto; padding: 7px 11px; font-size: 10px; }
.finance-tab-panel { display: none; }
.finance-tab-panel.active { display: block; }
.reconcile-panel { margin-top: 0; }
.reconcile-toolbar, .reconcile-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 13px; }
.reconcile-form { grid-template-columns: 1.3fr 1.3fr 1fr auto; }
.reconcile-toolbar label, .reconcile-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 10px; }
.reconcile-toolbar select, .reconcile-form select, .reconcile-form input { border: 1px solid #dbe2ea; border-radius: 4px; background: #fff; color: var(--ink); padding: 8px 9px; font-size: 11px; outline: 0; }
.reconcile-toolbar select:focus, .reconcile-form select:focus, .reconcile-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53,120,246,.1); }
.finance-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 19px; }
.finance-cards article { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 18px 19px; box-shadow: var(--shadow); }
.finance-card-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 11px; }
.finance-cards strong { font-size: 23px; display: block; margin-bottom: 12px; }
.finance-cards small { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.blue-dot { background: var(--blue); }.orange-dot { background: var(--orange); }.green-dot { background: var(--green); }
.report-filter { background: #fafbfd; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); padding: 7px 9px; font-size: 10px; display: flex; align-items: center; gap: 6px; }
.report-panel { margin-top: 0; }
.report-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 13px; }
.report-summary > div { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 7px; padding: 14px 17px; box-shadow: var(--shadow); }
.report-summary > div:nth-child(2) { border-top-color: var(--green); }
.report-summary > div:nth-child(3) { border-top-color: var(--orange); }
.report-summary span { display: block; color: var(--muted); font-size: 10px; }
.report-summary strong { display: block; margin-top: 7px; color: var(--ink); font-size: 19px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.account-panel { margin-top: 18px; overflow: hidden; }
.settings-card { padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.settings-icon { width: 38px; height: 38px; border-radius: 7px; display: grid; place-items: center; font-size: 17px; flex: 0 0 auto; }
.settings-card h2 { margin: 0 0 7px; font-size: 14px; }
.settings-card p { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.storage-status { color: var(--green); font-size: 11px; display: flex; gap: 6px; align-items: center; }

.modal { position: fixed; inset: 0; background: rgba(16, 31, 45, .46); display: grid; place-items: center; z-index: 10; padding: 20px; }
.modal.hidden { display: none; }
.modal-card { background: #fff; border-radius: 9px; width: min(690px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 55px rgba(11,34,55,.22); }
.modal-header { padding: 22px 24px 18px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 20px; margin: 0 0 6px; }
.modal-header p:last-child { margin: 0; font-size: 11px; color: var(--muted); }
.close-modal { font-size: 24px; color: #8897a8; }
.entry-type-switcher { padding: 15px 24px 0; display: flex; gap: 7px; border-bottom: 1px solid var(--line); }
.entry-type-switcher button { border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 0 8px 12px; position: relative; }
.entry-type-switcher button span { font-size: 15px; margin-right: 4px; }
.entry-type-switcher button.active { color: var(--ink); font-weight: 700; }
.entry-type-switcher button.active::after { content: ""; position: absolute; height: 2px; background: var(--blue); left: 0; right: 0; bottom: -1px; }
.entry-form-desktop { padding: 20px 24px 24px; }
.user-form-content { padding: 20px 24px 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px 17px; }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; color: #536275; font-size: 11px; font-weight: 600; margin-bottom: 7px; }
.required::after { content: " *"; color: var(--red); }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid #dbe2ea; background: #fff; border-radius: 4px; outline: 0; padding: 9px 10px; color: var(--ink); font-size: 12px; }
.form-field textarea { min-height: 66px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53,120,246,.1); }
.form-help { font-size: 10px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.calc-callout { background: #f7faff; border: 1px solid #dce8ff; border-radius: 5px; padding: 12px 13px; margin-top: 2px; font-size: 11px; color: #526985; line-height: 1.6; }
.calc-callout strong { color: var(--blue); }
.material-line { border: 1px solid #e6ebf2; border-radius: 6px; padding: 12px; margin-bottom: 10px; background: #fbfcfe; }
.material-line-grid { display: grid; grid-template-columns: 1.3fr .8fr 1.3fr auto; gap: 10px; align-items: end; }
.material-line-cost { margin-top: 8px; color: #607086; font-size: 11px; }
.material-line-cost strong { color: var(--blue); }
@media (max-width: 780px) { .material-line-grid { grid-template-columns: 1fr 1fr; } .material-line-grid .material-line-remove { grid-column: 1 / -1; justify-self: start; } }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.form-actions button { border-radius: 4px; padding: 10px 15px; font-size: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.form-actions button.submit { background: var(--navy); color: #fff; border-color: var(--navy); }
.entry-form-wizard { display: none; }
.wizard-progress { padding: 18px 22px 0; }
.wizard-progress-top { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); margin-bottom: 8px; }
.wizard-progress-top strong { color: var(--ink); }
.wizard-progress-track { height: 4px; background: #edf1f5; border-radius: 2px; overflow: hidden; }.wizard-progress-track span { display: block; height: 100%; background: var(--blue); transition: width .2s; }
.wizard-body { padding: 35px 22px 22px; min-height: 290px; }.wizard-question { color: var(--muted); font-size: 12px; margin: 0 0 10px; }.wizard-body h3 { font-size: 22px; margin: 0 0 20px; }.wizard-input-wrap input, .wizard-input-wrap select { width: 100%; border: 0; border-bottom: 2px solid #d9e1ea; padding: 8px 1px 11px; outline: 0; font-size: 18px; color: var(--ink); background: transparent; }.wizard-input-wrap input:focus, .wizard-input-wrap select:focus { border-bottom-color: var(--blue); }.wizard-hint { font-size: 10px; color: var(--muted); margin-top: 9px; }.wizard-callout { margin-top: 19px; padding: 11px 12px; background: #f7faff; border: 1px solid #dce8ff; color: #526985; border-radius: 5px; font-size: 11px; line-height: 1.6; }.wizard-actions { display: flex; justify-content: space-between; gap: 9px; padding: 0 22px 22px; }.wizard-actions button { border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 10px 16px; font-size: 11px; }.wizard-actions button.primary { background: var(--navy); color: #fff; border-color: var(--navy); }.wizard-actions button:disabled { opacity: .4; cursor: not-allowed; }
.wizard-lines { display: grid; gap: 10px; width: 100%; }
.wizard-line { display: grid; grid-template-columns: 1.25fr .75fr .95fr; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; }
.wizard-line-heading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.wizard-line label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.wizard-line label:first-of-type { grid-column: 1 / -1; }
.wizard-line input, .wizard-line select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 8px; font-size: 13px; background: #fff; }
.wizard-line input[readonly] { color: var(--muted); background: #f1f4f6; }
.wizard-line-remove { border: 0; background: transparent; color: var(--red); padding: 2px 0; font-size: 10px; }
.wizard-add-line { border: 1px dashed #b9c9d7; border-radius: 5px; background: #fff; color: var(--blue); padding: 9px; font-size: 11px; }
.wizard-line-cost { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }.wizard-line-cost strong { color: var(--ink); margin-left: 5px; }
.wizard-order-list { display: grid; gap: 10px; width: 100%; max-height: 42vh; overflow-y: auto; padding: 1px; }
.wizard-order-option { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.wizard-order-option:has(input:checked) { border-color: var(--blue); background: #f5f9ff; box-shadow: 0 0 0 2px rgba(46, 104, 166, .09); }
.wizard-order-option input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--blue); }
.wizard-order-card { display: grid; gap: 6px; min-width: 0; }
.wizard-order-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; color: var(--ink); font-size: 12px; }
.wizard-order-top small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.wizard-order-work { color: var(--muted); font-size: 10px; }
.wizard-order-detail { display: grid; grid-template-columns: minmax(64px, 1fr) minmax(100px, 1.45fr) auto; gap: 5px 8px; align-items: baseline; padding-top: 5px; border-top: 1px solid #edf1f5; color: var(--muted); font-size: 10px; }
.wizard-order-detail b { color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.wizard-order-detail strong { color: var(--ink); white-space: nowrap; }
.wizard-order-empty { padding: 14px; border: 1px dashed var(--line); color: var(--muted); font-size: 12px; text-align: center; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 20px); background: var(--navy); color: #fff; border-radius: 4px; padding: 11px 16px; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; box-shadow: 0 8px 20px rgba(23,50,77,.2); }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.login-screen { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top right, #e6f3ed, transparent 45%), var(--canvas); }
.login-screen.hidden { display: none; }
.login-card { width: min(390px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 34px 32px 30px; box-shadow: 0 20px 60px rgba(23,50,77,.12); }
.login-card .brand-mark { margin-bottom: 22px; }
.login-card h1 { margin: 0 0 8px; font-size: 25px; }
.login-subtitle { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.login-card label { display: block; margin: 14px 0 7px; color: #536275; font-size: 11px; font-weight: 600; }
.login-card input { width: 100%; border: 1px solid #dbe2ea; border-radius: 4px; padding: 11px 12px; outline: 0; font-size: 13px; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53,120,246,.1); }
.login-card .primary-button { width: 100%; justify-content: center; margin-top: 20px; }
.login-card small { display: block; margin-top: 15px; color: var(--muted-2); font-size: 10px; text-align: center; }
.login-error { display: none; margin: 13px 0 0; color: var(--red); font-size: 11px; }
.login-error.visible { display: block; }

@media (max-width: 1100px) {
  .sidebar { width: 210px; flex-basis: 210px; }
  .view { padding-left: 25px; padding-right: 25px; }
  .topbar { padding: 0 25px; }
  .metric-card > strong { font-size: 20px; }
  .dashboard-grid, .dashboard-bottom { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); }
  .toolbar-controls { width: 100%; justify-content: space-between; }
  .table-toolbar { display: block; }.table-toolbar .toolbar-controls { margin-top: 13px; }
}

@media (max-width: 780px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .mobile-bar { height: 56px; display: flex; background: var(--navy); padding: 0 16px; align-items: center; justify-content: space-between; color: #fff; }
  .brand.compact { padding: 0; gap: 8px; }.brand.compact .brand-mark { width: 26px; height: 26px; font-size: 14px; }.brand.compact strong { font-size: 14px; }
  .mobile-bar .icon-button { color: #fff; font-size: 25px; }
  .mobile-nav { position: fixed; z-index: 9; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 6px 5px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(23,50,77,.12); background: rgba(255,255,255,.97); box-shadow: 0 -5px 18px rgba(23,50,77,.08); }
  .mobile-nav .nav-item { min-width: 0; width: auto; margin: 0; padding: 5px 2px 4px; border-radius: 6px; display: flex; flex-direction: column; justify-content: center; gap: 3px; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.2; }
  .mobile-nav .nav-item:hover { background: var(--blue-soft); color: var(--navy); }
  .mobile-nav .nav-item.active { color: var(--navy); background: var(--blue-soft); box-shadow: inset 0 2px 0 var(--blue); }
  .mobile-nav .nav-icon { width: auto; height: 17px; color: currentColor; font-size: 16px; line-height: 17px; }
  .topbar { height: 52px; padding: 0 16px; background: #fff; }.topbar-actions { gap: 8px; }.topbar-actions .clock-display { padding: 7px 8px; font-size: 10px; }.topbar-actions .icon-button { display: none; }.topbar-actions .avatar-button { width: 27px; height: 27px; }
  .view { padding: 22px 16px 80px; }
  .page-heading { margin-bottom: 20px; }.page-heading h1 { font-size: 23px; }.page-heading.compact-heading h1 { font-size: 22px; }.page-subtitle { line-height: 1.6; }.page-heading .primary-button, .page-heading .secondary-button { display: inline-flex; align-items: center; justify-content: center; font-size: 0; width: 37px; height: 37px; padding: 0; line-height: 1; }.page-heading .primary-button span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; font-size: 20px; line-height: 1; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }.metric-card { padding: 13px 12px 12px; }.metric-top { font-size: 10px; }.metric-card > strong { font-size: 18px; margin-bottom: 9px; }.metric-foot { font-size: 9px; }.trend { padding: 2px 4px; }
  .dashboard-grid, .dashboard-bottom { display: block; margin-bottom: 13px; }.dashboard-grid .panel, .dashboard-bottom .panel { margin-bottom: 13px; }
  .panel-header { padding: 15px 14px 12px; }.panel-header h2 { font-size: 13px; }
  .data-table th { padding: 9px 12px; }.data-table td { padding: 11px 12px; }
  .cash-summary { padding-left: 15px; padding-right: 15px; }.mini-progress, .cash-note { padding-left: 15px; padding-right: 15px; }
  .quick-actions { padding-left: 13px; padding-right: 13px; }.quick-actions button { padding: 10px 8px; }
  .warehouse-shortcuts { grid-template-columns: repeat(2, 1fr); gap: 9px; }.warehouse-shortcuts button { padding: 11px; }
  .toolbar-controls { display: block; }.segmented-control { overflow-x: auto; width: 100%; }.segmented-control button { white-space: nowrap; }.search-field { margin-top: 8px; }.search-field input { width: 100%; }
  .finance-tabs, .report-tabs { gap: 19px; overflow-x: auto; margin-bottom: 14px; }.finance-tabs button, .report-tabs button { white-space: nowrap; }
  .report-filters { display: block; }.report-filters label { margin-bottom: 9px; width: 100%; }.report-filters .secondary-button { width: 100%; margin: 0; }
  .finance-cards { grid-template-columns: 1fr; gap: 9px; }.finance-cards article { padding: 14px 15px; }.finance-cards strong { font-size: 20px; margin-bottom: 8px; }.reconcile-toolbar, .reconcile-form { display: block; }.reconcile-toolbar label, .reconcile-form label { margin-bottom: 9px; }.reconcile-toolbar button, .reconcile-form button { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; gap: 11px; }
  .login-card { width: min(410px, 100%); padding: 28px 20px 24px; border-radius: 10px; }.login-card h1 { font-size: 23px; }.login-card input { min-height: 46px; padding: 12px 13px; font-size: 16px; }.login-card .primary-button { min-height: 46px; margin-top: 18px; font-size: 14px; }
  .modal { padding: 0; align-items: end; }.modal-card { width: 100%; max-height: 94vh; border-radius: 14px 14px 0 0; }.modal-header { padding: 17px 17px 14px; }.modal-header h2 { font-size: 18px; }.entry-type-switcher { padding: 11px 17px 0; overflow-x: auto; }.entry-type-switcher button { min-height: 40px; white-space: nowrap; padding: 0 7px 11px; }
  .wizard-progress { padding: 15px 17px 0; }.wizard-body { padding: 24px 17px 18px; min-height: 0; }.wizard-question { font-size: 11px; }.wizard-body h3 { font-size: 20px; margin-bottom: 15px; }.wizard-input-wrap input, .wizard-input-wrap select { min-height: 46px; border: 1px solid #dbe2ea; border-radius: 6px; padding: 11px 12px; background: #fff; font-size: 16px; }.wizard-input-wrap input:focus, .wizard-input-wrap select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53,120,246,.1); }.wizard-hint { font-size: 11px; line-height: 1.55; margin-top: 10px; }.wizard-actions { padding: 0 17px 17px; gap: 10px; }.wizard-actions button { flex: 1; min-height: 44px; padding: 10px 12px; font-size: 13px; }
  .wizard-line { grid-template-columns: 1fr 1fr; gap: 9px; padding: 11px; }.wizard-line label:first-of-type { grid-column: 1 / -1; }.wizard-line input, .wizard-line select { min-height: 43px; padding: 9px 10px; font-size: 14px; }.wizard-line-cost { font-size: 12px; }.wizard-add-line { min-height: 43px; font-size: 12px; }
  .wizard-order-list { max-height: 45vh; }.wizard-order-option { grid-template-columns: 21px minmax(0, 1fr); padding: 11px 10px; }.wizard-order-option input { width: 18px; height: 18px; }.wizard-order-top { font-size: 13px; }.wizard-order-detail { grid-template-columns: minmax(56px, .8fr) minmax(104px, 1.4fr) auto; font-size: 11px; }
  .entry-form-desktop { display: none; }.entry-form-wizard { display: block; }
  .user-form-content { padding: 18px; }
}

@media (min-width: 781px) { .entry-form-wizard { display: none !important; } }

.table-action { border: 0; background: transparent; padding: 3px 0; color: var(--blue); font-size: 10px; cursor: pointer; white-space: nowrap; }
.table-action:hover { color: var(--navy); text-decoration: underline; }
.table-action.danger { color: var(--red); margin-left: 10px; }
.master-panel { margin-top: 18px; overflow: hidden; }
.master-tabs { display: flex; gap: 6px; padding: 0 19px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.master-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 8px 11px; font-size: 11px; white-space: nowrap; }
.master-tabs button.active { color: var(--navy); border-bottom-color: var(--blue); font-weight: 700; }
.report-visuals { margin-bottom: 19px; }
.bi-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.bi-kpi { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 7px; padding: 15px 17px 13px; box-shadow: var(--shadow); }
.bi-kpi.orange { border-top-color: var(--orange); }.bi-kpi.green { border-top-color: var(--green); }.bi-kpi.purple { border-top-color: var(--purple); }.bi-kpi.red { border-top-color: var(--red); }
.bi-kpi span, .bi-kpi small { display: block; color: var(--muted); font-size: 10px; }.bi-kpi strong { display: block; margin: 8px 0; font-size: 20px; color: var(--ink); }.bi-kpi small { color: var(--muted-2); }
.bi-chart-grid, .bi-foot-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 13px; margin-bottom: 13px; }
.bi-foot-grid { grid-template-columns: repeat(2, 1fr); }
.stock-balance-panel { min-height: auto; margin-bottom: 13px; }
.stock-balance-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stock-balance-grid > div { padding: 11px 12px; background: #f8fafc; border: 1px solid #e7edf3; border-radius: 6px; }
.stock-balance-grid span { display: block; color: var(--muted); font-size: 10px; }
.stock-balance-grid strong { display: block; margin-top: 6px; color: var(--ink); font-size: 18px; }
.stock-balance-warehouses { margin-top: 14px; border-top: 1px solid #edf1f5; }
.stock-balance-subtitle { padding: 11px 0 8px; color: var(--muted); font-size: 10px; }
.warehouse-balance-head { display: grid; grid-template-columns: minmax(0, 1fr) 100px 130px; gap: 10px; padding: 0 0 6px; color: var(--muted-2); font-size: 9px; }
.warehouse-balance-head span:nth-child(n+2) { text-align: right; }
.warehouse-balance-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 130px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid #f0f3f6; font-size: 11px; }
.warehouse-balance-row strong { color: var(--ink); text-align: right; }
.warehouse-balance-row em { color: var(--muted); font-style: normal; text-align: right; }
.stock-balance-legend { margin-top: 13px; }
.bi-panel { padding: 16px 18px; min-height: 212px; }
.bi-inventory-scroll { max-height: 285px; overflow: auto; }
.bi-inventory-table th, .bi-inventory-table td { padding-top: 8px; padding-bottom: 8px; }
.bi-panel-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }.bi-panel-title h3 { margin: 0 0 5px; font-size: 13px; }.bi-panel-title p { margin: 0; font-size: 10px; color: var(--muted); }.chart-period { border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; color: var(--muted); font-size: 9px; }
.bi-bars { display: grid; gap: 14px; }.bi-bar-row { display: grid; grid-template-columns: 68px minmax(0, 1fr) 66px; align-items: center; gap: 10px; font-size: 10px; color: var(--muted); }.bi-bar-row strong { text-align: right; color: var(--ink); font-size: 10px; }.bi-bar-track, .stock-rank-track { height: 9px; background: #edf1ee; border-radius: 5px; overflow: hidden; }.bi-bar { display: block; height: 100%; border-radius: 5px; }.bi-bar.blue { background: var(--blue); }.bi-bar.orange { background: var(--orange); }.bi-bar.green { background: var(--green); }.bi-bar.purple { background: var(--purple); }
.bi-empty-note { padding: 25px 0; text-align: center; color: var(--muted-2); font-size: 11px; }
.stock-ranking { display: grid; gap: 13px; }.stock-rank-row { display: grid; gap: 6px; }.stock-rank-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }.stock-rank-label strong { color: var(--ink); }.stock-rank-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #88c5aa); border-radius: 5px; }
.compact-bi { min-height: 120px; }.bi-balance-line { display: grid; grid-template-columns: 32px 1fr 32px 1fr; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }.bi-balance-line strong { font-size: 15px; }.blue-text { color: var(--blue); }.orange-text { color: var(--orange); }.bi-balance-track { margin-top: 15px; height: 7px; background: var(--orange-soft); border-radius: 4px; overflow: hidden; }.bi-balance-track i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }.bi-legend { display: flex; gap: 20px; align-items: center; color: var(--muted); font-size: 11px; }.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }.legend-dot.blue-bg { background: var(--blue); }.legend-dot.green-bg { background: var(--green); }

@media (max-width: 780px) {
  .bi-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }.bi-kpi { padding: 12px; }.bi-kpi strong { font-size: 17px; }.bi-chart-grid, .bi-foot-grid { display: block; }.bi-chart-grid .bi-panel, .bi-foot-grid .bi-panel { margin-bottom: 10px; }.bi-bar-row { grid-template-columns: 58px minmax(0, 1fr) 55px; }.master-tabs { padding-left: 14px; padding-right: 14px; }.stock-balance-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }.stock-balance-grid strong { font-size: 16px; }.warehouse-balance-head, .warehouse-balance-row { grid-template-columns: minmax(0, 1fr) 70px 100px; font-size: 10px; }
}

@media (max-width: 780px) {
  .report-summary { grid-template-columns: 1fr; gap: 9px; }
}
