:root {
  --ink: #17202e;
  --muted: #687386;
  --soft: #f6f8fb;
  --line: #dce3ee;
  --panel: #ffffff;
  --nav: #21342f;
  --nav-soft: #2d4740;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #12805c;
  --amber: #b26b14;
  --red: #cf3f44;
  --teal: #0f766e;
  --surface: #f3f6fa;
  --surface-strong: #e9eef6;
  --shadow: 0 10px 28px rgba(30, 41, 59, .08);
  --shadow-soft: 0 4px 14px rgba(30, 41, 59, .06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7f9fc 0%, #eef3f8 52%, #eef4f2 100%);
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 244px;
  background:
    linear-gradient(180deg, var(--nav) 0%, #263b36 54%, #1e2f2b 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 10px 0 30px rgba(20, 32, 46, .08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f8fafc;
  color: #1f4038;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(9, 21, 35, .16);
}

.brand-name {
  font-weight: 800;
}

.brand-sub {
  margin-top: 3px;
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
}

.nav {
  padding: 16px 12px;
  display: grid;
  gap: 6px;
  flex: 1;
  align-content: start;
}

.nav-item {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .68);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 700;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, .13);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 20px;
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #28c76f;
}

.status-dot.pending {
  background: #f59e0b;
}

.status-dot.warn {
  background: #ef4444;
}

.status-dot.ok {
  background: #28c76f;
}

.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions,
.head-actions,
.toolbar,
.preview-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content {
  display: none;
  padding: 24px 28px 42px;
  max-width: 1680px;
}

.content.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.metric:hover {
  border-color: #cbd6e5;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .9fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 12px;
}

.upload-card {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 18px;
  border: 1.5px dashed #b7c5d8;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.upload-card:hover,
.upload-card.dragover {
  border-color: var(--blue);
  background: #f2f7ff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .10);
  transform: translateY(-1px);
}

.upload-card.uploading {
  border-color: var(--blue);
  background: #eef5ff;
  opacity: .78;
  cursor: progress;
}

.upload-card input {
  display: none;
}

.upload-card svg {
  width: 26px;
  height: 26px;
  color: var(--blue);
}

.upload-card strong {
  font-size: 15px;
}

.upload-card span {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  padding: 0 20px 18px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 800;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(30, 41, 59, .04);
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: linear-gradient(180deg, #3374f3 0%, var(--blue) 100%);
  color: #fff;
  border-color: var(--blue-dark);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #2563eb 0%, var(--blue-dark) 100%);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .20);
  transform: translateY(-1px);
}

.btn-soft {
  background: #f7f9fc;
  border-color: var(--line);
}

.btn-soft:hover {
  background: #edf3fa;
  border-color: #cbd6e5;
  transform: translateY(-1px);
}

.btn-danger {
  background: #fff7f7;
  border-color: #ffd2d2;
  color: var(--red);
}

.btn.full {
  width: calc(100% - 40px);
  margin: 0 20px 20px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field.wide {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: #3f4b5f;
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.search-box input,
.table-tools select {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--ink);
  background: #fff;
  outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.field input:focus,
.field select:focus,
.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: #536077;
  background: #f8fafc;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 800;
}

tbody tr {
  transition: background .14s ease;
}

tbody tr:hover {
  background: #fbfdff;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  color: var(--green);
  background: #eaf8f1;
}

.badge.warn {
  color: var(--amber);
  background: #fff6df;
}

.badge.error {
  color: var(--red);
  background: #fff0f0;
}

.table-tools {
  padding: 14px 20px;
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  max-width: 360px;
  flex: 1;
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search-box input {
  padding-left: 34px;
}

.table-tools select {
  max-width: 150px;
}

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
}

.statement-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.statement-list-panel {
  position: sticky;
  top: 112px;
  max-height: calc(100vh - 132px);
  overflow: auto;
}

.statement-list {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.statement-period-box {
  margin: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  display: grid;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.period-total-fields {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}

.period-total-fields label {
  display: grid;
  gap: 5px;
}

.period-total-fields span,
.period-total-label {
  color: #3f4b5f;
  font-size: 12px;
  font-weight: 800;
}

.period-total-fields input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  background: #fff;
}

.period-total-card {
  border: 1px solid #d8e4f4;
  border-radius: 8px;
  padding: 11px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f8fc 100%);
  display: grid;
  gap: 9px;
}

.period-total-card strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.1;
}

.period-total-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.period-total-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.period-total-card div,
.period-total-card dt,
.period-total-card dd {
  min-width: 0;
}

.period-total-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.period-total-card dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.statement-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  padding: 12px;
  text-align: left;
  box-shadow: 0 1px 2px rgba(30, 41, 59, .04);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.statement-item:hover {
  border-color: #c9d5e4;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.statement-item.active {
  border-color: var(--blue);
  background: #f4f8ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .42), 0 8px 18px rgba(37, 99, 235, .10);
}

.statement-item strong {
  display: block;
}

.statement-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.statement-preview-shell {
  min-width: 0;
}

.preview-actions {
  justify-content: flex-end;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-soft);
}

.btn-save-statement {
  border-color: #b7d8ff;
  background: linear-gradient(180deg, #f6fbff 0%, #eff7ff 100%);
  color: #1159a8;
}

.btn-save-statement:hover {
  background: #dff0ff;
}

.switch-control {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: .16s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 32, 51, .22);
  transition: .16s ease;
}

.switch-control input:checked + .switch-track {
  background: var(--blue);
}

.switch-control input:checked + .switch-track::after {
  transform: translateX(14px);
}

.statement-preview {
  overflow: auto;
  border-radius: 8px;
  scrollbar-gutter: stable;
}

.statement-paper {
  width: 100%;
  min-width: 780px;
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid #e4eaf2;
}

.invoice {
  color: #001eff;
  font-family: "Malgun Gothic", "Noto Sans KR", sans-serif;
}

.invoice .doc-no {
  text-align: right;
  font-size: 12px;
  margin-bottom: 3px;
}

.invoice table {
  border-collapse: collapse;
  width: 100%;
}

.invoice th,
.invoice td {
  border: 2px solid #001eff;
  padding: 3px 5px;
  font-size: 11px;
  line-height: 1.25;
  color: #001eff;
}

.invoice-title {
  border: 2px solid #001eff;
  border-bottom: 0;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  text-align: center;
  min-height: 52px;
}

.invoice-title h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.invoice-title .small {
  font-size: 12px;
  font-weight: 700;
}

.party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.party {
  border: 2px solid #001eff;
  border-top: 0;
}

.party + .party {
  border-left: 0;
}

.party table th,
.party table td {
  border-width: 1px;
}

.party table {
  height: 100%;
}

.party-label {
  width: 26px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}

.summary-table th,
.summary-table td,
.line-table th,
.line-table td {
  border-width: 1px;
}

.summary-table th {
  text-align: center;
}

.line-table th {
  text-align: center;
}

.line-table td:nth-child(1),
.line-table td:nth-child(2),
.line-table td:nth-child(6) {
  text-align: center;
}

.line-table td:nth-child(7),
.line-table td:nth-child(8),
.line-table td:nth-child(9) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.line-table td.has-input {
  padding: 2px 3px;
}

.line-month,
.line-day,
.line-qty {
  text-align: center;
}

.line-unit-price,
.line-supply,
.line-tax {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.line-action-left,
.line-action-right {
  position: relative;
}

.line-action-left {
  padding-left: 28px !important;
}

.line-action-left .line-row-btn {
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
}

.line-action-right {
  padding-right: 56px !important;
}

.line-action-right .invoice-edit,
.line-memo-text {
  display: block;
  min-width: 0;
}

.line-row-actions {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.line-row-btn {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0, 30, 255, .24);
  border-radius: 4px;
  background: rgba(255, 255, 255, .82);
  color: #001eff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.line-row-btn:hover {
  background: rgba(0, 30, 255, .08);
  border-color: rgba(0, 30, 255, .42);
}

.line-row-btn svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.line-delete-btn {
  color: #c2410c;
  border-color: rgba(194, 65, 12, .28);
}

.line-drag-handle {
  cursor: grab;
}

.line-drag-handle:active {
  cursor: grabbing;
}

.line-dragging {
  opacity: .45;
}

.line-drop-before {
  box-shadow: inset 0 2px 0 rgba(0, 30, 255, .65);
}

.line-drop-after {
  box-shadow: inset 0 -2px 0 rgba(0, 30, 255, .65);
}

.invoice-edit {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(255, 255, 255, .7);
  color: #001eff;
  font: inherit;
  line-height: 1.25;
  padding: 2px 3px;
  outline: 0;
}

.invoice-edit:hover {
  border-color: rgba(0, 30, 255, .28);
}

.invoice-edit:focus {
  background: #fff;
  border-color: #001eff;
  box-shadow: 0 0 0 2px rgba(0, 30, 255, .12);
}

.invoice-edit.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.btn.is-busy {
  opacity: .68;
  cursor: wait;
}

.pdf-capture-stage {
  position: fixed;
  left: -20000px;
  top: 0;
  width: 794px;
  background: #fff;
  z-index: -1;
}

.pdf-capture-paper {
  width: 794px !important;
  min-width: 794px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
}

.pdf-capture-paper .invoice {
  background: #fff;
  font-weight: 400;
}

.pdf-capture-paper .invoice table {
  border-collapse: collapse !important;
  table-layout: fixed;
}

.pdf-capture-paper .invoice th,
.pdf-capture-paper .invoice td {
  border: .5px solid #001eff !important;
  border-width: .5px !important;
  padding: 1.8px 2.6px;
  font-size: 9.8px;
  font-weight: 400;
  line-height: 1.2;
}

.pdf-capture-paper .party table th,
.pdf-capture-paper .party table td,
.pdf-capture-paper .summary-table th,
.pdf-capture-paper .summary-table td,
.pdf-capture-paper .line-table th,
.pdf-capture-paper .line-table td {
  border-width: .5px !important;
}

.pdf-capture-paper .invoice-title {
  border: .5px solid #001eff !important;
  border-bottom: 0 !important;
  min-height: 44px;
}

.pdf-capture-paper .invoice-title h2 {
  font-size: 23px;
  font-weight: 800;
}

.pdf-capture-paper .invoice-title .small {
  font-size: 11px;
  font-weight: 800;
}

.pdf-capture-paper .party {
  border: .5px solid #001eff !important;
  border-top: 0 !important;
}

.pdf-capture-paper .party + .party {
  border-left: 0 !important;
}

.pdf-capture-paper .party-label {
  width: 22px;
  font-size: 13px;
  font-weight: 400;
}

.pdf-capture-paper .line-table th,
.pdf-capture-paper .line-table td {
  font-size: 9px;
  font-weight: 400;
  padding: 1.8px 2.2px;
}

.pdf-capture-paper .line-table td.has-input {
  padding: 1.4px 1.8px;
}

.pdf-capture-paper .line-action-left,
.pdf-capture-paper .line-action-right {
  padding-left: 2px !important;
  padding-right: 2px !important;
}

.pdf-capture-paper .line-row-btn,
.pdf-capture-paper .line-row-actions {
  display: none !important;
}

.pdf-capture-paper .invoice-footer {
  font-size: 11px;
  font-weight: 400;
}

.pdf-input-text {
  display: block;
  width: 100%;
  min-height: 12px;
  color: #001eff;
  font-weight: 400;
  white-space: normal;
  word-break: keep-all;
}

.pdf-input-text.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.invoice-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  color: #001eff;
  font-size: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 36, 58, .54);
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.global-drop-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 36, 58, .62);
  backdrop-filter: blur(4px);
  z-index: 110;
  pointer-events: none;
}

.global-drop-overlay.open {
  display: flex;
}

.global-drop-overlay.processing {
  display: flex;
  background: rgba(24, 36, 58, .44);
}

.drop-panel {
  width: min(440px, 100%);
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 2px dashed rgba(255, 255, 255, .74);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(23, 32, 51, .34);
  text-align: center;
}

.drop-panel svg {
  width: 42px;
  height: 42px;
  color: var(--blue);
}

.drop-panel strong {
  font-size: 20px;
}

.drop-panel span {
  color: var(--muted);
  font-size: 13px;
}

.modal {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(23, 32, 51, .24);
  padding: 20px;
  display: grid;
  gap: 14px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: none;
  max-width: 420px;
  padding: 13px 15px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  box-shadow: 0 12px 34px rgba(23, 32, 51, .24);
  font-weight: 700;
  z-index: 120;
}

.toast.show {
  display: block;
}

@media (max-width: 1080px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }

  .nav {
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .sidebar-foot {
    display: none;
  }

  .workspace-grid,
  .statement-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .statement-list-panel {
    position: static;
    max-height: none;
  }

  .preview-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .content {
    padding: 16px;
  }

  .metric-grid,
  .upload-grid,
  .field-grid,
  .field-grid.two,
  .period-total-fields,
  .period-total-card dl {
    grid-template-columns: 1fr;
  }

  .field.wide {
    grid-column: auto;
  }

  .topbar-actions,
  .head-actions,
  .toolbar {
    width: 100%;
  }

  .btn {
    flex: 1;
    min-width: max-content;
  }

  .preview-actions .btn,
  .preview-actions .switch-control {
    flex: 1 1 160px;
  }

  .statement-paper {
    padding: 10px;
  }

  .table-tools {
    flex-direction: column;
  }

  .search-box,
  .table-tools select {
    max-width: none;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 7mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body {
    background: #fff;
    width: auto;
    min-height: 0;
  }

  .sidebar,
  .topbar,
  .statement-list-panel,
  .preview-actions,
  .toast {
    display: none !important;
  }

  .content {
    display: none !important;
    padding: 0;
  }

  .content.page.active,
  #page-statements.active,
  #page-simple-statement.active {
    display: block !important;
  }

  .statement-layout {
    display: block;
  }

  .statement-preview {
    overflow: visible !important;
  }

  .statement-paper {
    width: 100%;
    min-width: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .invoice {
    width: 100%;
    color: #001eff !important;
    font-weight: 400 !important;
  }

  .invoice table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: fixed;
  }

  .invoice th,
  .invoice td {
    border: .5px solid #001eff !important;
    border-width: .5px !important;
    box-shadow: none !important;
    color: #001eff !important;
    font-weight: 400 !important;
    background-clip: padding-box;
  }

  .party table th,
  .party table td,
  .summary-table th,
  .summary-table td,
  .line-table th,
  .line-table td {
    border-width: .5px !important;
  }

  .invoice-title,
  .party {
    border: .5px solid #001eff !important;
    box-shadow: none !important;
  }

  .invoice-title {
    border-bottom: 0 !important;
  }

  .party {
    border-top: 0 !important;
  }

  .party + .party {
    border-left: 0 !important;
  }

  .summary-table,
  .line-table {
    border: .5px solid #001eff !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .invoice-edit {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    color: #001eff !important;
    font-weight: 400 !important;
    appearance: none;
    -webkit-appearance: none;
  }

  .line-action-left,
  .line-action-right {
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  .line-row-btn,
  .line-row-actions {
    display: none !important;
  }
}
