:root {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-card: #f9f4ed;
  --color-text: #201e1d;
  --color-muted: #645c50;
  --color-subtle: #82796a;
  --color-faint: #a19786;
  --color-accent: #c67139;
  --color-accent-ink: #fff2eb;
  --color-divider: rgba(32, 30, 29, 0.12);
  --color-divider-soft: rgba(32, 30, 29, 0.08);
  --font-heading: "Caprasimo", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(46, 43, 37, 0.1);
  --shadow-md: 0 3px 10px rgba(46, 43, 37, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  margin: 0;
}

input:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- buttons & fields ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.btn:hover { filter: brightness(0.95); }
.btn-primary { background: var(--color-accent); color: var(--color-accent-ink); width: 100%; }
.btn-inline { width: auto; padding: 12px 22px; font-size: 14px; }
.btn-quiet { background: var(--color-card); color: var(--color-text); }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

input[type="text"], input[type="tel"], input[type="password"], textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-card);
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 16px;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--color-faint); }

.notice {
  background: #f0fae1;
  color: #4f5c38;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.error {
  background: #ffe1d0;
  color: #8c491a;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.muted { color: var(--color-muted); font-size: 14px; line-height: 1.5; margin: 0; }

/* ---------- auth screens ---------- */

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.brand img { width: 56px; height: 56px; margin-bottom: 6px; }
.brand-name { font-family: var(--font-heading); font-size: 34px; line-height: 1.1; }
.brand-tagline {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.auth-card {
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 24px; margin-bottom: 8px; }
.auth-card form { margin-top: 22px; display: flex; flex-direction: column; gap: 20px; }
.phone-row { display: flex; gap: 8px; }
.chip {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
}
.code-input, .pin-input { text-align: center; font-size: 24px; letter-spacing: 10px; }
.pin-input { letter-spacing: 14px; }
.hint { font-size: 12px; color: var(--color-subtle); margin: 6px 0 0; line-height: 1.5; }
.auth-card form.inline-form { margin-top: 14px; gap: 0; align-items: center; }
.link-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
}
.auth-footnote { font-size: 13px; line-height: 1.6; color: var(--color-subtle); text-align: center; margin: 0; }
.auth-footnote a { color: var(--color-accent); font-weight: 700; }
.text-link { text-align: center; font-size: 13px; font-weight: 600; color: var(--color-subtle); }

/* ---------- app shell ---------- */

.topbar {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-divider);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-size: 20px; }
.topbar-brand img { width: 30px; height: 30px; }
.topbar-right { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topbar-right strong { font-weight: 600; }
.topbar-right a { font-size: 13px; color: var(--color-subtle); }

.tabs {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-divider);
  padding: 0 24px;
  display: flex;
  gap: 28px;
  overflow-x: auto;
}
.tabs a {
  padding: 13px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-subtle);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs a:hover { color: var(--color-text); }
.tabs a.active { color: var(--color-accent); font-weight: 700; border-bottom-color: var(--color-accent); }

.page { max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 20px; }
.page h1 { font-size: 26px; }
.back { font-size: 13px; font-weight: 600; color: var(--color-subtle); }

.panel { background: var(--color-surface); border-radius: 24px; padding: 28px; box-shadow: var(--shadow-sm); }
.panel.light { background: var(--color-card); }
.panel h2 { font-size: 19px; margin-bottom: 4px; }
.panel .muted { margin-bottom: 18px; font-size: 13px; }

.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 160px; }
.form-row .field.narrow { flex: 0 0 180px; }
.form-row label { font-size: 12px; margin-bottom: 6px; }

/* ---------- job cards ---------- */

.jobs { display: flex; flex-direction: column; gap: 14px; }
.job {
  background: var(--color-card);
  border-radius: 20px;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.job-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.job-who { display: flex; align-items: center; gap: 10px; }
.job-who strong { font-size: 15px; }
.job-time { font-size: 12px; color: var(--color-faint); }
.job-type { font-size: 14px; }
.job-transcript { font-size: 13px; color: var(--color-muted); line-height: 1.55; margin: 0; }
.job-link { font-size: 13px; font-weight: 700; color: var(--color-accent); margin-top: 2px; }

.empty { padding: 36px 20px; text-align: center; color: var(--color-muted); font-size: 14px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-muted);
}
.badge.pending_review, .badge.draft { background: #fff2eb; color: #b2622d; }
.badge.approved { background: #f0fae1; color: #728157; }
.badge.edited { background: #eee7db; color: #645c50; }
.badge.clarify_requested, .badge.needs-price { background: #ffe1d0; color: #8c491a; }
.badge.needs-price { font-size: 10px; padding: 3px 9px; margin-left: 6px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; font-size: 14px; }
th {
  color: var(--color-faint);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-divider);
}
td { border-bottom: 1px solid var(--color-divider-soft); }
td input[type="text"] { width: 96px; padding: 8px 10px; border-radius: 10px; font-size: 14px; }
tr.total td { border-bottom: none; font-weight: 700; }

.actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .auth-card { padding: 28px 22px; }
  .topbar { padding: 12px 16px; }
  .topbar-right strong { display: none; }
  .tabs { padding: 0 16px; }
  .page { padding: 24px 16px 48px; }
  .panel { padding: 22px 18px; }
  .job { padding: 18px; }
}
