/* Marcelo App Design System & Styles */
:root {
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-app: #f4f6f8;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --primary-dark: #0f2937;
  --primary-dark-hover: #16384c;
  --teal-main: #0f766e;
  --teal-light: #ccfbf1;
  --teal-dark: #115e59;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  --badge-green-bg: #e6f4ea;
  --badge-green-text: #137333;
  --badge-blue-bg: #e8f0fe;
  --badge-blue-text: #1967d2;
  --badge-amber-bg: #fef3d6;
  --badge-amber-text: #b06000;
  --badge-red-bg: #fee2e2;
  --badge-red-text: #b91c1c;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 41, 55, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 41, 55, 0.12);
}

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

body {
  font-family: var(--font-family);
  background-color: #0b1922;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Device Shell */
.app-viewport {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  height: 100vh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

@media (min-width: 450px) {
  .app-viewport {
    height: 92vh;
    max-height: 880px;
    border-radius: 40px;
    border: 8px solid #1a2a36;
    margin: auto;
  }
}

/* Status Bar */
.ios-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 6px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  z-index: 10;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* Main Content Scroll Area */
.app-screen-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px 90px 18px;
  -webkit-overflow-scrolling: touch;
}

/* Bottom Navigation Bar */
.bottom-nav-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 74px;
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 8px;
  z-index: 30;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
  cursor: pointer;
  padding: 6px 12px;
  transition: all 0.15s ease;
  border-radius: 12px;
}

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

.nav-item.active .nav-icon {
  color: var(--teal-main);
  transform: translateY(-1px);
}

.nav-icon {
  font-size: 20px;
  line-height: 1;
}

/* Home Header */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  margin-top: 4px;
}

.header-greeting {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.header-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: #e2e8f0;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

/* Hero Voice Card */
.hero-voice-card {
  background: linear-gradient(135deg, #134e4a 0%, #0f766e 100%);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.hero-voice-card:active {
  transform: scale(0.98);
}

.hero-voice-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.hero-voice-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.hero-voice-text h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.hero-voice-text p {
  font-size: 12px;
  opacity: 0.9;
  line-height: 1.3;
  margin-top: 2px;
}

.hero-voice-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: #ffffff;
  color: var(--teal-main);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  cursor: pointer;
}

/* 4 Quick Actions Grid */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.quick-action-tile {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.quick-action-tile:active {
  transform: scale(0.96);
  background-color: var(--bg-card-subtle);
}

.quick-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.quick-action-tile.active-scan .quick-tile-icon {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.quick-tile-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: center;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.3px;
}

.section-link {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-main);
  cursor: pointer;
}

/* Job Cards */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.job-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: all 0.15s ease;
}

.job-card:active {
  transform: translateY(1px);
}

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

.job-time-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: #0ea5e9;
}

.job-dot.dot-in-progress {
  background-color: #10b981;
}

.job-dot.dot-pending {
  background-color: #f59e0b;
}

.job-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

.job-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.job-badge.badge-en-camino {
  background-color: var(--badge-green-bg);
  color: var(--badge-green-text);
}

.job-badge.badge-confirmado {
  background-color: var(--badge-blue-bg);
  color: var(--badge-blue-text);
}

.job-badge.badge-pendiente {
  background-color: var(--badge-amber-bg);
  color: var(--badge-amber-text);
}

.job-badge.badge-completado {
  background-color: #f1f5f9;
  color: #475569;
}

.job-client-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

.job-service-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.job-address-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.job-actions-bar {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.btn-action-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--primary-dark);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-pill:active {
  background-color: #f1f5f9;
}

.btn-action-pill.btn-complete {
  background-color: var(--primary-dark);
  color: #ffffff;
  border-color: var(--primary-dark);
}

/* Weekly Date Selector */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 10px 8px;
  margin-bottom: 18px;
  border: 1px solid var(--border-color);
}

.day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
  background: none;
  border: none;
}

.day-cell.active {
  background-color: var(--primary-dark);
  color: #ffffff;
}

.day-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.day-cell.active .day-label {
  color: #93c5fd;
}

.day-number {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-dark);
}

.day-cell.active .day-number {
  color: #ffffff;
}

/* Floating Action Button (FAB) */
.fab-button {
  position: absolute;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--primary-dark);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 20px rgba(15, 41, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 25;
  transition: transform 0.15s ease;
}

.fab-button:active {
  transform: scale(0.92);
}

/* Segmented Tabs */
.segmented-tabs {
  display: flex;
  background-color: #e2e8f0;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 18px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background-color: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Money Screen Hero Cards */
.money-hero-card {
  background: linear-gradient(135deg, #064e3b 0%, #0f766e 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #ffffff;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.money-hero-title {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

.money-hero-amount {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 4px 0 6px 0;
}

.money-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.stats-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.stat-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-box-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-box-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-top: 4px;
}

/* Movements List */
.movements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.movement-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px;
}

.mov-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mov-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.mov-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

.mov-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.mov-right {
  text-align: right;
}

.mov-amount {
  font-size: 15px;
  font-weight: 800;
}

.mov-amount.income {
  color: #16a34a;
}

.mov-amount.expense {
  color: #dc2626;
}

.mov-date {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Receipts Gallery & Scanned Items */
.receipts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.receipt-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.receipt-card:active {
  transform: scale(0.98);
}

.receipt-card-thumb {
  height: 110px;
  width: 100%;
  object-fit: cover;
  background-color: #e2e8f0;
}

.receipt-card-body {
  padding: 12px;
}

.receipt-vendor {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-amount {
  font-size: 16px;
  font-weight: 800;
  color: #dc2626;
  margin: 2px 0;
}

.receipt-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

/* Scanner Modal Styles */
.ocr-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 25, 34, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ocr-modal-card {
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  background-color: #ffffff;
  border-radius: 24px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.ocr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.ocr-modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-dark);
}

.ocr-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.ocr-viewfinder-box {
  position: relative;
  width: 100%;
  height: 220px;
  background-color: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ocr-receipt-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.ocr-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #22c55e, #4ade80, transparent);
  box-shadow: 0 0 14px #22c55e;
  animation: laserScan 2s infinite ease-in-out;
  z-index: 5;
}

@keyframes laserScan {
  0% { top: 5%; }
  50% { top: 90%; }
  100% { top: 5%; }
}

.ocr-bracket {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #22c55e;
  border-style: solid;
  z-index: 4;
}

.ocr-bracket.tl { top: 16px; left: 16px; border-width: 3px 0 0 3px; border-top-left-radius: 8px; }
.ocr-bracket.tr { top: 16px; right: 16px; border-width: 3px 3px 0 0; border-top-right-radius: 8px; }
.ocr-bracket.bl { bottom: 16px; left: 16px; border-width: 0 0 3px 3px; border-bottom-left-radius: 8px; }
.ocr-bracket.br { bottom: 16px; right: 16px; border-width: 0 3px 3px 0; border-bottom-right-radius: 8px; }

.ocr-status-pill {
  position: absolute;
  bottom: 14px;
  background-color: rgba(15, 23, 42, 0.85);
  color: #4ade80;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(4px);
  z-index: 6;
}

/* OCR Preset Quick Pickers */
.preset-picker-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.preset-chip {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
  white-space: nowrap;
}

.preset-chip.active {
  background-color: var(--primary-dark);
  color: #ffffff;
  border-color: var(--primary-dark);
}

.ocr-form-body {
  padding: 16px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ocr-detected-box {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ocr-confidence-badge {
  align-self: flex-start;
  background-color: #15803d;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

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

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--primary-dark);
  background-color: #ffffff;
  outline: none;
}

.form-input:focus {
  border-color: var(--teal-main);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.items-breakdown-list {
  background-color: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.item-breakdown-row {
  display: flex;
  justify-content: space-between;
  color: #334155;
}

.btn-primary-dark {
  width: 100%;
  background-color: var(--primary-dark);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 41, 55, 0.2);
  transition: all 0.15s ease;
}

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

/* Chat & Bilingual Screen */
.chat-bubbles-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

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

.chat-bubble-card.bubble-me {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  align-self: flex-end;
  max-width: 90%;
}

.bubble-spanish {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

.bubble-translation {
  font-size: 13px;
  color: #047857;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 3px solid #10b981;
}

/* Pendings Screen Cards */
.pending-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}

.pending-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.pending-tag {
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
}
