/* Travel CRM - Design System */
:root {
  --primary: #2563EB;
  --primary-dark: #1E40AF;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --navbar-height: 64px;
  --spacing: 16px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar-wrap {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  transition: width 0.25s ease, min-width 0.25s ease;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 40;
}

.sidebar-wrap.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.main-wrap {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-wrap.collapsed + .main-wrap,
body.sidebar-collapsed .main-wrap {
  margin-left: var(--sidebar-collapsed);
}

.sidebar-wrap.collapsed .sidebar-label {
  overflow: hidden;
  width: 0;
  opacity: 0;
  white-space: nowrap;
  display: inline-block;
}

.sidebar-wrap.collapsed .sidebar-link span.sidebar-label {
  display: none;
}

@media (min-width: 1024px) {
  body.sidebar-collapsed .navbar-header {
    left: var(--sidebar-collapsed);
  }
}

.main-content {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: var(--spacing);
  padding-top: calc(var(--navbar-height) + var(--spacing));
  overflow-x: hidden;
}

/* Mobile */
@media (max-width: 1024px) {
  .sidebar-wrap {
    transform: translateX(-100%);
  }
  .sidebar-wrap.open {
    transform: translateX(0);
  }
  .main-wrap {
    margin-left: 0;
  }
  .main-content {
    padding-bottom: 80px;
  }
}

/* Charts placeholder */
.chart-container {
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 16px 0;
}

.bar-item {
  flex: 1;
  background: var(--primary);
  border-radius: 8px 8px 0 0;
  transition: height 0.3s ease;
  min-height: 20px;
}

.funnel-row .funnel-bar {
  min-width: 20px;
  height: 28px;
}

/* Table */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive table padding on small screens */
@media (max-width: 640px) {
  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 0.8125rem;
  }
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.sidebar-wrap .sidebar-link.active {
  background: #EEF2FF;
  color: #2563EB;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-new { background: #DBEAFE; color: #1E40AF; }
.badge-new-lead { background: #DBEAFE; color: #1E40AF; }
.badge-contacted { background: #E0E7FF; color: #3730A3; }
.badge-follow-up { background: #E0E7FF; color: #3730A3; }
.badge-qualified { background: #DCFCE7; color: #15803D; }
.badge-quoted { background: #FEF3C7; color: #B45309; }
.badge-negotiation { background: #FDE68A; color: #92400E; }
.badge-confirmed { background: #DCFCE7; color: #15803D; }
.badge-travelled { background: #E0F2FE; color: #0369A1; }
.badge-review-received { background: #D1FAE5; color: #047857; }
.badge-draft { background: #F1F5F9; color: #475569; }
.badge-sent { background: #E0E7FF; color: #3730A3; }
.badge-approved { background: #FEF3C7; color: #B45309; }
.badge-booked { background: #DCFCE7; color: #15803D; }
.badge-completed { background: #E0F2FE; color: #0369A1; }
.badge-won { background: #DCFCE7; color: #15803D; }
.badge-lost { background: #FEE2E2; color: #B91C1C; }
.badge-pending { background: #F3F4F6; color: #4B5563; }
.badge-confirmed { background: #DCFCE7; color: #15803D; }
.badge-paid { background: #DCFCE7; color: #15803D; }
.badge-unpaid { background: #FEE2E2; color: #B91C1C; }
.badge-partial { background: #FEF3C7; color: #B45309; }

/* Mobile bottom nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 50;
  padding: 0 8px;
}

@media (max-width: 1024px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.7rem;
  transition: color 0.2s;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--primary);
}

/* Hide scrollbar but keep scroll */
.hide-scrollbar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.hide-scrollbar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Transitions */
.sidebar-wrap,
.main-wrap,
.bar-item,
.data-table tbody tr {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
