/* ==========================================================================
   RIB Sales — Google Material Design 3 × Cupertino Warm Orange/Yellow Theme
   PT Rencana Indah Bersama
   ========================================================================== */

:root {
  /* Studio & Warm Surface System (Material 3 Dynamic Warm Palette) */
  --studio-bg: #ece7df;
  --bg-canvas: #faf7f2;
  --surface: #ffffff;
  --surface-tonal: #fff8f0;
  --surface-container: #f5efe6;
  --divider: #f0e8dd;

  /* Warm Charcoal Ink Hierarchy */
  --ink-1: #1c1917;
  --ink-2: #57534e;
  --ink-3: #a8a29e;

  /* Signature Orange & Golden Yellow Brand Tokens */
  --orange-700: #c2410c;
  --orange-600: #ea580c;
  --orange-500: #f97316;
  --orange-100: #ffedd5;
  --orange-50: #fff7ed;

  --yellow-500: #f59e0b;
  --yellow-400: #fbbf24;
  --yellow-100: #fef3c7;

  /* Semantic Tokens */
  --green-600: #059669;
  --green-100: #dcfce7;
  --red-600: #dc2626;
  --red-100: #fee2e2;

  /* Elevation (Soft Warm Shadows — no harsh gray borders) */
  --elev-1: 0 1px 3px rgba(28, 25, 23, 0.05), 0 4px 12px rgba(28, 25, 23, 0.03);
  --elev-2: 0 6px 20px rgba(28, 25, 23, 0.08), 0 2px 6px rgba(28, 25, 23, 0.04);
  --elev-orange: 0 8px 20px -4px rgba(234, 88, 12, 0.34);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-pill: 999px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Roboto', sans-serif;
  background: var(--studio-bg);
  color: var(--ink-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  -webkit-font-smoothing: antialiased;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ==================== DEVICE HARDWARE FRAME (DESKTOP) ==================== */
.device-frame {
  width: 394px;
  height: 822px;
  background: #171514;
  border-radius: 48px;
  padding: 10px;
  box-shadow:
    0 32px 72px -16px rgba(28, 25, 23, 0.28),
    0 4px 14px rgba(28, 25, 23, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.device-screen {
  flex: 1;
  background: var(--bg-canvas);
  border-radius: 38px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* System Status Bar */
.sys-statusbar {
  height: 38px;
  padding: 0 24px;
  background: var(--bg-canvas);
  color: var(--ink-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 60;
}

.sys-statusbar.surface-match {
  background: var(--surface);
}

.sys-punchhole {
  width: 78px;
  height: 22px;
  border-radius: 999px;
  background: #121110;
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
}

.sys-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sys-gps-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-600);
}

.sys-gps-dot.off {
  background: var(--red-600);
}

/* Shell & Viewport */
.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.app-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background: var(--bg-canvas);
}

.app-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sys-gesturebar {
  height: 20px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sys-gesture-pill {
  width: 118px;
  height: 4.5px;
  border-radius: 999px;
  background: #d6d0c7;
}

/* ==================== SCREENS ==================== */
.screen {
  display: none;
  min-height: 100%;
  flex-direction: column;
}

.screen.active {
  display: flex;
  animation: screenFade 0.16s ease-out;
}

@keyframes screenFade {
  from { opacity: 0.65; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== MATERIAL 3 BOTTOM NAVIGATION (4 TABS) ==================== */
.bottom-nav {
  display: none;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--divider);
  height: 66px;
  padding: 6px 8px 4px;
  grid-template-columns: repeat(4, 1fr);
  flex-shrink: 0;
  z-index: 40;
}

.bottom-nav.visible {
  display: grid;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s;
}

.nav-pill {
  width: 54px;
  height: 30px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.15s ease;
}

.nav-item.active {
  color: var(--orange-700);
  font-weight: 700;
}

.nav-item.active .nav-pill {
  background: var(--orange-100);
  color: var(--orange-600);
}

/* ==================== TOP APP BAR (CUPERTINO FROSTED / M3) ==================== */
.appbar {
  height: 54px;
  padding: 0 14px 0 8px;
  background: rgba(250, 247, 242, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 30;
}

.appbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-container);
}

.appbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-1);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar-sub {
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 500;
}

.tonal-pill-btn {
  border: none;
  background: var(--yellow-100);
  color: var(--orange-700);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.tonal-pill-btn:hover {
  background: var(--orange-100);
}

/* ==================== MATERIAL 3 PILL BUTTONS & FILLED INPUTS ==================== */
.btn {
  height: 48px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  border: none;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.975);
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--orange-600) 0%, var(--orange-500) 100%);
  color: #ffffff;
  box-shadow: var(--elev-orange);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn-tonal {
  background: var(--orange-100);
  color: var(--orange-700);
}

.btn-tonal:hover {
  background: #fed7aa;
}

.btn-yellow-tonal {
  background: var(--yellow-100);
  color: #92400e;
}

.btn-outline {
  background: var(--surface);
  color: var(--ink-1);
  box-shadow: inset 0 0 0 1.5px #e7dfd4;
}

.btn-outline:hover {
  background: var(--surface-tonal);
}

.btn-success {
  background: var(--green-600);
  color: #ffffff;
  box-shadow: 0 8px 18px -4px rgba(5, 150, 105, 0.34);
}

.btn-danger-tonal {
  background: var(--red-100);
  color: var(--red-600);
}

.btn-danger-tonal:hover {
  background: #fecaca;
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
}

/* Material 3 Filled Input Fields */
.field {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
  padding-left: 4px;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--ink-1);
  background: var(--surface-container);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.field-input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--orange-500);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.field-input.has-prefix {
  padding-left: 46px;
}

.field-input.has-suffix {
  padding-right: 48px;
}

.field-prefix {
  position: absolute;
  left: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--orange-700);
  pointer-events: none;
}

.field-suffix-btn {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.inline-banner {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 14px;
}

.inline-banner.show {
  display: flex;
}

.inline-banner.error {
  background: var(--red-100);
  color: #991b1b;
}

.inline-banner.warn {
  background: var(--yellow-100);
  color: #92400e;
}

.inline-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==================== SCREEN 1: LOGIN (WARM MATERIAL 3 / CUPERTINO) ==================== */
.login-screen {
  background: linear-gradient(180deg, #fff3e0 0%, #faf7f2 34%, #ffffff 34.1%);
  padding: 34px 24px 26px;
  justify-content: space-between;
}

.login-head {
  margin-top: 14px;
}

.rib-badge-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--orange-600) 0%, var(--yellow-500) 100%);
  box-shadow: 0 12px 24px -6px rgba(234, 88, 12, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.login-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink-1);
  line-height: 1.2;
}

.login-head p {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 8px;
  line-height: 1.5;
}

.login-form-area {
  margin-top: 28px;
}

.login-foot {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
}

.login-company {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}

.login-sub {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
}

/* ==================== SCREEN 2: BERANDA (WARM HERO + FOCUSED WORKSPACE) ==================== */
.home-topbar {
  padding: 12px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-600), var(--yellow-500));
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.28);
}

.home-greeting {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.home-name {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--ink-1);
  letter-spacing: -0.02em;
}

.gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--green-100);
  color: var(--green-600);
  flex-shrink: 0;
}

.gps-pill.off {
  background: var(--red-100);
  color: var(--red-600);
}

.gps-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.page-section {
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Signature Orange-Yellow Hero Performance Card */
.hero-summary-card {
  background: linear-gradient(135deg, #d9480f 0%, #ea580c 52%, #f59e0b 100%);
  color: #ffffff;
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 28px -10px rgba(234, 88, 12, 0.45);
}

.hero-summary-card::before {
  content: '';
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(254, 243, 199, 0.16);
  top: -64px;
  right: -40px;
  pointer-events: none;
}

.hero-summary-card::after {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  bottom: -48px;
  right: 44px;
  pointer-events: none;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  position: relative;
  z-index: 2;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 12px;
  margin-top: 14px;
  position: relative;
  z-index: 2;
}

.hero-metric-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
}

.hero-metric-val {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.hero-progress-wrap {
  margin-top: 14px;
  position: relative;
  z-index: 2;
}

.hero-progress-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.hero-progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: #fef08a;
  transition: width 0.3s ease;
}

/* Elevated Soft White Card (Material 3 / Cupertino) */
.m3-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--elev-1);
}

.section-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Next Destination Card (Dijkstra Live Priority) */
.next-stop-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--elev-1);
  border-left: 4px solid var(--orange-500);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.next-stop-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.next-stop-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dist-chip {
  background: var(--yellow-100);
  color: #92400e;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

.next-stop-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-1);
  letter-spacing: -0.02em;
}

.next-stop-addr {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
  line-height: 1.4;
}

/* Quick Actions (Ayo mulai bekerja hari ini) */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-tile {
  background: var(--surface);
  border: none;
  border-radius: var(--r-md);
  padding: 16px 14px;
  box-shadow: var(--elev-1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.quick-tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--elev-2);
}

.qt-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qt-squircle {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qt-squircle.orange {
  background: var(--orange-100);
  color: var(--orange-600);
}

.qt-squircle.amber {
  background: var(--yellow-100);
  color: #b45309;
}

.qt-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface-container);
  padding: 3px 8px;
  border-radius: var(--r-pill);
}

.qt-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.25;
}

.qt-sub {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 2px;
}

/* ==================== SCREEN 3: JADWAL KUNJUNGAN (MAP + SHEET) ==================== */
.schedule-screen {
  height: 100%;
  display: none;
  flex-direction: column;
}

.schedule-screen.active {
  display: flex;
}

.map-container-wrap {
  position: relative;
  height: 294px;
  width: 100%;
  flex-shrink: 0;
  background: #ede6dc;
}

#visitMap {
  width: 100%;
  height: 100%;
  z-index: 1;
}

#visitMap .leaflet-tile-pane {
  filter: saturate(0.92) sepia(0.06) contrast(1.02);
}

.map-fab-stack {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 15;
}

.map-fab {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: none;
  box-shadow: var(--elev-2);
  color: var(--orange-600);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.map-route-pill {
  position: absolute;
  bottom: 18px;
  left: 12px;
  right: 12px;
  z-index: 15;
  background: rgba(28, 25, 23, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(28, 25, 23, 0.24);
}

.route-sub {
  font-size: 11px;
  color: #fde68a;
  font-weight: 600;
}

.route-main {
  font-size: 13.5px;
  font-weight: 700;
  margin-top: 1px;
}

.pill-action {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: none;
  border-radius: var(--r-pill);
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.sheet-surface {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  margin-top: -12px;
  position: relative;
  z-index: 20;
  flex: 1;
  padding: 10px 16px 24px;
  box-shadow: 0 -4px 18px rgba(28, 25, 23, 0.06);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: #e2d9cd;
  border-radius: var(--r-pill);
  margin: 0 auto 12px;
}

.sheet-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sheet-head-row h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}

.sheet-head-row span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--orange-700);
}

/* Route Timeline Stops */
.stop-list {
  display: flex;
  flex-direction: column;
}

.stop-row {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--divider);
}

.stop-row:last-child {
  border-bottom: none;
}

.stop-row.focused {
  background: var(--orange-50);
  margin: 0 -16px;
  padding: 13px 16px;
}

.stop-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  flex-shrink: 0;
}

.stop-node {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--orange-600);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stop-node.active {
  background: var(--yellow-500);
  color: var(--ink-1);
}

.stop-node.done {
  background: var(--green-600);
}

.stop-line {
  width: 2px;
  flex: 1;
  min-height: 22px;
  background: #f0e4d4;
  margin-top: 6px;
}

.stop-row:last-child .stop-line {
  display: none;
}

.stop-content {
  flex: 1;
  min-width: 0;
}

.stop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stop-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-1);
}

.stop-dist {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-700);
  white-space: nowrap;
}

.stop-addr {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
  line-height: 1.4;
}

.stop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.status-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

.status-tag.pending {
  background: var(--surface-container);
  color: var(--ink-2);
}

.status-tag.active {
  background: var(--yellow-100);
  color: #92400e;
}

.status-tag.done {
  background: var(--green-100);
  color: var(--green-600);
}

.stop-btn-group {
  display: flex;
  gap: 6px;
}

/* ==================== SCREEN 4: CHECK-IN & CAMERA ==================== */
.geo-strip {
  border-radius: var(--r-md);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

.geo-strip.valid {
  background: var(--green-100);
  color: #065f46;
}

.geo-strip.invalid {
  background: var(--red-100);
  color: #991b1b;
}

.geo-strip-title {
  font-weight: 700;
}

.geo-strip-sub {
  font-size: 11.5px;
  opacity: 0.9;
  margin-top: 2px;
}

.viewfinder-wrap {
  background: #141210;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--elev-2);
}

.viewfinder-wrap video,
.viewfinder-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vf-reticle {
  position: absolute;
  inset: 14px 14px 38px 14px;
  pointer-events: none;
}

.vf-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--yellow-400);
  border-style: solid;
  border-width: 0;
}

.vf-corner.tl { top: 0; left: 0; border-top-width: 2.5px; border-left-width: 2.5px; border-top-left-radius: 6px; }
.vf-corner.tr { top: 0; right: 0; border-top-width: 2.5px; border-right-width: 2.5px; border-top-right-radius: 6px; }
.vf-corner.bl { bottom: 0; left: 0; border-bottom-width: 2.5px; border-left-width: 2.5px; border-bottom-left-radius: 6px; }
.vf-corner.br { bottom: 0; right: 0; border-bottom-width: 2.5px; border-right-width: 2.5px; border-bottom-right-radius: 6px; }

.vf-hud {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 9px 14px;
  background: linear-gradient(transparent, rgba(20, 18, 16, 0.82));
  color: #fef3c7;
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.vf-empty {
  text-align: center;
  color: #a8a29e;
  padding: 20px;
}

.vf-empty p {
  font-size: 12.5px;
  margin-top: 8px;
  color: #e7e5e4;
}

.shutter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 6px 0;
}

.shutter-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 4px solid var(--orange-600);
  background: var(--surface);
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.25);
  transition: transform 0.1s;
}

.shutter-btn:active {
  transform: scale(0.92);
}

.shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-600), var(--yellow-500));
}

.shutter-side-btn {
  border: none;
  background: var(--surface);
  color: var(--ink-1);
  border-radius: var(--r-pill);
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: var(--elev-1);
}

/* ==================== SCREEN 5: CHECK-OUT & PENJUALAN ==================== */
.photo-evidence {
  border-radius: var(--r-md);
  overflow: hidden;
  background: #141210;
  aspect-ratio: 4 / 3;
  box-shadow: var(--elev-1);
}

.photo-evidence img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quick-nominal-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.nominal-chip {
  border: none;
  background: var(--yellow-100);
  color: #92400e;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.12s;
}

.nominal-chip:hover {
  background: var(--orange-100);
  color: var(--orange-700);
}

/* ==================== CUPERTINO INSET GROUPED LISTS (RIWAYAT & KARYAWAN) ==================== */
.segmented-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface-container);
  padding: 4px;
  border-radius: var(--r-pill);
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 8px 6px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--orange-700);
  box-shadow: 0 2px 6px rgba(28, 25, 23, 0.08);
}

.stats-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-stat {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--elev-1);
}

.mini-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.mini-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-1);
  margin-top: 3px;
  letter-spacing: -0.02em;
}

.mini-stat-val.orange {
  color: var(--orange-600);
}

.grouped-list {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--elev-1);
  overflow: hidden;
}

.grouped-row {
  padding: 13px 16px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.grouped-row:last-child {
  border-bottom: none;
}

.grouped-row.clickable {
  cursor: pointer;
  transition: background 0.12s;
}

.grouped-row.clickable:hover {
  background: var(--surface-tonal);
}

.gr-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.gr-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--orange-50);
  color: var(--orange-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gr-icon.yellow {
  background: var(--yellow-100);
  color: #b45309;
}

.gr-icon.green {
  background: var(--green-100);
  color: var(--green-600);
}

.gr-label {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}

.gr-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-1);
  text-align: right;
}

.hr-outlet {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-1);
}

.hr-time {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 2px;
}

.hr-coord {
  font-size: 10.5px;
  color: var(--ink-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: 2px;
}

.hr-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hr-amount {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--orange-600);
}

/* Profile Hero (Tab 4: Informasi Karyawan) */
.profile-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border-radius: var(--r-lg);
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--elev-1);
}

.avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-600), var(--yellow-500));
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.3);
}

.profile-name {
  font-size: 17.5px;
  font-weight: 800;
  color: var(--ink-1);
  letter-spacing: -0.02em;
}

.profile-role {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
}

.profile-id-pill {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange-700);
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

.group-caption {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-left: 6px;
  margin-bottom: -6px;
}

.empty-box {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 36px 20px;
  text-align: center;
  box-shadow: var(--elev-1);
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--orange-50);
  color: var(--orange-500);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-box h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-1);
}

.empty-box p {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 4px;
  line-height: 1.45;
}

/* ==================== MODAL BOTTOM SHEET ==================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(3px);
  z-index: 80;
  display: none;
  align-items: flex-end;
}

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

.modal-sheet {
  background: var(--surface);
  width: 100%;
  max-height: 82%;
  border-radius: 26px 26px 0 0;
  padding: 12px 18px 24px;
  overflow-y: auto;
  animation: sheetIn 0.18s ease-out;
}

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

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-1);
}

.leg-card {
  background: var(--surface-tonal);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 12px;
}

.leg-title {
  font-weight: 700;
  color: var(--ink-1);
  margin-bottom: 3px;
}

.leg-route {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--orange-700);
  background: var(--yellow-100);
  padding: 6px 9px;
  border-radius: 9px;
  margin: 6px 0 4px;
  line-height: 1.4;
}

/* ==================== SNACKBAR ==================== */
.snackbar {
  position: absolute;
  bottom: 76px;
  left: 16px;
  right: 16px;
  z-index: 95;
  background: #1c1917;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(28, 25, 23, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s, transform 0.18s;
}

.snackbar.show {
  opacity: 1;
  transform: translateY(0);
}

.snackbar.error { background: #991b1b; }
.snackbar.success { background: #065f46; }

/* ==================== MAP MARKERS (GOOGLE / APPLE MAPS STYLE) ==================== */
.map-pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--orange-600);
  color: #ffffff;
  border: 2.5px solid #ffffff;
  box-shadow: 0 3px 8px rgba(28, 25, 23, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.map-pin.active {
  background: var(--yellow-400);
  color: var(--ink-1);
}

.map-pin.done {
  background: var(--green-600);
}

.gps-puck {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.22), 0 2px 6px rgba(0, 0, 0, 0.28);
}

/* ==================== MINIMAL STUDIO QA BAR (DESKTOP ONLY) ==================== */
.studio-qa-bar {
  margin-top: 12px;
  width: 394px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-radius: var(--r-pill);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  box-shadow: var(--elev-1);
}

.qa-btn {
  border: none;
  background: var(--surface-container);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}

.qa-btn:hover {
  background: var(--orange-100);
  color: var(--orange-700);
}

.qa-btn.on {
  background: var(--orange-100);
  color: var(--orange-700);
}

.qa-btn.off {
  background: var(--red-100);
  color: var(--red-600);
}

/* ==================== MOBILE FULL-BLEED ==================== */
@media (max-width: 540px) {
  body {
    padding: 0;
    background: var(--bg-canvas);
    align-items: stretch;
    justify-content: stretch;
  }

  .device-frame {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .device-screen {
    border-radius: 0;
  }

  .sys-statusbar,
  .sys-gesturebar,
  .studio-qa-bar,
  .studio-admin-link {
    display: none;
  }
}
