:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #66716d;
  --soft: #8a938f;
  --line: #d9ded8;
  --line-strong: #bdc6bf;
  --paper: #ffffff;
  --canvas: #f2f4ef;
  --canvas-deep: #e9ede7;
  --forest: #204f47;
  --forest-dark: #173c36;
  --forest-soft: #e1ede8;
  --clay: #aa4f36;
  --clay-soft: #f6e7e1;
  --blue: #38667b;
  --blue-soft: #e5eef2;
  --amber: #9d6b1f;
  --amber-soft: #f7efd9;
  --danger: #9c3737;
  --danger-soft: #f8e6e5;
  --success: #2f6e4d;
  --success-soft: #e3f0e9;
  --shadow: 0 10px 30px rgb(25 41 36 / 8%);
  --sidebar-width: 242px;
  font-family: "Segoe UI", "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
}

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

button {
  color: inherit;
}

a {
  color: var(--forest);
}

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

h1,
h2,
h3,
strong {
  font-weight: 650;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.subtle {
  color: var(--soft);
}

.nowrap {
  white-space: nowrap;
}

.text-right {
  text-align: right;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 7px;
  color: #fff;
  background: var(--clay);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.brand-mark-large {
  width: 60px;
  height: 60px;
  border-color: rgb(255 255 255 / 38%);
  font-size: 38px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 13px;
  background: transparent;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

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

.button:hover {
  text-decoration: none;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  border-color: var(--forest);
  color: #fff;
  background: var(--forest);
}

.button-primary:hover {
  border-color: var(--forest-dark);
  background: var(--forest-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--paper);
}

.button-secondary:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.button-ghost {
  color: var(--forest);
  background: transparent;
}

.button-ghost:hover {
  background: var(--forest-soft);
}

.button-danger {
  border-color: #d9b7b4;
  color: var(--danger);
  background: var(--danger-soft);
}

.button-danger:hover {
  border-color: var(--danger);
}

.button-small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.button-wide {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--canvas);
}

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

.text-button {
  border: 0;
  padding: 2px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.text-button.is-active {
  color: var(--forest);
  font-weight: 700;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(380px, 1.05fr) minmax(420px, 0.95fr);
  background: var(--paper);
}

.auth-brand {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  gap: 54px;
  padding: clamp(40px, 7vw, 100px);
  color: #fff;
  background-color: var(--forest-dark);
  background-image:
    linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 42px 42px;
}

.auth-brand .eyebrow {
  color: #c8d9d4;
}

.auth-brand h1 {
  max-width: 650px;
  margin-bottom: 18px;
  font-family: Georgia, "Microsoft JhengHei", serif;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.1;
}

.auth-brand h1 small {
  display: block;
  margin-top: 14px;
  color: #d9e5e1;
  font-family: "Segoe UI", "Microsoft JhengHei", sans-serif;
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 500;
  line-height: 1.35;
}

.auth-description {
  max-width: 540px;
  margin: 0;
  color: #d1dfdb;
  font-size: 16px;
  line-height: 1.75;
}

.auth-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 25px;
  color: #c3d5d0;
  font-size: 12px;
}

.auth-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.auth-meta svg {
  width: 16px;
  height: 16px;
}

.auth-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 80px 32px 44px;
  background: var(--canvas);
}

.auth-language {
  position: absolute;
  top: 30px;
  right: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
}

.login-card {
  width: min(100%, 410px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-heading {
  margin-bottom: 26px;
}

.login-heading h2 {
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.2;
}

.login-heading p,
.login-footnote {
  color: var(--muted);
}

.login-heading p {
  margin-bottom: 0;
}

.login-footnote {
  margin: 22px 0 0;
  font-size: 12px;
  text-align: center;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  color: var(--forest);
  font-weight: 700;
}

.stack-form {
  display: grid;
  gap: 17px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span,
.field-label {
  color: #44504c;
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgb(32 79 71 / 10%);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  color: var(--muted);
  background: var(--canvas);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 44px;
}

.password-field .icon-button {
  position: absolute;
  top: 2px;
  right: 3px;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
  background: var(--canvas);
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #edf4f1;
  background: var(--forest-dark);
}

.sidebar-brand {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  padding: 18px 20px;
}

.sidebar-brand strong {
  display: block;
  font-size: 15px;
}

.sidebar-brand span {
  display: block;
  margin-top: 2px;
  color: #abc1bb;
  font-size: 11px;
}

.main-nav {
  display: grid;
  gap: 3px;
  padding: 18px 12px;
}

.nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 12px;
  color: #c7d7d3;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  color: #9fb7b1;
}

.nav-item:hover {
  color: #fff;
  background: rgb(255 255 255 / 7%);
}

.nav-item.is-active {
  border-color: rgb(255 255 255 / 9%);
  color: #fff;
  background: rgb(255 255 255 / 11%);
}

.nav-item.is-active svg {
  color: #f2b09d;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid rgb(255 255 255 / 10%);
  padding: 16px;
}

.sidebar-footer .icon-button {
  color: #bdd0cb;
}

.sidebar-footer .icon-button:hover {
  border-color: rgb(255 255 255 / 15%);
  background: rgb(255 255 255 / 8%);
}

.sidebar-user {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.sidebar-user > div {
  min-width: 0;
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  max-width: 132px;
  font-size: 12px;
}

.sidebar-user > div span {
  color: #a9bfb9;
  font-size: 10px;
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #446e65;
  font-size: 11px;
  font-weight: 700;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 13px clamp(20px, 3.3vw, 46px);
  background: rgb(250 251 248 / 94%);
  backdrop-filter: blur(8px);
}

.page-heading {
  min-width: 0;
}

.page-heading h1 {
  overflow: hidden;
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.language-switch {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 2px;
  background: var(--paper);
}

.language-switch button {
  min-width: 34px;
  min-height: 29px;
  border: 0;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.language-switch button.is-active {
  color: #fff;
  background: var(--forest);
}

.mobile-menu {
  display: none;
}

.main-content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px) clamp(16px, 3.3vw, 46px) 64px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.page-actions h2 {
  margin: 0;
  font-size: 18px;
}

.page-actions p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  position: relative;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 20px;
  background: var(--paper);
}

.stat::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 7px 0 0 7px;
  background: var(--forest);
  content: "";
}

.stat:nth-child(2)::before {
  background: var(--blue);
}

.stat:nth-child(3)::before {
  background: var(--clay);
}

.stat:nth-child(4)::before {
  background: var(--amber);
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 6px;
  color: var(--forest);
  background: var(--forest-soft);
}

.stat:nth-child(2) .stat-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat:nth-child(3) .stat-icon {
  color: var(--clay);
  background: var(--clay-soft);
}

.stat:nth-child(4) .stat-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.stat svg {
  width: 18px;
  height: 18px;
}

.stat strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

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

.panel-header h3 {
  margin: 0;
  font-size: 14px;
}

.panel-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-body {
  padding: 16px;
}

.panel-body.flush {
  padding: 0;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.quick-action {
  display: flex;
  min-height: 74px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: var(--paper);
  text-align: left;
  cursor: pointer;
}

.quick-action:hover {
  border-color: var(--forest);
  background: #fafcf9;
}

.quick-action svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--forest);
}

.quick-action strong {
  display: block;
  font-size: 12px;
}

.quick-action span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px;
  background: var(--paper);
}

.toolbar .field {
  flex: 1 1 155px;
}

.toolbar .field-search {
  flex-basis: min(360px, 100%);
}

.toolbar .field-auto {
  flex: 0 0 auto;
}

.search-input {
  position: relative;
}

.search-input svg {
  position: absolute;
  top: 11px;
  left: 11px;
  width: 17px;
  height: 17px;
  color: var(--soft);
  pointer-events: none;
}

.search-input input {
  padding-left: 35px;
}

.checkbox-field {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 8px;
  color: #44504c;
  font-size: 12px;
  font-weight: 650;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--forest);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: var(--muted);
  background: #f6f7f3;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfcf9;
}

.data-table tbody tr.is-clickable {
  cursor: pointer;
}

.data-table .cell-main {
  min-width: 170px;
  font-weight: 650;
}

.data-table .cell-main small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.data-table .cell-actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

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

.table-empty svg {
  width: 28px;
  height: 28px;
  margin: 0 auto 10px;
  color: var(--soft);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

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

.page-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--muted);
  background: var(--canvas);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-green {
  border-color: #bdd7c7;
  color: var(--success);
  background: var(--success-soft);
}

.badge-red {
  border-color: #e3c1bd;
  color: var(--danger);
  background: var(--danger-soft);
}

.badge-blue {
  border-color: #bdcfd8;
  color: var(--blue);
  background: var(--blue-soft);
}

.badge-amber {
  border-color: #dfce9f;
  color: var(--amber);
  background: var(--amber-soft);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.detail-title {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.detail-title h2 {
  margin: 0 0 5px;
  font-size: 24px;
  line-height: 1.25;
}

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

.detail-monogram {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--forest);
  background: var(--forest-soft);
  font-size: 18px;
  font-weight: 750;
}

.tabs {
  display: flex;
  overflow: auto;
  gap: 2px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 18px;
}

.tab {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.tab:hover {
  color: var(--forest);
}

.tab.is-active {
  border-bottom-color: var(--forest);
  color: var(--forest);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.75fr);
  gap: 16px;
}

.detail-stack {
  display: grid;
  gap: 16px;
}

.info-section h3 {
  margin-bottom: 12px;
  font-size: 13px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px 16px;
}

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

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

.detail-field {
  min-width: 0;
  border-bottom: 1px solid #edf0eb;
  padding-bottom: 9px;
}

.detail-field > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.detail-field > strong,
.detail-field > a {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 550;
}

.notes-box {
  min-height: 60px;
  color: var(--ink);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.relation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.relation-summary strong {
  font-size: 13px;
}

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

.empty-state svg {
  width: 30px;
  height: 30px;
  margin: 0 auto 10px;
  color: var(--soft);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #ddd3b5;
  border-radius: 6px;
  padding: 11px 13px;
  color: #6f5727;
  background: #fbf6e9;
  font-size: 12px;
}

.notice svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.notice.success {
  border-color: #bdd7c7;
  color: var(--success);
  background: var(--success-soft);
}

.notice.danger {
  border-color: #e3c1bd;
  color: var(--danger);
  background: var(--danger-soft);
}

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

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.report-metric {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 17px;
  background: var(--paper);
}

.report-metric span {
  color: var(--muted);
  font-size: 11px;
}

.report-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.bar-list {
  display: grid;
  gap: 11px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(120px, 1.2fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.bar-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  overflow: hidden;
  height: 7px;
  border-radius: 4px;
  background: var(--canvas-deep);
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--forest);
}

.bar-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.newsletter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 16px;
}

.export-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 18px;
  background: var(--paper);
}

.export-card h3 {
  margin-bottom: 7px;
  font-size: 15px;
}

.export-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.export-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.history-list {
  display: grid;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 15px;
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item strong {
  display: block;
  font-size: 12px;
}

.history-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  background: var(--paper);
}

.settings-nav button {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 5px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.settings-nav button svg {
  width: 16px;
  height: 16px;
}

.settings-nav button:hover {
  color: var(--forest);
  background: var(--canvas);
}

.settings-nav button.is-active {
  color: var(--forest);
  background: var(--forest-soft);
  font-weight: 650;
}

.settings-content {
  min-width: 0;
}

.settings-content > .panel + .panel {
  margin-top: 16px;
}

.form-section {
  margin-bottom: 24px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section h3 {
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 8px;
  color: var(--forest);
  font-size: 13px;
}

.form-section h3:not(:first-child) {
  margin-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .span-3 {
  grid-column: span 3;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 16px;
}

.modal {
  width: min(860px, calc(100vw - 34px));
  max-height: calc(100vh - 34px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 70px rgb(20 34 30 / 22%);
}

.modal[data-size="small"] {
  width: min(480px, calc(100vw - 34px));
}

.modal[data-size="wide"] {
  width: min(1100px, calc(100vw - 34px));
}

.modal[data-size="full"] {
  width: min(1280px, calc(100vw - 34px));
}

.modal::backdrop {
  background: rgb(15 27 24 / 46%);
  backdrop-filter: blur(2px);
}

.modal-header {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 13px 20px;
  background: var(--paper);
}

.modal-header h2 {
  margin: 0;
  font-size: 19px;
}

.modal-body {
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 20px;
}

.suggestion-box {
  position: relative;
}

.suggestions {
  position: absolute;
  z-index: 9;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 250px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.suggestion {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 9px 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion:hover {
  background: var(--canvas);
}

.suggestion strong {
  display: block;
  font-size: 12px;
}

.suggestion span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.donation-items {
  display: grid;
  gap: 8px;
}

.donation-item-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(115px, 0.4fr) 36px;
  gap: 8px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.amount {
  font-variant-numeric: tabular-nums;
}

.amount-total {
  margin: 14px 0 0;
  text-align: right;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(360px, calc(100vw - 44px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #b8cbc5;
  border-radius: 6px;
  padding: 12px 14px;
  color: #edf6f2;
  background: var(--forest-dark);
  box-shadow: var(--shadow);
  font-size: 12px;
  pointer-events: auto;
  animation: toast-in 150ms ease-out;
}

.toast.error {
  border-color: #d8a9a5;
  background: #7b2b2b;
}

.toast svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.loading-bar {
  position: fixed;
  z-index: 120;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: #d6d8d2;
}

.loading-bar::after {
  display: block;
  width: 34%;
  height: 100%;
  background: var(--clay);
  content: "";
  animation: loading 1s ease-in-out infinite;
}

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

.skeleton {
  height: 110px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(90deg, #eef0eb 20%, #f8f9f6 50%, #eef0eb 80%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.error-page {
  max-width: 620px;
  border: 1px solid #e3c1bd;
  border-radius: 7px;
  padding: 22px;
  color: var(--danger);
  background: var(--danger-soft);
}

.error-page h2 {
  font-size: 17px;
}

.sidebar-backdrop {
  display: none;
}

@keyframes loading {
  from { transform: translateX(-110%); }
  to { transform: translateX(390%); }
}

@keyframes shimmer {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Legacy operations theme */
:root {
  --ink: #151515;
  --muted: #4f5356;
  --soft: #6d7072;
  --line: #898b8b;
  --line-strong: #5a5d5e;
  --paper: #f8f6f1;
  --canvas: #d3cfc7;
  --canvas-deep: #c4c0b8;
  --forest: #0a246a;
  --forest-dark: #061742;
  --forest-soft: #dbe3f3;
  --clay: #8a2525;
  --clay-soft: #f2dddd;
  --blue: #0a246a;
  --blue-soft: #dbe3f3;
  --amber: #705700;
  --amber-soft: #f3edcf;
  --danger: #861d1d;
  --danger-soft: #f3dede;
  --success: #205b31;
  --success-soft: #e0eee2;
  --shadow: 2px 2px 0 rgb(38 38 38 / 32%);
  --sidebar-width: 224px;
  font-family: Tahoma, "MS Sans Serif", "Microsoft JhengHei", Arial, sans-serif;
}

html,
body,
.app-shell {
  background: var(--canvas);
}

body {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

button,
input,
select,
textarea {
  font-family: Tahoma, "MS Sans Serif", "Microsoft JhengHei", Arial, sans-serif;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 1px dotted #111;
  outline-offset: 1px;
}

h1,
h2,
h3,
strong {
  font-weight: 700;
}

.eyebrow {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid #111;
  border-radius: 0;
  color: var(--forest);
  background: #f6f1e3;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #777;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 22px;
}

.brand-mark-large {
  width: 54px;
  height: 54px;
  font-size: 34px;
}

.button {
  min-height: 28px;
  gap: 5px;
  border: 1px solid #555;
  border-top-color: #fff;
  border-left-color: #fff;
  border-radius: 0;
  padding: 4px 9px;
  color: #111;
  background: #e5e1d8;
  box-shadow: inset 1px 1px 0 #fff;
  font-size: 11px;
  font-weight: 700;
}

.button svg {
  width: 14px;
  height: 14px;
}

.button:hover {
  border-color: #555;
  border-top-color: #fff;
  border-left-color: #fff;
  color: #111;
  background: #f5f1e8;
}

.button:active {
  border-color: #555;
  border-top-color: #555;
  border-left-color: #555;
  border-right-color: #fff;
  border-bottom-color: #fff;
  box-shadow: inset 1px 1px 0 rgb(0 0 0 / 24%);
}

.button-primary {
  border-color: #00123b;
  border-top-color: #6177a8;
  border-left-color: #6177a8;
  color: #fff;
  background: #0a246a;
}

.button-primary:hover {
  border-color: #00123b;
  border-top-color: #7f92bd;
  border-left-color: #7f92bd;
  color: #fff;
  background: #173b8f;
}

.button-secondary,
.button-ghost {
  color: #111;
  background: #e5e1d8;
}

.button-ghost {
  border-color: transparent;
  box-shadow: none;
}

.button-ghost:hover {
  border-color: #777;
  color: #111;
  background: #f4f1e9;
}

.button-danger {
  border-color: #5d1919;
  color: #fff;
  background: #8a2525;
}

.button-danger:hover {
  color: #fff;
  background: #a52c2c;
}

.button-small {
  min-height: 23px;
  padding: 2px 7px;
  font-size: 10px;
}

.icon-button {
  width: 28px;
  height: 27px;
  border-color: transparent;
  border-radius: 0;
}

.icon-button:hover {
  border-color: #777;
  background: #f2eee5;
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

.auth-page {
  min-height: 100vh;
  background: #d3cfc7;
}

.auth-brand {
  gap: 30px;
  border-right: 2px solid #4b4b4b;
  padding: clamp(30px, 5vw, 70px);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 8%), transparent 36%),
    #0a246a;
  background-size: auto, auto;
}

.auth-brand h1,
.auth-description,
.auth-meta,
.auth-language {
  color: #fff;
}

.auth-brand .eyebrow {
  color: #c8d4ef;
}

.auth-brand h1 small {
  margin-top: 9px;
  color: #d8e0f3;
  font-family: Tahoma, "Microsoft JhengHei", Arial, sans-serif;
  font-size: clamp(13px, 1.3vw, 18px);
  font-weight: 400;
}

.auth-description {
  color: #e1e7f5;
  font-size: 13px;
  line-height: 1.55;
}

.auth-brand h1 {
  font-family: Tahoma, "Microsoft JhengHei", Arial, sans-serif;
  font-size: clamp(27px, 3.5vw, 42px);
  line-height: 1.08;
  text-shadow: 1px 1px 0 #000;
}

.auth-meta {
  font-size: 10px;
}

.auth-meta span {
  border-color: rgb(255 255 255 / 30%);
  padding: 4px 6px;
  background: rgb(0 0 0 / 12%);
}

.auth-panel {
  background:
    linear-gradient(90deg, rgb(255 255 255 / 14%) 1px, transparent 1px),
    linear-gradient(rgb(255 255 255 / 14%) 1px, transparent 1px),
    #d3cfc7;
  background-size: 4px 4px;
}

.login-card {
  border: 1px solid #555;
  border-top-color: #fff;
  border-left-color: #fff;
  border-radius: 0;
  background: #f7f4ed;
  box-shadow: 3px 3px 0 rgb(33 33 33 / 34%);
}

.login-heading h2 {
  border-bottom: 1px solid #999;
  margin-bottom: 14px;
  padding-bottom: 7px;
  color: #0a246a;
  font-size: 19px;
}

.login-heading p,
.login-footnote {
  color: #4f5356;
  font-size: 11px;
}

.sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid #454545;
  color: #111;
  background: #e3dfd7;
  box-shadow: inset -1px 0 0 rgb(255 255 255 / 45%);
}

.sidebar-brand {
  min-height: 66px;
  border-bottom: 1px solid #161616;
  padding: 12px 10px;
  color: #fff;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 15%), transparent 45%),
    #0a246a;
}

.sidebar-brand strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.sidebar-brand span {
  color: #d2dcf2;
  font-size: 10px;
}

.main-nav {
  gap: 0;
  border-bottom: 1px solid #8b8881;
  padding: 5px 4px 10px;
}

.nav-item {
  min-height: 29px;
  gap: 7px;
  border: 1px solid transparent;
  border-bottom-color: #c5c1b9;
  border-radius: 0;
  padding: 4px 7px;
  color: #161616;
  background: #efede7;
  font-size: 11px;
  font-weight: 700;
}

.nav-item svg {
  width: 14px;
  height: 14px;
  color: #0a246a;
}

.nav-item:hover {
  border-color: #7d7d7d;
  color: #111;
  background: #f7f4ed;
}

.nav-item.is-active {
  border-color: #00113a;
  border-top-color: #6379aa;
  border-left-color: #6379aa;
  color: #fff;
  background: #0a246a;
}

.nav-item.is-active svg {
  color: #fff;
}

.sidebar-footer {
  border-top: 1px solid #79766f;
  background: #d7d3cb;
  padding: 8px;
}

.sidebar-footer .icon-button {
  color: #111;
}

.sidebar-user strong {
  font-size: 11px;
}

.sidebar-user > div span {
  color: #53575a;
  font-size: 10px;
}

.avatar {
  width: 27px;
  height: 27px;
  border: 1px solid #555;
  border-radius: 0;
  color: #fff;
  background: #0a246a;
  font-size: 10px;
}

.workspace {
  margin-left: var(--sidebar-width);
}

.topbar {
  display: grid;
  min-height: 87px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 10px;
  border-bottom: 2px solid #454545;
  padding: 5px 8px 0;
  color: #fff;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 16%), transparent 44%),
    #0a246a;
  backdrop-filter: none;
}

.page-heading {
  padding: 2px 4px;
}

.page-heading .eyebrow {
  color: #c8d4ef;
  font-size: 9px;
}

.page-heading h1 {
  color: #fff;
  font-size: 17px;
  line-height: 1.15;
  text-shadow: 1px 1px 0 #000;
}

.topbar-actions {
  gap: 5px;
}

.language-switch {
  border: 1px solid #444;
  border-top-color: #fff;
  border-left-color: #fff;
  border-radius: 0;
  padding: 1px;
  background: #ddd9d0;
}

.language-switch button {
  min-width: 28px;
  min-height: 21px;
  border-radius: 0;
  color: #111;
  background: transparent;
  font-size: 10px;
}

.language-switch button.is-active {
  color: #fff;
  background: #0a246a;
}

.legacy-commandbar {
  display: flex;
  min-width: 0;
  grid-column: 1 / -1;
  align-items: center;
  gap: 1px;
  overflow-x: auto;
  border-top: 1px solid #fff;
  border-right: 1px solid #4e4e4e;
  border-bottom: 1px solid #4e4e4e;
  border-left: 1px solid #fff;
  padding: 1px 3px;
  background: #d9d4ca;
}

.legacy-command {
  display: inline-flex;
  min-height: 23px;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 2px 7px;
  color: #111;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.legacy-command svg {
  width: 12px;
  height: 12px;
  color: #0a246a;
}

.legacy-command:hover {
  border-color: #777;
  border-top-color: #fff;
  border-left-color: #fff;
  background: #efebe2;
}

.legacy-command.is-active {
  color: #fff;
  background: #0a246a;
}

.legacy-command.is-active svg {
  color: #fff;
}

.legacy-command-logout {
  margin-left: auto;
}

.mobile-menu {
  color: #fff;
  background: transparent;
}

.mobile-menu:hover {
  border-color: rgb(255 255 255 / 50%);
  background: rgb(255 255 255 / 10%);
}

.main-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 10px 38px;
}

.page-actions {
  min-height: 42px;
  gap: 8px;
  border: 1px solid #676767;
  border-top-color: #fff;
  border-left-color: #fff;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #efede7;
  box-shadow: inset 1px 1px 0 #fff;
}

.page-actions h2 {
  color: #111;
  font-size: 14px;
}

.page-actions p {
  margin-top: 1px;
  color: #4f5356;
  font-size: 10px;
}

.action-group {
  gap: 4px;
}

.stats-grid {
  gap: 6px;
  margin-bottom: 8px;
}

.stat {
  min-height: 86px;
  border: 1px solid #666;
  border-top-color: #fff;
  border-left-color: #fff;
  border-radius: 0;
  padding: 9px 11px;
  background: #f7f4ed;
  box-shadow: inset 1px 1px 0 #fff;
}

.stat::before {
  display: none;
}

.stat-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 25px;
  height: 25px;
  border: 1px solid #808080;
  border-radius: 0;
  color: #0a246a;
  background: #dce4f3;
}

.stat svg {
  width: 14px;
  height: 14px;
}

.stat strong {
  margin-top: 8px;
  color: #0a246a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 22px;
}

.stat span {
  margin-top: 3px;
  color: #404448;
  font-size: 10px;
}

.dashboard-grid,
.detail-grid,
.newsletter-grid,
.breakdown-grid {
  gap: 8px;
}

.panel,
.report-metric,
.export-card,
.settings-nav {
  border: 1px solid #676767;
  border-top-color: #fff;
  border-left-color: #fff;
  border-radius: 0;
  background: #f8f6f1;
  box-shadow: inset 1px 1px 0 #fff;
}

.panel-header {
  min-height: 34px;
  gap: 7px;
  border-bottom: 1px solid #858585;
  padding: 5px 8px;
  background: linear-gradient(180deg, #f3f1eb, #d8d3ca);
}

.panel-header h3 {
  color: #111;
  font-size: 11px;
}

.panel-header p {
  margin-top: 1px;
  color: #4c5053;
  font-size: 9px;
}

.panel-body {
  padding: 9px;
}

.panel-body.flush {
  padding: 0;
}

.quick-actions {
  gap: 5px;
}

.quick-action {
  min-height: 56px;
  gap: 7px;
  border: 1px solid #929292;
  border-top-color: #fff;
  border-left-color: #fff;
  border-radius: 0;
  padding: 7px;
  background: #eeeae1;
}

.quick-action:hover {
  border-color: #0a246a;
  color: #fff;
  background: #0a246a;
}

.quick-action:hover svg,
.quick-action:hover span {
  color: #fff;
}

.quick-action svg {
  width: 16px;
  height: 16px;
  color: #0a246a;
}

.quick-action strong {
  font-size: 10px;
}

.quick-action span {
  margin-top: 2px;
  color: #4c5053;
  font-size: 9px;
}

.field {
  gap: 3px;
}

.field > span,
.field-label {
  color: #383c3f;
  font-size: 10px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.input {
  min-height: 27px;
  border: 1px solid #666;
  border-top-color: #333;
  border-left-color: #333;
  border-radius: 0;
  padding: 3px 5px;
  color: #111;
  background: #fff;
  font-size: 11px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: #0a246a;
  box-shadow: none;
  outline: 1px dotted #0a246a;
  outline-offset: -3px;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  color: #555;
  background: #e6e2da;
}

.search-input svg {
  top: 6px;
  left: 6px;
  width: 13px;
  height: 13px;
}

.search-input input {
  padding-left: 23px;
}

.checkbox-field {
  min-height: 27px;
  gap: 5px;
  color: #222;
  font-size: 10px;
}

.checkbox-field input {
  width: 13px;
  height: 13px;
  accent-color: #0a246a;
}

.toolbar {
  align-items: end;
  gap: 5px;
  border: 1px solid #666;
  border-top-color: #fff;
  border-left-color: #fff;
  border-radius: 0;
  margin-bottom: 7px;
  padding: 6px;
  background: #efede7;
}

.toolbar .field {
  flex-basis: 135px;
}

.toolbar .field-search {
  flex-basis: min(320px, 100%);
}

.table-wrap {
  border: 1px solid #555;
  border-radius: 0;
  background: #fff;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 10px;
}

.data-table th,
.data-table td {
  border-right: 1px solid #a4a4a4;
  border-bottom: 1px solid #a4a4a4;
  padding: 4px 6px;
  vertical-align: top;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.data-table th {
  top: 0;
  color: #111;
  background: linear-gradient(180deg, #f0ede6, #d2cdc3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.data-table tbody tr:nth-child(even) {
  background: #f3f1eb;
}

.data-table tbody tr:hover {
  color: #111;
  background: #dfe7f7;
}

.data-table tbody tr:last-child td {
  border-bottom: 1px solid #a4a4a4;
}

.data-table .cell-main {
  min-width: 125px;
  font-weight: 700;
}

.data-table .cell-main small {
  margin-top: 0;
  color: #565a5d;
  font-size: 9px;
}

.data-table .cell-actions {
  background: #f3f0e9;
}

.pagination {
  gap: 5px;
  margin-top: 5px;
}

.pagination span {
  color: #414548;
  font-size: 10px;
}

.page-buttons {
  gap: 3px;
}

.badge {
  min-height: 17px;
  border: 1px solid #777;
  border-radius: 0;
  padding: 1px 4px;
  color: #222;
  background: #ebe8e1;
  font-size: 9px;
}

.badge-green {
  border-color: #66866c;
  color: #205b31;
  background: #e0eee2;
}

.badge-red {
  border-color: #9b6c6c;
  color: #861d1d;
  background: #f3dede;
}

.badge-blue {
  border-color: #7285b3;
  color: #0a246a;
  background: #dbe3f3;
}

.badge-amber {
  border-color: #9c8b4f;
  color: #705700;
  background: #f3edcf;
}

.detail-title h2 {
  color: #0a246a;
  font-size: 18px;
}

.detail-title p {
  font-size: 10px;
}

.detail-monogram {
  width: 36px;
  height: 36px;
  border: 1px solid #666;
  border-radius: 0;
  color: #fff;
  background: #0a246a;
  font-size: 14px;
}

.tabs {
  gap: 2px;
  border-bottom: 1px solid #666;
  margin-bottom: 8px;
}

.tab {
  border: 1px solid #8b8b8b;
  border-bottom-color: transparent;
  margin-bottom: -1px;
  padding: 5px 10px;
  color: #222;
  background: #dfdbd2;
  font-size: 10px;
}

.tab:hover {
  color: #0a246a;
  background: #f1eee7;
}

.tab.is-active {
  border-color: #555;
  border-bottom-color: #f8f6f1;
  color: #0a246a;
  background: #f8f6f1;
  font-weight: 700;
}

.field-grid {
  gap: 6px 12px;
}

.detail-field {
  border-bottom: 1px solid #c3c0b9;
  padding-bottom: 5px;
}

.detail-field > span {
  margin-bottom: 2px;
  color: #4b4f52;
  font-size: 9px;
  text-transform: none;
}

.detail-field > strong,
.detail-field > a {
  color: #111;
  font-size: 11px;
  font-weight: 400;
}

.notes-box {
  min-height: 46px;
  font-size: 11px;
}

.notice {
  gap: 7px;
  border: 1px solid #8f814f;
  border-radius: 0;
  padding: 7px 8px;
  color: #4e3f08;
  background: #f5efd2;
  font-size: 10px;
}

.notice svg {
  width: 14px;
  height: 14px;
}

.notice.success {
  border-color: #67866d;
  color: #205b31;
  background: #e0eee2;
}

.notice.danger {
  border-color: #9b6c6c;
  color: #861d1d;
  background: #f3dede;
}

.report-summary {
  gap: 6px;
  margin-bottom: 8px;
}

.report-metric {
  padding: 8px 10px;
}

.report-metric span {
  color: #3e4245;
  font-size: 9px;
}

.report-metric strong {
  margin-top: 3px;
  color: #0a246a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 21px;
}

.bar-list {
  gap: 6px;
}

.bar-row {
  gap: 6px;
  font-size: 9px;
}

.bar-track {
  height: 8px;
  border: 1px solid #777;
  border-radius: 0;
  padding: 1px;
  background: #e1ddd5;
}

.bar-fill {
  border-radius: 0;
  background: #0a246a;
}

.export-card {
  padding: 10px;
}

.export-card h3 {
  font-size: 12px;
}

.export-card p {
  font-size: 10px;
}

.history-item {
  border-bottom-color: #b5b2ab;
  padding: 6px 8px;
}

.history-item strong {
  font-size: 10px;
}

.history-item span {
  font-size: 9px;
}

.settings-layout {
  grid-template-columns: 165px minmax(0, 1fr);
  gap: 8px;
}

.settings-nav {
  gap: 1px;
  padding: 3px;
}

.settings-nav button {
  min-height: 28px;
  gap: 5px;
  border: 1px solid transparent;
  border-bottom-color: #c3c0b9;
  border-radius: 0;
  padding: 4px 6px;
  color: #111;
  background: #efede7;
  font-size: 10px;
  font-weight: 700;
}

.settings-nav button svg {
  width: 13px;
  height: 13px;
  color: #0a246a;
}

.settings-nav button:hover {
  border-color: #777;
  color: #111;
  background: #f8f5ee;
}

.settings-nav button.is-active {
  border-color: #00113a;
  border-top-color: #6379aa;
  border-left-color: #6379aa;
  color: #fff;
  background: #0a246a;
}

.settings-nav button.is-active svg {
  color: #fff;
}

.settings-content > .panel + .panel {
  margin-top: 8px;
}

.form-section {
  margin-bottom: 14px;
}

.form-section h3 {
  border-bottom-color: #969696;
  margin-bottom: 8px;
  padding-bottom: 4px;
  color: #0a246a;
  font-size: 11px;
}

.form-grid {
  gap: 6px 9px;
}

.form-actions {
  gap: 4px;
  border-top-color: #aaa7a0;
  margin-top: 10px;
  padding-top: 8px;
}

.receipt-sequence-table-wrap {
  margin-top: 8px;
}

.receipt-sequence-table code,
.receipt-preview strong {
  color: #0a246a;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
}

.receipt-sequence-editor {
  border-top: 1px solid #777;
  background: #e9e5dd;
}

.receipt-preview {
  display: grid;
  max-width: 430px;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 2px 10px;
  border: 1px solid #555;
  border-top-color: #333;
  border-left-color: #333;
  margin-top: 9px;
  padding: 8px;
  background: #fff;
}

.receipt-preview > span {
  color: #4c5053;
  font-size: 10px;
}

.receipt-preview strong {
  font-size: 21px;
  line-height: 1;
}

.receipt-preview p {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  color: #3f5c42;
  font-size: 9px;
}

.receipt-preview p.is-error {
  color: #861d1d;
}

.modal {
  border: 1px solid #333;
  border-top-color: #fff;
  border-left-color: #fff;
  border-radius: 0;
  background: #f4f1ea;
  box-shadow: 4px 4px 0 rgb(24 24 24 / 38%);
}

.modal::backdrop {
  background: rgb(0 0 0 / 38%);
  backdrop-filter: none;
}

.modal-header {
  min-height: 33px;
  border-bottom: 1px solid #444;
  padding: 4px 5px 4px 8px;
  color: #fff;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 16%), transparent 45%),
    #0a246a;
}

.modal-header .eyebrow {
  display: none;
}

.modal-header h2 {
  color: #fff;
  font-size: 12px;
}

.modal-header .icon-button {
  color: #fff;
}

.modal-header .icon-button:hover {
  border-color: rgb(255 255 255 / 55%);
  background: rgb(255 255 255 / 12%);
}

.modal-body {
  max-height: calc(100vh - 74px);
  padding: 10px;
  background: #f4f1ea;
}

.suggestions {
  border-color: #555;
  border-radius: 0;
  background: #fff;
  box-shadow: 2px 2px 0 rgb(0 0 0 / 25%);
}

.suggestion {
  border-bottom-color: #aaa7a0;
  padding: 5px 7px;
}

.suggestion:hover {
  background: #dfe7f7;
}

.suggestion strong {
  font-size: 10px;
}

.suggestion span {
  font-size: 9px;
}

.donation-item-row {
  gap: 4px;
}

.amount-total {
  margin-top: 8px;
  color: #0a246a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 16px;
}

.toast-region {
  right: 12px;
  bottom: 12px;
  gap: 4px;
  width: min(330px, calc(100vw - 24px));
}

.toast {
  gap: 6px;
  border: 1px solid #fff;
  border-radius: 0;
  padding: 7px 8px;
  color: #fff;
  background: #0a246a;
  box-shadow: 2px 2px 0 rgb(0 0 0 / 35%);
  font-size: 10px;
}

.toast svg {
  width: 14px;
  height: 14px;
}

.loading-bar {
  height: 2px;
  background: #d1cdc5;
}

.loading-bar::after {
  background: #0a246a;
}

.skeleton-grid {
  gap: 6px;
}

.skeleton {
  height: 82px;
  border: 1px solid #777;
  border-radius: 0;
  background: linear-gradient(90deg, #e1ddd5 20%, #f4f1ea 50%, #e1ddd5 80%);
  background-size: 200% 100%;
}

.error-page {
  border: 1px solid #862d2d;
  border-radius: 0;
  padding: 12px;
  background: #f3dede;
}

.error-page h2 {
  font-size: 13px;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .newsletter-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .form-grid .span-3 {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-panel {
    padding: 76px 18px 30px;
  }

  .mobile-brand {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.is-open {
    position: fixed;
    z-index: 29;
    inset: 0;
    display: block;
    background: rgb(13 27 23 / 42%);
  }

  .workspace {
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    min-height: 70px;
    padding: 10px 14px;
  }

  .page-heading h1 {
    font-size: 19px;
  }

  .page-heading .eyebrow {
    display: none;
  }

  .topbar-actions .button span {
    display: none;
  }

  .topbar-actions .button {
    width: 38px;
    padding: 0;
  }

  .main-content {
    padding: 18px 14px 50px;
  }

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

  .settings-nav {
    display: flex;
    overflow: auto;
  }

  .settings-nav button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .detail-header {
    flex-direction: column;
  }

  .detail-header .action-group {
    width: 100%;
  }

  .detail-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .login-card {
    padding: 25px 20px;
  }

  .stats-grid,
  .report-summary,
  .breakdown-grid,
  .field-grid,
  .field-grid.two,
  .field-grid.four,
  .form-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2,
  .form-grid .span-3 {
    grid-column: span 1;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .stat {
    min-height: 96px;
    padding: 16px 18px 16px 20px;
  }

  .stat-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    margin: 0;
  }

  .stat strong {
    font-size: 23px;
  }

  .page-actions {
    align-items: stretch;
  }

  .page-actions .action-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .page-actions .button {
    width: 100%;
  }

  .toolbar .field {
    flex-basis: 100%;
  }

  .donation-item-row {
    grid-template-columns: 1fr 110px 34px;
  }

  .bar-row {
    grid-template-columns: minmax(80px, 1fr) 1fr;
  }

  .bar-row .bar-value {
    grid-column: span 2;
    text-align: right;
  }

  .modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .modal-header {
    padding: 11px 14px;
  }

  .modal-body {
    max-height: calc(100vh - 92px);
    padding: 14px;
  }

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

  .form-actions .button {
    width: 100%;
  }
}

@media print {
  .sidebar,
  .topbar,
  .page-actions,
  .toolbar,
  .button,
  .icon-button,
  .tabs {
    display: none !important;
  }

  .workspace {
    margin: 0;
  }

  .main-content {
    width: 100%;
    padding: 0;
  }

  .panel,
  .data-table,
  .table-wrap {
    border-color: #999;
  }
}
