:root {
  --bg: #f1ede1;
  --surface: #ffffff;
  --surface-soft: #fbf9f2;
  --ink: #1b1b17;
  --ink-soft: #5b564a;
  --muted: #948c79;
  --line: #e4dec9;
  --accent: #2e6f5c;
  --accent-dark: #204e41;
  --accent-soft: #e2eee7;
  --gold: #ad8a2e;
  --gold-soft: #f3e7c5;
  --danger: #b4432e;
  --danger-soft: #f5e3dd;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px -14px rgba(27, 27, 23, 0.16);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4 {
  font-family: "Fraunces", Georgia, serif;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
p {
  margin: 0;
}
a {
  color: inherit;
}
button {
  font-family: inherit;
  cursor: pointer;
}
input,
select {
  font-family: inherit;
}
.mono {
  font-family: "IBM Plex Mono", monospace;
}

/* Layout */
.shell {
  display: flex;
  min-height: 100vh;
}
.rail {
  width: 84px;
  flex-shrink: 0;
  background: var(--ink);
  border-radius: 0 28px 28px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 0 18px;
  gap: 8px;
}
.rail-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: #fff;
}
.rail-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: #948c79;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.rail-btn:hover {
  background: #2a2a24;
  color: #fff;
}
.rail-btn.active {
  background: var(--accent);
  color: #fff;
}
.rail-spacer {
  flex: 1;
}
.rail-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

.main {
  flex: 1;
  padding: 26px 34px 40px;
  max-width: 1280px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}
.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.topbar h1 {
  font-size: 26px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pill {
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.pill.paid {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: transparent;
}
.pill.unpaid {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.btn {
  border: none;
  border-radius: 100px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.grid {
  display: grid;
  gap: 20px;
}
.grid-2 {
  grid-template-columns: 1.3fr 1fr;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 920px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(27, 27, 23, 0.04);
}
.hero-card {
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-card h2 {
  color: #fff;
  font-size: 24px;
}
.hero-sub {
  color: #b9b4a4;
  font-size: 14px;
  margin-top: 6px;
}
.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  flex-wrap: wrap;
  gap: 16px;
}
.hero-amount {
  font-family: "Fraunces", serif;
  font-size: 38px;
  font-weight: 600;
}
.hero-amount span {
  font-size: 15px;
  color: #b9b4a4;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  font-family: "Fraunces", serif;
  font-size: 26px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title h3 {
  font-size: 17px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.field input,
.field select {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface-soft);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  width: 100%;
}
.field input:focus,
.field select:focus {
  border-color: var(--accent);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.errorlist {
  color: var(--danger);
  font-size: 12.5px;
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 14px 12px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td {
  border-bottom: none;
}
.table-wrap {
  overflow-x: auto;
}
.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 36px 12px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: 100px;
  padding: 10px 16px;
  flex: 1;
  min-width: 180px;
}
.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  width: 100%;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.select-plain {
  border: 1.5px solid var(--line);
  background: var(--surface-soft);
  border-radius: 100px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 880px;
  background: var(--surface);
  border-radius: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 760px) {
  .login-box {
    grid-template-columns: 1fr;
  }
}
.login-side {
  background: var(--ink);
  color: #fff;
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-side h1 {
  color: #fff;
  font-size: 28px;
  margin-top: 22px;
  line-height: 1.25;
}
.login-side p {
  color: #b9b4a4;
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.6;
}
.login-tag {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8f8a7a;
}
.login-main {
  padding: 44px 40px;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.messages li {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  margin-bottom: 8px;
  font-weight: 600;
}
.messages .success {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.messages .error {
  background: var(--danger-soft);
  color: var(--danger);
}
.messages .warning {
  background: var(--gold-soft);
  color: var(--gold);
}

/* Receipt */
.receipt {
  background: var(--surface);
  border-radius: 20px;
  padding: 26px;
  border: 1px solid var(--line);
}
.receipt-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1.5px dashed var(--line);
}
.receipt-org {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 16px;
}
.receipt-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.receipt-head-r {
  margin-left: auto;
  text-align: right;
}
.receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  padding: 18px 0;
}
.rg-item span {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 3px;
}
.rg-item strong {
  font-size: 14px;
  font-weight: 600;
}
.receipt-amount-box {
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 18px;
}
.receipt-amount-box span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
  font-weight: 700;
}
.receipt-amount-box strong {
  font-family: "Fraunces", serif;
  font-size: 24px;
  color: var(--accent-dark);
}
.signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-top: 18px;
  border-top: 1.5px dashed var(--line);
}
@media (max-width: 480px) {
  .signatures {
    grid-template-columns: 1fr;
  }
}
.sig-block {
  text-align: center;
}
.sig-script {
  font-family: "Caveat", cursive;
  font-size: 27px;
  line-height: 1;
  margin-bottom: 2px;
}
.sig-line {
  border-top: 1.3px solid var(--ink);
  margin: 6px 0 6px;
}
.sig-name {
  font-size: 11.5px;
  font-weight: 700;
}
.sig-title {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}
.receipt-foot {
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 18px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .shell {
    flex-direction: column;
  }
  .rail {
    width: 100%;
    flex-direction: row;
    border-radius: 0;
    padding: 12px 16px;
    justify-content: flex-start;
    gap: 6px;
  }
  .rail-logo {
    margin-bottom: 0;
    margin-right: 10px;
  }
  .rail-spacer {
    display: none;
  }
  .rail-avatar {
    margin-bottom: 0;
    margin-left: auto;
  }
  .main {
    padding: 20px 16px 90px;
  }
}
