/* ─────────────────────────────────────────────────────────────
   Design tokens + shared base components. Loaded once, globally.
   Screens reuse these instead of redeclaring :root / buttons / etc.
   ───────────────────────────────────────────────────────────── */

:root {
  --paper: #FBF9F5;
  --paper-deep: #F2EDE5;
  --surface: #FFFFFF;
  --ink: #1E1C19;
  --ink-soft: #6E675E;
  --line: #E4DED4;
  --accent: #A5713C;
  --accent-weak: #F0E4D5;
  --done: #5E6B52;

  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --sidebar-w: 240px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#root { min-height: 100vh; }

::placeholder { color: #a69d90; opacity: 1; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }

/* ── Shared animations ─────────────────────────────────────── */
@keyframes veraFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes veraRise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: translateY(0) } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Base components (reusable classes) ────────────────────── */

.v-btn {
  appearance: none;
  font: 500 16px var(--font-body);
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background .2s ease;
}
.v-btn:hover { background: #8C5F31; }
.v-btn:disabled { opacity: .55; cursor: default; }

.v-btn--ghost {
  background: none;
  color: var(--accent);
  border: 1px solid var(--line);
}
.v-btn--ghost:hover { background: var(--paper-deep); }

.v-field {
  width: 100%;
  font: 400 16px var(--font-body);
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s ease;
}
.v-field:focus { border-color: var(--accent); }

.v-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.v-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  background: rgba(30, 28, 25, 0.42);
  animation: veraFade .2s ease;
}
.v-modal {
  width: 100%;
  max-width: 440px;
  max-height: 94%;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: clamp(22px, 5vw, 32px);
  animation: veraRise .25s ease;
}

/* Empty-state helper */
.v-empty {
  text-align: center;
  color: var(--ink-soft);
  font: 400 15px/1.6 var(--font-body);
  padding: 48px 24px;
}

/* ── App shell (sidebar / tab-bar) ─────────────────────────── */
.v-shell { min-height: 100vh; }

.v-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: none;                 /* shown on desktop */
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.v-content {
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

.v-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 40;
}

@media (min-width: 1024px) {
  .v-sidebar { display: flex; }
  .v-content { margin-left: var(--sidebar-w); padding-bottom: 0; }
  .v-tabbar { display: none; }
}
