:root {
  --bg: #f4eee5;
  --panel: rgba(255, 250, 242, 0.86);
  --panel-strong: rgba(255, 245, 232, 0.92);
  --text: #1d1915;
  --muted: #6b6157;
  --accent: #97501a;
  --accent-strong: #71390d;
  --line: rgba(31, 27, 23, 0.09);
  --good-bg: #e5f2e6;
  --good-text: #2f7a47;
  --bad-bg: #f8e3de;
  --bad-text: #ad5035;
  --shadow: 0 24px 54px rgba(88, 60, 31, 0.13);
  --shadow-soft: 0 14px 28px rgba(88, 60, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(151, 80, 26, 0.18), transparent 20%),
    radial-gradient(circle at top right, rgba(217, 137, 22, 0.12), transparent 18%),
    radial-gradient(circle at 75% 20%, rgba(47, 122, 71, 0.08), transparent 16%),
    linear-gradient(180deg, #f8f3eb 0%, var(--bg) 100%);
}

.page-shell {
  max-width: 1260px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 6px 0 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.topbar h1 a {
  color: inherit;
  text-decoration: none;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-form {
  margin: 0;
}

.topnav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid rgba(156, 79, 25, 0.16);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent);
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.button {
  cursor: pointer;
  font: inherit;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff8f1;
  border-color: var(--accent);
}

.hero,
.grid.two-up {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card,
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.hero-card::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.02) 48%),
    radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 26%);
  pointer-events: none;
}

.hero-card-main {
  background: linear-gradient(135deg, #fffaf2 0%, #f3e6d8 100%);
}

.hero-card-side {
  background: linear-gradient(135deg, #fffaf4 0%, #f7ecdf 100%);
}

.hero-copy {
  max-width: 56ch;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--accent);
}

.metric-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.metric-list div {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.metric-list dt {
  font-size: 13px;
  color: var(--muted);
}

.metric-list dd {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 700;
}

.panel {
  margin-bottom: 18px;
}

.panel-head {
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 6px 0 0;
  font-size: 28px;
}

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

.stack-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.stack-form input[type="text"],
.stack-form input[type="password"],
.stack-form input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fffdf9;
  font: inherit;
}

.stack-form input[type="file"] {
  padding: 12px 14px;
  color: var(--muted);
  cursor: pointer;
}

.stack-form input[type="file"]::file-selector-button {
  margin-right: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(156, 79, 25, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.98) 0%, rgba(245, 231, 214, 0.95) 100%);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.stack-form input[type="file"]:hover::file-selector-button {
  transform: translateY(-1px);
  border-color: rgba(151, 80, 26, 0.3);
  box-shadow: 0 10px 20px rgba(88, 60, 31, 0.1);
}

.stack-form input[type="text"]:focus,
.stack-form input[type="password"]:focus,
.stack-form input[type="file"]:focus {
  outline: none;
  border-color: rgba(151, 80, 26, 0.36);
  box-shadow: 0 0 0 4px rgba(151, 80, 26, 0.1);
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-weight: 400 !important;
}

.help-text,
.empty-state {
  color: var(--muted);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.month-card,
.file-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.84) 0%, rgba(253,247,239,0.74) 100%);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.month-card strong,
.file-item strong {
  font-size: 20px;
}

.file-list {
  display: grid;
  gap: 12px;
}

.file-item span,
.month-card span {
  color: var(--muted);
}

.file-item-static {
  text-decoration: none;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
}

.flash.success {
  background: var(--good-bg);
  color: var(--good-text);
}

.flash.error {
  background: var(--bad-bg);
  color: var(--bad-text);
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
}

.login-panel {
  width: min(100%, 520px);
}

@media (max-width: 900px) {
  .topbar,
  .hero,
  .grid.two-up {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 16px 12px 30px;
  }

  .hero-card,
  .panel {
    padding: 18px;
    border-radius: 22px;
  }
}
