/* ===========================================================================
   Total Lawn Care — shared styles
   Warm, friendly, sturdy. Green + cream. Used by every page.
   =========================================================================== */

:root {
  --green:        #3a7d44;
  --green-dark:   #2f6638;
  --green-soft:   #eaf3ec;
  --ink:          #2b2b2b;
  --ink-soft:     #5f5f58;
  --muted:        #8a8a82;
  --cream:        #e7e5df;
  --cream-2:      #efece5;
  --panel:        #ffffff;
  --panel-2:      #fbfbf9;
  --line:         #ddd9cf;
  --amber:        #c98a1b;
  --red:          #b3402f;
  --red-soft:     #fbeae6;
  --blue:         #2f6db3;
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 1px 2px rgba(43,43,43,.06), 0 8px 24px rgba(43,43,43,.07);
  --shadow-sm:    0 1px 3px rgba(43,43,43,.10);
  --maxw:         1120px;
  --font-display: 'Fredoka', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display { font-family: var(--font-display); font-weight: 600; line-height: 1.1; color: var(--ink); }

a { color: var(--green-dark); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 500; font-size: 17px;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  background: var(--green); color: #fff; cursor: pointer; text-decoration: none;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.btn:hover { background: var(--green-dark); }
.btn:active { transform: translateY(1px); }
.btn.outline { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: none; }
.btn.outline:hover { background: var(--cream-2); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border-color: var(--line); }
.btn.ghost:hover { background: var(--cream-2); }
.btn.sm { padding: 7px 14px; font-size: 15px; }
.btn.lg { padding: 15px 30px; font-size: 19px; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #93331f; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

/* ── Badges / pills ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-dark);
  border: 1px solid var(--line);
}
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 700; padding: 9px 16px; border-radius: 999px;
  background: #fff; color: var(--ink); border: 1.5px solid var(--ink); box-shadow: var(--shadow-sm);
}

/* status chips */
.chip { display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:800;
  padding:4px 11px; border-radius:999px; letter-spacing:.2px; text-transform:capitalize; }
.chip.paid    { background:#e6f4ea; color:#1f7a37; }
.chip.sent    { background:#e7f0fb; color:#2456a6; }
.chip.draft   { background:#efece5; color:#6b6b62; }
.chip.overdue { background:var(--red-soft); color:#a3331f; }
.chip.void    { background:#eee; color:#999; text-decoration: line-through; }

/* ── Cards / panels ───────────────────────────────────────────────────────── */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
label { display:block; font-weight:700; font-size:14px; color: var(--ink-soft); margin: 0 0 6px; }
input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 16px; color: var(--ink);
  padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft);
}
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 14px; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.row3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
@media (max-width:620px){ .row2,.row3 { grid-template-columns:1fr; } }

/* ── App top bar ──────────────────────────────────────────────────────────── */
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar .wrap { display:flex; align-items:center; justify-content:space-between; height: 66px; }

/* ── TLC logo lockup ──────────────────────────────────────────────────────── */
.brand { display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--ink); }
.brand .mark {
  width:46px; height:46px; flex:0 0 auto; border-radius:12px; border:3px solid var(--green);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:700; color:var(--green); font-size:18px; background:#fff;
}
.brand .name { font-family:var(--font-display); font-weight:600; font-size:20px; line-height:1; }
.brand .sub  { font-size:12px; color:var(--muted); }

/* ── Tables (owner invoice/customer lists) ────────────────────────────────── */
.table { width:100%; border-collapse: collapse; }
.table th { text-align:left; font-size:13px; text-transform:uppercase; letter-spacing:.4px;
  color: var(--muted); font-weight:800; padding:10px 12px; border-bottom:2px solid var(--line); }
.table td { padding:13px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
.table tr:last-child td { border-bottom:none; }
.table tr.clickable { cursor:pointer; }
.table tr.clickable:hover td { background: var(--panel-2); }

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 700; font-size: 15px; box-shadow: var(--shadow); opacity:0; pointer-events:none;
  transition: opacity .2s ease, transform .2s ease; z-index: 200; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red); }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(43,43,43,.45); z-index: 150;
  display:flex; align-items:flex-start; justify-content:center; padding: 40px 16px; overflow:auto;
}
.modal {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 640px; padding: 26px; margin: auto;
}
.modal h2 { font-size: 24px; margin-bottom: 4px; }

/* ── Misc helpers ─────────────────────────────────────────────────────────── */
.stack > * + * { margin-top: 16px; }
.flex { display:flex; align-items:center; gap:12px; }
.flex.wrap { flex-wrap: wrap; }
.spread { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.spacer { flex: 1; }
.money { font-variant-numeric: tabular-nums; font-weight: 800; }
.small { font-size: 14px; }
.tiny  { font-size: 12.5px; }
