/* ============================================================
   AMS Connect · assets/app.css
   Sales Rep Mobile PWA
   Roboto · #1E88E5 blue · #FF6D00 orange · White
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;0,900;1,400&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --blue:       #1E88E5;
  --blue-dark:  #1565C0;
  --blue-deep:  #0D47A1;
  --blue-mid:   #42A5F5;
  --blue-light: #E3F2FD;
  --blue-pale:  #F0F8FF;
  --orange:     #FF6D00;
  --orange-dk:  #E65100;
  --orange-lt:  #FFF3E0;
  --white:      #FFFFFF;
  --bg:         #F2F6FB;
  --surface:    #FFFFFF;
  --text:       #1A237E;
  --text2:      #37474F;
  --text3:      #78909C;
  --text4:      #B0BEC5;
  --green:      #00C853;
  --green-lt:   #E8F5E9;
  --red:        #F44336;
  --red-lt:     #FFEBEE;
  --border:     #E1EAF3;
  --shadow-sm:  0 1px 6px rgba(30,136,229,.10);
  --shadow-md:  0 3px 16px rgba(30,136,229,.14);
  --shadow-lg:  0 8px 32px rgba(30,136,229,.18);
  --r-sm:       10px;
  --r-md:       14px;
  --r-lg:       18px;
  --r-xl:       24px;
  --safe-top:   env(safe-area-inset-top, 0px);
  --safe-bot:   env(safe-area-inset-bottom, 0px);
  font-size: 16px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text2);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: transparent;
}

/* ── App shell ─────────────────────────────────────────────── */
#app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* ── Screens ───────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transform: translateX(30px);
  transition: opacity .22s ease, transform .22s ease;
  overflow: hidden;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.screen.slide-back { transform: translateX(-30px); }

/* ── Top status bar (simulated) ────────────────────────────── */
.status-bar {
  height: 28px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.status-bar.blue { background: var(--blue); }
.status-bar .time { font-size: 12px; font-weight: 700; color: #fff; }
.status-bar .icons { display: flex; gap: 5px; color: #fff; font-size: 11px; }

/* ── App Header ────────────────────────────────────────────── */
.app-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--blue);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.app-header .header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.app-header .header-back {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
}
.app-header h1 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}
.app-header .header-actions {
  display: flex;
  gap: 6px;
}
.app-header .icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  border: none;
  position: relative;
  transition: background .15s;
}
.app-header .icon-btn:active { background: rgba(255,255,255,.25); }
.badge-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 9px; height: 9px;
  background: var(--orange);
  border-radius: 50%;
  border: 2px solid var(--blue);
}

/* ── Scrollable body ───────────────────────────────────────── */
.scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px calc(70px + var(--safe-bot));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.scroll-body::-webkit-scrollbar { display: none; }

/* ── Bottom navigation ─────────────────────────────────────── */
.bottom-nav {
  height: calc(60px + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 -2px 16px rgba(30,136,229,.10);
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  transition: all .18s;
  flex: 1;
}
.nav-item .nav-icon { font-size: 20px; transition: transform .2s; }
.nav-item .nav-label { font-size: 10px; font-weight: 500; color: var(--text3); transition: color .18s; }
.nav-item.active .nav-label { color: var(--blue); }
.nav-item.active .nav-icon { transform: translateY(-2px); }
.nav-item:active { background: var(--blue-light); }

/* ── ═══════════════════════════════════════════════════════ ── */
/*    SCREEN: LOGIN                                               */
/* ── ═══════════════════════════════════════════════════════ ── */
.login-bg {
  flex: 1;
  background: linear-gradient(160deg, var(--blue-deep) 0%, var(--blue) 55%, var(--blue-dark) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}
.login-bg .bubble1,
.login-bg .bubble2,
.login-bg .bubble3 {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.login-bg .bubble1 {
  width: 260px; height: 260px;
  top: -90px; right: -90px;
  background: rgba(255,255,255,.05);
}
.login-bg .bubble2 {
  width: 180px; height: 180px;
  bottom: -50px; left: -50px;
  background: rgba(255,107,0,.10);
}
.login-bg .bubble3 {
  width: 120px; height: 120px;
  bottom: 80px; right: 20px;
  background: rgba(255,255,255,.04);
}

/* Logo */
.logo-wrap {
  width: 108px; height: 108px;
  background: var(--white);
  border-radius: 28px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.28), 0 0 0 6px rgba(255,255,255,.1);
  margin-bottom: 18px;
  overflow: hidden;
  animation: logoPop .5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes logoPop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
.logo-wrap img { width: 96px; height: 96px; object-fit: contain; }

.login-app-name {
  font-size: 1.625rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: .02em;
  margin-bottom: 4px;
  animation: fadeUp .4s .2s ease both;
}
.login-app-tagline {
  font-size: .75rem;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  letter-spacing: 2px;
  margin-bottom: 32px;
  animation: fadeUp .4s .3s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Login card */
.login-card {
  width: 100%;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--r-xl);
  padding: 22px 20px 24px;
  animation: fadeUp .4s .4s ease both;
}
.login-field-label {
  font-size: .7rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 6px;
  margin-top: 14px;
}
.login-field-label:first-of-type { margin-top: 0; }
.login-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.16);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--r-md);
  padding: 13px 14px;
  transition: border-color .18s;
}
.login-input-wrap:focus-within { border-color: rgba(255,255,255,.6); }
.login-input-wrap .field-icon { font-size: 18px; flex-shrink: 0; }
.login-input-wrap input {
  flex: 1;
  color: #fff;
  font-size: 1rem;
  font-weight: 400;
}
.login-input-wrap input::placeholder { color: rgba(255,255,255,.45); }

.login-btn {
  width: 100%;
  margin-top: 20px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .5px;
  box-shadow: 0 6px 20px rgba(255,107,0,.45);
  transition: all .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-btn:active { transform: scale(.98); box-shadow: 0 2px 8px rgba(255,107,0,.3); }

.login-footer {
  margin-top: 20px;
  color: rgba(255,255,255,.4);
  font-size: .7rem;
  letter-spacing: .5px;
  text-align: center;
  animation: fadeUp .4s .5s ease both;
}

/* Offline pill */
.offline-pill {
  display: none;
  position: fixed;
  top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--orange);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  animation: slideDown .3s ease;
}
.offline-pill.show { display: block; }
@keyframes slideDown {
  from { top: 50px; opacity: 0; }
  to   { top: 70px; opacity: 1; }
}

/* ── ═══════════════════════════════════════════════════════ ── */
/*    SCREEN: DASHBOARD / HOME                                    */
/* ── ═══════════════════════════════════════════════════════ ── */
.greeting-card {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.greeting-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.greeting-card::after {
  content: '👋';
  position: absolute;
  right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 34px;
  opacity: .22;
}
.greeting-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.greeting-meta {
  font-size: .75rem;
  color: rgba(255,255,255,.65);
  margin-top: 3px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
}
.stat-card.orange .stat-num { color: var(--orange); }
.stat-card.red .stat-num    { color: var(--red); }
.stat-card.green .stat-num  { color: var(--green); }
.stat-card .stat-label {
  font-size: .7rem;
  color: var(--text3);
  font-weight: 500;
  margin-top: 4px;
}
.stat-card .stat-change {
  font-size: .7rem;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-card .stat-change.up   { color: var(--green); }
.stat-card .stat-change.down { color: var(--red); }
.stat-card .stat-change.warn { color: var(--orange); }

/* Section headings */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.section-head .see-all {
  font-size: .75rem;
  color: var(--blue);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
}

/* Quick actions grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.quick-item {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: none;
  transition: all .18s;
  -webkit-tap-highlight-color: transparent;
}
.quick-item:active { transform: scale(.94); box-shadow: none; }
.quick-item .qi-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.quick-item .qi-label {
  font-size: .65rem;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
  line-height: 1.3;
}

/* ── CARDS (generic) ──────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}
.card:last-child { margin-bottom: 0; }

/* Visit cards */
.visit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .18s;
}
.visit-row:active { background: var(--blue-pale); }
.visit-avatar {
  width: 42px; height: 42px;
  background: var(--blue-light);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.visit-name  { font-size: .9rem; font-weight: 600; color: var(--text); }
.visit-sub   { font-size: .7rem; color: var(--text3); margin-top: 2px; }
.visit-time  { font-size: .65rem; color: var(--text4); margin-top: 2px; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-done    { background: var(--green-lt); color: #2E7D32; }
.badge-ongoing { background: var(--blue-light); color: var(--blue-dark); }
.badge-pending { background: var(--orange-lt); color: var(--orange-dk); }
.badge-flagged { background: #FFEBEE; color: var(--red); }
.badge-located { background: var(--blue-light); color: var(--blue); }
.badge-noloc   { background: var(--orange-lt); color: var(--orange); }
.badge-fcr     { background: #F3E5F5; color: #7B1FA2; }
.badge-fdr     { background: #E1F5FE; color: #0277BD; }
.badge-active-funnel { background: var(--green-lt); color: #2E7D32; }

/* ── ═══════════════════════════════════════════════════════ ── */
/*    SCREEN: CUSTOMERS                                           */
/* ── ═══════════════════════════════════════════════════════ ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: var(--r-md);
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  border: 1.5px solid transparent;
  transition: border-color .18s;
}
.search-bar:focus-within { border-color: var(--blue); }
.search-bar .search-icon { font-size: 18px; color: var(--text3); flex-shrink: 0; }
.search-bar input { flex: 1; font-size: .9rem; color: var(--text); }
.search-bar input::placeholder { color: var(--text4); }

.filter-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 12px;
  padding-bottom: 2px;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
}
.filter-chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.customer-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--white);
  border-radius: var(--r-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .18s;
  position: relative;
}
.customer-card:active { background: var(--blue-pale); }
.customer-card .loc-pending-stripe {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--orange);
  border-radius: var(--r-md) 0 0 var(--r-md);
}
.customer-avatar {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.customer-name { font-size: .95rem; font-weight: 600; color: var(--text); }
.customer-sub  { font-size: .72rem; color: var(--text3); margin-top: 2px; }
.customer-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

/* FAB */
.fab {
  position: fixed;
  bottom: calc(72px + var(--safe-bot));
  right: 16px;
  width: 52px; height: 52px;
  background: var(--orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: #fff;
  border: none;
  box-shadow: 0 4px 18px rgba(255,107,0,.45);
  transition: all .18s;
  z-index: 99;
}
.fab:active { transform: scale(.9); }

/* ── ═══════════════════════════════════════════════════════ ── */
/*    SCREEN: VISIT START                                         */
/* ── ═══════════════════════════════════════════════════════ ── */
.visit-hero {
  background: linear-gradient(160deg, var(--blue), var(--blue-deep));
  padding: 20px 16px 22px;
  margin: -14px -14px 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.visit-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.visit-hero-name { font-size: 1.2rem; font-weight: 700; }
.visit-hero-sub  { font-size: .8rem; opacity: .75; margin-top: 4px; }
.visit-hero-pill {
  display: inline-block;
  background: rgba(255,255,255,.16);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .7rem;
  margin-top: 10px;
}

/* GPS card */
.gps-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--blue-light);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
}
.gps-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(0,200,83,.2);
  animation: gpsPulse 1.8s ease-in-out infinite;
}
@keyframes gpsPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(0,200,83,.2); }
  50%       { box-shadow: 0 0 0 8px rgba(0,200,83,.06); }
}
.gps-dot.orange { background: var(--orange); animation: none; box-shadow: none; }
.gps-text { font-size: .78rem; color: var(--text2); line-height: 1.4; }
.gps-text strong { color: var(--text); }

.visit-time-pill {
  background: var(--bg);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .75rem;
  color: var(--text3);
  margin-top: 8px;
}

/* Visit type picker */
.vtype-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.vtype-btn {
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 11px 8px 9px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all .15s;
}
.vtype-btn.selected { border-color: var(--blue); background: var(--blue-light); }
.vtype-btn .vt-icon { font-size: 22px; margin-bottom: 4px; }
.vtype-btn .vt-label { font-size: .68rem; font-weight: 600; color: var(--text3); }
.vtype-btn.selected .vt-label { color: var(--blue); }

/* Form fields */
.form-field {
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-sm);
}
.form-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
  display: block;
}
.form-input {
  width: 100%;
  font-size: .9rem;
  color: var(--text);
  padding: 0;
}
.form-input::placeholder { color: var(--text4); }
.form-select {
  width: 100%;
  font-size: .9rem;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* Primary buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .4px;
  box-shadow: 0 5px 18px rgba(30,136,229,.38);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .18s;
  margin-top: 4px;
}
.btn-primary:active { transform: scale(.98); box-shadow: 0 2px 8px rgba(30,136,229,.25); }

.btn-success {
  width: 100%;
  background: linear-gradient(135deg, #00C853, #00897B);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .4px;
  box-shadow: 0 5px 18px rgba(0,200,83,.32);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .18s;
  margin-top: 4px;
}
.btn-success:active { transform: scale(.98); }

.btn-orange {
  width: 100%;
  background: linear-gradient(135deg, var(--orange), var(--orange-dk));
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 14px;
  font-size: .95rem;
  font-weight: 700;
  box-shadow: 0 5px 18px rgba(255,107,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .18s;
}
.btn-orange:active { transform: scale(.98); }

/* ── ═══════════════════════════════════════════════════════ ── */
/*    SCREEN: VISIT LOG / END                                     */
/* ── ═══════════════════════════════════════════════════════ ── */
.timer-bar {
  background: linear-gradient(135deg, var(--orange), var(--orange-dk));
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.timer-duration { font-size: 1.8rem; font-weight: 700; color: #fff; letter-spacing: .02em; }
.timer-label    { font-size: .72rem; color: rgba(255,255,255,.75); margin-bottom: 2px; }
.timer-started  { font-size: .7rem; color: rgba(255,255,255,.6); margin-top: 2px; }
.timer-cust     { font-size: .85rem; font-weight: 600; color: #fff; text-align: right; }

/* Map placeholder */
.map-card {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
  border-radius: var(--r-md);
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.map-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Crect width='60' height='60' fill='none'/%3E%3Cpath d='M0 30h60M30 0v60' stroke='%231E88E5' stroke-width='.4' stroke-dasharray='3 3' opacity='.3'/%3E%3C/svg%3E") repeat;
}
.map-pin { font-size: 30px; position: relative; }
.map-coords { font-size: .7rem; color: var(--blue); font-weight: 600; margin-top: 4px; position: relative; text-align: center; }

/* Location update alert */
.loc-update-alert {
  background: var(--orange-lt);
  border-left: 4px solid var(--orange);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .78rem;
  color: var(--orange-dk);
  margin-bottom: 10px;
}
.loc-update-alert strong { display: block; font-size: .8rem; margin-bottom: 2px; }

/* File attachments */
.attach-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.attach-scroll::-webkit-scrollbar { display: none; }
.attach-btn {
  flex-shrink: 0;
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.attach-btn:active { border-color: var(--blue); color: var(--blue); }
.attach-thumb {
  width: 68px; height: 68px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  position: relative;
}
.attach-thumb .thumb-del {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  border: 2px solid var(--bg);
}
.attach-count {
  font-size: .72rem;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

/* ── ═══════════════════════════════════════════════════════ ── */
/*    SCREEN: ADD CUSTOMER                                        */
/* ── ═══════════════════════════════════════════════════════ ── */
.loc-card {
  background: var(--blue-light);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 10px;
}
.loc-card-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.loc-pending-note {
  background: var(--orange-lt);
  border: 1px dashed var(--orange);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: .75rem;
  color: var(--orange-dk);
  margin-top: 8px;
}

/* ── ═══════════════════════════════════════════════════════ ── */
/*    LOADING / SPINNERS                                          */
/* ── ═══════════════════════════════════════════════════════ ── */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #f0f4f8 25%, #e2eaf3 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Toast notifications ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(72px + 10px + var(--safe-bot));
  left: 50%; transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 28px);
  max-width: 440px;
}
.toast {
  background: #1E2A3A;
  color: #fff;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1);
}
.toast.success { background: #1B5E20; }
.toast.error   { background: #B71C1C; }
.toast.warning { background: var(--orange-dk); }
.toast.offline { background: var(--orange-dk); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Pull-to-refresh indicator ─────────────────────────────── */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  color: var(--text3);
  font-size: .8rem;
  gap: 8px;
}

/* ── ═══════════════════════════════════════════════════════ ── */
/*    MISC UTILITIES                                              */
/* ── ═══════════════════════════════════════════════════════ ── */
.divider { height: 1px; background: var(--border); margin: 10px 0; }
.text-center { text-align: center; }
.text-muted  { color: var(--text3); font-size: .8rem; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.gap-row { display: flex; align-items: center; gap: 8px; }
.flex-1  { flex: 1; }

/* ── MEDIA QUERIES ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
