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

:root {
  --background: 0 0% 99%;
  --foreground: 222 47% 10%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 10%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 10%;
  --primary: 160 84% 39%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 20% 96%;
  --secondary-foreground: 222 47% 10%;
  --muted: 210 20% 96%;
  --muted-foreground: 220 10% 40%;
  --accent: 210 20% 96%;
  --accent-foreground: 222 47% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 220 14% 92%;
  --input: 220 14% 92%;
  --ring: 160 84% 39%;
  --radius: 0.9rem;
}

.dark {
  --background: 220 20% 10%;
  --foreground: 210 40% 96%;
  --card: 220 16% 12%;
  --card-foreground: 210 40% 96%;
  --popover: 220 16% 12%;
  --popover-foreground: 210 40% 96%;
  --primary: 160 84% 45%;
  --primary-foreground: 220 20% 10%;
  --secondary: 220 16% 16%;
  --secondary-foreground: 210 40% 96%;
  --muted: 220 16% 16%;
  --muted-foreground: 220 10% 68%;
  --accent: 220 16% 16%;
  --accent-foreground: 210 40% 96%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 220 14% 22%;
  --input: 220 14% 22%;
  --ring: 160 84% 45%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

.gradient-text {
  background: linear-gradient(to right, hsl(var(--primary)), hsl(var(--primary) / 0.8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 5rem 1rem;
}

.section--tight {
  padding: 3rem 1rem;
}

h1 {
  font-size: clamp(2.25rem, 3.5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.875rem, 2.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

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

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
}

.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background-color: hsl(var(--muted));
}

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

.btn-destructive:hover {
  background-color: hsl(var(--destructive) / 0.9);
}

/* Cards */
.card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px hsl(var(--primary) / 0.1);
}

/* Inputs */
.input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsla(var(--background), 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: min-height 0.2s ease;
}

.navbar-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 auto;
}

.navbar-panels {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-left: auto;
  flex: 1 1 auto;
  flex-wrap: wrap;
  row-gap: 0.75rem;
}

.navbar-panels:empty {
  display: none;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: hsl(var(--foreground));
  font-weight: 600;
}

.navbar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: hsl(var(--primary));
  border-radius: 0.5rem;
}

.navbar-menu,
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.navbar-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: hsl(var(--muted) / 0.3);
  cursor: default;
}

.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  padding: 0.5rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.navbar-toggle:hover {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--foreground) / 0.15);
}

.navbar-toggle-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  border-radius: 999px;
  background-color: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar-toggle-bar + .navbar-toggle-bar {
  margin-top: 0.25rem;
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(2) {
  opacity: 0;
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.navbar-menu a {
  white-space: nowrap;
}

.navbar-menu-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.navbar-menu-group-toggle {
  border: 1px solid hsl(var(--border));
  padding-left: 1rem;
  padding-right: 1rem;
  justify-content: space-between;
  min-width: 8rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.navbar-menu-group-toggle svg {
  transition: transform 0.2s ease;
}

.navbar-menu-group.is-open .navbar-menu-group-toggle svg {
  transform: rotate(180deg);
}

.navbar-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 14rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 12px 25px hsl(var(--foreground) / 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}

.navbar-menu-group.is-open .navbar-menu-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.navbar-menu-dropdown .btn {
  width: 100%;
  justify-content: flex-start;
}

/* Table */
.table-container {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background-color: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border));
}

.table th {
  padding: 1rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.table td {
  padding: 1rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}

.table tbody tr:hover {
  background-color: hsl(var(--muted) / 0.3);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background-color: hsl(142 76% 36% / 0.2);
  color: hsl(142 76% 36%);
  border: 1px solid hsl(142 76% 36% / 0.4);
}

.badge-warning {
  background-color: hsl(38 92% 50% / 0.2);
  color: hsl(38 92% 50%);
  border: 1px solid hsl(38 92% 50% / 0.4);
}

.badge-danger {
  background-color: hsl(0 84% 60% / 0.2);
  color: hsl(0 84% 60%);
  border: 1px solid hsl(0 84% 60% / 0.4);
}

/* Loading spinner */
.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid hsl(var(--border));
  border-top: 2px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Alert */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.alert-error {
  background-color: hsl(0 84% 60% / 0.1);
  border: 1px solid hsl(0 84% 60%);
  color: hsl(0 84% 60%);
}

.alert-success {
  background-color: hsl(142 76% 36% / 0.1);
  border: 1px solid hsl(142 76% 36%);
  color: hsl(142 76% 36%);
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.col-span-full { grid-column: 1 / -1; }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:col-span-6 { grid-column: span 6 / span 6; }
}

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 640px) {
  .sm\:inline { display: inline; }
}

@media (min-width: 768px) {
  .md\:flex { display: flex; }
}

@media (max-width: 768px) {
  .section {
    padding: 3.5rem 0.75rem;
  }

  .navbar-content {
    flex-direction: column;
    align-items: stretch;
    min-height: unset;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .navbar-header {
    width: 100%;
    justify-content: space-between;
  }

  .navbar-brand {
    width: auto;
    justify-content: flex-start;
  }

  .navbar-toggle {
    display: inline-flex;
  }

  .navbar-panels {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border));
  }

  .navbar-panels[data-mobile-open='false'] {
    display: none;
  }

  .navbar-panels[data-mobile-open='true'] {
    display: flex;
  }

  .navbar-menu,
  .navbar-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .navbar-menu .btn,
  .navbar-actions .btn,
  .navbar-menu a.btn-ghost,
  .navbar-actions a.btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .navbar-menu-group {
    width: 100%;
  }

  .navbar-menu-group-toggle {
    width: 100%;
  }

  .navbar-menu-dropdown {
    position: static;
    margin-top: 0.5rem;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    background-color: hsl(var(--muted) / 0.35);
  }

  .navbar-menu-group.is-open .navbar-menu-dropdown {
    display: flex;
  }

  .navbar-user {
    width: 100%;
    justify-content: center;
  }

  .card {
    padding: 1.25rem;
  }

  .table th,
  .table td {
    padding: 0.75rem;
  }
}

