:root {
  --ink: #1c1712;
  --muted: #6d6256;
  --line: #e4d8c8;
  --paper: #f3eee6;
  --card: #fffdf9;
  --bronze: #8a5324;
  --bronze-dark: #6d3f18;
  --sidebar: #241c16;
  --sidebar-text: #f4eadf;
  --good: #1d6b45;
  --bad: #8d2c2c;
  --warn: #8a5a12;
  --shadow: 0 12px 30px rgba(48, 32, 14, 0.06);
  font-family: "Segoe UI", "Nirmala UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--bronze-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 2rem; margin: 0 0 0.35rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
aside {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand { display: flex; flex-direction: column; padding: 4px 10px 18px; }
.brand strong { font-family: Georgia, serif; font-size: 1.35rem; letter-spacing: 0.01em; }
.brand span { color: #d7b08a; font-size: 0.85rem; }
aside a, .linkish {
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
aside a:hover, aside a.active { background: rgba(255, 248, 240, 0.08); }
aside a.active { box-shadow: inset 3px 0 0 #d7b08a; }
.side-label {
  margin: 18px 10px 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b9a38d;
}
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; }
main.app { padding: 28px 32px 64px; }
main.bare { min-height: 100vh; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.login-story {
  padding: 64px;
  background:
    radial-gradient(circle at top left, rgba(215, 176, 138, 0.35), transparent 40%),
    #241c16;
  color: #f6efe6;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-story p { max-width: 36rem; font-size: 1.15rem; line-height: 1.5; color: #eadccb; }
.login-story ul { padding-left: 1.1rem; color: #eadccb; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.login-panel .card { width: min(420px, 100%); padding: 28px; }
.lede { color: var(--muted); margin-top: 0; line-height: 1.5; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 0.92rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d9cbb8;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 80px; }
.btn, button.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--bronze);
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { background: var(--bronze-dark); }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.chart { width: 100%; height: auto; }
.axis { stroke: #e4d8c8; stroke-width: 1; }
.bar-sales { fill: #8a5324; }
.bar-expense { fill: #241c16; }
.chart-label { font-size: 11px; fill: #6d6256; font-family: "Segoe UI", sans-serif; }
.legend { color: var(--muted); font-size: 0.85rem; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; }
.swatch.sales { background: #8a5324; margin-left: 0; }
.swatch.expense { background: #241c16; }
.mix { margin: 10px 0; }
.mix-label { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; }
.mix-track { height: 8px; background: #f3eee6; border-radius: 99px; margin-top: 4px; }
.mix-fill { height: 8px; background: #8a5324; border-radius: 99px; }
.metric { padding: 16px; }
.metric span { display: block; color: var(--muted); font-size: 0.85rem; }
.metric strong { display: block; margin-top: 6px; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  background: #f3e7d8;
  color: var(--bronze-dark);
}
.pill.posted { background: #e5f4eb; color: var(--good); }
.pill.draft { background: #f8efd8; color: var(--warn); }
.pill.void { background: #f8e4e4; color: var(--bad); }
.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.flash.error { background: #fdecec; color: var(--bad); }
.flash.ok { background: #e8f6ee; color: var(--good); }
.banner {
  background: #fff6ea;
  border: 1px solid #efd7b4;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0 18px;
}
.grid-2 { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 16px; }
.pad { padding: 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tabs a { text-decoration: none; }
.split { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.muted { color: var(--muted); }
.totals td { font-weight: 700; }
.ok-text { color: var(--good); }
.bad-text { color: var(--bad); }
.demo {
  margin-top: 16px;
  background: #f7f1e8;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.88rem;
}
.demo code { font-family: Consolas, monospace; }
.user-card { padding: 14px; margin-bottom: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.checks label { display: flex; gap: 6px; align-items: center; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

@media (max-width: 980px) {
  .shell, .login-screen, .metrics, .grid-2, .split { grid-template-columns: 1fr; }
  aside { position: static; }
  .login-story { padding: 32px 24px; }
  main.app { padding: 20px 16px 48px; }
}
.logo-preview { max-height: 72px; max-width: 220px; display: block; margin-bottom: 8px; }
.bill {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin: 12px 0 18px;
}
.bill-head { display: flex; justify-content: space-between; gap: 24px; }
.bill-head h2 { margin: 0 0 8px; color: var(--bronze-dark); }
.bill-party {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  max-width: 28rem;
}
@media print {
  aside, .actions, .tabs, .no-print { display: none !important; }
  .shell { display: block; }
  main.app { padding: 0; }
  body { background: white; }
}
