@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --pine: #1F3A2E;
  --gold: #C89B3C;
  --gold-soft: #F3E6C8;
  --cream: #F7F3EA;
  --paper: #FFFFFF;
  --ink: #22281F;
  --slate: #6B7466;
  --line: #E4DFD1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, .display { font-family: 'Fraunces', Georgia, serif; color: var(--pine); font-weight: 700; margin: 0; }

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

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 20px 80px; }
.wrap-narrow { max-width: 420px; margin: 0 auto; padding: 60px 20px; }

.topbar {
  background: var(--ink);
  color: var(--cream);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand { font-family: 'Fraunces', serif; font-weight: 700; font-size: 20px; color: #fff; }
.topbar .brand span { color: var(--gold); }
.topbar a.nav-link { color: var(--cream); font-size: 14px; font-weight: 600; opacity: 0.85; }
.topbar a.nav-link:hover { opacity: 1; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 12px; padding: 10px 18px; font-weight: 600; font-size: 14px;
  border: 1.5px solid transparent; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--pine); color: #fff; }
.btn-gold { background: var(--gold); color: #3D2E06; }
.btn-outline { background: var(--cream); color: var(--pine); border-color: var(--line); }
.btn-danger { background: #fff; color: #A3372E; border-color: #E9C9C4; }
.btn-block { width: 100%; }

label { display: block; font-size: 12px; font-weight: 600; color: var(--slate); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--paper); font-size: 14px; color: var(--ink); font-family: inherit; margin-bottom: 14px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pine); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: none; padding: 0; margin: 0 0 20px; }
fieldset legend { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); margin-bottom: 10px; padding: 0; }

table.leads { width: 100%; border-collapse: collapse; }
table.leads th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.leads td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.leads tr:hover td { background: var(--cream); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--gold-soft); color: #7A5A14; }
.pill-lost { background: #F1E4E1; color: #A3372E; }
.pill-won, .pill-installed, .pill-commissioned, .pill-review { background: #DCE8DE; color: var(--pine); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters a { padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--paper); color: var(--slate); }
.filters a.active { background: var(--pine); color: #fff; border-color: var(--pine); }

.error { background: #F1E4E1; color: #A3372E; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.notice { background: var(--gold-soft); color: #7A5A14; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.muted { color: var(--slate); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; font-weight: 700; color: var(--gold); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--cream); border-radius: 12px; padding: 12px; text-align: center; }
.stat .value { font-family: 'Fraunces', serif; font-weight: 700; font-size: 17px; }
.stat .label { font-size: 11px; color: var(--slate); margin-top: 2px; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  max-width: 720px; margin: 0 auto;
  background: var(--paper); border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px 8px; color: var(--slate); text-decoration: none;
}
.bottom-nav-item.active { color: var(--pine); }
.bottom-nav-item.active .bottom-nav-label { font-weight: 700; }
.bottom-nav-icon-wrap { position: relative; display: flex; }
.bottom-nav-badge {
  position: absolute; top: -2px; right: -4px; width: 8px; height: 8px;
  border-radius: 999px; background: #A3372E; border: 1.5px solid var(--paper);
}
.bottom-nav-label { font-size: 11px; font-weight: 600; }

.fab {
  position: fixed; bottom: 76px; z-index: 41;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; box-shadow: 0 6px 20px rgba(34,40,31,0.25);
  border: none; cursor: pointer; font-family: inherit;
}
.fab-primary { right: max(20px, calc(50% - 340px)); background: var(--gold); color: var(--ink); padding: 14px 22px; font-weight: 700; font-size: 14px; }
.fab-secondary { left: max(20px, calc(50% - 340px)); background: var(--ink); color: var(--gold); width: 56px; height: 56px; padding: 0; }

.speed-dial-menu {
  position: fixed; bottom: 140px; left: max(20px, calc(50% - 340px)); z-index: 41;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 8px; box-shadow: 0 10px 30px rgba(34,40,31,0.2);
  display: none; flex-direction: column; min-width: 190px;
}
.speed-dial-menu.open { display: flex; }
.speed-dial-menu a { padding: 10px 12px; border-radius: 10px; color: var(--ink); font-size: 14px; font-weight: 600; display: block; }
.speed-dial-menu a:hover { background: var(--cream); }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  @page { size: A4; margin: 16mm 14mm; }
  .proposal-page { break-before: page; }
  .proposal-page:first-child { break-before: avoid; }
}
