/* =========================================================
   TOTAL CARE PRO - FIELD CREW MOBILE APP STYLESHEET
   Brand Colors: Navy (#0a2342), Gold (#c9a84c), Teal (#1abfb0)
   ========================================================= */

:root {
  --primary-dark: #0a2342;
  --primary: #1b4575;
  --primary-light: #2a6cb5;
  --accent: #c9a84c;
  --accent-light: #dfc477;
  --teal: #1abfb0;
  --teal-dark: #14998d;
  --whatsapp: #25D366;
  --whatsapp-dark: #128C7E;
  --whatsapp-glow: rgba(37, 211, 102, 0.4);
  
  --bg-dark: #07192f;
  --bg-light: #f4f7fb;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-dark: #1a202c;
  --text-muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 28px rgba(10,35,66,0.14);
  --shadow-xl: 0 20px 40px rgba(10,35,66,0.25);
  
  --bottom-bar-height: 64px;
  --header-height: 58px;
}

/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

h1, h2, h3, h4, strong {
  font-family: 'Montserrat', sans-serif;
}

/* APP WRAPPER (MOBILE FRAME EMBED OR PHONE SCREEN) */
.app-container {
  max-width: 520px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-light);
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.15);
}

/* TOP APP HEADER */
.app-header {
  height: var(--header-height);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(10,35,66,0.2);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.crew-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--primary-dark);
  font-size: 0.65rem;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gps-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.gps-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGps 2s infinite;
}

@keyframes pulseGps {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.icon-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.25);
}

/* VIEWS WRAPPER & SCROLL AREA */
.views-wrapper {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bottom-bar-height) + 12px);
}

.view-section {
  display: none;
  padding: 16px;
  animation: fadeIn 0.25s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARDS & CONTAINERS */
.hero-status-card {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 70%, var(--teal-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-status-card::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.status-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.pill-ready {
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.live-clock {
  font-family: 'Montserrat', monospace;
  font-size: 0.82rem;
  color: var(--accent-light);
  font-weight: 600;
}

.hero-status-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.hero-status-card p {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* GPS BOX */
.gps-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.gps-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.gps-info-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--primary-dark);
}

.gps-info-title i {
  color: var(--teal);
}

.accuracy-tag {
  background: #e6fffa;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(26, 191, 176, 0.3);
}

.gps-coords-row {
  display: flex;
  gap: 16px;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-dark);
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.gps-coords-row small {
  color: var(--text-muted);
  font-weight: 700;
}

.gps-address-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-dark);
  line-height: 1.3;
}

.gps-address-row i {
  color: #ef4444;
  margin-top: 2px;
}

.gps-controls-mini {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--primary-light);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
}

.btn-text-action:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* FORMS & INPUTS */
.app-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group label i {
  color: var(--teal);
  font-size: 0.9rem;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: #fff;
  font-size: 0.92rem;
  color: var(--text-dark);
  font-family: inherit;
  transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,191,176,0.15);
}

.input-with-icon {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

.input-with-icon:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,191,176,0.15);
}

.input-prefix {
  padding: 0 12px;
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  border-right: 1px solid var(--border-color);
  line-height: 44px;
}

.input-with-icon input {
  border: none;
  box-shadow: none;
}

.helper-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* CHECKLIST BOX */
.checklist-container {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-color);
}

.checklist-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.check-item:hover {
  background: #f8fafc;
}

.check-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--teal-dark);
  width: 16px;
  height: 16px;
}

.check-item.done span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* BUTTONS */
.btn-checkin {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
  margin-top: 10px;
  transition: all 0.2s;
}

.btn-checkin:active {
  transform: scale(0.98);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-photo-pick {
  background: #f1f5f9;
  border: 1.5px dashed #cbd5e1;
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-photo-pick:hover {
  background: #e2e8f0;
  border-color: var(--primary-light);
}

/* ACTIVE JOB SCREEN */
.active-job-banner {
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px rgba(4, 120, 87, 0.3);
}

.pulse-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 12px #34d399;
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

.timer-display {
  text-align: right;
}

.timer-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #a7f3d0;
  letter-spacing: 1px;
  font-weight: 700;
}

.timer-digits {
  font-family: 'Montserrat', monospace;
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

/* JOB META CARD */
.job-meta-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.meta-service-badge {
  background: rgba(26, 191, 176, 0.15);
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.meta-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.job-meta-card h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.meta-address {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.meta-gps-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}

.link-chip {
  color: var(--primary-light);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tech-chip {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* SECTION CARDS IN ACTIVE JOB */
.section-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-card h4 {
  font-size: 0.92rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.completion-pill {
  background: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* PHOTO ACTIONS & GRID */
.photo-actions-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-action-camera {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-camera.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--primary-dark);
}

.btn-action-camera.btn-outline {
  background: #f8fafc;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.btn-action-camera:active {
  transform: scale(0.96);
}

.active-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-height: 80px;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.empty-photo-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.empty-photo-placeholder i {
  font-size: 1.4rem;
  color: #94a3b8;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tag-before {
  background: rgba(10, 35, 66, 0.85);
  color: #fff;
}

.tag-after {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.btn-del-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* SIGNATURE CANVAS */
.signature-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.btn-sm-text {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.signature-canvas {
  width: 100%;
  height: 100px;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  touch-action: none;
}

/* CHECKOUT BUTTON FOOTER */
.checkout-footer {
  margin-top: 10px;
}

.btn-checkout {
  width: 100%;
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 70%, #ef4444 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.35);
  transition: all 0.2s;
}

.btn-checkout .btn-icon {
  font-size: 1.6rem;
}

.btn-text-col {
  text-align: left;
}

.btn-text-col strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.btn-text-col small {
  font-size: 0.72rem;
  opacity: 0.9;
}

.btn-checkout:active {
  transform: scale(0.98);
}

/* VIEW 2: MAP VIEW */
.map-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.map-title-block h3 {
  font-size: 1.1rem;
  color: var(--primary-dark);
}

#mapStatusText {
  font-size: 0.72rem;
  color: var(--teal-dark);
  font-weight: 600;
}

.btn-map-control {
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.full-map-container {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
  z-index: 10;
}

.map-bottom-drawer {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.drawer-stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.stat-title {
  color: var(--text-muted);
}

.stat-value {
  font-weight: 700;
  font-family: monospace;
  color: var(--primary-dark);
}

.btn-open-maps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 10px;
}

/* VIEW 3: HISTORY LIST */
.history-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.history-view-header h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.history-view-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-export-csv {
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-history-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-history-state i {
  font-size: 2.5rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.history-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.history-client {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.95rem;
}

.history-service {
  font-size: 0.75rem;
  color: var(--teal-dark);
  font-weight: 700;
}

.history-details-row {
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
  margin-top: 4px;
}

.btn-resend-wa {
  background: #25D366;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* VIEW 4: SETTINGS */
.settings-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.settings-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.settings-role {
  font-size: 0.75rem;
  color: var(--teal-dark);
  font-weight: 700;
}

.settings-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.settings-card h4 {
  font-size: 0.9rem;
  color: var(--primary-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.info-row a {
  color: var(--primary-light);
  font-weight: 700;
}

.btn-clear-cache {
  width: 100%;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* SWITCH TOGGLE */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--teal);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* BOTTOM NAVIGATION */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: var(--bottom-bar-height);
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 99;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-tab {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  transition: all 0.2s;
  flex: 1;
}

.nav-tab i {
  font-size: 1.15rem;
}

.nav-tab span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab.active i {
  color: var(--accent);
  transform: translateY(-2px);
}

/* MODAL & WHATSAPP COMPLETION */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 35, 66, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-badge-success {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.checkout-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.c-metric {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}

.c-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}

.c-metric strong {
  font-size: 0.95rem;
  color: var(--primary-dark);
}

/* WHATSAPP PREVIEW CARD */
.whatsapp-preview-card {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.wa-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--whatsapp-dark);
  margin-bottom: 8px;
}

.wa-bubble-preview {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #dcfce7;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.wa-bubble-preview pre {
  font-family: inherit;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1f2937;
  line-height: 1.45;
}

.send-options-block {
  margin-bottom: 12px;
}

.form-label-sm {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dark);
  display: block;
  margin-bottom: 6px;
}

.recipient-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipient-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
}

.recipient-pill.active {
  border-color: var(--whatsapp);
  background: #f0fdf4;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-send-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--whatsapp-glow);
  transition: all 0.2s;
}

.btn-send-whatsapp:active {
  transform: scale(0.98);
}

.modal-secondary-buttons {
  display: flex;
  gap: 8px;
}

.btn-sub-action {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.btn-finish-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-finish-modal:hover {
  color: var(--primary);
}

/* LIGHTBOX */
.lightbox-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 85%;
}

.lightbox-content img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.lightbox-caption {
  color: #fff;
  text-align: center;
  margin-top: 10px;
  font-size: 0.85rem;
}

/* TOAST */
.toast {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--primary-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 2000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border: 1px solid rgba(201,168,76,0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
