/* ============================================================
   SYBEX CRM — Global Stylesheet
   Mobile-first, webview-optimized, dark glassmorphism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/*  CSS Reset  */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/*  CSS Variables  */
:root {
  --bg-primary:    #0a0e1a;
  --bg-card:       #111827;
  --bg-card-2:     #1a2235;
  --accent-teal:   #00c896;
  --accent-blue:   #1a6b8a;
  --accent-grad:   linear-gradient(135deg, #00c896 0%, #1a6b8a 100%);
  --accent-grad-r: linear-gradient(135deg, #1a6b8a 0%, #00c896 100%);
  --text-primary:  #f0f4f8;
  --text-muted:    #8899aa;
  --text-dim:      #4a5568;
  --error:         #ff4757;
  --warning:       #ffa502;
  --success:       #00c896;
  --border-subtle: rgba(0, 200, 150, 0.12);
  --border-card:   rgba(0, 200, 150, 0.18);
  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow:   0 0 24px rgba(0, 200, 150, 0.15);
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --radius-2xl:    24px;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height:    72px;
}

/*  Base  */
html {
  height: -webkit-fill-available;
}
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  overscroll-behavior-y: none;
}

.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  position: relative;
  background: var(--bg-primary);
  overflow-x: hidden;
}

/* Main content — always clears sticky header + bottom nav */
main {
  /* header ~58px + bottom nav ~72px + safe area */
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 16px));
  min-height: calc(100vh - 58px);
  -webkit-overflow-scrolling: touch;
}

/*  Scrollbar  */
::-webkit-scrollbar         { width: 0; height: 0; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: rgba(0,200,150,0.35); border-radius: 2px; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-body { background: var(--bg-primary); }

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
}

/* Animated background blobs */
.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: blobFloat 8s ease-in-out infinite;
  pointer-events: none;
}
.auth-page::before {
  width: 300px; height: 300px;
  background: var(--accent-teal);
  top: -80px; left: -80px;
}
.auth-page::after {
  width: 250px; height: 250px;
  background: var(--accent-blue);
  bottom: -60px; right: -60px;
  animation-delay: -4s;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: rgba(17,24,39,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-2xl);
  padding: 40px 32px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5), var(--shadow-glow);
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.5s ease;
}

.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.auth-logo-text {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 4px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.auth-logo-check {
  font-size: 28px;
  line-height: 1;
}

.auth-logo-sub {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

/* OTP 6-digit boxes */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.otp-box {
  width: 46px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(0,200,150,0.25);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  caret-color: var(--accent-teal);
  transition: var(--transition);
  outline: none;
}
.otp-box:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.15);
  background: rgba(0,200,150,0.05);
}
.otp-box.filled {
  border-color: var(--accent-teal);
  background: rgba(0,200,150,0.08);
}

.otp-resend {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}
.otp-resend a { color: var(--accent-teal); font-weight: 600; }
#resendTimer { font-weight: 600; color: var(--accent-teal); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.form-control,
.form-select,
.form-textarea {
  width: 100%;
  /* 50px height ensures easy mobile tapping */
  padding: 14px 16px;
  min-height: 50px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-control::placeholder  { color: var(--text-dim); }
.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.12);
  background: rgba(0,200,150,0.04);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238899aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}
.form-select option { background: var(--bg-card); color: var(--text-primary); }
.form-textarea { min-height: 100px; resize: vertical; }

.form-file-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-file {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}
.form-file-label {
  flex: 1;
  padding: 13px 16px;
  background: rgba(255,255,255,0.04);
  border: 1.5px dashed rgba(0,200,150,0.3);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.form-file-label:hover { border-color: var(--accent-teal); color: var(--text-primary); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* min 48px tall = proper touch target */
  padding: 15px 24px;
  min-height: 48px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
  border: none;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); opacity: 0.9; }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,200,150,0.28);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,200,150,0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent-teal);
  color: var(--accent-teal);
}
.btn-outline:hover { background: rgba(0,200,150,0.08); }

.btn-danger {
  background: linear-gradient(135deg, #ff4757, #c0392b);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,71,87,0.25);
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, #ffa502, #e67e22);
  color: #000;
  font-weight: 700;
}

.btn-success {
  background: linear-gradient(135deg, #00c896, #27ae60);
  color: #fff;
}

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.btn-sm {
  padding: 9px 18px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  width: auto;
  flex: none;
}

.btn-xs {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  width: auto;
  flex: none;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  width: auto;
  flex: none;
}

/* ============================================================
   APP HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,14,26,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
  /* account for iOS notch */
  padding: 14px 20px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.header-back {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  font-size: 18px;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}
.header-back:hover { background: rgba(0,200,150,0.15); color: var(--accent-teal); }

.header-logo-sm {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}

.header-actions { display: flex; gap: 8px; }

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(11,16,28,0.98);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(0,200,150,0.14);
  display: flex;
  align-items: stretch;
  /* Always reserve room for phone home indicator */
  padding-bottom: max(env(safe-area-inset-bottom, 8px), 8px);
  z-index: 99;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px 8px;
  color: #3d4f66;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
  text-decoration: none;
  position: relative;
  min-height: 56px;
  /* Large tap target */
  -webkit-tap-highlight-color: transparent;
}
.nav-item.active { color: var(--accent-teal); }
.nav-item.active .nav-icon {
  transform: scale(1.12);
  filter: drop-shadow(0 0 6px rgba(0,200,150,0.5));
}
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2.5px;
  background: var(--accent-grad);
  border-radius: 0 0 4px 4px;
}
.nav-item:active { transform: scale(0.93); }
.nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.nav-label { font-size: 10px; line-height: 1; letter-spacing: 0.2px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(0,200,150,0.12);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:active { border-color: rgba(0,200,150,0.3); box-shadow: 0 2px 12px rgba(0,0,0,0.2); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-title { font-size: 15px; font-weight: 700; }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Stat Cards — 2-col native grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(0,200,150,0.08), rgba(26,107,138,0.06));
  border: 1px solid rgba(0,200,150,0.15);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.stat-card:active { transform: scale(0.97); }
.stat-card::after {
  content: '';
  position: absolute;
  top: -24px; right: -24px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: rgba(0,200,150,0.07);
}
.stat-icon { font-size: 22px; margin-bottom: 8px; display: block; }
.stat-value {
  font-size: 26px;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.3px; }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-new           { background: rgba(0,200,150,0.12);   color: #00c896; }
.badge-processing    { background: rgba(255,165,2,0.13);   color: #ffa502; }
.badge-pending       { background: rgba(255,71,87,0.12);   color: #ff4757; }
.badge-confirmed     { background: rgba(0,200,150,0.18);   color: #00c896; }
.badge-confused      { background: rgba(155,89,182,0.14);  color: #9b59b6; }
.badge-meeting_stage { background: rgba(52,152,219,0.14);  color: #3498db; }
.badge-sent_to_admin { background: rgba(255,165,2,0.13);   color: #ffa502; }
.badge-price_set     { background: rgba(0,200,150,0.12);   color: #00c896; }
.badge-proposal_created { background: rgba(52,152,219,0.14); color: #3498db; }
.badge-technical     { background: rgba(155,89,182,0.14);  color: #9b59b6; }
.badge-draft         { background: rgba(255,255,255,0.08); color: #8899aa; }
.badge-sent_to_rm    { background: rgba(255,165,2,0.13);   color: #ffa502; }
.badge-sent_to_client{ background: rgba(52,152,219,0.14);  color: #3498db; }
.badge-accepted      { background: rgba(0,200,150,0.18);   color: #00c896; }
.badge-rejected      { background: rgba(255,71,87,0.12);   color: #ff4757; }
.badge-verified      { background: rgba(0,200,150,0.18);   color: #00c896; }
.badge-low           { background: rgba(255,255,255,0.06); color: #8899aa; }
.badge-medium        { background: rgba(255,165,2,0.1);    color: #ffa502; }
.badge-high          { background: rgba(255,71,87,0.12);   color: #ff4757; }
.badge-urgent        { background: rgba(255,0,0,0.15);     color: #ff0000; animation: pulse 1.5s infinite; }
.badge-pending       { background: rgba(255,165,2,0.12);   color: #ffa502; }
.badge-in_progress   { background: rgba(52,152,219,0.14);  color: #3498db; }
.badge-completed     { background: rgba(0,200,150,0.18);   color: #00c896; }
.badge-on_hold       { background: rgba(255,71,87,0.12);   color: #ff4757; }

/* ============================================================
   LEAD / LIST ITEMS — native swipeable card style
   ============================================================ */
.lead-item {
  background: var(--bg-card);
  border: 1px solid rgba(0,200,150,0.1);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  display: block;
  text-decoration: none;
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
}
.lead-item:active {
  transform: scale(0.985);
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
  border-color: rgba(0,200,150,0.25);
}
.lead-item-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.lead-item-name   { font-size: 15px; font-weight: 700; line-height: 1.3; }
.lead-item-id     { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.lead-item-service { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; margin-bottom: 8px; }
.lead-item-footer  { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.05); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  padding: 0;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 24px 40px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUpModal 0.3s ease;
  border: 1px solid var(--border-card);
  border-bottom: none;
}
.modal-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(255,71,87,0.15); color: var(--error); }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-message {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  margin: 12px 16px;
  animation: slideDown 0.28s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}
.flash-message span:first-child {
  font-size: 16px;
  flex-shrink: 0;
}
.alert-success { background: rgba(0,200,150,0.1);  border: 1px solid rgba(0,200,150,0.25); color: #00c896; }
.alert-error   { background: rgba(255,71,87,0.1);  border: 1px solid rgba(255,71,87,0.25);  color: #ff4757; }
.alert-warning { background: rgba(255,165,2,0.1);  border: 1px solid rgba(255,165,2,0.25);  color: #ffa502; }
.alert-info    { background: rgba(52,152,219,0.1); border: 1px solid rgba(52,152,219,0.25); color: #3498db; }


/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  padding: 16px 16px 0;
  /* Bottom cleared by main's padding-bottom — no double spacing */
  animation: fadeIn 0.28s ease;
}

/* Horizontal edge bleed for full-width sections */
.full-bleed {
  margin-left: -16px;
  margin-right: -16px;
}

.page-hero {
  background: linear-gradient(135deg, rgba(0,200,150,0.09), rgba(26,107,138,0.07));
  border: 1px solid rgba(0,200,150,0.15);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 20px;
}
.page-title    { font-size: 20px; font-weight: 800; margin-bottom: 4px; line-height: 1.3; }
.page-subtitle { font-size: 13px; color: var(--text-muted); }

/* Section labels */
.section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.06);
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-teal), transparent);
}
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.15);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.timeline-content { font-size: 14px; }

/* ============================================================
   PROPOSAL / PRINT STYLES
   ============================================================ */
.proposal-wrapper {
  background: #fff;
  color: #1a1a2e;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.proposal-header-bar {
  background: linear-gradient(135deg, #0a0e1a, #1a2235);
  padding: 28px 28px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.proposal-logo-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #00c896, #1a6b8a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.proposal-number-badge {
  background: rgba(0,200,150,0.15);
  border: 1px solid rgba(0,200,150,0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: #00c896;
  font-weight: 700;
}
.proposal-body { padding: 28px; }
.proposal-client-box {
  background: #f8fafc;
  border-left: 3px solid #00c896;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.proposal-client-box h3 { font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 12px; }
.proposal-client-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; border-bottom: 1px solid #eee; }
.proposal-client-row:last-child { border-bottom: none; }
.proposal-client-label { color: #666; font-weight: 600; }
.proposal-client-value { color: #1a1a2e; font-weight: 500; }

.proposal-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #0a0e1a;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #00c896;
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.proposal-field { display: flex; gap: 12px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.proposal-field:last-child { border-bottom: none; }
.proposal-field-label { font-weight: 600; color: #444; min-width: 200px; }
.proposal-field-value { color: #1a1a2e; flex: 1; }

.proposal-price-box {
  background: linear-gradient(135deg, #0a0e1a, #1a2235);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.proposal-price-label { font-size: 13px; opacity: 0.7; }
.proposal-price-value { font-size: 28px; font-weight: 800; color: #00c896; }

.proposal-footer {
  background: #f8fafc;
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #888;
  border-top: 1px solid #e8e8e8;
}
.proposal-rm-info { font-size: 13px; }
.proposal-rm-info strong { color: #1a1a2e; }

/* ============================================================
   RECEIPT
   ============================================================ */
.receipt-card {
  background: #fff;
  color: #1a1a2e;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
}
.receipt-header { text-align: center; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.receipt-amount {
  font-size: 40px;
  font-weight: 800;
  background: linear-gradient(135deg, #00c896, #1a6b8a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.receipt-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.receipt-row:last-child { border-bottom: none; }
.receipt-label { color: #666; }
.receipt-value { font-weight: 600; color: #1a1a2e; }

/* ============================================================
   PAYMENT SCREENSHOT
   ============================================================ */
.payment-screenshot-preview {
  width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-card);
  margin-top: 8px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state-icon { font-size: 52px; opacity: 0.4; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.empty-state-text  { font-size: 14px; max-width: 260px; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-teal   { color: var(--accent-teal) !important; }
.text-muted  { color: var(--text-muted)  !important; }
.text-danger { color: var(--error)        !important; }
.text-warn   { color: var(--warning)      !important; }
.text-white  { color: #fff                !important; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.fw-bold     { font-weight: 700; }
.fw-800      { font-weight: 800; }

.mt-1 { margin-top: 4px;  }
.mt-2 { margin-top: 8px;  }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px;  }
.mb-2 { margin-bottom: 8px;  }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-1 { gap: 4px;  }
.gap-2 { gap: 8px;  }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.w-100  { width: 100%; }
.hidden { display: none !important; }

.divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 16px 0;
}

.loading-spinner {
  width: 24px; height: 24px;
  border: 2.5px solid rgba(0,200,150,0.2);
  border-top-color: var(--accent-teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.grad-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Pills row (filter tabs) */
.pills-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.pills-row::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.pill.active, .pill:hover {
  background: rgba(0,200,150,0.1);
  color: var(--accent-teal);
  border-color: rgba(0,200,150,0.25);
}

/* RM Link Box */
.link-box {
  background: rgba(0,200,150,0.06);
  border: 1.5px dashed rgba(0,200,150,0.35);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  word-break: break-all;
}
.link-box .link-text { flex: 1; color: var(--accent-teal); font-weight: 500; }
.copy-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  background: rgba(0,200,150,0.12);
  border: 1px solid rgba(0,200,150,0.3);
  border-radius: 8px;
  color: var(--accent-teal);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.copy-btn:hover { background: rgba(0,200,150,0.2); }

/* Info row */
.info-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label { width: 130px; flex-shrink: 0; color: var(--text-muted); font-size: 13px; }
.info-value { flex: 1; font-weight: 500; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes slideUpModal {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes slideDown {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes blobFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%       { transform: translate(20px, 20px) scale(1.05); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.animate-in { animation: slideUp 0.4s ease forwards; }

@media print {
  .app-header, .bottom-nav, .btn, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .app-wrapper { max-width: 100%; }
  .proposal-wrapper, .receipt-card { box-shadow: none; }
}

/* ============================================================
   MISSING UTILITIES — Section Labels, Hero, Buttons, Cards
   ============================================================ */

/* Section label */
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 20px 0 10px;
}

/* Page hero strip */
.page-hero {
  background: linear-gradient(135deg,rgba(0,200,150,0.08),rgba(26,107,138,0.08));
  border: 1px solid rgba(0,200,150,0.12);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

/* Extra button variants */
.btn-xs {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
  width: auto;
}
.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-success {
  background: linear-gradient(135deg, #00c896, #00a07a);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,200,150,0.3);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,200,150,0.4); }

/* Payment screenshot preview */
.payment-screenshot-preview {
  width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid rgba(0,200,150,0.3);
  margin-top: 12px;
}

/* ============================================================
   PROPOSAL — Printable Card
   ============================================================ */
.proposal-wrapper {
  background: #1a1a2e;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  margin-bottom: 24px;
}
.proposal-header-bar {
  background: linear-gradient(135deg, #0a0e1a 0%, #1a2235 100%);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0,200,150,0.2);
}
.proposal-logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-teal);
}
.proposal-number-badge {
  background: rgba(0,200,150,0.12);
  border: 1px solid rgba(0,200,150,0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-teal);
}
.proposal-body { padding: 20px; }
.proposal-client-box {
  background: rgba(0,200,150,0.05);
  border: 1px solid rgba(0,200,150,0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}
.proposal-client-box h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.proposal-client-row {
  display: flex;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.proposal-client-row:last-child { border-bottom: none; }
.proposal-client-label { width: 80px; flex-shrink: 0; color: var(--text-muted); font-size: 12px; }
.proposal-client-value { flex: 1; font-weight: 600; color: var(--text-primary); font-size: 13px; }
.proposal-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 16px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,200,150,0.2);
}
.proposal-field {
  display: flex;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 12px;
}
.proposal-field:last-child { border-bottom: none; }
.proposal-field-label {
  width: 140px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.proposal-field-value { flex: 1; font-weight: 500; color: var(--text-primary); font-size: 13px; }
.proposal-price-box {
  background: linear-gradient(135deg, rgba(0,200,150,0.12), rgba(26,107,138,0.12));
  border: 1px solid rgba(0,200,150,0.25);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}
.proposal-price-label { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.proposal-price-value { font-size: 28px; font-weight: 800; color: var(--accent-teal); }
.proposal-footer {
  background: rgba(0,200,150,0.06);
  border-top: 1px solid rgba(0,200,150,0.15);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.proposal-rm-info { color: var(--text-muted); }
.proposal-rm-info strong { color: var(--text-primary); }

/* ============================================================
   RECEIPT — Printable Card
   ============================================================ */
.receipt-wrapper {
  background: #1a1a2e;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  margin-bottom: 24px;
}
.receipt-header {
  background: linear-gradient(135deg, #0a0e1a 0%, #1a2235 100%);
  padding: 28px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(0,200,150,0.2);
}
.receipt-logo { font-size: 26px; font-weight: 800; letter-spacing: 3px; color: var(--accent-teal); }
.receipt-sub  { font-size: 11px; color: rgba(255,255,255,0.4); letter-spacing: 2px; margin-top: 4px; }
.receipt-body { padding: 24px 20px; }
.receipt-amount {
  font-size: 40px;
  font-weight: 800;
  color: var(--accent-teal);
  text-align: center;
  margin: 8px 0 20px;
}
.receipt-stamp {
  display: inline-block;
  background: linear-gradient(135deg, #00c896, #1a6b8a);
  color: #fff;
  padding: 8px 22px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 13px;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
}
.receipt-row:last-child { border-bottom: none; }
.receipt-label { color: var(--text-muted); }
.receipt-value { font-weight: 600; color: var(--text-primary); text-align: right; }
.receipt-footer {
  background: rgba(0,200,150,0.05);
  border-top: 1px solid rgba(0,200,150,0.12);
  padding: 16px 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state-icon  { font-size: 48px; margin-bottom: 16px; }
.empty-state-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state-text  { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* Flash message */
.flash-message {
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  border-left: 4px solid var(--accent-teal);
  background: rgba(0,200,150,0.08);
  color: var(--text-primary);
  animation: slideDown 0.3s ease;
}
.flash-message.alert-error   { border-color: var(--error);   background: rgba(255,71,87,0.08); }
.flash-message.alert-warning { border-color: var(--warning); background: rgba(255,165,2,0.08); }
.flash-message.alert-success { border-color: var(--success); }

/* Header logo small */
.header-logo-sm {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
}
.header-back {
  font-size: 22px;
  color: var(--text-primary);
  padding: 4px 8px 4px 0;
  display: flex;
  align-items: center;
  margin-right: 4px;
}
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   RESPONSIVE DESIGN FOR CUSTOMER PORTAL (ALL DEVICES)
   ============================================================ */
@media (min-width: 601px) {
  .customer-wrapper {
    max-width: 1024px !important;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    background: var(--bg-primary);
  }
  .customer-wrapper .app-header {
    max-width: 1024px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 0 0 16px 16px;
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }
  .customer-wrapper main {
    padding-bottom: 120px;
  }
  .customer-wrapper .bottom-nav {
    bottom: 24px !important;
    border-radius: 30px !important;
    max-width: 480px !important;
    border: 1px solid rgba(0, 200, 150, 0.25) !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6) !important;
    padding-bottom: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    height: 64px;
  }
  .customer-wrapper .bottom-nav .nav-item {
    min-height: 52px;
    padding: 8px 4px 6px;
  }
}

@media (min-width: 900px) {
  /* Side-by-side Layout for Customer Dashboard on Large Screens */
  .customer-dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.0fr;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
  }
  .customer-dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .customer-dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}


