/* ============================================================
   Coil Light Theme — Shared Design Tokens & Components
   ============================================================ */

:root {
  /* Backgrounds */
  --bg: #FAF9F7;
  --surface: #FFFFFF;
  --surface-hover: #FAFAF8;
  --border: #E8E6E1;
  --border-light: #F0EDE8;

  /* Brand Colors */
  --blue: #0978E1;
  --blue-light: #E3F0FD;
  --blue-hover: #0768C5;
  --coral: #FF766C;
  --coral-light: #FFF0EE;
  --teal: #5BB5A2;
  --teal-light: #EDF8F5;
  --amber: #F59E0B;
  --amber-light: #FEF7E6;
  --violet: #8B5CF6;
  --green: #10B981;
  --green-light: #ECFDF5;
  --red: #EF4444;

  /* Text */
  --text: #2D2D2D;
  --text-secondary: #6B6B6B;
  --text-tertiary: #9A9A9A;

  /* Radii */
  --radius: 14px;
  --radius-sm: 8px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Fonts */
  --font: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}


/* ============================================================
   Reset
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ============================================================
   Typography
   ============================================================ */

h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}


/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--blue);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--blue-hover);
  box-shadow: var(--shadow-md);
}

.btn-ai {
  background: linear-gradient(135deg, var(--blue), var(--coral));
  color: #FFFFFF;
}

.btn-ai:hover {
  opacity: 0.9;
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background-color: var(--surface-hover);
  border-color: var(--text-tertiary);
}

.btn-danger {
  background-color: var(--red);
  color: #FFFFFF;
}

.btn-danger:hover {
  opacity: 0.9;
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}


/* ============================================================
   Card
   ============================================================ */

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: box-shadow 0.15s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}


/* ============================================================
   Status Pills
   ============================================================ */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 100px;
  white-space: nowrap;
  line-height: 1.4;
}

.status-scheduled {
  background-color: var(--blue-light);
  color: var(--blue);
}

.status-enroute {
  background-color: var(--amber-light);
  color: var(--amber);
}

.status-active,
.status-onsite {
  background-color: var(--teal-light);
  color: var(--teal);
}

.status-complete {
  background-color: var(--green-light);
  color: var(--green);
}

.status-unassigned {
  background-color: var(--border-light);
  color: var(--text-tertiary);
}


/* ============================================================
   Form Inputs
   ============================================================ */

.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea.input {
  min-height: 80px;
  resize: vertical;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B6B6B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}


/* ============================================================
   Spinner
   ============================================================ */

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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


/* ============================================================
   Loading State
   ============================================================ */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}


/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.6;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: 8px;
}
