/* Mountainside Pros HQ — Copyright (c) 2026 Mountainside Pros Handyman & Landscape Services LLC. All rights reserved. */
:root, [data-theme="orange"] {
  --accent: #D9650A; --accent-ink: #FFFFFF; --accent-soft: #FFF1E4; --link: #B04F05;
  --head: #141010; --head2: #2A201A; --head-ink: #F4C79B;
  --bg: #FBF6EF; --card: #FFFFFF; --ink: #1A1411; --muted: #6B4A2E; --label: #8A5A2E;
  --chip: #F3E9DD; --chip-ink: #5A3B22; --line: #EADCCB; --shadow: rgba(90,50,20,0.08);
  --ok: #2F7D4A; --warn-bg: #FFF1E4; --warn-line: #D9650A; --warn-ink: #8A3E04;
}
[data-theme="pink"] {
  --accent: #F7C6D5; --accent-ink: #2B1D23; --accent-soft: #FDE6EE; --link: #A8476E;
  --head: #2B1D23; --head2: #3D2A33; --head-ink: #F9D3DF;
  --bg: #FFF7F9; --card: #FFFFFF; --ink: #1F1418; --muted: #6E4357; --label: #8E3E5C;
  --chip: #F9E8EE; --chip-ink: #5C3446; --line: #F1D6E0; --shadow: rgba(120,50,80,0.08);
  --ok: #2F7D4A; --warn-bg: #FDE6EE; --warn-line: #E59AB5; --warn-ink: #7A2E4C;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Barlow, -apple-system, system-ui, sans-serif; font-size: 16px; }
body { min-height: 100vh; min-height: 100dvh; }
a { color: var(--link); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.cond { font-family: 'Barlow Condensed', Barlow, system-ui, sans-serif; }
.hidden { display: none !important; }

/* layout */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.head { background: var(--head); color: #fff; padding: calc(env(safe-area-inset-top) + 14px) 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.head .logo { height: 40px; width: auto; border-radius: 6px; display: block; }
.head .office { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 22px; color: var(--head-ink); letter-spacing: .06em; text-transform: uppercase; }
.head .kicker { font-weight: 600; font-size: 14px; color: var(--head-ink); letter-spacing: .04em; text-transform: uppercase; }
.head h1 { margin: 0; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 32px; line-height: 1.05; color: #fff; }
.head .sub { font-weight: 500; font-size: 16px; color: var(--head-ink); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--head-ink); font-weight: 600; font-size: 15px; min-height: 44px; background: none; border: 0; padding: 0; cursor: pointer; }
.head-btn { background: var(--head2); color: var(--head-ink); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; min-height: 38px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.sync { background: var(--head2); color: var(--head-ink); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; white-space: nowrap; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: #6FD08C; }
.sync.pending .dot { background: #F5B451; }
.sync.offline .dot { background: #F5B451; }
.sync.busy .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--head2); border-radius: 14px; padding: 12px; border: 0; text-align: left; cursor: pointer; color: inherit; }
.stat b { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 28px; color: #fff; font-weight: 700; }
.stat span { font-weight: 500; font-size: 13px; color: var(--head-ink); }
.stat.hot { background: var(--accent); }
.stat.hot b, .stat.hot span { color: var(--accent-ink); }

main { flex: 1; padding: 18px 16px 110px; display: flex; flex-direction: column; gap: 12px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 4px 0; }
.section-title h2 { margin: 0; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 21px; text-transform: uppercase; letter-spacing: .02em; }
.section-title a, .section-title button { font-weight: 600; font-size: 15px; background: none; border: 0; color: var(--link); cursor: pointer; padding: 6px 0; }

/* cards */
.card { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 0 var(--line), 0 6px 18px var(--shadow); }
.card.flat { box-shadow: 0 1px 0 var(--line); }
.item { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: 16px; padding: 14px; box-shadow: 0 1px 0 var(--line), 0 6px 18px var(--shadow); color: var(--ink); border: 0; width: 100%; text-align: left; cursor: pointer; }
.item .when { width: 58px; flex: none; align-self: stretch; background: var(--chip); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 0; color: var(--chip-ink); }
.item .when b { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 700; }
.item .when span { font-size: 12px; font-weight: 600; }
.item.next .when { background: var(--accent-soft); color: var(--link); }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 700; font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-weight: 500; font-size: 15px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .r { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; flex: none; }
.item .avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--chip); color: var(--chip-ink); display: flex; align-items: center; justify-content: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { background: var(--chip); color: var(--chip-ink); font-weight: 600; font-size: 12px; border-radius: 999px; padding: 3px 10px; }
.chip.accent { background: var(--accent); color: var(--accent-ink); }
.chip.ok { background: #E3F3E8; color: #22643A; }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.list { display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; font-weight: 500; }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; border-radius: 16px; border: 0; padding: 0 20px; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--head); color: #fff; }
.btn.outline { background: var(--card); color: var(--ink); border: 2px solid var(--ink); }
.btn.danger { background: var(--card); color: #A3261A; border: 2px solid #A3261A; }
.btn.small { min-height: 44px; font-size: 16px; width: auto; }
.btn-row .btn { padding: 0 10px; font-size: 17px; line-height: 1.05; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick button, .quick a { background: var(--card); border: 0; border-radius: 14px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink); box-shadow: 0 1px 0 var(--line), 0 6px 18px var(--shadow); cursor: pointer; min-height: 72px; justify-content: center; text-align: center; }
.quick svg { color: var(--link); }
.quick .off { opacity: .45; pointer-events: none; }

/* detail fields */
.fields { display: flex; flex-direction: column; gap: 12px; }
.f .l { font-weight: 600; font-size: 12px; color: var(--label); text-transform: uppercase; letter-spacing: .06em; }
.f .v { font-weight: 500; font-size: 17px; margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere; }
.f2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.photos img, .photos .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--chip); display: block; }
.photos label { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; color: var(--link); font-weight: 600; font-size: 13px; cursor: pointer; }
.money-card { border: 2px solid var(--accent); }

/* forms */
form.card { display: flex; flex-direction: column; gap: 14px; }
.field label, .field .lab { display: block; font-weight: 600; font-size: 13px; color: var(--label); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; border: 2px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 17px; outline: none; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--link); }
.field .req { color: #A3261A; }
.checks { display: flex; flex-direction: column; gap: 4px; }
.checks label { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
.checks input { width: 22px; height: 22px; min-height: 0; accent-color: var(--link); }
.err { color: #A3261A; font-weight: 600; font-size: 14px; }

/* search + tabs */
.search { width: 100%; min-height: 50px; border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 14px; font-size: 17px; outline: none; }
.search:focus { border-color: var(--link); }
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.seg button { flex: none; border: 0; background: var(--chip); color: var(--chip-ink); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; min-height: 40px; cursor: pointer; }
.seg button.on { background: var(--head); color: #fff; }
.week { display: grid; grid-template-columns: 36px repeat(7, minmax(0, 1fr)) 36px; gap: 4px; align-items: center; }
.week button { border: 0; background: none; cursor: pointer; border-radius: 12px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; color: var(--head-ink); min-height: 54px; justify-content: center; }
.week button b { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; color: #fff; }
.week button span { font-size: 12px; font-weight: 600; text-transform: uppercase; }
.week button.on { background: var(--accent); }
.week button.on b, .week button.on span { color: var(--accent-ink); }
.week button .pip { width: 5px; height: 5px; border-radius: 50%; background: var(--head-ink); margin-top: 3px; }
.week button.on .pip { background: var(--accent-ink); }
.week .arrow { color: var(--head-ink); min-height: 44px; }

/* bottom nav */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 6px 6px calc(env(safe-area-inset-bottom) + 8px); z-index: 10; }
nav.tabs .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 50px; color: var(--chip-ink); font-weight: 600; font-size: 12px; }
nav.tabs a.on { color: var(--link); }
.fab { position: fixed; right: max(18px, calc(50vw - 262px)); bottom: calc(env(safe-area-inset-bottom) + 84px); width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px var(--shadow), 0 2px 6px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 11; }

/* menu list */
.menu a, .menu button { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 17px; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; cursor: pointer; min-height: 56px; }
.menu a:last-child, .menu button:last-child { border-bottom: 0; }
.menu svg { color: var(--link); flex: none; }
.menu .count { margin-left: auto; color: var(--muted); font-weight: 600; }

/* toast + sign-in */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 150px); background: var(--head); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 30; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.signin { min-height: 100vh; min-height: 100dvh; background: var(--head); display: flex; flex-direction: column; justify-content: center; padding: 32px 24px; gap: 18px; }
.signin img { width: 220px; max-width: 70%; border-radius: 10px; align-self: center; }
.signin h1 { color: #fff; margin: 8px 0 0; font-family: 'Barlow Condensed', sans-serif; font-size: 34px; text-align: center; }
.signin p { color: var(--head-ink); margin: 0; text-align: center; font-weight: 500; }
.signin input { min-height: 56px; border-radius: 14px; border: 2px solid var(--head2); background: var(--head2); color: #fff; padding: 0 16px; font-size: 20px; text-align: center; letter-spacing: .04em; outline: none; }
.signin input:focus { border-color: var(--accent); }
.signin .err { color: #FFB4A8; text-align: center; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 0 0; }
.warnbox { background: var(--warn-bg); border: 2px solid var(--warn-line); border-radius: 16px; padding: 14px 16px; color: var(--warn-ink); font-weight: 600; }
