/*
 * QUORBEX Host Design System — Mobile-First (iPhone / iPad primary)
 * Prefix: qx-
 * Primary: neon blue #00B4D8 | BG: dark gray #1a1a2e
 */

/* ════════════════════════════════════════
   DESIGN TOKENS
   ════════════════════════════════════════ */
:root {
  /* Colors — Dark Gray + Neon Blue/Celeste */
  --qx-primary: #00B4D8;
  --qx-primary-hover: #0096C7;
  --qx-primary-light: #caf0f8;
  --qx-accent: #00E5FF;
  --qx-accent-hover: #00B8D4;

  --qx-bg-body: #0f1624;
  --qx-bg-surface: #1a2332;
  --qx-bg-muted: #243044;
  --qx-bg-hover: #1e2d42;

  --qx-text-default: #e2e8f0;
  --qx-text-muted: #94a3b8;
  --qx-text-light: #64748b;
  --qx-text-inverse: #0f1624;

  --qx-border-default: #2d3a4a;
  --qx-border-focus: #00B4D8;

  /* Semantic */
  --qx-success: #34d399;
  --qx-success-bg: rgba(52, 211, 153, 0.15);
  --qx-warning: #fbbf24;
  --qx-warning-bg: rgba(251, 191, 36, 0.15);
  --qx-danger: #f87171;
  --qx-danger-bg: rgba(248, 113, 113, 0.15);
  --qx-info: #60a5fa;
  --qx-info-bg: rgba(96, 165, 250, 0.15);

  /* Shadow (dark) */
  --qx-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --qx-shadow: 0 1px 3px rgba(0,0,0,0.4);
  --qx-shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --qx-shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

/* ════════════════════════════════════════
   LIGHT THEME
   ════════════════════════════════════════ */
[data-theme="light"] {
  --qx-primary: #0891b2;
  --qx-primary-hover: #0e7490;
  --qx-primary-light: #cffafe;
  --qx-accent: #06b6d4;
  --qx-accent-hover: #0891b2;

  --qx-bg-body: #f1f5f9;
  --qx-bg-surface: #ffffff;
  --qx-bg-muted: #e2e8f0;
  --qx-bg-hover: #f0f9ff;

  --qx-text-default: #1e293b;
  --qx-text-muted: #64748b;
  --qx-text-light: #94a3b8;
  --qx-text-inverse: #ffffff;

  --qx-border-default: #cbd5e1;
  --qx-border-focus: #0891b2;

  --qx-success: #10b981;
  --qx-success-bg: #d1fae5;
  --qx-warning: #f59e0b;
  --qx-warning-bg: #fef3c7;
  --qx-danger: #ef4444;
  --qx-danger-bg: #fee2e2;
  --qx-info: #3b82f6;
  --qx-info-bg: #dbeafe;

  --qx-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --qx-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --qx-shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --qx-shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

[data-theme="light"] .qx-badge-success { background: #d1fae5; color: #065f46; }
[data-theme="light"] .qx-badge-warning { background: #fef3c7; color: #92400e; }
[data-theme="light"] .qx-badge-danger { background: #fee2e2; color: #991b1b; }
[data-theme="light"] .qx-badge-info { background: #dbeafe; color: #1e40af; }
[data-theme="light"] .qx-badge-primary { background: #cffafe; color: #155e75; }
[data-theme="light"] .qx-badge-airbnb { background: #fee2e2; color: #dc2626; }
[data-theme="light"] .qx-badge-booking { background: #dbeafe; color: #1e40af; }
[data-theme="light"] .qx-badge-private { background: #cffafe; color: #0891b2; }

:root {
  /* Spacing (4px base) */
  --qx-space-1: 4px;
  --qx-space-2: 8px;
  --qx-space-3: 12px;
  --qx-space-4: 16px;
  --qx-space-5: 20px;
  --qx-space-6: 24px;
  --qx-space-8: 32px;

  /* Typography */
  --qx-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --qx-fs-xs: 11px;
  --qx-fs-sm: 13px;
  --qx-fs-base: 15px;
  --qx-fs-md: 17px;
  --qx-fs-lg: 20px;
  --qx-fs-xl: 24px;
  --qx-fs-2xl: 30px;

  /* Radius */
  --qx-radius: 12px;
  --qx-radius-sm: 8px;
  --qx-radius-lg: 16px;
  --qx-radius-full: 50%;

  /* Safe area (iOS notch) */
  --qx-safe-top: env(safe-area-inset-top, 0px);
  --qx-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ════════════════════════════════════════
   RESET & BASE (Mobile-first)
   ════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--qx-font);
  font-size: var(--qx-fs-base);
  color: var(--qx-text-default);
  background: var(--qx-bg-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

/* Page fade-in animation */
@keyframes qx-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes qx-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Bell shake animation */
@keyframes qx-bell-shake {
  0% { transform: rotate(0); }
  15% { transform: rotate(15deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-5deg); }
  75% { transform: rotate(2deg); }
  100% { transform: rotate(0); }
}

a { color: var(--qx-primary); text-decoration: none; }
a:hover { color: var(--qx-primary-hover); }

/* ════════════════════════════════════════
   APP LAYOUT (Bottom nav on mobile)
   ════════════════════════════════════════ */
.qx-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.qx-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--qx-space-4);
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  background: var(--qx-bg-surface);
  border-bottom: 1px solid var(--qx-border-default);
  min-height: 48px;
}

.qx-topbar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: var(--qx-fs-md);
  font-weight: 700;
  color: var(--qx-primary);
  pointer-events: none;
}
.qx-topbar-title img {
  vertical-align: middle;
}

.qx-topbar-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--qx-space-2);
  align-items: center;
  flex-shrink: 0;
  justify-content: flex-end;
}

.qx-content {
  flex: 1;
  padding: var(--qx-space-4);
  padding-top: var(--qx-space-4);
  padding-bottom: calc(85px + var(--qx-safe-bottom));
  max-width: 100%;
  overflow-x: hidden;
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  animation: qx-fade-in 0.3s ease-out;
}

.qx-main {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Bottom Navigation (Mobile) */
.qx-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 0;
  padding-bottom: calc(2px + var(--qx-safe-bottom));
  background: #1a2332;
  border-top: none;
}

.qx-bottom-nav::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.15);
  z-index: 0;
}

.qx-bottom-nav > * {
  position: relative;
  z-index: 1;
}


.qx-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--qx-space-1) var(--qx-space-2);
  color: var(--qx-text-muted);
  font-size: var(--qx-fs-xs);
  text-decoration: none;
  border-radius: var(--qx-radius-sm);
  transition: all 0.2s ease;
  position: relative;
  min-width: 56px;
}

.qx-nav-item { color: #64748b; }
.qx-nav-item.active { color: var(--qx-accent); }
.qx-nav-item:hover { color: var(--qx-accent); }
.qx-nav-item:active { transform: scale(0.9); transition-duration: 0.1s; }

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

/* Center + button */
.qx-nav-center {
  position: relative;
  top: -18px;
}

.qx-nav-center::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82px;
  height: 82px;
  background: #1a2332;
  border-radius: 50%;
  z-index: -1;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
}

.qx-nav-plus {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--qx-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 180, 216, 0.4);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  border: 4px solid #1a2332;
}

[data-theme="light"] .qx-nav-plus {
  border-color: #1e293b;
}

.qx-nav-center:active .qx-nav-plus {
  transform: scale(0.9);
  box-shadow: 0 2px 8px rgba(0, 180, 216, 0.3);
}

.qx-nav-plus svg { width: 30px; height: 30px; }

.qx-nav-badge {
  position: absolute;
  top: -2px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--qx-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ════════════════════════════════════════
   CARDS
   ════════════════════════════════════════ */
.qx-card {
  background: var(--qx-bg-surface);
  border-radius: var(--qx-radius);
  box-shadow: var(--qx-shadow-sm);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s ease;
}

.qx-card-body { padding: var(--qx-space-4); }

.qx-card-header {
  padding: var(--qx-space-4);
  border-bottom: 1px solid var(--qx-border-default);
  font-weight: 600;
  font-size: var(--qx-fs-md);
}

/* Property card (grid) */
.qx-property-card {
  background: var(--qx-bg-surface);
  border-radius: var(--qx-radius);
  box-shadow: var(--qx-shadow);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.qx-property-card:hover { transform: translateY(-3px); box-shadow: var(--qx-shadow-md); }
.qx-property-card:active { transform: translateY(0) scale(0.98); transition-duration: 0.1s; }

.qx-property-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.qx-property-card-body { padding: var(--qx-space-3); }

.qx-property-card-title {
  font-size: var(--qx-fs-base);
  font-weight: 600;
  margin-bottom: var(--qx-space-1);
}

.qx-property-card-meta {
  font-size: var(--qx-fs-sm);
  color: var(--qx-text-muted);
  display: flex;
  gap: var(--qx-space-3);
}

/* ════════════════════════════════════════
   KPI CARDS (Dashboard)
   ════════════════════════════════════════ */
.qx-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--qx-space-3);
}

.qx-kpi {
  background: var(--qx-bg-surface);
  border-radius: var(--qx-radius);
  padding: var(--qx-space-4);
  box-shadow: var(--qx-shadow-sm);
  transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), box-shadow 0.2s ease;
}
.qx-kpi:active { transform: scale(0.96); transition-duration: 0.1s; }

.qx-kpi-label {
  font-size: var(--qx-fs-xs);
  color: var(--qx-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--qx-space-1);
}

.qx-kpi-value {
  font-size: var(--qx-fs-xl);
  font-weight: 700;
  color: var(--qx-text-default);
}

.qx-kpi-value.primary { color: var(--qx-primary); }
.qx-kpi-value.accent { color: var(--qx-accent); }
.qx-kpi-value.danger { color: var(--qx-danger); }
.qx-kpi-value.success { color: var(--qx-success); }

/* ════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════ */
.qx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--qx-space-2);
  padding: var(--qx-space-3) var(--qx-space-5);
  font-size: var(--qx-fs-base);
  font-weight: 600;
  border: none;
  border-radius: var(--qx-radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

/* Ripple / press effect for all buttons */
.qx-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.qx-btn:active { transform: scale(0.93); box-shadow: none; transition-duration: 0.08s; }

.qx-btn-primary {
  background: var(--qx-primary);
  color: white;
}
.qx-btn-primary:hover { background: var(--qx-primary-hover); box-shadow: 0 4px 15px rgba(0, 180, 216, 0.4); }

.qx-btn-accent {
  background: var(--qx-accent);
  color: white;
}
.qx-btn-accent:hover { background: var(--qx-accent-hover); box-shadow: 0 4px 15px rgba(0, 229, 255, 0.4); }

.qx-btn-outline {
  background: rgba(0, 180, 216, 0.15);
  color: var(--qx-primary);
  border: 1.5px solid var(--qx-primary);
}
.qx-btn-outline:hover { background: rgba(0, 180, 216, 0.25); }

.qx-btn-success {
  background: var(--qx-success);
  color: white;
}
.qx-btn-success:hover { box-shadow: 0 4px 15px rgba(52, 211, 153, 0.4); }

.qx-btn-warning {
  background: var(--qx-warning);
  color: #1e293b;
}
.qx-btn-warning:hover { box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4); }

.qx-btn-info {
  background: var(--qx-info);
  color: white;
}
.qx-btn-info:hover { box-shadow: 0 4px 15px rgba(96, 165, 250, 0.4); }

.qx-btn-danger {
  background: var(--qx-danger);
  color: white;
}
.qx-btn-danger:hover { box-shadow: 0 4px 15px rgba(248, 113, 113, 0.4); }

.qx-btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--qx-text-muted);
}
.qx-btn-ghost:hover { background: var(--qx-bg-muted); box-shadow: none; transform: none; }
.qx-btn-ghost:active { transform: scale(0.95); }

.qx-btn-danger {
  background: var(--qx-danger);
  color: white;
}

.qx-btn-sm { padding: var(--qx-space-2) var(--qx-space-3); font-size: var(--qx-fs-sm); min-height: 36px; }
.qx-btn-lg { padding: var(--qx-space-4) var(--qx-space-6); font-size: var(--qx-fs-md); }
.qx-btn-block { width: 100%; }
.qx-btn-round { border-radius: var(--qx-radius-full); width: 48px; height: 48px; padding: 0; }

/* FAB (Floating Action Button) */
.qx-fab {
  position: fixed;
  bottom: calc(80px + var(--qx-safe-bottom) + var(--qx-space-4));
  right: var(--qx-space-4);
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: var(--qx-radius-full);
  background: var(--qx-primary);
  color: white;
  border: none;
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  animation: qx-fab-pulse 2s ease-in-out infinite;
}
.qx-fab:hover { transform: scale(1.1) rotate(90deg); box-shadow: 0 8px 25px rgba(0, 180, 216, 0.5); }
.qx-fab:active { transform: scale(0.9) rotate(90deg); transition-duration: 0.1s; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes qx-fab-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4); }
  50% { box-shadow: 0 6px 25px rgba(0, 180, 216, 0.6); }
}
.qx-fab svg { width: 24px; height: 24px; }

/* ════════════════════════════════════════
   FORMS (Touch-friendly)
   ════════════════════════════════════════ */
.qx-form-group {
  margin-bottom: var(--qx-space-4);
}

/* Inside a row, form-groups don't need extra bottom margin */
.qx-form-row .qx-form-group {
  margin-bottom: 0;
}

.qx-form-label {
  display: block;
  font-size: var(--qx-fs-sm);
  font-weight: 600;
  color: var(--qx-text-muted);
  margin-bottom: var(--qx-space-1);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.qx-form-input,
.qx-form-select,
.qx-form-textarea {
  width: 100%;
  padding: var(--qx-space-3) var(--qx-space-4);
  font-size: 16px; /* Prevents iOS zoom */
  font-family: var(--qx-font);
  border: 1.5px solid var(--qx-border-default);
  border-radius: var(--qx-radius-sm);
  background: var(--qx-bg-surface);
  color: var(--qx-text-default);
  min-height: 48px;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

/* Unified placeholder style */
.qx-form-input::placeholder,
.qx-form-textarea::placeholder {
  color: var(--qx-text-light);
  opacity: 1;
  font-size: 15px;
}

.qx-form-input:focus,
.qx-form-select:focus,
.qx-form-textarea:focus {
  outline: none;
  border-color: var(--qx-border-focus);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.qx-form-textarea { min-height: 100px; resize: vertical; }

.qx-form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.qx-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--qx-space-4);
  margin-bottom: var(--qx-space-4);
}

.qx-form-error {
  color: var(--qx-danger);
  font-size: var(--qx-fs-sm);
  margin-top: var(--qx-space-1);
}

/* ════════════════════════════════════════
   BADGES
   ════════════════════════════════════════ */
.qx-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--qx-space-1) var(--qx-space-3);
  font-size: var(--qx-fs-xs);
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
}

.qx-badge-success { background: var(--qx-success-bg); color: var(--qx-success); }
.qx-badge-warning { background: var(--qx-warning-bg); color: var(--qx-warning); }
.qx-badge-danger { background: var(--qx-danger-bg); color: var(--qx-danger); }
.qx-badge-info { background: var(--qx-info-bg); color: var(--qx-info); }
.qx-badge-primary { background: rgba(0, 180, 216, 0.15); color: var(--qx-primary); }
.qx-badge-muted { background: var(--qx-bg-muted); color: var(--qx-text-muted); }

/* Channel badges */
/* Channel badges — only 3 channels: Airbnb, Booking, Privado */
.qx-badge-airbnb { background: rgba(255, 88, 93, 0.15); color: #ff585d; }
.qx-badge-booking { background: rgba(0, 59, 149, 0.2); color: #60a5fa; }
.qx-badge-private { background: rgba(0, 180, 216, 0.15); color: var(--qx-primary); }

/* ════════════════════════════════════════
   LISTS (Mobile-optimized)
   ════════════════════════════════════════ */
.qx-list { list-style: none; }

.qx-list-item {
  display: flex;
  align-items: center;
  gap: var(--qx-space-3);
  padding: var(--qx-space-3) var(--qx-space-4);
  border-bottom: 1px solid var(--qx-border-default);
  text-decoration: none;
  color: var(--qx-text-default);
  transition: background 0.15s;
  min-height: 56px;
}

.qx-list-item:hover { background: var(--qx-bg-hover); }
.qx-list-item:active { background: var(--qx-bg-hover); transform: scale(0.97); transition: transform 0.08s; }

.qx-list-item-content { flex: 1; min-width: 0; }

.qx-list-item-title {
  font-weight: 600;
  font-size: var(--qx-fs-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qx-list-item-subtitle {
  font-size: var(--qx-fs-sm);
  color: var(--qx-text-muted);
  margin-top: 2px;
}

.qx-list-item-right {
  text-align: right;
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   KANBAN BOARD (Horizontal scroll on mobile)
   ════════════════════════════════════════ */
.qx-kanban {
  display: flex;
  gap: var(--qx-space-3);
  overflow-x: auto;
  padding-bottom: var(--qx-space-4);
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.qx-kanban-column {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--qx-bg-muted);
  border-radius: var(--qx-radius);
  padding: var(--qx-space-3);
  max-height: 70vh;
  overflow-y: auto;
}

.qx-kanban-title {
  font-size: var(--qx-fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--qx-text-muted);
  margin-bottom: var(--qx-space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qx-kanban-count {
  background: var(--qx-bg-surface);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: var(--qx-fs-xs);
}

.qx-kanban-card {
  background: var(--qx-bg-surface);
  border-radius: var(--qx-radius-sm);
  padding: var(--qx-space-3);
  margin-bottom: var(--qx-space-2);
  box-shadow: var(--qx-shadow-sm);
  cursor: pointer;
}

.qx-kanban-card:hover { box-shadow: var(--qx-shadow); transform: translateY(-2px); }
.qx-kanban-card:active { transform: scale(0.97); transition-duration: 0.1s; }

/* ════════════════════════════════════════
   MODALS (Full-screen on mobile)
   ════════════════════════════════════════ */
.qx-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.qx-modal-overlay.show { display: flex; align-items: flex-start; padding-top: 60px; }

.qx-modal {
  width: 100%;
  max-height: 90vh;
  background: var(--qx-bg-surface);
  border-radius: var(--qx-radius-lg) var(--qx-radius-lg) 0 0;
  overflow-y: auto;
  animation: qx-slide-up 0.3s ease-out;
}

@keyframes qx-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.qx-modal-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--qx-space-4);
  background: var(--qx-bg-surface);
  border-bottom: 1px solid var(--qx-border-default);
  z-index: 1;
}

.qx-modal-title {
  font-size: var(--qx-fs-md);
  font-weight: 700;
}

.qx-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--qx-bg-muted);
  border-radius: var(--qx-radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--qx-text-muted);
}

.qx-modal-body { padding: var(--qx-space-4); }

.qx-modal-footer {
  padding: var(--qx-space-4);
  padding-bottom: calc(var(--qx-space-4) + var(--qx-safe-bottom));
  border-top: 1px solid var(--qx-border-default);
  display: flex;
  gap: var(--qx-space-3);
}

/* ════════════════════════════════════════
   ALERTS / TOASTS
   ════════════════════════════════════════ */
.qx-alert {
  padding: var(--qx-space-3) var(--qx-space-4);
  border-radius: var(--qx-radius-sm);
  font-size: var(--qx-fs-sm);
  margin-bottom: var(--qx-space-4);
}

.qx-alert-success { background: var(--qx-success-bg); color: #065f46; }
.qx-alert-warning { background: var(--qx-warning-bg); color: #92400e; }
.qx-alert-danger { background: var(--qx-danger-bg); color: #991b1b; }
.qx-alert-info { background: var(--qx-info-bg); color: #1e40af; }

/* ════════════════════════════════════════
   SECTION HEADERS
   ════════════════════════════════════════ */
.qx-section-title {
  font-size: var(--qx-fs-md);
  font-weight: 700;
  margin-bottom: var(--qx-space-3);
  margin-top: var(--qx-space-6);
  color: var(--qx-primary);
}

.qx-section-title:first-child { margin-top: 0; }

/* ════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════ */
.qx-empty {
  text-align: center;
  padding: var(--qx-space-8);
  color: var(--qx-text-muted);
}

.qx-empty svg { width: 48px; height: 48px; margin-bottom: var(--qx-space-3); opacity: 0.4; }
.qx-empty-text { font-size: var(--qx-fs-base); margin-bottom: var(--qx-space-4); }

/* ════════════════════════════════════════
   FILTERS (Horizontal scroll chips)
   ════════════════════════════════════════ */
.qx-filter-bar {
  display: flex;
  gap: var(--qx-space-2);
  overflow-x: auto;
  padding-bottom: var(--qx-space-3);
  margin-bottom: var(--qx-space-3);
  -webkit-overflow-scrolling: touch;
}

.qx-filter-chip {
  flex-shrink: 0;
  padding: var(--qx-space-2) var(--qx-space-3);
  font-size: var(--qx-fs-sm);
  border: 1.5px solid var(--qx-border-default);
  border-radius: 20px;
  background: var(--qx-bg-surface);
  color: var(--qx-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.qx-filter-chip:hover { transform: translateY(-1px); }
.qx-filter-chip:active { transform: scale(0.9); transition-duration: 0.08s; }

.qx-filter-chip.active,
.qx-filter-chip:active {
  background: var(--qx-primary);
  color: white;
  border-color: var(--qx-primary);
}

/* ════════════════════════════════════════
   UTILITY CLASSES
   ════════════════════════════════════════ */
.qx-flex { display: flex; }
.qx-flex-col { flex-direction: column; }
.qx-flex-between { justify-content: space-between; }
.qx-flex-center { align-items: center; }
.qx-flex-wrap { flex-wrap: wrap; }
.qx-gap-2 { gap: var(--qx-space-2); }
.qx-gap-3 { gap: var(--qx-space-3); }
.qx-gap-4 { gap: var(--qx-space-4); }

.qx-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--qx-space-3); }

.qx-mt-3 { margin-top: var(--qx-space-3); }
.qx-mt-4 { margin-top: var(--qx-space-4); }
.qx-mb-3 { margin-bottom: var(--qx-space-3); }
.qx-mb-4 { margin-bottom: var(--qx-space-4); }
.qx-p-4 { padding: var(--qx-space-4); }

.qx-text-sm { font-size: var(--qx-fs-sm); }
.qx-text-muted { color: var(--qx-text-muted); }
.qx-text-right { text-align: right; }
.qx-text-center { text-align: center; }
.qx-font-bold { font-weight: 700; }
.qx-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.qx-hidden { display: none !important; }

/* ════════════════════════════════════════
   TABLET (iPad) — 768px+
   ════════════════════════════════════════ */
/* Landscape phone + small tablet */
@media (min-width: 568px) {
  .qx-kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .qx-form-row { grid-template-columns: 1fr 1fr; }
  .qx-kanban-column { flex: 0 0 240px; }
  .qx-modal-overlay.show { align-items: center; justify-content: center; }
  .qx-modal { max-width: 560px; border-radius: var(--qx-radius-lg); max-height: 85vh; }
  .qx-modal-footer { padding-bottom: var(--qx-space-4); }
}

/* Landscape safe areas */
@media (orientation: landscape) {
  .qx-content {
    padding-left: calc(env(safe-area-inset-left, 0px) + var(--qx-space-4));
    padding-right: calc(env(safe-area-inset-right, 0px) + var(--qx-space-4));
  }
  .qx-bottom-nav {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .qx-topbar {
    padding-left: calc(env(safe-area-inset-left, 0px) + var(--qx-space-4));
    padding-right: calc(env(safe-area-inset-right, 0px) + var(--qx-space-4));
  }
}

/* iPad / Desktop — sidebar only here */
@media (min-width: 1024px) {
  .qx-content { padding: var(--qx-space-6); padding-bottom: var(--qx-space-6); max-width: 900px; margin: 0 auto; }
  .qx-bottom-nav { display: none; }
  .qx-sidebar { display: flex !important; }
}

/* ════════════════════════════════════════
   DESKTOP — 1024px+
   ════════════════════════════════════════ */
@media (min-width: 1024px) {
  .qx-content { max-width: 1100px; }
  .qx-form-row { grid-template-columns: 1fr 1fr 1fr; }
  .qx-property-grid { grid-template-columns: repeat(3, 1fr); }
  .qx-kanban-column { flex: 1; }
}

/* ════════════════════════════════════════
   SIDEBAR (Hidden on mobile, visible on iPad+)
   ════════════════════════════════════════ */
.qx-sidebar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: #1a2332;
  color: #cbd5e1;
  z-index: 150;
  flex-direction: column;
  overflow-y: auto;
  padding-top: var(--qx-safe-top);
}

.qx-sidebar-brand {
  padding: var(--qx-space-5) var(--qx-space-4);
  font-size: var(--qx-fs-lg);
  font-weight: 800;
  color: #ffffff;
  border-bottom: 1px solid #2d3a4a;
}

.qx-sidebar-brand span { color: var(--qx-accent); }

.qx-sidebar-nav { padding: var(--qx-space-3) 0; flex: 1; }

.qx-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--qx-space-3);
  padding: var(--qx-space-3) var(--qx-space-4);
  color: #94a3b8;
  text-decoration: none;
  font-size: var(--qx-fs-sm);
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.qx-sidebar-item:hover { background: #2d3a4a; color: #e2e8f0; }
.qx-sidebar-item.active {
  background: #2d3a4a;
  color: var(--qx-accent);
  border-left-color: var(--qx-accent);
}

.qx-sidebar-item svg { width: 20px; height: 20px; flex-shrink: 0; }

@media (min-width: 1024px) {
  .qx-app { flex-direction: row; }
  .qx-sidebar { display: flex; }
  .qx-main { margin-left: 240px; flex: 1; min-height: 100dvh; }
}

/* ════════════════════════════════════════
   PROPERTY GRID
   ════════════════════════════════════════ */
.qx-property-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--qx-space-4);
}

@media (min-width: 500px) {
  .qx-property-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ════════════════════════════════════════
   LIGHT THEME — Sidebar & Drawer overrides
   ════════════════════════════════════════ */
[data-theme="light"] .qx-sidebar,
[data-theme="light"] .qx-drawer {
  background: #1e293b;
}

[data-theme="light"] .qx-topbar {
  background: var(--qx-bg-surface);
  border-bottom-color: var(--qx-border-default);
}

[data-theme="light"] .qx-bottom-nav {
  background: #1e293b;
}

[data-theme="light"] .qx-nav-center::before {
  background: #1e293b;
}

[data-theme="light"] .qx-form-input,
[data-theme="light"] .qx-form-select,
[data-theme="light"] .qx-form-textarea {
  background: var(--qx-bg-surface);
  color: var(--qx-text-default);
  border-color: var(--qx-border-default);
}

/* Theme toggle icon */
.qx-theme-toggle {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--qx-text-muted);
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
}
.qx-theme-toggle:active { color: var(--qx-primary); }

/* Logo switching per theme */
.logo-dark { display: inline; }
.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: inline; }
