/* =====================================================
   SALES VISIT PWA - Premium Orange Theme
   ===================================================== */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Orange palette - warm, professional */
  --orange-50: #FFF8F0;
  --orange-100: #FFEDD5;
  --orange-200: #FED7AA;
  --orange-300: #FDBA74;
  --orange-400: #FB923C;
  --orange-500: #F97316;
  --orange-600: #EA580C;
  --orange-700: #C2410C;
  --orange-800: #9A3412;
  --orange-900: #7C2D12;

  /* Neutral palette */
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* Semantic colors */
  --success: #10B981;
  --success-bg: #D1FAE5;
  --error: #EF4444;
  --error-bg: #FEE2E2;
  --info: #3B82F6;
  --info-bg: #DBEAFE;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;

  /* Primary gradient */
  --gradient-primary: linear-gradient(135deg, #F97316 0%, #EA580C 50%, #C2410C 100%);
  --gradient-warm: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
  --gradient-hero: linear-gradient(160deg, #FFF7ED 0%, #FFF1E0 30%, #FFE4C9 60%, #FFDBB5 100%);
  --gradient-card: linear-gradient(145deg, #FFFFFF 0%, #FFFBF7 100%);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-orange: 0 4px 14px rgba(249, 115, 22, 0.25);
  --shadow-orange-lg: 0 8px 25px rgba(249, 115, 22, 0.3);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.6;
  color: var(--slate-800);
  background: var(--gradient-hero);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* --- PWA Install Banner --- */
.install-banner {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-primary);
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-orange-lg);
  z-index: 999999;
  transition: top var(--transition-slow);
  max-width: 420px;
  width: calc(100% - 32px);
}

.install-banner.show {
  top: calc(20px + env(safe-area-inset-top, 0px));
}

.install-banner i {
  font-size: 22px;
  flex-shrink: 0;
}

.install-banner .install-text {
  flex: 1;
}

.install-banner .install-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.install-banner .install-text span {
  font-size: 12px;
  opacity: 0.85;
}

.install-banner .install-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.install-banner .btn-install {
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.install-banner .btn-install:hover {
  background: rgba(255, 255, 255, 0.35);
}

.install-banner .btn-dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: color var(--transition-fast);
}

.install-banner .btn-dismiss:hover {
  color: white;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  background-attachment: fixed;
  background-size: cover;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, transparent 70%);
  top: -60px;
  right: -60px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.08) 0%, transparent 70%);
  bottom: -50px;
  left: -50px;
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--gradient-card);
  border-radius: var(--radius-2xl);
  padding: 36px 28px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(249, 115, 22, 0.08);
  backdrop-filter: blur(20px);
  animation: slideUp 0.6s var(--transition-slow);
  width: 100%;
  box-sizing: border-box;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

/* ====== ANIMATED LOGO SCENE ====== */
.logo-scene {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulsating glow behind logo */
.logo-glow {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(249, 115, 22, 0.3) 0%, transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
  z-index: 0;
}

@keyframes glowPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.6);
    opacity: 0.15;
  }
}

/* Main logo icon */
.login-header .logo-icon {
  width: 64px;
  height: 64px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-orange);
  z-index: 3;
  position: relative;
  animation: logoBounceIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.login-header .logo-icon i {
  font-size: 28px;
  color: white;
  animation: iconFloat 4s ease-in-out infinite;
}

@keyframes logoBounceIn {
  0% {
    transform: scale(0) rotate(-30deg);
    opacity: 0;
  }

  60% {
    transform: scale(1.15) rotate(5deg);
    opacity: 1;
  }

  80% {
    transform: scale(0.95) rotate(-2deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes iconFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

/* Orbiting rings */
.logo-ring {
  position: absolute;
  border-radius: var(--radius-full);
  border: 1.5px dashed rgba(249, 115, 22, 0.2);
  z-index: 1;
}

.logo-ring.ring-1 {
  width: 100px;
  height: 100px;
  animation: orbitSpin 10s linear infinite;
}

.logo-ring.ring-2 {
  width: 132px;
  height: 132px;
  animation: orbitSpin 15s linear infinite reverse;
  border-color: rgba(249, 115, 22, 0.12);
}

@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Satellite dots on the rings */
.orbit-dot {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.orbit-dot.dot-1 {
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #F97316, #EA580C);
  color: white;
  animation: dotCounterSpin1 10s linear infinite, dotPop 0.5s 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.orbit-dot.dot-2 {
  bottom: -13px;
  right: 8px;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: white;
  animation: dotCounterSpin2 15s linear infinite, dotPop 0.5s 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.orbit-dot.dot-3 {
  top: 50%;
  left: -13px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  animation: dotCounterSpin2 15s linear infinite, dotPop 0.5s 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes dotCounterSpin1 {
  from {
    transform: translateX(-50%) rotate(0deg);
  }

  to {
    transform: translateX(-50%) rotate(-360deg);
  }
}

@keyframes dotCounterSpin2 {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes dotPop {
  from {
    scale: 0;
    opacity: 0;
  }

  to {
    scale: 1;
    opacity: 1;
  }
}

/* ====== ANIMATED TITLE TEXT ====== */
.login-title-animated {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-800);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, var(--slate-800) 40%, var(--orange-500) 50%, var(--slate-800) 60%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleReveal 0.6s 0.3s ease both, shimmer 4s 1.5s ease-in-out infinite;
}

.login-subtitle-animated {
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 400;
  animation: titleReveal 0.6s 0.5s ease both;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% center;
  }

  100% {
    background-position: -200% center;
  }
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: 8px;
}

.login-form label i {
  color: var(--orange-500);
  font-size: 14px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--slate-800);
  background: var(--slate-50);
  transition: all var(--transition-normal);
  box-sizing: border-box;
}

.login-form input:focus {
  border-color: var(--orange-400);
  background: white;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.login-form input::placeholder {
  color: var(--slate-400);
}

.login-footer {
  margin-top: 20px;
  text-align: center;
}

.login-footer p {
  font-size: 12px;
  color: var(--slate-400);
}

/* ====== LOGIN MOBILE RESPONSIVE ====== */
@media (max-width: 480px) {
  .login-page {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    align-items: center;
  }

  .login-card {
    padding: 28px 20px;
    border-radius: var(--radius-xl);
  }

  .login-header {
    margin-bottom: 22px;
  }

  .logo-scene {
    width: 120px;
    height: 120px;
    margin-bottom: 14px;
  }

  .login-header .logo-icon {
    width: 56px;
    height: 56px;
  }

  .login-header .logo-icon i {
    font-size: 24px;
  }

  .logo-glow {
    width: 76px;
    height: 76px;
  }

  .logo-ring.ring-1 {
    width: 86px;
    height: 86px;
  }

  .logo-ring.ring-2 {
    width: 114px;
    height: 114px;
  }

  .orbit-dot {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }

  .orbit-dot.dot-1 {
    top: -11px;
  }

  .orbit-dot.dot-2 {
    bottom: -11px;
    right: 6px;
  }

  .orbit-dot.dot-3 {
    left: -11px;
  }

  .login-title-animated {
    font-size: 20px;
  }

  .login-subtitle-animated {
    font-size: 12px;
  }

  .login-form .form-group {
    margin-bottom: 14px;
  }

  .login-form input[type="text"],
  .login-form input[type="password"] {
    padding: 12px 14px;
    font-size: 14px;
  }

  .login-page::before {
    width: 200px;
    height: 200px;
    top: -40px;
    right: -40px;
  }

  .login-page::after {
    width: 180px;
    height: 180px;
    bottom: -40px;
    left: -40px;
  }
}

@media (max-height: 640px) {
  .login-page {
    align-items: flex-start;
    padding-top: 24px;
  }

  .logo-scene {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
  }

  .login-header .logo-icon {
    width: 48px;
    height: 48px;
  }

  .login-header .logo-icon i {
    font-size: 22px;
  }

  .logo-ring.ring-1 {
    width: 72px;
    height: 72px;
  }

  .logo-ring.ring-2 {
    width: 94px;
    height: 94px;
  }

  .login-card {
    padding: 24px 18px;
  }

  .login-header {
    margin-bottom: 16px;
  }

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

/* --- Alerts --- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert i {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-error {
  background: var(--error-bg);
  color: #991B1B;
  border: 1px solid #FECACA;
}

.alert-success {
  background: var(--success-bg);
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.alert-info {
  background: var(--info-bg);
  color: #1E40AF;
  border: 1px solid #93C5FD;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  pointer-events: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-orange);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-orange-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-block {
  width: 100%;
}

.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1.5px solid var(--slate-200);
}

.btn-secondary:hover {
  background: var(--slate-200);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--orange-300);
  color: var(--orange-600);
}

.btn-outline:hover {
  background: var(--orange-50);
}

/* =====================================================
   PWA CONTAINER (Dashboard, Attendance, etc.)
   ===================================================== */
.pwa-container {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--gradient-hero);
  position: relative;
  padding-bottom: 80px;
}

/* --- App Header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  border-bottom: 1px solid rgba(249, 115, 22, 0.08);
}

.header-gradient {
  height: 3px;
  background: var(--gradient-primary);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.header-content h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-800);
  letter-spacing: -0.3px;
}

.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--slate-600);
  transition: all var(--transition-fast);
}

.back-btn:hover {
  background: var(--orange-50);
  color: var(--orange-600);
}

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

.header-action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--slate-100);
  color: var(--slate-600);
  font-size: 15px;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  background: var(--orange-100);
  color: var(--orange-600);
}

.header-action-btn.logout:hover {
  background: #FEE2E2;
  color: #DC2626;
}

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

.header-avatar {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.header-user-text {
  display: flex;
  flex-direction: column;
}

.header-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-800);
}

.header-user-role {
  font-size: 11px;
  color: var(--slate-400);
  font-weight: 500;
}

/* --- Main Content Area --- */
.main-content {
  padding: 20px;
}

.hero-greeting {
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  margin-bottom: 24px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-orange);
  display: flex;
  flex-direction: column;
}

.hero-greeting::before {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  top: -80px;
  right: -50px;
  pointer-events: none;
}

.hero-greeting::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  bottom: -40px;
  left: -20px;
  pointer-events: none;
}

.hero-greeting .greeting-text {
  position: relative;
  z-index: 2;
  margin-bottom: 12px;
  width: 100%;
}

.hero-greeting h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-greeting p {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 500;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

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

/* --- Hero Bottom Row (Date + Clock) --- */
.hero-bottom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  position: relative;
  z-index: 2;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero-date, .hero-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-clock {
  background: rgba(0, 0, 0, 0.15);
  font-variant-numeric: tabular-nums; /* Monospace numbers for clock */
}

/* --- Stats Cards --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(249, 115, 22, 0.06);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 18px;
}

.stat-card:nth-child(1) .stat-icon {
  background: var(--orange-100);
  color: var(--orange-600);
}

.stat-card:nth-child(2) .stat-icon {
  background: var(--success-bg);
  color: var(--success);
}

.stat-card:nth-child(3) .stat-icon {
  background: var(--info-bg);
  color: var(--info);
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-800);
  letter-spacing: -0.5px;
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--slate-500);
  font-weight: 500;
  margin-top: 2px;
}

/* --- Quick Actions --- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-800);
  letter-spacing: -0.2px;
}

.section-title a {
  font-size: 13px;
  font-weight: 600;
  color: var(--orange-600);
  transition: color var(--transition-fast);
}

.section-title a:hover {
  color: var(--orange-700);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.action-card {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: 22px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(249, 115, 22, 0.06);
  transition: all var(--transition-normal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--orange-200);
}

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

.action-card .action-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform var(--transition-normal);
}

.action-card:hover .action-icon {
  transform: scale(1.08);
}

.action-card.action-customer .action-icon {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  color: var(--orange-600);
}

.action-card.action-list .action-icon {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  color: var(--info);
}

.action-card.action-attendance .action-icon {
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  color: var(--success);
}

.action-card.action-install-app .action-icon {
  background: linear-gradient(135deg, #FDF2F8, #FCE7F3);
  color: #DB2777; /* Pink */
}

.action-card .action-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
  line-height: 1.3;
}

/* --- Recent List --- */
.recent-section {
  margin-bottom: 24px;
}

.customer-card {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(249, 115, 22, 0.05);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition-normal);
}

.customer-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--orange-100);
  color: var(--orange-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.customer-info {
  flex: 1;
  min-width: 0;
}

.customer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-meta {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.customer-meta i {
  font-size: 10px;
  color: var(--orange-400);
}

.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-active {
  background: var(--success-bg);
  color: #065F46;
}

.badge-inactive {
  background: var(--error-bg);
  color: #991B1B;
}

.badge-retail {
  background: var(--orange-100);
  color: var(--orange-700);
}

.badge-distributor {
  background: var(--info-bg);
  color: #1E40AF;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--slate-400);
}

.empty-state i {
  font-size: 48px;
  color: var(--orange-200);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
  color: var(--slate-500);
}

/* --- Bottom Navigation --- */
/* --- Modern Floating Bubble Navbar --- */
.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 440px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-around;
  padding: 10px 12px;
  border-radius: 24px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 25%;
  height: 48px;
  color: var(--slate-400);
  font-size: 10px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
  text-decoration: none;
}

.nav-item i {
  font-size: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item span {
  opacity: 0.6;
  transition: all 0.3s;
}

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

.nav-item.active i {
  transform: translateY(-4px);
  color: var(--orange-600);
}

.nav-item.active span {
  opacity: 1;
  font-weight: 800;
}

/* The Bubble Indicator */
.nav-indicator {
  position: absolute;
  height: 48px;
  width: 22%;
  background: var(--orange-50);
  border-radius: 18px;
  top: 10px;
  left: 12px;
  z-index: 1;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}

/* Positioning for 4 items */
.nav-item:nth-child(1).active ~ .nav-indicator { left: 12px; width: 22%; }
.nav-item:nth-child(2).active ~ .nav-indicator { left: calc(25% + 6px); width: 22%; }
.nav-item:nth-child(3).active ~ .nav-indicator { left: calc(50% + 2px); width: 22%; }
.nav-item:nth-child(4).active ~ .nav-indicator { left: calc(75% - 2px); width: 22%; }

/* Mobile refinement */
@media (max-width: 400px) {
  .nav-item span { font-size: 9px; }
  .nav-indicator { height: 44px; top: 12px; }
}

/* =====================================================
   CREATE CUSTOMER PAGE
   ===================================================== */
.form-card {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(249, 115, 22, 0.06);
  animation: fadeIn 0.4s ease;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--slate-100);
}

.card-header i {
  width: 34px;
  height: 34px;
  background: var(--orange-100);
  color: var(--orange-600);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-800);
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: 8px;
}

.form-group label i {
  color: var(--orange-500);
  font-size: 13px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--slate-800);
  background: var(--slate-50);
  transition: all var(--transition-normal);
  appearance: none;
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--orange-400);
  background: white;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--slate-400);
}

.form-group input:disabled,
.form-group input[readonly] {
  background: var(--slate-100);
  color: var(--slate-500);
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group.checkbox label {
  cursor: pointer;
  gap: 10px;
}

.form-group.checkbox input[type="checkbox"] {
  width: auto;
  accent-color: var(--orange-500);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding: 0 0 8px;
}

.form-actions .btn {
  flex: 1;
}

/* --- Radio Group (Attendance) --- */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
  background: var(--slate-50);
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-label .radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--slate-300);
  border-radius: 50%;
  position: relative;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.radio-label input[type="radio"]:checked+.radio-custom {
  border-color: var(--orange-500);
}

.radio-label input[type="radio"]:checked+.radio-custom::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--orange-500);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.radio-label input[type="radio"]:checked~span:last-child {
  color: var(--orange-700);
  font-weight: 600;
}

.radio-label:has(input[type="radio"]:checked) {
  border-color: var(--orange-300);
  background: var(--orange-50);
}

/* --- Location & Photo Buttons --- */
.btn-location,
.btn-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 2px dashed var(--slate-300);
  border-radius: var(--radius-md);
  background: var(--slate-50);
  color: var(--slate-600);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-location:hover,
.btn-photo:hover {
  border-color: var(--orange-300);
  background: var(--orange-50);
  color: var(--orange-600);
}

.btn-location.success {
  border-color: var(--success);
  border-style: solid;
  background: var(--success-bg);
  color: #065F46;
}

.full-width {
  width: 100%;
}

.location-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--slate-500);
}

.location-status.success {
  color: #065F46;
}

.photo-preview {
  margin-top: 10px;
}

.photo-preview img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
}

/* --- Submit Button (Attendance) --- */
.btn-submit {
  width: 100%;
  padding: 16px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-orange);
  transition: all var(--transition-normal);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-orange-lg);
}

.btn-submit:active {
  transform: translateY(0);
}

/* =====================================================
   MODAL (View Customers)
   ===================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: flex-end;
  animation: modalBgFade 0.25s ease;
}

.modal.active {
  display: flex;
}

@keyframes modalBgFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

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

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-800);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h2 i {
  color: var(--orange-500);
  font-size: 18px;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--slate-100);
  color: var(--slate-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--slate-200);
  color: var(--slate-800);
}

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

.modal-body .loading {
  text-align: center;
  padding: 40px;
  color: var(--slate-400);
}

.modal-body .loading i {
  font-size: 28px;
  color: var(--orange-400);
  margin-bottom: 12px;
  display: block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =====================================================
   LOADING & SPLASH ANIMATIONS
   ===================================================== */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--gradient-hero);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.page-loader .loader-icon {
  width: 64px;
  height: 64px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-glow 2s ease-in-out infinite;
  margin-bottom: 20px;
}

.page-loader .loader-icon i {
  font-size: 28px;
  color: white;
}

.page-loader .loader-text {
  font-size: 14px;
  color: var(--slate-500);
  font-weight: 500;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (min-width: 481px) {
  .pwa-container {
    border-left: 1px solid var(--slate-200);
    border-right: 1px solid var(--slate-200);
    box-shadow: var(--shadow-xl);
  }

  .bottom-nav {
    border-radius: 0;
  }
}

@media (max-width: 380px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-greeting h1 {
    font-size: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .radio-group {
    flex-direction: column;
  }
}

/* --- Utility: Scrollbar --- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* --- Stagger animations --- */
.stagger-1 {
  animation-delay: 0.05s;
}

.stagger-2 {
  animation-delay: 0.1s;
}

.stagger-3 {
  animation-delay: 0.15s;
}

.stagger-4 {
  animation-delay: 0.2s;
}

.stagger-5 {
  animation-delay: 0.25s;
}

/* Logout button in header */
.btn-logout {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--slate-400);
  transition: all var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
}

.btn-logout:hover {
  background: var(--error-bg);
  color: var(--error);
}

/* =====================================================
   ATTENDANCE FLOW - Step Wizard
   ===================================================== */

/* Step Section Visibility */
.step-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

/* Step Indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 0 20px;
}

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--slate-200);
  color: var(--slate-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
}

.step-dot.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-orange);
  border-color: rgba(249, 115, 22, 0.3);
}

.step-dot.done {
  background: var(--success);
  color: white;
  border-color: rgba(16, 185, 129, 0.3);
}

.step-dot.done i {
  font-size: 14px;
}

.step-line {
  flex: 1;
  height: 3px;
  background: var(--slate-200);
  margin: 0 4px;
  border-radius: var(--radius-full);
  max-width: 60px;
  transition: background var(--transition-normal);
}

.step-line.done {
  background: var(--success);
}

/* Customer Info Card */
.customer-info-card .customer-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
}

.customer-detail-row .detail-label {
  font-size: 13px;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

.customer-detail-row .detail-label i {
  color: var(--orange-400);
  font-size: 12px;
}

/* Loading Card */
.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--slate-500);
  font-size: 14px;
}

.loading-card i {
  font-size: 20px;
  color: var(--orange-400);
}

/* Info Card */
.info-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-card p {
  font-size: 13px;
  color: var(--slate-600);
  margin: 0;
}

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

.invoice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--slate-200);
  transition: all var(--transition-fast);
  flex-wrap: wrap;
}

.invoice-item.selected {
  border-color: var(--orange-400);
  background: var(--orange-50);
}

.invoice-item:hover {
  border-color: var(--orange-300);
}

.invoice-item-info {
  flex: 1;
  min-width: 0;
}

.invoice-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-800);
}

.invoice-item-meta {
  font-size: 11px;
  color: var(--slate-500);
  display: flex;
  gap: 12px;
  margin-top: 2px;
}

.invoice-item-meta i {
  font-size: 10px;
  margin-right: 3px;
}

/* Return Items */
.return-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.return-item-row {
  padding: 12px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
}

.return-item-info {
  margin-bottom: 10px;
}

.return-item-info strong {
  font-size: 13px;
  color: var(--slate-800);
  display: block;
}

.return-item-info span {
  font-size: 11px;
  color: var(--slate-500);
}

.return-item-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.return-item-fields input,
.return-item-fields select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: white;
}

.return-item-fields input:focus,
.return-item-fields select:focus {
  border-color: var(--orange-400);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.08);
}

/* Action Choice Grid */
.action-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-btn {
  background: var(--gradient-card);
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.choice-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.choice-btn.choice-transaction:hover {
  border-color: var(--orange-400);
  background: var(--orange-50);
}

.choice-btn.choice-absen:hover {
  border-color: var(--success);
  background: var(--success-bg);
}

.choice-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.choice-transaction .choice-icon {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  color: var(--orange-600);
}

.choice-absen .choice-icon {
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  color: var(--success);
}

.choice-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-800);
}

.choice-desc {
  font-size: 11px;
  color: var(--slate-500);
}

/* Transaction Items */
.txn-item-row {
  padding: 12px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  margin-bottom: 8px;
}

.txn-item-row .form-row {
  display: flex;
  align-items: flex-end;
}

.txn-item-row input,
.txn-item-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: white;
}

.txn-item-row input:focus,
.txn-item-row select:focus {
  border-color: var(--orange-400);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.08);
}

.txn-total {
  margin-top: 16px;
  padding: 16px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  color: white;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
}

.total-row strong {
  font-size: 20px;
  font-weight: 800;
}

/* Stock Items */
.stock-item-row {
  padding: 12px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  margin-bottom: 8px;
}

.stock-item-row .form-row {
  display: flex;
  align-items: flex-end;
}

.stock-item-row input,
.stock-item-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: white;
}

.stock-item-row input:focus,
.stock-item-row select:focus {
  border-color: var(--orange-400);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.08);
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  background: white;
  padding: 32px 40px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-xl);
  animation: fadeIn 0.3s ease;
}

.loading-spinner i {
  font-size: 36px;
  color: var(--orange-500);
}

.loading-spinner span {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
}

/* Success Card */
.success-card {
  text-align: center;
  padding: 40px 24px;
  animation: fadeIn 0.5s ease;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes successPop {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.success-icon i {
  font-size: 40px;
  color: var(--success);
}

.success-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-800);
  margin-bottom: 8px;
}

.success-card p {
  font-size: 14px;
  color: var(--slate-600);
}

.success-details {
  margin-top: 16px;
  text-align: left;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  padding: 16px;
}

.success-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--slate-600);
  border-bottom: 1px solid var(--slate-200);
}

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

.success-detail-row strong {
  color: var(--slate-800);
}

/* Responsive adjustments for attendance */
@media (max-width: 380px) {
  .action-choice-grid {
    grid-template-columns: 1fr;
  }

  .return-item-fields {
    grid-template-columns: 1fr;
  }

  .step-dot {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .step-line {
    max-width: 40px;
  }
}

/* =====================================================
   DETAIL PAGES (Customer / Visit)
   ===================================================== */

/* Detail Hero Card */
.detail-hero {
  text-align: center;
  padding: 28px 20px;
  margin-bottom: 16px;
  background: var(--gradient-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(249, 115, 22, 0.06);
  animation: fadeIn 0.4s ease;
}

.detail-hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  margin: 0 auto 14px;
  box-shadow: var(--shadow-orange);
}

.detail-hero-avatar.visit-avatar {
  border-radius: var(--radius-xl);
  font-size: 28px;
  font-weight: 400;
}

.detail-hero-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--slate-800);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.detail-hero-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-hero-badges .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Detail Info Rows */
.detail-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--slate-100);
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-row:first-of-type {
  padding-top: 0;
}

.detail-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--orange-50);
  color: var(--orange-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

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

.detail-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-800);
  word-break: break-word;
}

.detail-link {
  color: var(--orange-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.detail-link:hover {
  color: var(--orange-700);
  text-decoration: underline;
}

/* Detail Map */
.detail-map {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  overflow: hidden;
  z-index: 1;
}

.detail-map-coords {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--slate-500);
}

.detail-map-coords i {
  color: var(--orange-400);
  font-size: 11px;
}

/* Custom Map Marker Pins */
.custom-marker {
  background: none !important;
  border: none !important;
}

.marker-pin {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  position: relative;
}

.marker-pin::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.marker-pin.visit-pin {
  background: var(--gradient-primary);
}

.marker-pin.visit-pin::after {
  border-top: 10px solid var(--orange-600);
}

.marker-pin.customer-pin {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
}

.marker-pin.customer-pin::after {
  border-top: 10px solid #1D4ED8;
}

/* Clickable customer card */
a.customer-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.customer-card-link .customer-card {
  cursor: pointer;
}

a.customer-card-link:hover .customer-card {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
  border-color: var(--orange-200);
}

/* =====================================================
   INVOICE PAGES
   ===================================================== */

/* Invoice action card color */
.action-invoice .action-icon {
  background: linear-gradient(135deg, #d0bdfc, #bf9ef4) !important;
}

/* Badge: distributor / unpaid */
.badge-distributor {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* Invoice filter tabs */
.invoice-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
}

.invoice-filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--slate-200);
  background: white;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-tab:hover {
  border-color: var(--orange-300);
  color: var(--orange-600);
}

.filter-tab.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-orange);
}

/* =====================================================
   DASHBOARD REDESIGN (Modern & Tidy)
   ===================================================== */

/* Hero Section New */
.hero-section-new {
  position: relative;
  padding: 32px 24px 60px;
  background: var(--gradient-primary);
  border-radius: 0 0 40px 40px;
  overflow: hidden;
  margin-bottom: -30px;
  z-index: 1;
}

.hero-bg-accent {
  position: absolute;
  top: -20%;
  right: -10%;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content-new {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

.greeting-info .greet-date {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.greeting-info .greet-title {
  font-size: 24px;
  font-weight: 800;
  color: white;
  margin-bottom: 2px;
  letter-spacing: -0.5px;
}

.greeting-info .greet-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.hero-clock-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  min-width: 100px;
}

.clock-icon {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2px;
}

.clock-time {
  font-size: 18px;
  font-weight: 800;
  color: white;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.clock-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  font-weight: 700;
}

/* Stats Grid Modern */
.stats-grid-modern {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

.stat-pill {
  background: white;
  padding: 14px 18px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--slate-100);
}

.stat-pill-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--orange-50);
  color: var(--orange-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.stat-pill-info {
  display: flex;
  flex-direction: column;
}

.stat-pill-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--slate-800);
  line-height: 1.2;
}

.stat-pill-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-400);
}

/* Actions Grid Modern */
.actions-section {
  padding: 24px 24px 100px;
}

.actions-grid-modern {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.action-tile {
  background: white;
  padding: 20px 16px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  border: 1px solid var(--slate-50);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-tile:active {
  transform: scale(0.96);
  box-shadow: none;
}

.tile-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.3s;
}

.tile-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-700);
}

.tile-primary .tile-icon { background: #E0E7FF; color: #4F46E5; }
.tile-info .tile-icon { background: #DBEAFE; color: #2563EB; }
.tile-success .tile-icon { background: #DCFCE7; color: #16A34A; }
.tile-warning .tile-icon { background: #FEF3C7; color: #D97706; }
.tile-purple .tile-icon { background: #F3E8FF; color: #9333EA; }
.tile-indigo .tile-icon { background: #E0E7FF; color: #6366F1; }

.action-tile:hover .tile-icon {
  transform: translateY(-4px) rotate(-5deg);
}

/* Recent Section Layout */
.recent-section {
  padding: 0 24px;
}

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

.section-title h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--slate-800);
  letter-spacing: -0.3px;
}

.section-title a {
  font-size: 13px;
  font-weight: 600;
  color: var(--orange-600);
}

/* Glass Detail Card for Visits */
.customer-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.customer-avatar {
  background: var(--gradient-primary);
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.2);
}

.customer-name {
  font-weight: 700;
  color: var(--slate-800);
}