:root {
  --bg: oklch(97% 0.006 75);
  --surface: oklch(99% 0.002 90);
  --surface-2: oklch(95.5% 0.008 75);
  --line: oklch(89% 0.008 75);
  --line-strong: oklch(80% 0.01 75);
  --ink: oklch(23% 0.02 262);
  --ink-2: oklch(48% 0.02 262);
  --ink-3: oklch(64% 0.014 262);
  --navy: oklch(27% 0.045 262);
  --on-navy: oklch(97% 0.008 262);
  --accent: oklch(60% 0.13 74);
  --accent-ink: oklch(24% 0.04 74);
  --success-bg: oklch(93% 0.05 150);
  --success-ink: oklch(34% 0.08 150);
  --warn-bg: oklch(93% 0.06 80);
  --warn-ink: oklch(40% 0.1 55);
  --neutral-bg: oklch(93% 0.006 262);
  --neutral-ink: oklch(45% 0.02 262);
  --font-head: 'Lora', Georgia, serif;
  --font-body: 'Public Sans', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--navy); }

button, input, select, textarea { font-family: inherit; }
button:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 4px; }
button:focus:not(:focus-visible) { outline: none; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- header ---------- */
.app-header {
  flex: 0 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-header.with-border { border-bottom: 1px solid var(--line); }
.app-header .title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}
.app-header.secondary .title { font-size: 19px; }
.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
}
.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: auto;
}
.header-top-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
}
.greeting { font-size: 13px; color: var(--ink-3); margin-bottom: 2px; }

/* ---------------------------------------------------------------- */
/* logo                                                               */
/* ---------------------------------------------------------------- */
.header-logo-row { display: flex; justify-content: center; margin-bottom: 12px; }
.app-logo { height: 34px; width: auto; display: block; border-radius: 4px; }
.app-logo-home { height: 46px; }
.login-logo { height: 76px; width: auto; display: block; margin: 0 auto 6px; border-radius: 6px; }

/* ---------- content ---------- */
.screen-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 20px 24px;
  -webkit-overflow-scrolling: touch;
}
.screen-content.with-top-pad { padding-top: 18px; }
.screen-content.form { display: flex; flex-direction: column; gap: 16px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 6px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: var(--surface);
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ink-3);
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  min-height: 44px;
  justify-content: center;
}
.nav-item.active { color: var(--navy); }
.nav-item .label { font-size: 10.5px; font-weight: 600; }
.nav-item.active .label { font-weight: 700; }

/* ---------- fixed bottom action bar (forms) ---------- */
.action-bar {
  flex: 0 0 auto;
  padding: 14px 20px calc(env(safe-area-inset-bottom, 0px) + 18px);
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  width: 100%;
}
.btn-primary { background: var(--navy); color: var(--on-navy); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: none; color: var(--ink-2); font-weight: 600; }
.btn-outline { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); font-weight: 600; }
.btn-danger-ghost { background: none; color: var(--warn-ink); font-weight: 600; }
.btn-sm { padding: 0 14px; min-height: 40px; font-size: 13px; width: auto; }

/* ---------- fab ---------- */
.fab {
  position: fixed;
  right: max(20px, calc((100vw - 480px) / 2 + 20px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px -6px oklch(60% 0.13 74 / 0.55);
  border: none;
  cursor: pointer;
  z-index: 5;
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { font-size: 13.5px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--ink-3); }
.card-strong { font-size: 12px; color: var(--ink-2); font-weight: 600; }

.hero-card {
  background: var(--navy);
  border-radius: 20px;
  padding: 18px;
  color: var(--on-navy);
  margin-bottom: 18px;
}

.stat-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.stat-value { font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- badges / pills / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 100px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-warn { color: var(--warn-ink); background: var(--warn-bg); }
.badge-success { color: var(--success-ink); background: var(--success-bg); }
.badge-neutral { color: var(--neutral-ink); background: var(--neutral-bg); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 100px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
}
.chip.dashed { background: transparent; border-style: dashed; }
.chip.active { background: var(--navy); color: var(--on-navy); border-color: var(--navy); border-style: solid; font-weight: 700; }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }

.toggle-row { display: flex; gap: 8px; }
.toggle-btn {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
}
.toggle-btn.active { background: var(--navy); color: var(--on-navy); border-color: var(--navy); font-weight: 700; }

/* ---------- forms ---------- */
.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  display: block;
}
.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 12px;
  width: 100%;
  outline: none;
  min-height: 44px;
}
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

/* ---------- info list (detail screen) ---------- */
.info-list { display: flex; flex-direction: column; gap: 14px; }
.info-row { display: flex; gap: 12px; align-items: flex-start; }
.info-row svg { flex: 0 0 auto; margin-top: 2px; color: var(--ink-3); }
.info-label { font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; }
.info-value { font-size: 13.5px; font-weight: 600; }

/* ---------- search input ---------- */
.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3);
}
.search-wrap input {
  padding-left: 38px !important;
}

/* ---------- empty state ---------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.6;
}
.empty-state svg { margin-bottom: 10px; color: var(--line-strong); }

/* ---------- contact icon row (escritórios) ---------- */
.contact-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.icon-link-row { display: flex; gap: 8px; margin-top: 4px; }
.icon-link {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--navy);
  border: 1px solid var(--line);
}

/* scrollbar niceties (non-critical) */
::-webkit-scrollbar { width: 0; height: 0; }
