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

:root {
  /* ── 2 Ladies — "Fresh Seal": sunshine yellow on fresh-sealed asphalt ──
     Yellow is Lisa's favourite and the brand colour, set against warm
     asphalt-black surfaces and warm grey neutrals so the app reads,
     instantly, as an asphalt / sealcoating business. */
  --black: #211f1b;        /* fresh-sealed asphalt — dark surfaces & text on yellow */
  --gold: #ffc400;         /* brand sunshine yellow */
  --gold-dk: #e0a800;      /* deeper yellow for pressed/active states */
  --white: #ffffff;
  --gray-50: #faf9f4;      /* warm near-white */
  --gray-100: #f3f1e8;     /* warm light grey — app background */
  --gray-200: #e5e1d4;     /* warm border */
  --gray-400: #9b978a;     /* muted warm grey */
  --gray-600: #5f5c52;     /* secondary text */
  --gray-800: #2c2a23;     /* primary text — asphalt charcoal */
  --green: #22a559;
  --green-bg: #dcf5e5;
  --green-txt: #136b3a;
  --amber-bg: #fff1c9;
  --amber-txt: #8a6a00;
  --red: #e5484d;
  --red-bg: #fde3e4;
  --red-txt: #9c2126;
  --blue-bg: #dceafb;
  --blue-txt: #21458f;
  --purple-bg: #ece1f7;
  --purple-txt: #5b2f8a;
  --r: 12px;
  --rl: 18px;
  --shadow: 0 2px 10px rgba(40,36,20,0.08);
  --shadow-lg: 0 10px 30px rgba(40,36,20,0.16);
  --font-display: 'Fredoka', 'Nunito', sans-serif;
  --font-ui: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font-ui);
  font-size: 14px;
  background: var(--gray-100);
  color: var(--gray-800);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;   /* no gray flash on tap — app feel */
}

/* Friendly rounded display face for the brand wordmark, headings & key numbers */
.login-logo h1, .topbar-title, .brief-date, .metric-num,
.modal-title, .est-total-num, .reminders-hero-title {
  font-family: var(--font-display);
  letter-spacing: 0;
}
/* Remove the 300ms tap delay and double-tap-to-zoom on controls (touch devices) */
button, .nav-tab, .job-row, .clock-row, .pin-btn { touch-action: manipulation; }

/* SCREENS */
.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* LOGIN */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  /* Aerial view of a freshly-sealed parking lot, darkened so the card pops */
  background:
    linear-gradient(180deg, rgba(15,14,12,0.55) 0%, rgba(15,14,12,0.78) 100%),
    url('../assets/parking-lot.svg') center / cover no-repeat,
    var(--black);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.logo-icon-lg {
  width: 72px; height: 72px;
  background: transparent;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255,196,0,0.40);
}
.logo-img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.login-badge { width: 132px; height: 132px; display: block; margin: 0 auto 12px; cursor: pointer; filter: drop-shadow(0 12px 26px rgba(0,0,0,0.45)); }
@media (min-width: 768px) { .login-badge { width: 152px; height: 152px; } }
.login-logo h1 { font-size: 22px; font-weight: 600; color: var(--white); }
.login-logo p { font-size: 11px; color: var(--gold); margin-top: 8px; letter-spacing: 1px; text-transform: uppercase; }
.login-site-link { display: block; text-align: center; margin-top: 18px; color: rgba(255,255,255,0.6); font-size: 12px; font-weight: 600; text-decoration: none; letter-spacing: 0.5px; }
.login-site-link:hover { color: var(--gold); }
.login-card {
  background: var(--white);
  border-radius: var(--rl);
  padding: 26px 22px;
  width: 100%; max-width: 340px;
  box-shadow: 0 18px 50px rgba(30,10,25,0.45);
}
.field-label { font-size: 11px; font-weight: 600; color: var(--gray-600); letter-spacing: 0.5px; display: block; margin-bottom: 6px; }
.field-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--r);
  font-size: 14px; color: var(--gray-800);
  background: var(--white);
  outline: none; appearance: none;
  transition: border-color 0.15s;
}
.field-input:focus { border-color: var(--gold); }
.pin-user-name { font-size: 15px; font-weight: 600; text-align: center; margin-bottom: 14px; color: var(--gray-800); }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
.pin-dots span {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--gray-200);
  transition: background 0.1s, border-color 0.1s;
}
.pin-dots span.filled { background: var(--gold); border-color: var(--gold); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-btn {
  height: 52px; border-radius: var(--r);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 20px; font-weight: 500;
  color: var(--gray-800); cursor: pointer;
  transition: background 0.1s;
}
.pin-btn:active { background: var(--gray-200); }
.pin-clear { font-size: 18px; }
.pin-back { font-size: 13px; color: var(--gray-400); }
.pin-error { color: var(--red-txt); font-size: 12px; text-align: center; margin-top: 10px; }

/* BUTTONS */
.btn-primary {
  background: linear-gradient(145deg, #ffd23d 0%, var(--gold) 55%, var(--gold-dk) 100%);
  color: var(--black);
  border: none; border-radius: var(--r);
  padding: 12px 20px; font-size: 14px; font-weight: 800;
  cursor: pointer; transition: filter 0.12s, transform 0.05s;
  box-shadow: 0 4px 14px rgba(255,196,0,0.32);
}
.btn-primary:active { filter: brightness(0.94); transform: translateY(1px); }
.btn-secondary {
  background: var(--white); color: var(--gray-800);
  border: 1px solid var(--gray-200); border-radius: var(--r);
  padding: 10px 18px; font-size: 14px;
  cursor: pointer; transition: background 0.1s;
}
.btn-secondary:active { background: var(--gray-100); }
.btn-xs {
  background: rgba(255,255,255,0.15); color: var(--white);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 6px;
  padding: 4px 10px; font-size: 11px; font-weight: 500;
  cursor: pointer;
}
.btn-danger {
  background: var(--red-bg); color: var(--red-txt);
  border: 1px solid #fca5a5; border-radius: var(--r);
  padding: 10px 18px; font-size: 14px;
  cursor: pointer;
}
.full-width { width: 100%; }
.mt16 { margin-top: 16px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.1);
  color: var(--white); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* TOPBAR */
.topbar {
  background: linear-gradient(120deg, #34322b 0%, var(--black) 100%);
  padding: 11px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 2px solid var(--gold);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-icon-sm {
  width: 34px; height: 34px; border-radius: 9px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
}
.topbar-title { font-size: 13px; font-weight: 600; color: var(--white); }
.topbar-role { font-size: 10px; color: var(--gold); letter-spacing: 0.5px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-time { font-size: 11px; color: var(--gray-400); }

/* WEATHER BAR */
.weather-bar {
  background: #2c2a22;
  padding: 7px 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: #e7e2d2;
}
.weather-status { font-weight: 600; color: var(--green); }
.weather-status.warn { color: var(--gold); }
.wx-sep { flex: 1; }
.weather-bar-actions { margin-left: auto; }

/* NAV — dropdown menu of sections */
.nav-tabs {
  display: block;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 51px; z-index: 40;
  padding: 9px 14px;
}
.nav-dd { position: relative; max-width: 360px; }
.nav-dd-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--r);
  padding: 11px 14px; font-family: var(--font-display); font-size: 16px; font-weight: 600;
  color: var(--gray-800); cursor: pointer;
}
.nav-dd-caret { color: var(--gold-dk); transition: transform 0.15s; font-size: 13px; }
.nav-dd-btn.open .nav-dd-caret { transform: rotate(180deg); }
.nav-dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 60; display: none;
  max-height: 64vh; overflow-y: auto;
}
.nav-dd-menu.open { display: block; animation: menu-in 0.12s ease; }
.nav-dd-item {
  display: block; width: 100%; text-align: left;
  padding: 11px 12px; border: none; background: none;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--gray-800);
  border-radius: 8px; cursor: pointer;
}
.nav-dd-item:hover { background: var(--gray-100); }
.nav-dd-item.active { background: #fffaf0; color: var(--gold-dk); }

/* PANELS */
#panels-container { padding: 14px; }
.panel { display: none; }
.panel.active { display: block; }

/* CARDS */
.card {
  background: var(--white);
  border-radius: var(--rl);
  border: 1px solid var(--gray-200);
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 11px; font-weight: 600; color: var(--gray-600); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 10px; }
.metric-num { font-size: 28px; font-weight: 600; color: var(--gray-800); }
.metric-sub { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* STAT GRID */
.stat-grid { display: grid; gap: 10px; margin-bottom: 14px; }
.stat-grid-2 { grid-template-columns: 1fr 1fr; }
.stat-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.stat-card {
  background: var(--gray-50);
  border-radius: var(--r);
  padding: 12px;
  border: 1px solid var(--gray-200);
}

/* JOB ROWS */
.job-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.1s;
}
.job-row:active { border-color: var(--gold); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--gold); }
.dot-blue { background: #3b82f6; }
.dot-gray { background: var(--gray-400); }
.dot-red { background: var(--red); }
.job-body { flex: 1; min-width: 0; }
.job-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-sub { font-size: 11px; color: var(--gray-400); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-right { text-align: right; flex-shrink: 0; }
.job-val { font-size: 13px; font-weight: 600; }

/* BADGES */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 20px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-green { background: var(--green-bg); color: var(--green-txt); }
.badge-amber { background: var(--amber-bg); color: var(--amber-txt); }
.badge-red { background: var(--red-bg); color: var(--red-txt); }
.badge-blue { background: var(--blue-bg); color: var(--blue-txt); }
.badge-purple { background: var(--purple-bg); color: var(--purple-txt); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* FORMS */
.form-group { margin-bottom: 12px; }
.form-group label { font-size: 11px; font-weight: 600; color: var(--gray-600); display: block; margin-bottom: 5px; letter-spacing: 0.4px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--gray-200); border-radius: var(--r);
  font-size: 13px; color: var(--gray-800); background: var(--white);
  outline: none; font-family: inherit;
  transition: border-color 0.15s;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-actions .btn-primary,
.form-actions .btn-secondary { flex: 1; }

/* WORKER CARD */
.worker-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r);
  padding: 12px;
  margin-bottom: 8px;
}
.worker-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--black); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.worker-info { flex: 1; }
.worker-name { font-size: 13px; font-weight: 600; }
.worker-role { font-size: 11px; color: var(--gray-400); }
.duty-chip {
  display: inline-block; background: var(--gray-100);
  border: 1px solid var(--gray-200); border-radius: 4px;
  padding: 2px 7px; font-size: 11px; margin: 2px;
}

/* CLOCK */
.clock-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--r); margin-bottom: 8px;
}
.clock-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); flex-shrink: 0; }
.clock-dot.in { background: var(--green); }
.clock-info { flex: 1; }
.clock-name { font-size: 13px; font-weight: 600; }
.clock-time { font-size: 11px; color: var(--gray-400); }
.punch-btn {
  padding: 6px 12px; border-radius: var(--r); font-size: 12px; font-weight: 600;
  border: 1px solid var(--gray-200); cursor: pointer; background: var(--white);
}
.punch-btn.punch-in { background: var(--green-bg); color: var(--green-txt); border-color: #86efac; }
.punch-btn.punch-out { background: var(--red-bg); color: var(--red-txt); border-color: #fca5a5; }

/* MORNING BRIEF */
.brief-card {
  background: linear-gradient(135deg, #3c3a30 0%, var(--black) 100%);
  border-radius: var(--rl);
  padding: 18px; margin-bottom: 14px; color: var(--white);
  box-shadow: var(--shadow-lg);
}
.brief-label { font-size: 10px; font-weight: 700; color: var(--gold); letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 4px; }
.brief-date { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.brief-line { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 7px; font-size: 12px; color: #e7e2d2; }
.brief-bullet { color: var(--gold); flex-shrink: 0; }

/* AI BRIEF BOX */
.ai-brief {
  background: linear-gradient(135deg, #3a382e 0%, var(--black) 100%);
  border: 1px solid #4d4a3d;
  border-radius: var(--rl);
  padding: 16px;
  margin-bottom: 14px;
  color: var(--white);
  box-shadow: var(--shadow-lg);
}
.ai-brief-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 600; color: var(--gold);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px;
}
.ai-brief-label::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }
.ai-brief-body { font-size: 13px; line-height: 1.7; color: #eee; }
.ai-brief-body strong { color: var(--gold); font-weight: 600; }
.ai-brief-loading { font-size: 12px; color: var(--gray-400); font-style: italic; }

/* WARRANTY PROGRESS */
.w-bar { background: var(--gray-200); border-radius: 4px; height: 4px; margin-top: 4px; overflow: hidden; }
.w-fill { height: 100%; border-radius: 4px; }

/* LEAD SOURCE BARS */
.source-bar-wrap { margin-bottom: 10px; }
.source-bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.source-bar { background: var(--gray-200); border-radius: 4px; height: 8px; overflow: hidden; }
.source-fill { height: 100%; border-radius: 4px; }

/* STAT ROW */
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--gray-600); }

/* MONEY LEAK */
.money-leak-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--gray-100);
  font-size: 12px;
}
.money-leak-item:last-child { border-bottom: none; }

/* SEVERITY SELECTOR */
.sev-group { display: flex; gap: 6px; margin-top: 5px; }
.sev-opt {
  flex: 1; padding: 7px; text-align: center;
  border: 1px solid var(--gray-200); border-radius: var(--r);
  font-size: 12px; font-weight: 600; cursor: pointer; background: var(--white);
  transition: all 0.1s;
}
.sev-opt.sel-low { background: var(--green-bg); color: var(--green-txt); border-color: #86efac; }
.sev-opt.sel-med { background: var(--amber-bg); color: var(--amber-txt); border-color: #fcd34d; }
.sev-opt.sel-high { background: var(--red-bg); color: var(--red-txt); border-color: #fca5a5; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end;
  z-index: 200;
}
.modal-box {
  background: var(--white);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px 32px;
  width: 100%; max-height: 85vh;
  overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--gray-800); }

/* TOAST */
.toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800); color: var(--white);
  padding: 10px 20px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  z-index: 300; white-space: nowrap;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity:0; transform: translateX(-50%) translateY(10px); } }

/* SECTION TITLE */
.section-title {
  font-size: 13px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.section-title-sm { font-size: 11px; font-weight: 600; color: var(--gray-600); letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 8px; }

/* RANGE SLIDER */
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 4px;
  background: var(--gray-200); border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--gold); cursor: pointer;
}

/* RESPONSIVE */
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: 16px; max-width: 500px; }
  #panels-container { max-width: 700px; margin: 0 auto; }
}

/* PRODUCTION FORM */
.prod-form { background: var(--gray-50); border-radius: var(--r); padding: 14px; border: 1px solid var(--gray-200); }

/* ESTIMATE BUILDER */
.est-total-card {
  position: sticky; top: 92px; z-index: 30;
  background: linear-gradient(145deg, #ffd23d 0%, var(--gold) 55%, var(--gold-dk) 100%); color: var(--black);
  border-radius: var(--rl); padding: 15px 17px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; box-shadow: 0 8px 22px rgba(255,196,0,0.42);
}
.est-total-label { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.7; }
.est-total-num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.est-total-side { text-align: right; font-size: 13px; font-weight: 600; }
.est-measure-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.est-sec-label {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
  background: var(--gray-100); color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.est-measure-row .field-input { text-align: center; }
.est-x { color: var(--gray-400); font-weight: 600; }
.est-measured-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding-top: 8px; margin-top: 4px;
  border-top: 1px solid var(--gray-100); color: var(--gray-600);
}
.est-svc { padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.est-svc:last-child { border-bottom: none; }
.est-svc-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.est-svc-head input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold-dk); }
.est-svc-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; padding-left: 26px; }
.est-svc-inputs.est-svc-3 { grid-template-columns: 1fr 1fr 1fr; }
.est-svc-inputs label { font-size: 10px; font-weight: 600; color: var(--gray-400); display: block; margin-bottom: 3px; }
.est-line { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.est-line-total { border-top: 1px solid var(--gray-200); margin-top: 4px; padding-top: 8px; font-weight: 700; font-size: 15px; }
.est-materials { margin-top: 8px; }
.est-mat-row { font-size: 12px; color: var(--gray-600); background: var(--amber-bg); border-radius: var(--r); padding: 8px 10px; }

/* MAP MEASURE OVERLAY */
.mm-overlay { position: fixed; inset: 0; z-index: 500; background: #000; display: flex; flex-direction: column; }
.mm-map { flex: 1; width: 100%; }
.mm-bar { background: var(--black); padding: 8px; display: flex; gap: 6px; align-items: center; }
.mm-top { border-bottom: 2px solid var(--gold); }
.mm-top input { flex: 1; }
.mm-modes { background: var(--black); display: flex; gap: 6px; padding: 0 8px 8px; }
.mm-mode { flex: 1; background: var(--gray-800); color: #fff; border: 1px solid #444; border-radius: var(--r); padding: 9px 6px; font-size: 13px; font-weight: 700; cursor: pointer; }
.mm-mode.active { background: var(--gold); color: var(--black); border-color: var(--gold); }
.mm-bottom { flex-direction: column; gap: 8px; border-top: 2px solid var(--gold); padding-bottom: 14px; }
.mm-area { color: #fff; font-size: 15px; align-self: flex-start; }
.mm-area strong { color: var(--gold); font-size: 20px; }
.mm-actions { display: flex; gap: 6px; width: 100%; }
.mm-btn { flex: 1; background: var(--gray-800); color: #fff; border: 1px solid #444; border-radius: var(--r); padding: 10px 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.mm-top .mm-btn { flex: 0 0 auto; padding: 10px 12px; }
.mm-use { background: var(--gold); color: var(--black); border-color: var(--gold); font-weight: 800; }
.mm-hint {
  position: absolute; top: 112px; left: 50%; transform: translateX(-50%);
  z-index: 510; background: rgba(26,26,26,0.85); color: #fff;
  font-size: 12px; padding: 6px 12px; border-radius: 16px; pointer-events: none;
  max-width: 90%; text-align: center; line-height: 1.4;
}

/* SETUP / DB ERROR BANNER (login) */
.setup-error {
  background: #2a1212; border: 1px solid #7a2d2d; color: #ffd7d7;
  border-radius: var(--r); padding: 14px 16px; margin: 0 0 14px;
  font-size: 13px; line-height: 1.5; text-align: left;
}
.setup-error-title { font-weight: 800; color: #ffb3b3; margin-bottom: 8px; }
.setup-error-steps { margin: 0; padding-left: 18px; }
.setup-error-steps li { margin-bottom: 6px; }
.setup-error code { background: rgba(255,255,255,0.12); padding: 1px 5px; border-radius: 4px; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 32px 16px; color: var(--gray-400); font-size: 13px; }

/* SCROLL FIX */
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* ===== iPad / TABLET =====
   Phone-first sizes are cramped on Lisa's iPad. At >=768px: bump text,
   grow touch targets toward the 44px iOS minimum, and use the wider
   screen instead of a narrow centered column. Topbar height is left
   unchanged so the sticky nav offsets still line up. */
@media (min-width: 768px) {
  body { font-size: 16px; }

  /* Use the screen rather than a phone-width column */
  #panels-container { max-width: 920px; padding: 22px 28px; }

  /* Login — more presence on a large display */
  .login-card { max-width: 420px; padding: 32px 28px; }
  .logo-icon-lg { width: 80px; height: 80px; font-size: 30px; border-radius: 20px; }
  .login-logo h1 { font-size: 24px; }
  .login-logo p { font-size: 13px; }
  .field-label { font-size: 13px; }
  .field-input { padding: 14px; font-size: 17px; }
  .pin-btn { height: 64px; font-size: 24px; }
  .pin-dots span { width: 18px; height: 18px; }

  /* Header / nav — readable + easier to tap */
  .topbar-title { font-size: 15px; }
  .weather-bar { font-size: 14px; padding: 9px 20px; }
  .nav-tab { padding: 13px 22px; font-size: 15px; }
  .est-total-card { top: 102px; }   /* keep below the taller nav row */

  /* Cards & metrics */
  .card { padding: 18px; }
  .card-title { font-size: 12px; }
  .metric-num { font-size: 34px; }
  .metric-sub { font-size: 14px; }
  .stat-card { padding: 16px; }

  /* Lists — taller rows are much easier to tap on a touchscreen */
  .job-row, .clock-row { padding: 15px 16px; }
  .job-name, .job-val, .clock-name { font-size: 15px; }
  .job-sub { font-size: 13px; }
  .worker-card { padding: 16px; }
  .worker-name { font-size: 15px; }

  /* Buttons — bigger hit area */
  .btn-primary, .btn-secondary, .btn-danger { padding: 14px 22px; font-size: 16px; }
  .punch-btn { padding: 10px 18px; font-size: 14px; }
  .badge { font-size: 11px; padding: 3px 10px; }

  /* Forms — comfortable touch typing (16px+ also stops iOS zoom-on-focus) */
  .form-group label { font-size: 12px; }
  .form-group input,
  .form-group select,
  .form-group textarea { padding: 13px; font-size: 16px; }

  /* Misc readability */
  .modal-box { max-width: 560px; }
  .modal-title { font-size: 18px; }
  .section-title { font-size: 15px; }
  .ai-brief-body { font-size: 15px; }
  .stat-row { font-size: 15px; }
}

/* ============================================================
   SWIPE-TO-DELETE + ROW MENUS + REMINDERS  (added in redesign)
   ============================================================ */

/* Polished, tappable list rows */
.job-row { box-shadow: var(--shadow); transition: border-color 0.12s, transform 0.05s, box-shadow 0.12s; }
.job-row:active { border-color: var(--gold); }
@media (hover: hover) {
  .job-row:hover { border-color: var(--gold); box-shadow: var(--shadow-lg); }
}

/* Kebab (⋮) action button that opens a dropdown menu on a row */
.row-menu-btn {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: transparent; color: var(--gray-400);
  font-size: 18px; line-height: 1; cursor: pointer; margin-left: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.row-menu-btn:hover { background: var(--gray-100); color: var(--gold-dk); }

/* Dropdown popover menu */
.menu-pop {
  position: fixed; z-index: 400; min-width: 168px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 6px; animation: menu-in 0.12s ease;
  overflow: hidden;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 10px 12px; border: none; background: none;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--gray-800);
  border-radius: 8px; cursor: pointer;
}
.menu-item:hover { background: var(--gray-100); }
.menu-item.danger { color: var(--red-txt); }
.menu-item.danger:hover { background: var(--red-bg); }
.menu-item .mi-ico { font-size: 15px; width: 18px; text-align: center; }
.menu-backdrop { position: fixed; inset: 0; z-index: 399; background: transparent; }

/* Swipe-to-delete wrapper. The visible row sits on top of a red
   "Delete" action that is revealed when you drag the row left. */
.swipe-wrap {
  position: relative; overflow: hidden;
  border-radius: var(--r); margin-bottom: 8px;
}
.swipe-wrap .job-row,
.swipe-wrap .clock-row,
.swipe-wrap .worker-card { margin-bottom: 0; }
.swipe-del {
  position: absolute; top: 0; right: 0; bottom: 0; width: 96px;
  background: linear-gradient(145deg, #e0566f 0%, #b32d46 100%); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px;
  cursor: pointer; border: none;
}
.swipe-del .sd-ico { font-size: 18px; }
.swipe-row {
  position: relative; z-index: 1;
  background: var(--white);
  transform: translateX(0);
  transition: transform 0.22s cubic-bezier(.22,.61,.36,1);
  touch-action: pan-y;           /* let the browser handle vertical scroll */
  will-change: transform;
}
.swipe-row.swiping { transition: none; }

/* Hint shown the first time a swipeable list renders */
.swipe-hint {
  font-size: 11px; color: var(--gray-400);
  display: flex; align-items: center; gap: 5px;
  margin: 0 2px 8px; font-style: italic;
}

/* ── REMINDERS HUB ── */
.reminders-hero {
  background: linear-gradient(135deg, #3c3a30 0%, var(--black) 100%);
  border-radius: var(--rl); padding: 18px; margin-bottom: 14px;
  color: #fff; box-shadow: var(--shadow-lg);
}
.reminders-hero-title { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.reminders-hero-title::after { content: ' 🙂'; }
.reminders-hero-sub { font-size: 12px; color: #e7e2d2; line-height: 1.5; }
.reminder-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 13px; background: var(--white);
  border: 1px solid var(--gray-200); border-left: 4px solid var(--gray-200);
  border-radius: var(--r); margin-bottom: 0;
  box-shadow: var(--shadow);
}
.reminder-row.prio-high { border-left-color: var(--red); }
.reminder-row.prio-med  { border-left-color: var(--gold); }
.reminder-row.prio-low  { border-left-color: var(--green); }
.reminder-row.is-done   { opacity: 0.55; }
.reminder-row.is-done .rem-title { text-decoration: line-through; }
.rem-check {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; border: 2px solid var(--gray-200);
  background: var(--white); cursor: pointer; position: relative;
  transition: background 0.12s, border-color 0.12s;
}
.rem-check.on { background: var(--green); border-color: var(--green); }
.rem-check.on::after {
  content: '✓'; color: #fff; font-size: 13px; font-weight: 800;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.rem-body { flex: 1; min-width: 0; }
.rem-title { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.rem-meta { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.rem-due { font-size: 11px; font-weight: 700; }
.rem-due.overdue { color: var(--red-txt); }
.rem-due.soon { color: var(--amber-txt); }

/* Smart (auto-generated) reminder cards */
.smart-rem {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; background: var(--gray-50);
  border: 1px solid var(--gray-200); border-radius: var(--r);
  margin-bottom: 8px;
}
.smart-rem .sr-ico {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: var(--gold); color: var(--black);
}

/* ── INVOICES ── */
.inv-item-row { display: grid; grid-template-columns: 1fr 96px 36px; gap: 6px; align-items: center; margin-bottom: 6px; }
.inv-item-row .field-input { padding: 9px 10px; }
.inv-amt { text-align: right; }
.inv-del-line { border: none; background: var(--gray-100); color: var(--gray-600); border-radius: 8px; height: 38px; cursor: pointer; font-weight: 700; font-size: 14px; }
.inv-del-line:hover { background: var(--red-bg); color: var(--red-txt); }
.pay-box { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--r); padding: 13px; margin: 12px 0; }

/* ── MAINTENANCE PLAN chips (quote builder) ── */
.plan-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-chip {
  flex: 1 1 130px; min-width: 130px; text-align: left;
  background: var(--gray-50); border: 1.5px solid var(--gray-200); border-radius: var(--r);
  padding: 10px 12px; font-family: inherit; font-weight: 800; font-size: 13px;
  color: var(--gray-800); cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  transition: border-color 0.12s, background 0.12s;
}
.plan-chip small { font-weight: 600; font-size: 10px; color: var(--gray-400); }
.plan-chip.active { border-color: var(--gold); background: #fffaf0; color: var(--gold-dk); box-shadow: 0 3px 12px rgba(255,196,0,0.20); }
.plan-chip.active small { color: var(--gold-dk); }
.plan-help { font-size: 11px; color: var(--gray-400); margin-top: 10px; line-height: 1.5; }
.est-recur { font-size: 11px; font-weight: 800; color: rgba(0,0,0,0.62); margin-top: 3px; }

/* ── SEAL CYCLE steps ── */
.cycle-steps { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cycle-steps::-webkit-scrollbar { display: none; }
.cycle-step {
  flex: 1 0 96px; min-width: 96px; text-align: center;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--r); padding: 11px 8px; box-shadow: var(--shadow);
}
.cycle-step.on { border-color: var(--gold); background: #fffaf0; box-shadow: 0 4px 14px rgba(255,196,0,0.22); }
.cs-ico { font-size: 20px; line-height: 1; }
.cs-t { font-size: 12px; font-weight: 800; margin-top: 5px; color: var(--gray-800); }
.cs-s { font-size: 10px; color: var(--gray-400); margin-top: 1px; }

/* 🙂 SMILEY EASTER EGG — tap the 2L logo to set them loose */
.smiley-pop {
  position: fixed; z-index: 1000; font-size: 26px;
  pointer-events: none; transform: translate(-50%, -50%);
  animation: smiley-float 1.1s ease-out forwards;
}
@keyframes smiley-float {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -170px) scale(1.25) rotate(var(--dr, 0deg)); }
}
.smart-rem .sr-body { flex: 1; min-width: 0; }
.smart-rem .sr-title { font-size: 13px; font-weight: 700; }
.smart-rem .sr-sub { font-size: 11px; color: var(--gray-600); margin-top: 1px; }
