:root {
  --yellow: #ccff00;
  --dark: #1F1F1F;
  --surface: #2a2a2a;
  --surface2: #333;
  --border: #3a3a3a;
  --text: #ffffff;
  --text-muted: #999;
  --danger: #ff4444;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.5px; }
.nav-brand span { color: var(--yellow); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 0.8rem; color: var(--text-muted); }
.nav-logout { background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.nav-logout:hover { border-color: var(--yellow); color: var(--yellow); }

/* SEASON TABS */
.season-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.season-tab {
  flex: 1;
  padding: 12px 16px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.season-tab.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

/* CONTAINER */
.container { max-width: 480px; margin: 0 auto; padding: 16px; }

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; border: none; transition: opacity 0.15s;
  text-decoration: none; width: 100%;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--yellow); color: #000; }
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--yellow); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--yellow); color: var(--yellow); }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; width: auto; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* LOG BUTTON */
.log-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 20px; background: var(--yellow); color: #000;
  border: none; border-radius: var(--radius); font-size: 1.1rem; font-weight: 700;
  cursor: pointer; margin-bottom: 20px;
}
.log-btn svg { width: 24px; height: 24px; }

/* ENTRY CARDS */
.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.entry-card.in-progress { border-left: 3px solid var(--yellow); }
.entry-card.complete { border-left: 3px solid var(--success); }
.entry-location { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.entry-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.entry-services { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.service-tag {
  background: var(--surface2); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 20px; font-size: 0.75rem; color: var(--text);
}
.entry-photos-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.entry-photo-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); cursor: pointer;
}
.entry-photo-thumb:hover { border-color: var(--yellow); }
.entry-status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status-in-progress { background: rgba(204,255,0,0.15); color: var(--yellow); }
.status-complete { background: rgba(34,197,94,0.15); color: var(--success); }

/* STEP HEADER */
.step-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.step-back { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
.step-back svg { display: block; }
.step-title { font-size: 1rem; font-weight: 700; }
.step-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* LOCATION LIST */
.search-bar {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 0.95rem; margin-bottom: 12px;
}
.search-bar:focus { outline: none; border-color: var(--yellow); }
.location-list { display: flex; flex-direction: column; gap: 8px; }
.location-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; cursor: pointer;
}
.location-item:hover, .location-item.selected { border-color: var(--yellow); }
.location-item.selected { background: rgba(204,255,0,0.08); }
.location-name { font-weight: 600; font-size: 0.95rem; }
.location-address { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* SERVICES */
.service-list { display: flex; flex-direction: column; gap: 8px; }
.service-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 14px; cursor: pointer;
}
.service-item:hover { border-color: var(--yellow); }
.service-item.selected { border-color: var(--yellow); background: rgba(204,255,0,0.08); }
.service-check {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.service-item.selected .service-check {
  background: var(--yellow); border-color: var(--yellow);
}
.service-check svg { width: 14px; height: 14px; }
.service-label { font-size: 1rem; font-weight: 500; }

/* PHOTO SECTION */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.photo-thumb {
  aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--border); width: 100%; cursor: pointer;
}
.photo-thumb:hover { border-color: var(--yellow); }
.photo-placeholder {
  aspect-ratio: 1; border: 2px dashed var(--border);
  border-radius: var(--radius-sm); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  color: var(--text-muted); font-size: 0.75rem; cursor: pointer;
}
.photo-placeholder:hover { border-color: var(--yellow); color: var(--yellow); }
.photo-placeholder svg { width: 28px; height: 28px; }
.photo-count { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }

/* CAMERA BTN */
.camera-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px; background: var(--surface);
  border: 2px dashed var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; margin-bottom: 12px;
}
.camera-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.camera-btn svg { width: 24px; height: 24px; }

/* EMPTY STATE */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* SECTION LABEL */
.section-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 10px;
}

/* ADMIN TABS */
.admin-tabs {
  display: flex; background: var(--surface);
  border-bottom: 1px solid var(--border); overflow-x: auto;
}
.admin-tab {
  flex: 1; padding: 14px 10px; text-align: center;
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap; background: none;
  border-top: none; border-left: none; border-right: none;
}
.admin-tab.active { color: var(--yellow); border-bottom-color: var(--yellow); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* FORMS */
.form-group { margin-bottom: 14px; }
label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
input[type=text], input[type=number], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 11px 12px; border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yellow); }
select option { background: var(--surface); }

/* ADMIN ROWS */
.admin-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.admin-row:last-child { border-bottom: none; }
.admin-row-info { flex: 1; }
.admin-row-name { font-weight: 600; font-size: 0.9rem; }
.admin-row-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.admin-row-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* TOGGLE */
.toggle {
  position: relative; display: inline-block; width: 44px; height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 12px; transition: 0.2s;
}
.toggle-slider:before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: white; border-radius: 50%; transition: 0.2s;
}
input:checked + .toggle-slider { background: var(--yellow); }
input:checked + .toggle-slider:before { transform: translateX(20px); background: #000; }

/* BADGE */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.7rem; font-weight: 700; }
.badge-admin { background: rgba(204,255,0,0.15); color: var(--yellow); }
.badge-employee { background: var(--surface2); color: var(--text-muted); }
.badge-active { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-inactive { background: rgba(255,68,68,0.15); color: var(--danger); }

/* PIN PAD */
.pin-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
}
.pin-brand { font-size: 2rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -1px; }
.pin-brand span { color: var(--yellow); }
.pin-tagline { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 40px; }
.pin-dots { display: flex; gap: 14px; margin-bottom: 32px; }
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); transition: background 0.15s, border-color 0.15s;
}
.pin-dot.filled { background: var(--yellow); border-color: var(--yellow); }
.pin-dot.error { background: var(--danger); border-color: var(--danger); }
.pin-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  width: 100%; max-width: 280px;
}
.pin-key {
  aspect-ratio: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 1.4rem; font-weight: 600;
  color: var(--text); cursor: pointer; display: flex; align-items: center;
  justify-content: center;
}
.pin-key:active { background: var(--surface2); }
.pin-key.del { font-size: 1rem; color: var(--text-muted); }
.pin-key.del:hover { color: var(--danger); }
.pin-error { color: var(--danger); font-size: 0.85rem; margin-top: 16px; height: 20px; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000; padding: 0;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 480px; padding: 20px;
  max-height: 90vh; overflow-y: auto;
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.modal-footer { display: flex; gap: 10px; margin-top: 16px; }

/* LIGHTBOX */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: white; font-size: 1.5rem;
  cursor: pointer; padding: 8px;
}

/* LOADING */
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--yellow); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { text-align: center; padding: 40px 20px; }
.loading-state p { color: var(--text-muted); margin-top: 12px; font-size: 0.9rem; }

/* TOAST */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface2); color: var(--text); padding: 12px 20px;
  border-radius: 8px; font-size: 0.9rem; z-index: 3000;
  border: 1px solid var(--border); white-space: nowrap;
  animation: fadeUp 0.2s ease;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }
@keyframes fadeUp { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* DIVIDER */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* SKIP LINK */
.skip-link { text-align: center; margin-top: 8px; }
.skip-link a { color: var(--text-muted); font-size: 0.85rem; text-decoration: underline; cursor: pointer; }

/* COMPLETE SUMMARY */
.summary-card {
  background: rgba(204,255,0,0.06); border: 1px solid rgba(204,255,0,0.2);
  border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; }
.summary-label { color: var(--text-muted); }
.summary-value { font-weight: 600; }

/* EXPORT */
.export-form { }
.date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=date] {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 11px 12px; border-radius: var(--radius-sm);
  font-size: 0.9rem; color-scheme: dark;
}
input[type=date]:focus { outline: none; border-color: var(--yellow); }

/* SEASON BADGE */
.season-active { background: rgba(204,255,0,0.15); color: var(--yellow); }
.season-inactive { background: var(--surface2); color: var(--text-muted); }

/* STORM BANNER */
.storm-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(204,255,0,0.08); border-bottom: 2px solid rgba(204,255,0,0.3);
  padding: 10px 16px; font-size: 0.85rem; font-weight: 600; color: var(--yellow);
}
.storm-banner-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--yellow);
  animation: stormPulse 1.5s infinite;
  flex-shrink: 0;
}
.storm-banner-timer { margin-left: auto; font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* STORM FAB */
.storm-fab {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--yellow);
  color: #000;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  z-index: 500;
  flex-shrink: 0;
}
.storm-fab svg { width: 28px; height: 28px; display: block; }
.storm-fab.active {
  background: var(--danger);
  color: #fff;
  animation: stormFabPulse 2s infinite;
}
@keyframes stormFabPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(255,68,68,0.4); }
  50% { box-shadow: 0 4px 28px rgba(255,68,68,0.8); }
}
@keyframes stormPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* MOBILE */
@media (max-width: 380px) {
  .pin-key { font-size: 1.2rem; }
  .nav-brand { font-size: 1.1rem; }
}
