/* ── ExeFast Design System ────────────────────────────────────── */

:root {
  /* Colors — ExeFast light theme, aligned with marketing site
     (warm orange accent, neutral slate inks, soft shadows) */
  --color-bg:            #f7f8fb;
  --color-surface:       #ffffff;
  --color-surface-hover: #f3f4f8;
  --color-surface-alt:   #fafbfe;
  --color-border:        rgba(15,23,42,0.08);
  --color-border-focus:  #ea580c;
  --color-text:          #0f172a;
  --color-text-muted:    #475569;
  --color-text-dim:      #94a3b8;
  --color-primary:       #ea580c;
  --color-primary-hover: #dc4e08;
  --color-primary-dim:   rgba(234,88,12,0.10);
  --color-success:       #16a34a;
  --color-success-dim:   rgba(22,163,74,0.10);
  --color-warning:       #d97706;
  --color-warning-dim:   rgba(217,119,6,0.10);
  --color-danger:        #dc2626;
  --color-danger-dim:    rgba(220,38,38,0.10);
  --color-accent:        #0d9488;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows — light, subtle, layered */
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.07), 0 2px 6px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.09), 0 4px 12px rgba(15,23,42,0.04);
  --shadow-glow: 0 8px 40px rgba(234,88,12,0.14);

  /* Typography */
  --font-sans: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --duration: 200ms;
  --duration-fast: 120ms;

  /* Layout */
  --nav-width: 260px;
  --nav-width-collapsed: 64px;
  --header-height: 60px;
  --content-max: 1200px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Reset ────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

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

img, svg { max-width: 100%; display: block; }

/* ── Utility classes ──────────────────────────────────────────── */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-center { text-align: center; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.grid { display: grid; }

/* ── Buttons ──────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  line-height: 1.5;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-glow);
}
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--color-border-focus);
}
.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #ef4444;
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-hover);
  color: var(--color-text);
}
.btn-sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
}
.btn-lg {
  padding: var(--sp-3) var(--sp-8);
  font-size: var(--text-base);
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ── Form elements ────────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}
.form-input, .form-select, .form-textarea {
  padding: var(--sp-2) var(--sp-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  transition: border-color var(--duration) var(--ease);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-dim);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--color-text-dim);
}
.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Cards ────────────────────────────────────────────────────── */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--duration) var(--ease);
}
.card:hover {
  border-color: var(--color-border-focus);
}
.card-clickable {
  cursor: pointer;
}
.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Badges ───────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
}
.badge-primary { background: var(--color-primary-dim); color: var(--color-primary); }
.badge-success { background: var(--color-success-dim); color: var(--color-success); }
.badge-warning { background: var(--color-warning-dim); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-dim); color: var(--color-danger); }

/* ── Stat cards ───────────────────────────────────────────────── */

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.stat-card .stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-card .stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
}

/* ── Drag and drop ────────────────────────────────────────────── */

.drag-source {
  cursor: grab;
  user-select: none;
  transition: all var(--duration) var(--ease);
}
.drag-source:active {
  cursor: grabbing;
}
.drag-source.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}
.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--duration) var(--ease);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drop-zone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-dim);
}
.drop-zone.has-items {
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-3);
}

/* ── Chip (removable items in drop zone) ──────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--color-danger-dim);
  border: none;
  border-radius: var(--radius-full);
  color: var(--color-danger);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.chip-remove:hover {
  background: var(--color-danger);
  color: #fff;
}

/* ── Tab bar ──────────────────────────────────────────────────── */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  gap: var(--sp-1);
}
.tab {
  padding: var(--sp-3) var(--sp-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-sans);
}
.tab:hover {
  color: var(--color-text);
}
.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ── Empty state ──────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16);
  text-align: center;
  gap: var(--sp-4);
}
.empty-state .empty-icon {
  font-size: 3rem;
  opacity: 0.3;
}
.empty-state .empty-title {
  font-size: var(--text-lg);
  font-weight: 600;
}
.empty-state .empty-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 320px;
}

/* ── Skeleton loading ─────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface) 25%,
    var(--color-surface-hover) 50%,
    var(--color-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Scrollbar ────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-dim);
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 768px) {
  :root {
    --nav-width: 100%;
    --header-height: 56px;
  }
}
