/* East NYC Roofing app — shared styles (mobile-first, navy + orange brand) */
:root {
  --navy: #14335c;
  --navy-2: #1e477e;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --ink: #1a2433;
  --muted: #5b6b7f;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e3e8ef;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --blue: #2563eb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 14px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--orange-dark); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; color: var(--navy); }
p { margin: 0 0 1em; }

/* Top bar */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .logo {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff; flex-shrink: 0;
}
.topbar .brand { font-weight: 800; font-size: 16px; letter-spacing: .2px; }
.topbar .sub { font-size: 11px; color: rgba(255,255,255,.75); }
.topbar .spacer { flex: 1; }
.topbar a.btn, .topbar .btn {
  background: var(--orange); color: #fff; border: none;
  padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px;
  cursor: pointer; text-decoration: none;
}

/* Emergency call strip */
.emergency-strip {
  background: var(--orange);
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
}
.emergency-strip a { color: #fff; font-weight: 800; }
.emergency-strip .spacer { flex: 1; }

/* Layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }
.wrap.wide { max-width: 1280px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid.c2 { grid-template-columns: 1fr 1fr; } .grid.c3 { grid-template-columns: 1fr 1fr 1fr; } }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card h3 { font-size: 16px; }

/* Hero */
.hero {
  background: linear-gradient(140deg, var(--navy) 0%, var(--navy-2) 60%, #28518f 100%);
  color: #fff; border-radius: var(--radius); padding: 28px 22px; position: relative; overflow: hidden;
}
.hero h1 { color: #fff; font-size: 26px; }
.hero p { color: rgba(255,255,255,.85); }
.hero .tag { display: inline-block; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; color: var(--ink); }
input, select, textarea {
  width: 100%; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); border-color: transparent; }
textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; gap: 12px; }
@media (min-width: 560px) { .form-row.c2 { grid-template-columns: 1fr 1fr; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--orange); color: #fff; border: none; cursor: pointer;
  padding: 12px 18px; border-radius: 10px; font-size: 15px; font-weight: 700;
  font-family: inherit; transition: filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn.block { width: 100%; }
.btn.secondary { background: #eef2f7; color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn.danger { background: var(--red); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Chips / badges */
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; text-transform: capitalize; white-space: nowrap;
}
.badge.new { background: #dbeafe; color: #1d4ed8; }
.badge.contacted { background: #fef3c7; color: #b45309; }
.badge.scheduled { background: #e0e7ff; color: #4338ca; }
.badge.estimate_sent, .badge.sent { background: #ede9fe; color: #6d28d9; }
.badge.approved { background: #dcfce7; color: #15803d; }
.badge.won, .badge.paid, .badge.completed { background: #dcfce7; color: #15803d; }
.badge.lost, .badge.declined, .badge.overdue { background: #fee2e2; color: #b91c1c; }
.badge.in_progress { background: #dbeafe; color: #1d4ed8; }
.badge.inspection_done { background: #cffafe; color: #0e7490; }
.badge.on_hold { background: #f1f5f9; color: #475569; }
.badge.draft { background: #f1f5f9; color: #475569; }
.badge.emergency { background: var(--red); color: #fff; }

/* Service list */
.service-list { display: grid; gap: 10px; }
.service-item {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  cursor: pointer; transition: border .15s, box-shadow .15s;
}
.service-item:hover { border-color: var(--orange); box-shadow: var(--shadow); }
.service-item .dot { width: 38px; height: 38px; border-radius: 10px; background: #fff3ea; color: var(--orange-dark); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.service-item .name { font-weight: 700; font-size: 14px; }
.service-item .desc { font-size: 12px; color: var(--muted); }

/* Steps */
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.step { flex: 1; min-width: 70px; text-align: center; font-size: 11px; color: var(--muted); }
.step .num { width: 26px; height: 26px; border-radius: 50%; background: #eef2f7; color: var(--muted); display: flex; align-items: center; justify-content: center; margin: 0 auto 4px; font-weight: 700; }
.step.active .num { background: var(--orange); color: #fff; }
.step.done .num { background: var(--green); color: #fff; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding-left: 24px; padding-bottom: 16px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .t { font-weight: 700; color: var(--navy); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: #fafbfd; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Kanban board */
.board { display: grid; gap: 14px; grid-template-columns: 1fr; overflow-x: auto; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(7, minmax(210px, 1fr)); } }
.col { background: #eef2f7; border-radius: 12px; padding: 10px; min-height: 120px; }
.col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 4px 6px 10px; }
.kcard { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.kcard .name { font-weight: 700; font-size: 14px; }
.kcard .svc { font-size: 12px; color: var(--muted); }
.kcard .meta { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Stat tiles */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .stats { grid-template-columns: repeat(6, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 24px; font-weight: 800; color: var(--navy); margin-top: 2px; }

/* Admin nav */
.admin-nav { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.admin-nav button {
  background: transparent; border: none; font-family: inherit; cursor: pointer;
  padding: 9px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.admin-nav button.active { background: var(--navy); color: #fff; }

/* Sections */
.section { display: none; }
.section.active { display: block; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600; z-index: 999; box-shadow: var(--shadow);
  max-width: 90%; text-align: center;
}
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

/* Utility */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.money { font-variant-numeric: tabular-nums; }

/* Login */
.login-box { max-width: 360px; margin: 40px auto; }

/* Footer */
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; }
.footer .disc { color: #98a2b3; font-size: 11px; }
