/* Ported from app/global.css and page.tsx */
:root {
  /* Using values from app/global.css */
  --background: oklch(0.08 0 0);
  --foreground: oklch(0.95 0 0);
  --card: oklch(0.12 0 0);
  --card-foreground: oklch(0.95 0 0);
  --popover: oklch(0.12 0 0);
  --popover-foreground: oklch(0.95 0 0);
  --primary: oklch(0.62 0.251 255);
  --primary-foreground: oklch(0.08 0 0);
  --secondary: oklch(0.18 0 0);
  --secondary-foreground: oklch(0.95 0 0);
  --muted: oklch(0.2 0 0);
  --muted-foreground: oklch(0.6 0 0);
  --accent: oklch(0.72 0.195 90);
  --accent-foreground: oklch(0.08 0 0);
  --destructive: oklch(0.628 0.257 29.23);
  --destructive-foreground: oklch(0.98 0 0);
  --border: oklch(0.18 0 0);
  --input: oklch(0.15 0 0);
  --ring: oklch(0.62 0.251 255);
  --chart-1: oklch(0.62 0.251 255);
  --chart-2: oklch(0.72 0.195 90);
  --chart-3: oklch(0.55 0.281 29);
  --chart-4: oklch(0.65 0.231 152);
  --chart-5: oklch(0.68 0.261 301);
  --radius: 0.625rem;

  --sidebar-width: 260px;
  --header-height: 80px;
  /* Adjusted for spacious header */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: var(--border);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  height: 100vh;
  overflow: hidden;
  font-feature-settings: "rlig" 1, "calt" 1;
}

.app-container {
  display: flex;
  height: 100%;
}

/* Sidebar - Styled to match `bg-sidebar` which is very dark */
.sidebar {
  width: var(--sidebar-width);
  background: oklch(0.1 0 0);
  /* --sidebar from global.css */
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  flex-shrink: 0;
}

.logo-area {
  padding: 0.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--muted-foreground);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-item:hover {
  background: var(--muted);
  color: var(--foreground);
}

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

.sidebar-footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.upgrade-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 0.5rem;
}

.upgrade-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.upgrade-desc {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.btn-upgrade {
  width: 100%;
  background: var(--foreground);
  color: var(--background);
  border: none;
  padding: 0.4rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: var(--background);
}

.top-bar {
  height: auto;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: var(--card);
}

.header-title h2 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.header-title p {
  color: var(--muted-foreground);
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  height: 2.25rem;
}

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

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

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

.btn-primary:hover {
  opacity: 0.9;
}

.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* Dashboard Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.stat-header {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.stat-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.stat-change.positive {
  color: #4ade80;
}

.stat-change.negative {
  color: #f87171;
}

.grid-section-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card.col-span-2 {
  grid-column: span 2;
}

.card-header {
  padding: 1.5rem 1.5rem 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.card-content {
  padding: 0 1.5rem 1.5rem;
}

/* Chart containers */
.chart-wrapper {
  width: 100%;
  height: 300px;
  position: relative;
}

/* Resort List Table (adapted style) */
.list-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.resort-list-container {
  max-height: 500px;
  overflow-y: auto;
}

.resort-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.resort-item:hover {
  background: var(--muted);
}

.resort-item:last-child {
  border-bottom: none;
}

.resort-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.resort-info p {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Modal & Map Styles (preserving functional styles) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: 90%;
  max-width: 1200px;
  height: 85%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

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

.close-modal {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
  width: 32px;
  height: 32px;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  background: var(--destructive);
  border-color: var(--destructive);
}

.modal-content {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.modal-sidebar {
  width: 350px;
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-main {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.map-container {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.map-container.active {
  display: block;
}

#resort-map {
  width: 100%;
  height: 100%;
}

/* Utilities */
.text-right {
  text-align: right;
}

.text-success {
  color: #4ade80;
}

.pill {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: var(--primary);
  color: var(--primary-foreground);
}

/* Calendar */
.calendar-grid-large {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.cal-day-cell {
  background: var(--card);
  aspect-ratio: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.cal-day-cell.booked {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
}

.cal-day-cell.available {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

/* View Details Button */
.view-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background: oklch(0.55 0.251 255);
  transform: translateY(-1px);
}

/* Link Button */
.link-btn {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.link-btn:hover {
  background: var(--muted);
  color: var(--foreground);
  border-color: var(--foreground);
}

/* Status Badge */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.active {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.status-badge.inactive {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}