/* Elles — business expense capture. Warm, editorial finance theme. */
:root {
  --ink: #1c2321;
  --ink-soft: #4a544f;
  --paper: #f6f4ee;
  --card: #fffdf8;
  --line: #e3ded3;
  --accent: #1f6f5c;       /* deep teal-green */
  --accent-ink: #134a3d;
  --accent-soft: #e6f0ec;
  --danger: #b23b32;
  --warn: #b9852b;
  --shadow: 0 1px 2px rgba(28, 35, 33, .06), 0 8px 24px rgba(28, 35, 33, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: ui-serif, Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; margin: 0 0 .25rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout shell */
.topbar {
  display: flex; align-items: center; gap: 1.25rem;
  padding: .85rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-family: ui-serif, Georgia, serif; font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 1rem; align-items: center; }
.nav a { color: var(--ink-soft); font-weight: 500; }
.nav a:hover { color: var(--accent-ink); text-decoration: none; }
.spacer { flex: 1; }
.who { color: var(--ink-soft); font-size: .9rem; }

.wrap { max-width: 920px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }

/* Company switcher */
.switcher { display: flex; align-items: center; gap: .4rem; }
.switcher select {
  border: 1px solid var(--line); background: var(--paper);
  border-radius: 9px; padding: .4rem .6rem; font: inherit; color: var(--ink);
}

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.card.tight { padding: 1rem 1.1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1px solid transparent; border-radius: 10px;
  padding: .6rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--accent-ink); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent-ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: transparent; color: var(--danger); border-color: #e7cbc7; }
.btn.danger:hover { background: #f7e9e7; }
.btn.big { padding: .9rem 1.4rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; color: var(--ink-soft); }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field textarea, .field select, .input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem .7rem; font: inherit; color: var(--ink); background: #fff;
}
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: .82rem; color: var(--ink-soft); margin-top: .3rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.actions { display: flex; gap: .6rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash.notice { background: var(--accent-soft); color: var(--accent-ink); }
.flash.alert { background: #f7e9e7; color: var(--danger); }
.errors { background: #f7e9e7; color: var(--danger); border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; }
.errors ul { margin: .25rem 0 0; padding-left: 1.1rem; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--line); }
table.list th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
table.list td.amount, table.list th.amount { text-align: right; font-variant-numeric: tabular-nums; }
.amount-big { font-size: 1.6rem; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Badges & pills */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge.draft { background: #f3ecd9; color: var(--warn); }
.badge.confirmed { background: var(--accent-soft); color: var(--accent-ink); }
.pill { display:inline-block; background: var(--paper); border:1px solid var(--line); border-radius:999px; padding:.2rem .6rem; font-size:.8rem; color: var(--ink-soft); }

/* Capture / recorder */
.capture-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.recorder { text-align: center; padding: 1.5rem; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.rec-dot { display:inline-block; width:.7rem; height:.7rem; border-radius:50%; background: var(--danger); margin-right:.4rem; animation: pulse 1.2s infinite; vertical-align: middle; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }
.rec-time { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 600; margin: .5rem 0; }
audio { width: 100%; margin-top: .75rem; }
.muted { color: var(--ink-soft); }
.totals { display:flex; gap: 2rem; flex-wrap: wrap; align-items: baseline; }

/* Breakdown bars — one line per row, label truncates instead of wrapping. */
.cat-bars { display: grid; gap: .4rem; margin-top: .85rem; }
.cat-bar { display:grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto; align-items:center; gap:.75rem; font-size:.85rem; }
.cat-bar .label { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar .track { background: var(--paper); border-radius: 999px; height: 6px; overflow: hidden; border: 1px solid var(--line); }
/* min-width keeps small slices visible when one category dwarfs the rest. */
.cat-bar .fill { display: block; height: 100%; min-width: 3px; background: var(--accent); border-radius: 999px; }
.cat-bar .amount { text-align: right; font-variant-numeric: tabular-nums; }
.cat-bar.rest .amount { color: var(--ink-soft); }
.card-title { font-size: 1rem; margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.grid-2 > *, .grid-3 > * { margin-bottom: 0; }
@media (max-width: 1000px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .cat-bar { grid-template-columns: 7rem minmax(0, 1fr) auto; font-size: .8rem; }
}

/* Iteration timeline on the review screen — one entry per voice/typed note. */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; counter-reset: iteration; }
.timeline-item { counter-increment: iteration; position: relative; padding-left: 2rem; }
.timeline-item::before {
  content: counter(iteration);
  position: absolute; left: 0; top: .05rem;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: .75rem; font-weight: 700; display: grid; place-items: center;
}
.timeline-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; }
.timeline-text { margin: .35rem 0 0; }
.empty { text-align:center; color: var(--ink-soft); padding: 2rem; }
.page-head { display:flex; align-items:center; gap:1rem; margin-bottom: 1.25rem; }
.page-head .spacer { flex: 1; }

/* --- Auth pages (login / password reset) --- */
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--paper);
}
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth__aside { display: none; } }

.auth__aside {
  position: relative;
  padding: 3rem;
  color: #f3efe6;
  background:
    radial-gradient(120% 120% at 0% 0%, #267a64 0%, var(--accent-ink) 55%, #0e3a30 100%),
    var(--accent-ink);
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.auth__aside::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 360px; height: 360px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.auth__brand { font-family: ui-serif, Georgia, serif; font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.auth__tag { font-family: ui-serif, Georgia, serif; font-size: 2rem; line-height: 1.2; max-width: 18ch; margin: 0; }
.auth__points { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; opacity: .92; }
.auth__points li { display: flex; gap: .6rem; align-items: flex-start; }
.auth__points .tick { color: #bfe3d8; font-weight: 700; }
.auth__foot { font-size: .85rem; opacity: .75; }

.auth__main { display: grid; place-items: center; padding: 2rem 1.5rem; }
.auth__card { width: 100%; max-width: 380px; }
.auth__card h1 { font-size: 1.6rem; margin-bottom: .25rem; }
.auth__card .lead { color: var(--ink-soft); margin: 0 0 1.5rem; }
.auth__card .field input { padding: .7rem .8rem; }
.auth__card .btn { width: 100%; justify-content: center; }
.auth__alt { margin-top: 1.25rem; text-align: center; font-size: .9rem; color: var(--ink-soft); }
.auth__mark {
  display:inline-flex; align-items:center; justify-content:center;
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 1rem;
  background: var(--accent-soft); color: var(--accent-ink);
  font-family: ui-serif, Georgia, serif; font-weight: 700; font-size: 1.4rem;
}
