/* ── MOBILE VIEW — /jobs/mobile
 * Single-column layout optimized for iPhone/Android field use.
 * Large tap targets, expandable job cards, sticky bottom bar.
 */

/* ── RESET FOR MOBILE CHROME ── */
html, body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ── HEADER ── */
.mob-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: env(safe-area-inset-top, 0);
}

.mob-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.mob-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.mob-desktop-link {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  transition: color 0.2s, border-color 0.2s;
}

.mob-desktop-link:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.18);
}

/* ── TABS ── */
.mob-tabs {
  display: flex;
  padding: 0 16px 0;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.mob-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  /* Large touch target */
  min-height: 44px;
}

.mob-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.mob-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--bg-accent);
  color: var(--fg-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.mob-tab.active .mob-tab-count {
  background: rgba(212,160,57,0.15);
  color: var(--accent);
}

/* ── MAIN CONTENT ── */
.mob-main {
  padding: 12px 12px 100px;
  /* 100px bottom = space for sticky bar */
}

.mob-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mob-panel.hidden {
  display: none;
}

.mob-empty {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
  padding: 48px 20px;
}

/* ── JOB CARD ── */
.mob-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  border-left: 3px solid transparent;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  /* Minimum touch target height */
  min-height: 72px;
}

.mob-card:active {
  box-shadow: 0 0 0 2px rgba(212,160,57,0.2);
}

.mob-card.status-scheduled    { border-left-color: var(--blue); }
.mob-card.status-in_progress  { border-left-color: var(--accent); }
.mob-card.status-complete     { border-left-color: rgba(100,200,100,0.6); opacity: 0.75; }

.mob-card.expanded {
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

/* ── CARD SUMMARY ROW ── */
.mob-card-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
}

.mob-card-main {
  flex: 1;
  min-width: 0;
}

.mob-card-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}

.mob-card-meta {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-card-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-end;
}

/* ── STATUS PILLS ── */
.mob-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  /* Minimum touch target */
  min-height: 36px;
  min-width: 88px;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.2px;
}

.mob-pill:active {
  transform: scale(0.96);
  opacity: 0.85;
}

.mob-pill:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Job status pill colors */
.job-pill-scheduled    { background: rgba(74,143,212,0.18); color: var(--blue); }
.job-pill-in_progress  { background: rgba(212,160,57,0.2); color: var(--accent); }
.job-pill-complete     { background: rgba(100,200,100,0.15); color: #6ec46e; }

/* Insurance pill colors */
.ins-pill-none     { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.ins-pill-pending  { background: rgba(212,160,57,0.12); color: var(--accent); }
.ins-pill-approved { background: rgba(74,143,212,0.15); color: var(--blue); }
.ins-pill-paid     { background: rgba(100,200,100,0.12); color: #6ec46e; }

/* ── CARD DETAILS (expandable) ── */
.mob-card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}

.mob-card-details.open {
  max-height: 400px;
  padding: 0 16px 16px;
}

.mob-details-divider {
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 14px;
}

/* ── ACTION BUTTONS (call / directions) ── */
.mob-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.mob-detail-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  /* Large touch target */
  min-height: 52px;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.mob-detail-action:active {
  transform: scale(0.97);
  opacity: 0.85;
}

.mob-call-btn {
  background: rgba(74,143,212,0.15);
  color: var(--blue);
  border: 1px solid rgba(74,143,212,0.2);
}

.mob-map-btn {
  background: rgba(212,160,57,0.12);
  color: var(--accent);
  border: 1px solid rgba(212,160,57,0.2);
}

.mob-detail-icon {
  font-size: 1rem;
}

/* ── DETAIL ROWS ── */
.mob-detail-row {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
  margin-bottom: 8px;
  line-height: 1.45;
}

.mob-detail-label {
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 500;
  min-width: 64px;
  flex-shrink: 0;
  padding-top: 1px;
}

.mob-detail-value {
  color: var(--fg);
}

.mob-detail-notes .mob-detail-value {
  color: var(--fg-muted);
  font-style: italic;
}

/* ── STICKY BOTTOM BAR ── */
.mob-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  background: rgba(10,12,16,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.06);
  z-index: 200;
}

.mob-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #0a0c10;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background 0.15s, transform 0.1s;
  /* Large touch target */
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
}

.mob-new-btn:active {
  background: var(--accent-bright);
  transform: scale(0.98);
}

/* ── NEW JOB MODAL ── */
.mob-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 500;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.mob-modal-overlay.active {
  display: flex;
}

.mob-modal {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  padding: 24px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mob-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.mob-modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
}

.mob-modal-close {
  background: var(--bg-accent);
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.mob-modal-close:active { color: var(--fg); }

.mob-form-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 16px 0 8px;
}

.mob-form-label:first-child { margin-top: 0; }

.mob-input {
  display: block;
  width: 100%;
  background: var(--bg-accent);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  /* Font size ≥16px prevents iOS zoom on focus */
  margin-bottom: 8px;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.mob-input:focus {
  outline: none;
  border-color: var(--accent);
}

.mob-input::placeholder { color: rgba(139,138,135,0.45); }

.mob-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.mob-input-row .mob-input {
  padding: 13px 10px;
}

.mob-textarea {
  resize: none;
  min-height: 72px;
}

select.mob-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b8a87' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.mob-modal-footer {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.mob-btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 52px;
}

.mob-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: var(--accent);
  color: #0a0c10;
  border: none;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  min-height: 52px;
  transition: background 0.15s;
}

.mob-btn-primary:active { background: var(--accent-bright); }
.mob-btn-primary:disabled { opacity: 0.6; cursor: wait; }

/* ── REFRESH INDICATOR ── */
.mob-refresh-indicator {
  position: fixed;
  top: 8px;
  right: 12px;
  font-size: 0.7rem;
  color: var(--fg-muted);
  z-index: 300;
  pointer-events: none;
}
