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

html, body {
  background-color: #060913 !important;
  color: #ffffff !important;
}

:root {
  --bg-dark: #060913;
  --bg-card: rgba(13, 21, 39, 0.65);
  --bg-card-hover: rgba(19, 29, 53, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(168, 85, 247, 0.35);
  --border-cyan: rgba(0, 229, 255, 0.4);
  
  --accent-cyan: #00e5ff;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-green: #00e676;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-yellow: #ffb300;
  
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --acrylic-blur: blur(16px) saturate(180%);
}

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

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

html {
  max-width: 100vw;
  overflow-x: hidden !important;
  touch-action: pan-y;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden !important;
  max-width: 100vw;
  touch-action: pan-y;
  line-height: 1.5;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -120px;
  left: -120px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 70%);
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: -120px;
  right: -120px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.22), transparent 70%);
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
}

/* Mobile-first base styles (Phones, Tablets, Touch devices, Screens < 901px) */
/* Clean Responsive Page Layout */
body {
  background: radial-gradient(circle at 50% 0%, #0f172a 0%, #070b14 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
}


.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

.page--locked {
  overflow: hidden !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
  height: 100% !important;
  max-height: 100% !important;
  user-select: none;
  -webkit-user-select: none;
}

.page--wide {
  max-width: 900px;
}

.zones-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 65vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.35rem;
  padding-bottom: 0.5rem;
}

.zones-scroll-list::-webkit-scrollbar {
  width: 5px;
}

.zones-scroll-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.zones-scroll-list::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.35);
  border-radius: 10px;
}

.zones-scroll-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

.zone-card {
  margin: 0;
  padding: 0.95rem 1rem !important;
  background: linear-gradient(135deg, rgba(13, 21, 39, 0.8), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 14px;
  overflow: visible !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.zone-card:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.2);
}

.zone-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.zone-card-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
  line-height: 1.25;
}

.zone-card-meta {
  font-size: 0.76rem;
  color: var(--accent-cyan);
  font-weight: 700;
  margin-top: 5px;
  line-height: 1.3;
}

.zone-card-address {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 3px;
}

.zone-card-btn {
  padding: 0.38rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.3));
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}

.zone-card-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(99, 102, 241, 0.5));
}

.container {
  padding: 1.25rem;
  width: 100%;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  background: transparent;
  position: relative;
  z-index: 100;
}

.nav-pill-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 2px 4px;
  gap: 1px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-pill-btn:hover,
.nav-pill-btn:active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-pill-btn--cyan {
  color: var(--accent-purple);
}

.nav-pill-btn--cyan:hover,
.nav-pill-btn--cyan:active {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.nav-pill-btn--logout {
  color: #f87171;
}

.nav-pill-btn--logout:hover,
.nav-pill-btn--logout:active {
  background: rgba(248, 113, 113, 0.15);
  color: #ef4444;
}

.nav-pill-divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.nav-brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.card {
  background: rgba(13, 21, 39, 0.6);
  backdrop-filter: var(--acrylic-blur);
  -webkit-backdrop-filter: var(--acrylic-blur);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.card--glass {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.card--glass:hover {
  border-color: transparent;
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 34px;
  min-height: 34px;
  padding: 0 1.25rem 2px 1.25rem;
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #ffffff;
  white-space: nowrap;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  outline: none;
  user-select: none;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.btn:hover {
  color: #ffffff;
  transform: translateY(-1.5px) scale(1.03);
}

.btn:active {
  transform: scale(0.94) !important;
  transition: transform 0.05s ease !important;
}

.btn--full {
  width: 100%;
}

.btn--xl {
  padding: 1.1rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn--primary {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.85), rgba(126, 34, 206, 0.95));
  color: #ffffff;
  border: 1px solid rgba(168, 85, 247, 0.6);
  box-shadow: 0 3px 12px rgba(147, 51, 234, 0.3);
}

.btn--primary:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.95), rgba(147, 51, 234, 1));
  border-color: rgba(192, 132, 252, 0.8);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
  color: #ffffff;
}

.btn--cyan {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.85), rgba(126, 34, 206, 0.95));
  color: #ffffff;
  font-weight: 700;
  border: 1px solid rgba(168, 85, 247, 0.6);
  box-shadow: 0 3px 12px rgba(147, 51, 234, 0.3);
}

.btn--cyan:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.95), rgba(147, 51, 234, 1));
  border-color: rgba(192, 132, 252, 0.8);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
  color: #ffffff;
}

.btn--danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(220, 38, 38, 0.85));
  color: #ffffff;
  border: 1px solid rgba(254, 202, 202, 0.4);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.btn--danger:hover {
  box-shadow: 0 5px 14px rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.btn-back-nav {
  appearance: none;
  -webkit-appearance: none;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  flex-shrink: 0 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  outline: none !important;
  padding: 0 !important;
}

.btn-back-nav:hover {
  background: rgba(168, 85, 247, 0.18) !important;
  border-color: rgba(168, 85, 247, 0.5) !important;
  color: #a855f7 !important;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2) !important;
  transform: translateY(-1px) scale(1.04);
}

.btn-back-nav:active {
  transform: scale(0.85) !important;
  background: rgba(168, 85, 247, 0.35) !important;
  border-color: rgba(168, 85, 247, 0.7) !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5) !important;
  transition: transform 0.05s ease, background 0.05s ease !important;
}

.map-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.38rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: none;
}

.map-link-btn:hover {
  background: rgba(168, 85, 247, 0.18);
  color: #ffffff;
  border-color: rgba(168, 85, 247, 0.45);
}

.btn--yellow {
  background: rgba(255, 179, 0, 0.14);
  color: var(--accent-yellow);
  border: 1.5px solid rgba(255, 179, 0, 0.45);
  box-shadow: 0 4px 15px rgba(255, 179, 0, 0.15);
}

.btn--yellow:hover {
  background: rgba(255, 179, 0, 0.22);
  border-color: rgba(255, 179, 0, 0.65);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge--success {
  background: rgba(0, 230, 118, 0.16);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.badge--warning {
  background: rgba(245, 158, 11, 0.16);
  color: var(--accent-orange);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge--neutral {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge--danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.badge--break {
  background: rgba(168, 130, 221, 0.2);
  color: #a882dd;
  border: 1.5px solid rgba(168, 130, 221, 0.6);
  font-weight: 800;
}

.badge--sos {
  background: rgba(239, 68, 68, 0.22);
  color: #ef4444;
  border: 1.5px solid rgba(239, 68, 68, 0.6);
  font-weight: 900;
  padding: 0.15rem 0.45rem;
  font-size: 0.65rem;
}

.badge--dayoff {
  background: rgba(124, 131, 253, 0.18);
  color: #7c83fd;
  border: 1px solid rgba(124, 131, 253, 0.4);
}

.status-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 2.2rem;
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.status-circle--success {
  background: radial-gradient(circle, rgba(0, 230, 118, 0.25), rgba(0, 230, 118, 0.05));
  border: 2px solid rgba(0, 230, 118, 0.6);
  color: var(--accent-green);
  box-shadow: 0 0 25px rgba(0, 230, 118, 0.25);
}

.status-circle--danger {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.05));
  border: 2px solid rgba(239, 68, 68, 0.6);
  color: var(--accent-red);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.25);
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.4;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.alert--danger {
  background: rgba(239, 68, 68, 0.14);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.alert--info {
  background: rgba(168, 85, 247, 0.12);
  border: 1.5px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-purple);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 0.65rem;
  margin: 0.75rem auto 0;
  max-width: 250px;
  justify-items: center;
}

.numpad-btn {
  width: clamp(56px, 15vw, 64px);
  height: clamp(56px, 15vw, 64px);
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: clamp(1.3rem, 4.2vw, 1.55rem);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.05s ease, background 0.05s ease, box-shadow 0.05s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.numpad-btn:focus,
.numpad-btn:focus-visible {
  outline: none !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

@media (hover: hover) {
  .numpad-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(168, 85, 247, 0.45);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
  }
}

.numpad-btn:active,
.numpad-btn.is-pressed {
  background: rgba(99, 102, 241, 0.35) !important;
  border-color: rgba(168, 85, 247, 0.6) !important;
  transform: scale(0.92) !important;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35) !important;
  transition: transform 0.02s ease, background 0.02s ease !important;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.75rem 0 0.45rem;
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  transition: all 0.05s ease;
}

@keyframes dotPulse {
  0% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.pin-dot--active {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  border-color: #a855f7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
  animation: dotPulse 0.06s ease-out forwards;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

.pin-dots--shake {
  animation: pinShake 0.35s ease-in-out;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.78);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  z-index: 10000 !important;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  touch-action: pan-y !important;
  pointer-events: auto !important;
}

.modal-content {
  background: rgba(13, 21, 39, 0.95);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border-radius: 24px 24px 0 0;
  padding: 1.5rem 1.25rem 2.5rem;
  width: 100%;
  max-width: 500px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: none;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  max-height: 90vh;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  pointer-events: auto !important;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-close {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 21, 39, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--accent-purple);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 15px rgba(168, 85, 247, 0.3);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  z-index: 2000;
  white-space: nowrap;
  max-width: 94vw;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: fadeIn 0.3s ease;
}

.toast--err {
  border-color: var(--accent-red);
  color: #fca5a5;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 15px rgba(239, 68, 68, 0.3);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-scaleIn { animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.animate-pulse { animation: pulse 2s infinite; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th, .data-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.app-footer {
  text-align: center;
  padding: 1.75rem 1rem 1.25rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  width: 100%;
}

.custom-select-wrapper {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-select-trigger:hover,
.custom-select-wrapper.open .custom-select-trigger {
  border-color: var(--accent-purple);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
}

.custom-select-arrow {
  font-size: 0.75rem;
  color: var(--accent-purple);
  transition: transform 0.2s ease;
}

.custom-select-wrapper.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(13, 21, 39, 0.95);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border: 1.5px solid rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(168, 85, 247, 0.2);
  z-index: 1100;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.custom-option {
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.custom-option:hover {
  background: rgba(168, 85, 247, 0.14);
  color: #ffffff;
}

.custom-option.selected {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(99, 102, 241, 0.22));
  color: var(--accent-purple);
  font-weight: 800;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.custom-datepicker-wrapper {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-datepicker-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.custom-datepicker-trigger:hover,
.custom-datepicker-wrapper.open .custom-datepicker-trigger {
  border-color: var(--accent-purple);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
  color: #ffffff;
}

.custom-datepicker-popup {
  position: absolute;
  top: calc(100% + 8px);
  width: 285px;
  background: rgba(13, 21, 39, 0.97);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1.5px solid rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(168, 85, 247, 0.25);
  padding: 0.9rem;
  z-index: 2500;
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  animation: scaleIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-datepicker-popup.align-right {
  right: 0;
  left: auto;
}

.custom-datepicker-popup.align-left {
  left: 0;
  right: auto;
}

.custom-datepicker-wrapper.open .custom-datepicker-popup {
  display: flex;
}

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

.cdp-month-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
}

.cdp-title-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0.2rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.cdp-title-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--accent-purple);
  color: #ffffff;
}

.cdp-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  padding: 0.5rem 0;
}

.cdp-grid-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.45rem 0.2rem;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.cdp-grid-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--accent-purple);
  color: #ffffff;
}

.cdp-grid-btn.selected {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.85), rgba(99, 102, 241, 0.85));
  color: #ffffff;
  border-color: var(--accent-purple);
}

.cdp-select {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0.2rem 1.15rem 0.2rem 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23a855f7' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
}

.cdp-select:hover,
.cdp-select:focus {
  background-color: rgba(168, 85, 247, 0.2);
  border-color: var(--accent-purple);
  color: #ffffff;
}

.cdp-select option {
  background: #0d1527;
  color: #ffffff;
}

.cdp-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cdp-nav-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.cdp-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cdp-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cdp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cdp-day:hover {
  background: rgba(168, 85, 247, 0.18);
  color: #ffffff;
}

.cdp-day.other-month {
  color: rgba(255, 255, 255, 0.2);
}

.cdp-day.today {
  border: 1.5px solid var(--accent-purple);
  color: var(--accent-purple);
  font-weight: 800;
}

.cdp-day.selected {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(99, 102, 241, 0.45));
  border: 1px solid var(--accent-purple);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.cdp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cdp-today-btn {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-purple);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.cdp-today-btn:hover {
  background: rgba(168, 85, 247, 0.15);
}

@media screen and (max-width: 480px), screen and (max-height: 740px) {
  :root {
    --radius-lg: 16px;
    --radius-md: 10px;
  }

  .page {
    padding: 0.6rem !important;
  }

  .card {
    padding: 1.1rem 0.95rem !important;
    margin-bottom: 0.75rem !important;
    border-radius: 16px !important;
  }

  .card--glass {
    padding: 1.25rem 1rem !important;
  }

  .numpad {
    gap: 0.65rem 0.85rem !important;
    max-width: 320px !important;
    margin-top: 1rem !important;
  }

  .numpad-btn {
    width: clamp(80px, 23vw, 92px) !important;
    height: clamp(80px, 23vw, 92px) !important;
    font-size: clamp(2rem, 6.5vw, 2.4rem) !important;
  }

  .pin-dots {
    gap: 0.8rem !important;
    margin: 1.1rem 0 0.6rem !important;
  }

  .pin-dot {
    width: 14px !important;
    height: 14px !important;
  }

  .status-circle {
    width: 64px !important;
    height: 64px !important;
    font-size: 1.8rem !important;
    margin-bottom: 1rem !important;
  }

  .btn--xl {
    padding: 0.9rem 1.25rem !important;
    font-size: 0.95rem !important;
  }

  .btn {
    padding: 0.75rem 1.1rem !important;
    font-size: 0.88rem !important;
  }

  h1 {
    font-size: clamp(1.2rem, 5vw, 1.45rem) !important;
  }

  h2 {
    font-size: clamp(1.1rem, 4.5vw, 1.3rem) !important;
  }
}

.leaflet-dark-theme .leaflet-tile {
  filter: invert(100%) hue-rotate(180deg) brightness(92%) contrast(90%);
}

.leaflet-dark-theme {
  background: #0d1527 !important;
}
