:root {
  --primary: #111827;
  --primary-foreground: #ffffff;
  --secondary: #f3f4f6;
  --secondary-foreground: #1f2937;
  --accent: #2563eb;
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --background: #ffffff;
  --foreground: #020817;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --radius: 0.75rem;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f8fafc;
  color: var(--foreground);
  margin: 0;
  padding-bottom: 80px;
  /* Nav bar space */
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

/* Utilities */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.text-center {
  text-align: center;
}

.font-bold {
  font-weight: 700;
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-muted {
  color: var(--muted-foreground);
}

.text-red {
  color: var(--destructive);
}

.mt-2 {
  margin-top: 0.5rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.grid {
  display: grid;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Components */
.card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-lg {
  padding: 1rem;
  font-size: 1.1rem;
}

/* Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--background);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 9999;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.7rem;
  gap: 2px;
  width: 100%;
  padding: 4px;
}

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

.nav-item svg {
  width: 24px;
  height: 24px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: var(--background);
  width: 90%;
  max-width: 400px;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.2s ease-out;
}

/* Desktop Responsive */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
    padding-left: 240px;
    /* Side nav width */
  }

  .container {
    max-width: 1000px;
    padding: 2rem;
  }

  /* Hide Bottom Nav on Desktop */
  .bottom-nav {
    display: none !important;
  }

  /* Side Nav (dynamically created by JS as .bottom-nav with extra class or new element) */
  .side-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--background);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    z-index: 50;
  }

  .side-nav .nav-heading {
    margin-bottom: 2rem;
    padding: 0 1rem;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .side-nav .nav-item {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    margin-bottom: 4px;
    width: 100%;
    justify-content: flex-start;
  }

  .side-nav .nav-item svg {
    width: 20px;
    height: 20px;
  }

  .side-nav .nav-item:hover {
    background: var(--secondary);
  }

  .side-nav .nav-item.active {
    background: var(--primary);
    color: var(--primary-foreground);
  }

  /* Grid for Dashboard */
  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
  }

  /* Import Page Layout */
  .import-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }
}