:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #e5e5e7;
  --border-strong: #d2d2d7;
  --accent: #0066cc;
  --accent-soft: #edf5ff;
  --green: #0a7a3d;
  --red: #bf3b3b;
  --amber: #9a6a00;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.055);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.045);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: rgba(255, 255, 255, 0.86);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #111111;
  color: #ffffff;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.2;
}

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

.nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 34px 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #424245;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-item::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  opacity: 0;
  transform: rotate(45deg) translateX(-5px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  background: #f2f2f4;
  border-color: var(--border);
  color: var(--text);
}

.nav-item.is-active::after {
  opacity: 1;
  transform: rotate(45deg) translateX(0);
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: #515154;
  display: grid;
  gap: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.user-panel {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  display: grid;
  gap: 8px;
}

.user-panel span,
.user-panel small {
  color: var(--muted);
  font-size: 12px;
}

.user-panel strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.workspace {
  min-width: 0;
  padding: 24px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.topbar,
.controls,
.kpi-grid,
.content-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  min-height: 76px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 18px;
}

.topbar {
  display: none;
}

#reportView > .panel-head {
  display: none;
}

.topbar h2,
.panel-head h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
}

.topbar p,
.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.ghost-button,
.audit-tab,
.subnav-item {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 650;
}

.ghost-button,
.audit-tab,
.subnav-item {
  background: #ffffff;
  color: var(--text);
}

.danger-button {
  color: var(--red);
  border-color: rgba(191, 59, 59, 0.32);
}

.primary-button:hover,
.ghost-button:hover,
.audit-tab:hover,
.subnav-item:hover {
  transform: translateY(-1px);
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.controls {
  border-radius: 18px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 170px)) minmax(240px, 1fr);
  gap: 12px;
}

.controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.controls select,
.controls input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 10px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.controls select:focus,
.controls input:focus,
.rate-cell:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.kpi-grid {
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.kpi-grid.has-four-kpis {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.kpi {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  display: grid;
  align-content: center;
  gap: 7px;
}

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

.kpi strong {
  font-size: 21px;
  font-weight: 650;
  line-height: 1.1;
  color: var(--text);
}

.kpi.warning strong {
  color: var(--amber);
}

.kpi.warning strong.num-pos {
  color: var(--green);
}

.kpi.warning strong.num-neg {
  color: var(--red);
}

.content-panel {
  min-width: 0;
  border-radius: 18px;
  overflow: hidden;
}

.panel-head {
  min-height: 66px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.rate-hint {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.segmented {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.audit-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #b8d9fb;
  font-weight: 650;
}

.subnav {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 250, 251, 0.94);
}

.subnav-item {
  min-height: 34px;
  color: var(--muted);
}

.subnav-item.is-active {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

.tab-subnav {
  gap: 18px;
  padding: 0 20px;
  background: #ffffff;
  align-items: center;
}

.tab-subnav .subnav-item {
  position: relative;
  min-height: 48px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 520;
}

.tab-subnav .subnav-item:hover {
  transform: none;
  color: var(--text);
}

.tab-subnav .subnav-item.is-active {
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.tab-subnav .subnav-item.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: #111111;
}

.sort-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.sort-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 620;
}

.sort-button:hover {
  border-color: #b8d9fb;
  color: var(--accent);
}

.sort-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.table-wrap {
  max-height: calc(100vh - 348px);
  overflow: auto;
  background: #ffffff;
}

.voucher-pagination {
  min-height: 58px;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(110px, 1fr);
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.pagination-summary,
.pagination-page-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pagination-page-meta {
  text-align: right;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pagination-button {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.pagination-button:hover:not(:disabled):not(.is-active) {
  border-color: #b8d9fb;
  color: var(--accent);
}

.pagination-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.pagination-text-button {
  min-width: 54px;
}

.inventory-summary {
  padding: 14px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfbfd;
}

.summary-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.summary-title {
  padding: 11px 13px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.summary-box table {
  min-width: 0;
  font-size: 12px;
}

.summary-box th {
  position: static;
  background: var(--surface-soft);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.summary-box td,
.summary-box th {
  padding: 8px 10px;
}

.report-summary-row td {
  border-top: 2px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 650;
}

.report-summary-label {
  text-align: left;
  white-space: nowrap;
}

.accounting-section {
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.accounting-head {
  min-height: 58px;
  background: #fbfbfd;
}

.accounting-section .table-wrap {
  max-height: 360px;
}

.accounting-section table {
  min-width: 1320px;
}

.accounting-section th,
.accounting-section td {
  padding: 8px 10px;
}

.accounting-total {
  margin: 14px 16px 16px;
}

.rate-cell {
  width: 84px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 8px;
  text-align: right;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.rate-month-cell {
  width: 88px;
  text-align: left;
}

.rate-table {
  min-width: 1220px;
  table-layout: fixed;
}

.rate-table th,
.rate-table td {
  min-width: 78px;
  width: 92px;
  text-align: right;
  white-space: nowrap;
}

.rate-table th:first-child,
.rate-table td:first-child {
  min-width: 92px;
  width: 96px;
  text-align: left;
}

.rate-table th:last-child,
.rate-table td:last-child {
  min-width: 132px;
  width: 132px;
  text-align: right;
}

.rate-chart {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #fbfbfd;
  display: grid;
  gap: 12px;
}

.rate-page-hero,
.rate-overview,
.rate-chart-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.rate-page-hero {
  padding: 18px 20px;
  border-radius: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.rate-page-hero h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.rate-page-hero p,
.rate-chart-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.rate-page-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: right;
  white-space: nowrap;
}

.rate-overview {
  padding: 12px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.rate-stat {
  min-height: 70px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  align-content: center;
  gap: 7px;
}

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

.rate-stat strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}

.rate-chart-panel {
  padding: 16px 18px 8px;
  border-radius: 16px;
}

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

.rate-chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.rate-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rate-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.rate-chart svg {
  display: block;
  width: 100%;
  height: 260px;
}

.rate-chart text {
  fill: var(--muted);
  font-size: 11px;
}

.rate-grid line {
  stroke: #e6e8ee;
  stroke-width: 1;
}

.rate-axis text {
  fill: var(--muted);
}

.rule-control,
.subject-control {
  width: 150px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 9px;
  color: var(--text);
  background: #ffffff;
  outline: none;
  font-size: 12px;
}

select.rule-control,
select.subject-control {
  width: 138px;
}

.subject-control {
  width: 180px;
}

.rule-control:focus,
.subject-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.table-toolbar {
  caption-side: top;
  padding: 12px 16px;
  text-align: left;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.voucher-actions {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

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

.voucher-filter {
  min-width: 148px;
  display: grid;
  gap: 4px;
}

.voucher-filter select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #ffffff;
  color: var(--text);
}

.voucher-filter select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.voucher-select {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.status-ok,
.status-pending {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.status-ok {
  color: #0b6b3a;
  background: #e7f6ec;
}

.status-pending {
  color: #6b4d00;
  background: #fff4cf;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1180px;
  font-size: 12px;
}

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

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

.voucher-detail-table th:nth-child(1),
.voucher-detail-table td:nth-child(1) {
  width: 44px;
  text-align: center;
}

.voucher-detail-table th:nth-child(2),
.voucher-detail-table td:nth-child(2) {
  width: 78px;
  text-align: left;
}

.voucher-detail-table th:nth-child(3),
.voucher-detail-table td:nth-child(3) {
  width: 130px;
  text-align: left;
}

.voucher-detail-table th:nth-child(4),
.voucher-detail-table td:nth-child(4),
.voucher-detail-table th:nth-child(5),
.voucher-detail-table td:nth-child(5) {
  width: 74px;
  text-align: left;
}

.voucher-detail-table th:nth-child(6),
.voucher-detail-table td:nth-child(6) {
  width: 104px;
  text-align: left;
}

.voucher-detail-table th:nth-child(7),
.voucher-detail-table td:nth-child(7) {
  width: 76px;
  text-align: left;
}

.voucher-detail-table th:nth-child(8),
.voucher-detail-table td:nth-child(8) {
  width: 150px;
  text-align: left;
}

.voucher-detail-table th:nth-child(9),
.voucher-detail-table td:nth-child(9) {
  width: 92px;
  text-align: left;
}

.voucher-detail-table th:nth-child(10),
.voucher-detail-table td:nth-child(10) {
  width: 160px;
  text-align: left;
}

.voucher-detail-table th:nth-child(n+11),
.voucher-detail-table td:nth-child(n+11) {
  width: 112px;
  text-align: right;
}

.voucher-detail-table th:nth-child(11),
.voucher-detail-table th:nth-child(14) {
  width: 124px;
}

.inventory-ledger-table {
  table-layout: fixed;
  min-width: 1280px;
  font-variant-numeric: tabular-nums;
}

.inventory-ledger-table .ledger-col-select {
  width: 50px;
}

.inventory-ledger-table .ledger-col-status {
  width: 96px;
}

.inventory-ledger-table .ledger-col-month {
  width: 88px;
}

.inventory-ledger-table .ledger-col-amount {
  width: calc((100% - 234px) / 8);
}

.inventory-ledger-table th,
.inventory-ledger-table td {
  padding: 11px 14px;
  vertical-align: middle;
}

.inventory-ledger-table th:nth-child(1),
.inventory-ledger-table td:nth-child(1) {
  text-align: center;
}

.inventory-ledger-table th:nth-child(2),
.inventory-ledger-table td:nth-child(2) {
  text-align: left;
}

.inventory-ledger-table th:nth-child(3),
.inventory-ledger-table td:nth-child(3) {
  text-align: center;
}

.inventory-ledger-table th:nth-child(n+4),
.inventory-ledger-table td:nth-child(n+4) {
  text-align: right;
}

.inventory-ledger-table .report-summary-row td {
  border-top-color: var(--border-strong);
  background: #f7f7f9;
  text-align: right;
}

.inventory-ledger-table .report-summary-row td:first-child,
.inventory-ledger-table .report-summary-row td.report-summary-label {
  text-align: center;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: #424245;
  padding: 10px;
  text-align: right;
  white-space: nowrap;
  font-weight: 650;
  border-bottom: 1px solid var(--border-strong);
}

td {
  padding: 9px 10px;
  text-align: right;
  border-bottom: 1px solid #eeeeef;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3) {
  text-align: left;
}

tbody tr:hover {
  background: #f9fafb;
}

.num-neg {
  color: var(--red);
}

.num-pos {
  color: var(--green);
}

.audit-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f2f2f4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.audit-status.missing {
  background: #fff1f1;
  color: var(--red);
}

.audit-status.mapped {
  background: var(--accent-soft);
  color: var(--accent);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(0, 102, 204, 0.09), rgba(10, 122, 61, 0.08)),
    var(--bg);
}

.login-shell {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

.login-brand,
.login-card,
.modal-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-brand {
  min-height: 420px;
  border-radius: 22px;
  padding: 34px;
  display: grid;
  align-content: end;
  gap: 12px;
}

.login-brand .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: auto;
}

.login-brand p,
.login-brand span,
.login-card p,
.login-note,
.form-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-brand h1 {
  max-width: 520px;
  margin: 0;
  color: var(--text);
  font-size: 36px;
  line-height: 1.16;
  font-weight: 720;
}

.login-card {
  border-radius: 22px;
  padding: 30px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.login-card h2 {
  margin: 0;
  font-size: 24px;
}

.login-form,
.account-form {
  display: grid;
  gap: 12px;
}

.login-form label,
.account-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-form input,
.account-form input,
.account-form select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 11px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.login-form input:focus,
.account-form input:focus,
.account-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.form-message.error {
  color: var(--red);
}

.form-message.success {
  color: var(--green);
}

.login-note {
  padding-top: 4px;
  line-height: 1.55;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(29, 29, 31, 0.32);
}

.modal-panel {
  width: min(860px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.modal-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-form {
  padding: 16px 20px;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  align-items: end;
  border-bottom: 1px solid var(--border);
}

.account-form-actions {
  display: flex;
  gap: 8px;
}

.account-form .form-message {
  grid-column: 1 / -1;
}

.account-table-wrap {
  max-height: 360px;
}

.is-hidden {
  display: none;
}

@media (max-width: 980px) {
  .voucher-pagination {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
  }

  .pagination-page-meta {
    text-align: center;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
  }

  .nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .sidebar-note {
    display: none;
  }

  .user-panel {
    margin-top: 0;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rate-page-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .rate-page-meta {
    text-align: left;
    white-space: normal;
  }

  .rate-overview {
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap {
    max-height: 60vh;
  }
}

@media (max-width: 620px) {
  .pagination-controls {
    flex-wrap: wrap;
  }

  .pagination-text-button {
    min-width: 48px;
    padding: 0 7px;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .nav-item {
    justify-content: center;
    padding: 9px 6px;
    font-size: 12px;
  }

  .controls,
  .kpi-grid,
  .rate-overview {
    grid-template-columns: 1fr;
  }

  .rate-chart-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .subnav {
    overflow-x: auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 280px;
  }

  .login-brand h1 {
    font-size: 28px;
  }

  .account-form {
    grid-template-columns: 1fr;
  }
}
