:root {
  color-scheme: light;
  --bg: #f4efe6;
  --paper: #f4efe6;
  --paper-soft: #fffaf1;
  --ink: #18191a;
  --muted: #766e64;
  --line: rgba(24, 25, 26, 0.1);
  --panel: rgba(255, 250, 241, 0.74);
  --primary: #d89d4a;
  --primary-dark: #f1bd68;
  --accent: #814c42;
  --warn: #b33434;
  --soft: rgba(241, 189, 104, 0.12);
  --charcoal: #151515;
  --console: #252523;
  --teal: #597a73;
  --amber: #d89d4a;
  --amber-bright: #f1bd68;
  --oxide: #814c42;
  --glass: rgba(255, 250, 241, 0.15);
  --glass-line: rgba(255, 250, 241, 0.25);
  --shadow: 0 24px 70px rgba(67, 54, 36, 0.12);
  --dark-shadow: 0 16px 50px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 18% 0%, rgba(241, 189, 104, 0.13), transparent 32%),
    linear-gradient(135deg, #f6f0e6 0%, #eee5d8 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body::selection {
  background: var(--amber);
  color: var(--charcoal);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(15, 15, 14, 0.9), rgba(15, 15, 14, 0.2) 62%, rgba(15, 15, 14, 0.76)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 42%, rgba(0, 0, 0, 0.58)),
    url("assets/hero-dscf4819.jpg") center / cover;
}

.login-panel {
  width: min(480px, 100%);
  background:
    linear-gradient(145deg, rgba(255, 250, 241, 0.18), rgba(255, 250, 241, 0.08)),
    rgba(28, 31, 29, 0.74);
  border: 1px solid rgba(255, 250, 241, 0.24);
  border-radius: 8px;
  box-shadow:
    0 30px 82px rgba(8, 9, 8, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 34px;
  color: #fffaf1;
  -webkit-backdrop-filter: blur(26px) saturate(1.22);
  backdrop-filter: blur(26px) saturate(1.22);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--amber-bright);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 0.98;
}

.login-panel h1 {
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.05;
  white-space: nowrap;
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
}

h4 {
  margin: 0;
  font-size: 15px;
}

.muted,
.hint {
  color: var(--muted);
  line-height: 1.6;
}

.login-panel .muted,
.login-panel .hint {
  color: rgba(255, 250, 241, 0.76);
}

.login-panel label {
  color: rgba(255, 250, 241, 0.76);
}

.hint {
  min-height: 22px;
  margin: 8px 0 0;
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(24, 24, 22, 0.96), rgba(24, 24, 22, 0.99)),
    url("assets/hero-dscf4819.jpg") center / cover;
  color: #fffaf1;
  padding: 18px;
  box-shadow: var(--dark-shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border: 1px solid rgba(255, 250, 241, 0.22);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 250, 241, 0.08), rgba(255, 250, 241, 0.03)),
    rgba(23, 24, 23, 0.5);
  padding: 10px 12px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.22);
  backdrop-filter: blur(18px);
}

.brand small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 250, 241, 0.62);
  font-size: 12px;
}

.brand strong {
  display: block;
  line-height: 1.25;
  color: #fffaf1;
  font-size: 14px;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-tabs {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav-tabs button {
  position: relative;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 16px;
  background: transparent;
  color: rgba(255, 250, 241, 0.72);
  text-align: left;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.nav-tabs button.active,
.nav-tabs button:hover {
  border-color: rgba(255, 250, 241, 0.2);
  background: rgba(255, 250, 241, 0.1);
  color: var(--amber-bright);
  transform: translateY(-1px);
}

.content {
  min-width: 0;
  padding: 28px;
}

.topbar {
  position: relative;
  display: block;
  margin-bottom: 28px;
  border: 1px solid rgba(24, 25, 26, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 250, 241, 0.34)),
    rgba(255, 255, 255, 0.36);
  min-height: 126px;
  padding: 20px;
  box-shadow: 0 24px 70px rgba(67, 54, 36, 0.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

.topbar-copy {
  display: grid;
  align-content: space-between;
  min-height: 86px;
  padding-right: 170px;
}

.topbar-copy p {
  margin-bottom: 14px;
}

.topbar-copy select {
  width: 148px;
}

.top-logout {
  position: absolute;
  top: 18px;
  right: 18px;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

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

.metric-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.58),
    0 24px 70px rgba(67, 54, 36, 0.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

.metric {
  min-height: 132px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
  text-transform: uppercase;
}

.metric strong {
  color: var(--oxide);
  font-size: 30px;
  line-height: 1;
  word-break: break-word;
}

.metric small {
  color: var(--muted);
  line-height: 1.45;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.72);
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.5);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(241, 189, 104, 0.66);
  box-shadow: 0 0 0 3px rgba(241, 189, 104, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.project-meta {
  grid-template-columns: 1.4fr 1.1fr 180px 180px;
}

.stack {
  display: grid;
  gap: 14px;
}

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

.primary,
.ghost,
.button-like {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.primary,
.button-like {
  background: var(--amber-bright);
  color: #1a1610;
  box-shadow: 0 14px 34px rgba(241, 189, 104, 0.18);
}

.primary:hover,
.button-like:hover {
  background: #ffd084;
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(241, 189, 104, 0.28);
}

.ghost {
  background: transparent;
  color: var(--oxide);
  border-color: rgba(24, 25, 26, 0.12);
}

.ghost:hover {
  border-color: rgba(216, 157, 74, 0.42);
  background: rgba(255, 250, 241, 0.58);
  color: var(--oxide);
  transform: translateY(-1px);
}

.button-like {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
}

.button-like input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.search {
  max-width: 300px;
}

.detail-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.detail-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.detail-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-actions button {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 11px;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -4px;
}

.bulk-toolbar button,
.bulk-toolbar select {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
}

.detail-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.45);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.year-summary-table {
  table-layout: fixed;
  min-width: 760px;
}

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

.year-summary-table th:first-child,
.year-summary-table td:first-child {
  text-align: left;
}

.detail-table {
  min-width: 1500px;
  table-layout: fixed;
}

.detail-col-kind {
  width: 6.5%;
}

.detail-col-check {
  width: 3.5%;
}

.detail-col-category {
  width: 10%;
}

.detail-col-note {
  width: 13%;
}

.detail-col-money {
  width: 8%;
}

.detail-col-status {
  width: 7%;
}

.detail-col-shareholder {
  width: 10%;
}

.detail-col-actions {
  width: 5.5%;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(24, 25, 26, 0.09);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
  white-space: nowrap;
}

tfoot td {
  background: rgba(241, 189, 104, 0.12);
  color: var(--oxide);
  font-weight: 800;
}

.detail-table input,
.detail-table select {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
}

.detail-table input[name="detailNote"] {
  min-width: 0;
}

.detail-table .line-kind {
  min-width: 0;
}

.detail-table .shareholder-select {
  min-width: 0;
}

.detail-table th,
.detail-table td {
  padding-left: 9px;
  padding-right: 9px;
}

.detail-table .form-dash {
  display: none;
  min-height: 35px;
  align-items: center;
}

.detail-table td.show-dash input,
.detail-table td.show-dash select {
  display: none;
}

.detail-table td.show-dash .form-dash {
  display: flex;
}

.detail-edit-table {
  min-width: 1500px;
  table-layout: fixed;
}

.detail-edit-table input,
.detail-edit-table select {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
}

.detail-edit-table input[data-field="note"] {
  min-width: 0;
}

.detail-edit-table th,
.detail-edit-table td {
  padding: 10px 9px;
  vertical-align: middle;
}

.detail-total-row th,
.detail-total-row td {
  background: rgba(241, 189, 104, 0.16);
  border-top: 1px solid rgba(129, 76, 66, 0.18);
  color: var(--accent);
  font-weight: 800;
  vertical-align: middle;
}

.year-amount {
  font-weight: 760;
}

.year-amount.is-income,
.year-amount.is-positive {
  color: var(--warn);
}

.year-amount.is-expense,
.year-amount.is-negative {
  color: var(--teal);
}

.year-amount.is-zero {
  color: var(--ink);
}

.detail-edit-table .readonly-dash,
.detail-edit-table .amount-ok,
.detail-edit-table .amount-danger,
.detail-edit-table .amount-neutral {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
}

.detail-readonly-table {
  min-width: 1320px;
}

.table-input {
  width: 100%;
  min-width: 96px;
  padding: 7px 8px;
}

.shareholder-ledger-table {
  min-width: 1040px;
  table-layout: fixed;
}

.shareholder-col-date {
  width: 11%;
}

.shareholder-col-name {
  width: 10%;
}

.shareholder-col-type {
  width: 15%;
}

.shareholder-col-amount {
  width: 10%;
}

.shareholder-col-project {
  width: 15%;
}

.shareholder-col-note {
  width: 34%;
}

.shareholder-col-actions {
  width: 5%;
}

.shareholder-ledger-table th,
.shareholder-ledger-table td {
  padding-left: 12px;
  padding-right: 12px;
  vertical-align: middle;
}

.shareholder-ledger-table th:nth-child(2),
.shareholder-ledger-table td:nth-child(2),
.shareholder-ledger-table th:nth-child(3),
.shareholder-ledger-table td:nth-child(3),
.shareholder-ledger-table .tag {
  white-space: nowrap;
}

.shareholder-ledger-table .table-input {
  min-width: 0;
}

.inline-edit-pair {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(96px, 1fr);
  gap: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 16, 13, 0.44);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.modal-panel {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 250, 241, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.94);
  padding: 20px;
  box-shadow: 0 28px 80px rgba(24, 25, 26, 0.24);
}

.modal-panel label {
  display: grid;
  gap: 7px;
}

.modal-actions {
  margin-top: 14px;
}

.calculated-cell,
.readonly-dash,
.amount-neutral {
  color: var(--muted);
  font-weight: 760;
}

.icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(24, 25, 26, 0.12);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.62);
  color: var(--oxide);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(216, 157, 74, 0.42);
  background: rgba(255, 250, 241, 0.9);
  transform: translateY(-1px);
}

.danger-icon {
  border-color: rgba(179, 52, 52, 0.24);
  background: rgba(179, 52, 52, 0.08);
  color: var(--warn);
}

.danger-icon:hover {
  border-color: rgba(179, 52, 52, 0.38);
  background: rgba(179, 52, 52, 0.13);
}

td strong {
  display: block;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid rgba(89, 122, 115, 0.24);
  background: rgba(89, 122, 115, 0.12);
  color: #25463f;
  font-size: 12px;
  font-weight: 700;
}

.tag.warn {
  background: #fbefef;
  color: var(--warn);
}

.tag.cash-in {
  background: #fbefef;
  border-color: rgba(144, 73, 65, 0.24);
  color: var(--warn);
}

.tag.cash-out {
  background: rgba(89, 122, 115, 0.12);
  border-color: rgba(89, 122, 115, 0.24);
  color: #25463f;
}

.danger {
  border: 0;
  background: transparent;
  color: var(--warn);
  font-weight: 700;
}

.danger-button {
  border: 1px solid rgba(179, 52, 52, 0.24);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(179, 52, 52, 0.08);
  color: var(--warn);
  font-weight: 820;
  cursor: pointer;
}

.compact-button {
  padding: 7px 12px;
  min-height: auto;
}

.project-toggle {
  display: inline-grid;
  width: 18px;
  height: 28px;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.project-name-edit {
  display: grid;
  grid-template-columns: 20px minmax(130px, 1fr);
  align-items: center;
  gap: 4px;
}

.project-name-edit .muted {
  grid-column: 2;
}

.inline-name-input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 6px;
  font-weight: 820;
}

.inline-name-input:focus {
  border-color: rgba(216, 157, 74, 0.42);
  background: rgba(255, 250, 241, 0.72);
}

.project-toggle::before {
  display: inline-block;
  color: var(--amber);
  content: "▸";
  transition: transform 160ms ease;
}

.project-toggle.is-open::before {
  transform: rotate(90deg);
}

.amount-stack {
  display: grid;
  gap: 4px;
  font-weight: 760;
}

.amount-stack small {
  font-size: 12px;
  font-weight: 820;
}

.amount-ok {
  color: #25463f;
}

.amount-danger {
  color: var(--warn);
}

.expanded-details {
  overflow-x: auto;
  border: 1px solid rgba(24, 25, 26, 0.09);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.48);
  padding: 10px;
}

.expanded-details-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.expanded-details-head span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.expanded-details table {
  min-width: 960px;
}

.expanded-details .detail-edit-table {
  min-width: 1500px;
}

.expanded-details .detail-readonly-table {
  min-width: 1320px;
}

.project-detail-row td {
  background: rgba(241, 189, 104, 0.08);
}

.detail-empty {
  padding: 14px;
}

.alerts,
.card-list {
  display: grid;
  gap: 12px;
}

.alert,
.shareholder-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 250, 241, 0.3)),
    rgba(255, 250, 241, 0.52);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.58),
    0 10px 24px rgba(40, 30, 20, 0.06);
}

.alert strong,
.shareholder-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--oxide);
}

.alert p,
.shareholder-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.upload-box {
  border: 1px dashed rgba(129, 76, 66, 0.35);
  border-radius: 8px;
  padding: 14px;
  background:
    radial-gradient(circle at 18% 24%, rgba(241, 189, 104, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(241, 232, 214, 0.28)),
    rgba(255, 250, 241, 0.45);
}

.invoice-preview {
  overflow: hidden;
  border: 1px solid rgba(129, 76, 66, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.72);
}

.invoice-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(129, 76, 66, 0.16);
}

.invoice-preview-head span,
.invoice-preview p {
  color: var(--muted);
  font-size: 12px;
}

.invoice-preview p {
  margin: 0;
  padding: 14px;
}

.invoice-preview iframe,
.invoice-preview img {
  display: block;
  width: 100%;
  height: min(560px, 56vh);
  border: 0;
  background: #fff;
  object-fit: contain;
}

.batch-review {
  padding-top: 4px;
}

.batch-review-title {
  margin-bottom: 10px;
  font-weight: 700;
}

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

.batch-invoice-card {
  overflow: hidden;
  border: 1px solid rgba(129, 76, 66, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.72);
}

.batch-invoice-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(129, 76, 66, 0.16);
}

.batch-invoice-card > header span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-file-preview {
  height: 300px;
  background: #fff;
}

.batch-file-preview iframe,
.batch-file-preview img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.batch-file-preview p {
  margin: 0;
  padding: 20px;
  color: var(--muted);
}

.batch-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.batch-fields .wide {
  grid-column: 1 / -1;
}

.invoice-ledger-table {
  min-width: 1020px;
  table-layout: fixed;
}

.invoice-ledger-table th:nth-child(1),
.invoice-ledger-table td:nth-child(1) { width: 76px; }

.invoice-ledger-table th:nth-child(2),
.invoice-ledger-table td:nth-child(2) { width: 66px; }

.invoice-ledger-table th:nth-child(3),
.invoice-ledger-table td:nth-child(3) { width: 84px; }

.invoice-ledger-table th:nth-child(4),
.invoice-ledger-table td:nth-child(4) { width: 70px; }

.invoice-ledger-table th:nth-child(5),
.invoice-ledger-table td:nth-child(5) { width: 72px; }

.invoice-ledger-table th:nth-child(6),
.invoice-ledger-table td:nth-child(6) { width: 168px; }

.invoice-ledger-table th:nth-child(7),
.invoice-ledger-table td:nth-child(7) { width: 146px; }

.invoice-ledger-table th:nth-child(8),
.invoice-ledger-table td:nth-child(8) { width: 150px; }

.invoice-ledger-table th:nth-child(9),
.invoice-ledger-table td:nth-child(9) { width: 34px; }

.invoice-ledger-table th:nth-child(-n + 5),
.invoice-ledger-table td:nth-child(-n + 5) {
  white-space: nowrap;
}

.trash-button {
  position: relative;
}

.trash-glyph,
.trash-glyph::before {
  display: block;
  box-sizing: border-box;
}

.edit-glyph {
  position: relative;
  display: block;
  width: 11px;
  height: 3px;
  margin: 0 auto;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(-45deg);
}

.edit-glyph::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0;
  border-top: 1.5px solid transparent;
  border-bottom: 1.5px solid transparent;
  border-right: 3px solid currentColor;
}

.invoice-date-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.invoice-date-filter > span:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.invoice-date-filter input {
  width: 148px;
  min-height: 34px;
  padding: 6px 8px;
}

.date-picker-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.date-picker-control > input:not(.native-date-input) {
  padding-right: 34px;
}

.native-date-input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  min-height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.date-picker-button {
  position: absolute;
  right: 5px;
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.date-picker-button:hover {
  color: var(--accent);
}

.calendar-glyph {
  position: relative;
  width: 14px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.calendar-glyph::before {
  content: "";
  position: absolute;
  left: -1.5px;
  right: -1.5px;
  top: 3px;
  border-top: 1.5px solid currentColor;
}

.calendar-glyph::after {
  content: "";
  position: absolute;
  left: 3px;
  top: -3px;
  width: 5px;
  height: 3px;
  border-left: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.date-range-separator {
  color: var(--muted);
}

.trash-glyph {
  position: relative;
  width: 10px;
  height: 10px;
  margin: 3px auto 0;
  border: 1.5px solid currentColor;
  border-top: 0;
  border-radius: 0 0 1px 1px;
}

.trash-glyph::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -4px;
  width: 11px;
  height: 2px;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

@media (max-width: 1080px) {
  .metric-grid,
  .metric-grid.compact,
  .split,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .invoice-date-filter {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .brand {
    align-items: flex-start;
  }

  .content {
    padding: 16px;
  }

  .topbar,
  .panel-head,
  .panel-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
    min-height: 0;
    gap: 14px;
  }

  .topbar-copy {
    min-height: 0;
    padding-right: 0;
  }

  .top-logout {
    position: static;
    justify-self: start;
  }

  .metric-grid,
  .metric-grid.compact,
  .split,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .batch-review-grid {
    grid-template-columns: 1fr;
  }

}
