/* DACOSTA affiliates PWA - brand tokens match the public site (petrol teal + gold, serif display). */
:root {
  --ink: #0d2b33; --c1: #14515a; --c1b: #1d6b73; --c2: #b8913f; --c2l: #d8b46b;
  --bg: #f5f7f8; --fg: #1a2b33; --mut: #66777e; --line: #e3eae9;
  --ok: #14515a; --bad: #b91c1c; --warn: #b45309;
  --serif: Georgia, 'Times New Roman', serif;
  --shadow: 0 2px 10px rgba(13, 43, 51, .08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--fg); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 15px; height: 15px; }
.ic.fill { fill: currentColor; }

/* ---- header ---- */
header.top { background: linear-gradient(135deg, var(--ink), var(--c1)); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 18px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; }
header.top .hi { font-family: var(--serif); font-size: 22px; margin: 0; color: #fff; }
header.top .sub { font-size: 12px; color: #bcd3d6; margin-top: 2px; }
header.top h1 { font-size: 19px; margin: 0; color: #fff; }
header.top .off { font-size: 12px; color: var(--c2l); }
main { padding: 14px; max-width: 720px; margin: 0 auto; }

/* ---- nav ---- */
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 5; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 14px rgba(13, 43, 51, .06); }
nav.tabs button { flex: 1; border: 0; background: none; padding: 9px 4px 8px; font-size: 11.5px; color: var(--mut); display: flex; flex-direction: column; align-items: center; gap: 3px; font-family: inherit; }
nav.tabs button.on { color: var(--c1); font-weight: 700; }
nav.tabs button.on .ic { fill: currentColor; fill-opacity: .18; }

/* ---- cards ---- */
.card { background: #fff; border-radius: 16px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.row { display: flex; gap: 12px; align-items: center; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-size: 15px; color: var(--ink); }
.thumb { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--line); flex: none; }
.price { font-weight: 700; color: var(--c1); font-size: 16px; margin: 2px 0; }
.mut { color: var(--mut); font-size: 13px; }
.meta { display: flex; gap: 12px; align-items: center; color: var(--mut); font-size: 12.5px; margin-top: 4px; }
.meta span { display: inline-flex; gap: 4px; align-items: center; }
.acts { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #e5eaed; color: #475569; white-space: nowrap; }
.badge.published { background: #d7ebec; color: var(--c1); }
.badge.review { background: #fef3c7; color: var(--warn); }
.badge.draft, .badge.paused { background: #e5eaed; color: #475569; }
.badge.closed { background: var(--ink); color: #fff; }
.badge.rejected, .badge.overdue { background: #fee2e2; color: var(--bad); }
.badge.ok { background: #d7ebec; color: var(--c1); }
.badge.plan { background: #f4ead4; color: #8a6a24; }

/* ---- buttons ---- */
button { font-family: inherit; }
button.btn { background: var(--c1); color: #fff; border: 0; border-radius: 999px; padding: 14px 20px; font-size: 15px; font-weight: 600; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button.btn.gold { background: linear-gradient(135deg, var(--c2l), var(--c2)); color: var(--ink); }
button.btn.sec { background: #fff; color: var(--c1); border: 1.5px solid var(--c1); }
button.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }
.fab { position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); width: auto !important; padding: 14px 22px !important; box-shadow: 0 6px 18px rgba(13, 43, 51, .3); z-index: 6; }
.round { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--c1); color: #fff; text-decoration: none; }
.round.wa { background: #1f9d55; }

/* ---- forms ---- */
label { display: block; font-size: 13px; color: var(--mut); margin: 12px 0 5px; }
input, select, textarea { width: 100%; padding: 12px 14px; border: 1.5px solid #d5dee1; border-radius: 12px; font-size: 16px; background: #fff; font-family: inherit; color: var(--fg); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--c1); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid #d5dee1; background: #fff; color: var(--fg); border-radius: 999px; padding: 8px 14px; font-size: 14px; }
.chip.on { background: var(--c1); border-color: var(--c1); color: #fff; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--c1); background: #fff; color: var(--c1); font-size: 20px; line-height: 1; }
.stepper input { width: 46px; text-align: center; padding: 6px 2px; border-radius: 10px; }

/* ---- stats ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 16px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--serif); font-size: 24px; color: var(--c1); font-weight: 400; }
.stat span { font-size: 11.5px; color: var(--mut); }
.top-actions { display: flex; justify-content: space-between; align-items: center; margin: 4px 2px 12px; }
.top-actions h3 { margin: 0; font-size: 20px; }

/* ---- leads / meetings ---- */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--c1b), var(--ink)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: none; }
.avatar.big { width: 60px; height: 60px; font-size: 20px; }
.chip-ch { display: inline-block; font-size: 11px; background: #f4ead4; color: #8a6a24; padding: 2px 8px; border-radius: 999px; margin-left: 4px; }
.lock { display: flex; gap: 6px; align-items: center; color: var(--mut); font-size: 12.5px; margin-top: 8px; }
.datebox { width: 54px; text-align: center; background: #e9f1f1; border-radius: 12px; padding: 8px 0; flex: none; color: var(--c1); }
.datebox b { display: block; font-family: var(--serif); font-size: 24px; line-height: 1; font-weight: 400; }
.datebox span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }

/* ---- account ---- */
.menu { background: #fff; border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.menu .item { display: flex; align-items: center; gap: 12px; padding: 15px 14px; width: 100%; border: 0; background: none; text-align: left; font-size: 15px; color: var(--fg); border-bottom: 1px solid var(--line); }
.menu .item:last-child { border-bottom: 0; }
.menu .item .ic { color: var(--c1); }
.menu .item .chev { margin-left: auto; color: var(--mut); }
.menu .item.danger, .menu .item.danger .ic { color: var(--bad); }
h3.sect { font-size: 18px; margin: 18px 2px 10px; }

/* ---- wizard ---- */
.steps { display: flex; gap: 6px; margin-bottom: 4px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: #d5dee1; }
.steps span.on { background: var(--c1); }
.steplab { display: flex; justify-content: space-between; font-size: 12px; color: var(--mut); margin-bottom: 12px; }
.steplab .on { color: var(--c1); font-weight: 700; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.photos div { position: relative; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.photos button { position: absolute; top: 4px; right: 4px; border: 0; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 50%; width: 24px; height: 24px; }
.photos .add { aspect-ratio: 1; border: 2px dashed var(--c1); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--c1); font-size: 34px; background: #fff; cursor: pointer; margin: 0; }
.photos .add input { display: none; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; z-index: 6; }
.bar .btn { flex: 1; }
body.wiz { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }

/* ---- feedback ---- */
.err { background: #fee2e2; color: var(--bad); padding: 12px; border-radius: 12px; margin: 8px 0; font-size: 14px; }
.banner { background: #fef3c7; color: #78490c; padding: 6px 12px; font-size: 12.5px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; z-index: 20; font-size: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); max-width: 90vw; }

/* ---- welcome / login ---- */
body.welcome { padding-bottom: 0; }
.welcome-wrap { min-height: 100vh; min-height: 100dvh; background: linear-gradient(180deg, rgba(13, 43, 51, .35), rgba(13, 43, 51, .92)), url('/dacosta/app/img/welcome.jpg') center / cover; display: flex; flex-direction: column; justify-content: space-between; padding: calc(60px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom)); }
.brand h1 { font-family: var(--serif); color: #fff; font-size: 38px; letter-spacing: .14em; margin: 0; }
.brand .tag { color: var(--c2l); letter-spacing: .3em; text-transform: uppercase; font-size: 12px; margin-top: 4px; }
.brand p { color: #dbe7e8; margin: 14px 0 0; }
.login { background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 12px 34px rgba(0, 0, 0, .35); }
.login label:first-child { margin-top: 0; }
.login .btn { margin-top: 16px; }
