:root {
  --bg: #f4ede3;
  --surface: rgba(255, 250, 244, 0.86);
  --surface-strong: #fffaf3;
  --text: #201916;
  --muted: #675a4f;
  --line: rgba(89, 57, 32, 0.12);
  --accent: #b06c49;
  --accent-dark: #83482c;
  --shadow: 0 26px 64px rgba(67, 41, 24, 0.14);
}

:root[data-theme="night"] {
  --bg: #121116;
  --surface: rgba(28, 29, 38, 0.82);
  --surface-strong: #202330;
  --text: #f5f1ea;
  --muted: #bbb5ac;
  --line: rgba(255, 255, 255, 0.08);
  --accent-dark: #844e31;
  --shadow: 0 26px 64px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 28%, transparent), transparent 22rem),
    radial-gradient(circle at bottom right, rgba(80, 104, 91, 0.16), transparent 26rem),
    linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 85%, #dbc8b4) 100%);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 32px 24px;
  background: rgba(33, 24, 19, 0.93);
  color: #f8efdf;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-block {
  display: grid;
  gap: 14px;
}

.nav-grid {
  align-content: start;
}

.content {
  padding: 32px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
}

.muted,
.helper,
.entry-card p,
.entry-card small,
.timeline li {
  color: var(--muted);
}

.sidebar .eyebrow,
.sidebar .muted {
  color: rgba(248, 239, 223, 0.75);
}

.hero,
.panel-card,
.stat-card,
.entry-card,
.login-card,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero,
.panel-card,
.entry-card,
.login-card,
.stat-card,
.empty-state {
  border-radius: 28px;
}

.login-card,
.panel-card,
.entry-card,
.stat-card {
  padding: 26px;
}

.login-card {
  width: min(500px, 100%);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  padding: 30px;
}

.quick-grid,
.stats-grid,
.two-column,
.stack,
.nav-grid {
  display: grid;
  gap: 16px;
}

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

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

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.quick-card,
.nav-link,
button,
.ghost,
.mini-button {
  border: none;
  border-radius: 18px;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.quick-card,
button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff8f1;
  padding: 15px 18px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--accent-dark) 28%, transparent);
}

.nav-link,
.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #f8efdf;
  padding: 12px 14px;
  text-align: left;
}

.nav-link.active,
.nav-link:hover,
.ghost:hover,
.quick-card:hover,
button:hover,
.mini-button:hover {
  transform: translateY(-1px);
}

.section-head,
.entry-header,
.card-actions,
.button-row,
.timeline li {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}

.page-head {
  margin-bottom: 18px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: auto;
}

.empty-state {
  padding: 20px;
}

.mini-button {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
  padding: 8px 12px;
}

.danger {
  background: rgba(150, 63, 50, 0.14);
}

code {
  background: rgba(0, 0, 0, 0.06);
  padding: 3px 8px;
  border-radius: 999px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 14px 18px;
  border-radius: 16px;
  color: #fff8f1;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 20;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  animation: rise 440ms ease both;
}

.stagger > * {
  animation: rise 440ms ease both;
}

.stagger > *:nth-child(2) {
  animation-delay: 60ms;
}

.stagger > *:nth-child(3) {
  animation-delay: 120ms;
}

.stagger > *:nth-child(4) {
  animation-delay: 180ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .shell,
  .hero,
  .stats-grid,
  .two-column,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 20px;
  }
}
