/* ─────────────────────────────────────────────────────
   Dashboard — Job Board
   Shares design tokens from theme.css (--bg, --accent, etc.)
   ───────────────────────────────────────────────────── */

/* ─── NAV ─── */
.dash-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  flex-shrink: 0;
}

/* ─── PAGE HEADER ─── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 28px 20px;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 16px;
}

.dash-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.dash-sub {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.dash-stats {
  display: flex;
  gap: 28px;
}

.dash-stat {
  text-align: right;
}

.dash-stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent-light);
}

.dash-stat-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}

/* ─── BOARD ─── */
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 28px 48px;
  overflow-x: auto;
  min-height: calc(100vh - 200px);
  align-items: start;
}

/* ─── COLUMN ─── */
.col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.col-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.col-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 2px 8px;
  color: var(--fg-muted);
}

/* Column accent colors */
.col-new      { border-bottom: 2px solid #e3a54a; }
.col-new .col-label { color: #e3a54a; }

.col-scheduled { border-bottom: 2px solid #5c9bd6; }
.col-scheduled .col-label { color: #5c9bd6; }

.col-active   { border-bottom: 2px solid var(--accent-light); }
.col-active .col-label { color: var(--accent-light); }

.col-done     { border-bottom: 2px solid var(--fg-muted); }
.col-done .col-label { color: var(--fg-muted); }

.col-warranty { border-bottom: 2px solid #b47ee8; }
.col-warranty .col-label { color: #b47ee8; }

.col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  flex: 1;
}

.col-empty {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-align: center;
  padding: 20px 8px;
  opacity: 0.5;
}

/* ─── JOB CARD ─── */
.job-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.14s, box-shadow 0.18s;
  user-select: none;
}

.job-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 166, 92, 0.12);
}

.job-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.job-customer {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.job-warranty-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(180, 126, 232, 0.18);
  color: #b47ee8;
  border: 1px solid rgba(180, 126, 232, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.job-address {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-species {
  font-size: 0.76rem;
  color: var(--accent);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.job-date {
  font-size: 0.74rem;
  color: var(--fg-muted);
}

.job-phone {
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
}

.job-phone:hover { opacity: 1; }

/* ─── BUTTONS ─── */
.btn-primary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 18px;
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 14px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 16px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover { color: var(--fg); border-color: var(--fg-muted); }

.btn-danger-sm {
  font-size: 0.78rem;
  padding: 5px 12px;
  background: rgba(220, 53, 69, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger-sm:hover { background: rgba(220, 53, 69, 0.3); }

/* ─── MODAL ─── */
/* Hidden by default; shown via .is-visible class (not hidden attr — Safari compat) */
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.modal-backdrop.is-visible {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  animation: modalIn 0.18s ease;
}

.modal-lg { max-width: 640px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

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

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}

.modal-close:hover { color: var(--fg); background: rgba(255,255,255,0.06); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ─── FORM ─── */
form {
  padding: 20px 24px 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

.field input::placeholder,
.field textarea::placeholder { color: rgba(139,148,158,0.5); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field select option { background: var(--bg-card); }

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

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--accent-light);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: none;
}

.toast.is-visible {
  display: block;
  -webkit-animation: toastIn 0.2s ease;
  animation: toastIn 0.2s ease;
}

.toast-error {
  border-color: #f87171;
  color: #f87171;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── MOBILE ─── */
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(3, minmax(200px, 1fr)); }
  .dash-header { flex-direction: column; align-items: flex-start; }
  .dash-stats { gap: 20px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  /* Stack columns vertically on phones — no horizontal scroll */
  .board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 12px 32px;
    overflow-x: visible;
    min-height: auto;
  }
  .col { width: 100%; }
  .col-body { gap: 8px; padding: 10px; }
  .dash-header { padding: 16px 12px 12px; }
  .dash-nav { padding: 0 12px; }
  .dash-stats { gap: 16px; }
  .dash-title { font-size: 1.3rem; }
  .dash-stat-num { font-size: 1.1rem; }

  /* Cards: larger tap targets on mobile */
  .job-card { padding: 14px 16px; }
  .job-customer { max-width: none; }

  /* Modal: full-width on small screens */
  .modal-backdrop { padding: 8px; }
  .modal, .modal-lg { max-width: 100%; border-radius: 10px; }
  form { padding: 16px 16px 0; }
  .modal-header { padding: 16px 16px 12px; }
  .modal-footer { padding: 12px 16px 16px; }

  /* Toast: bottom-center on mobile */
  .toast { bottom: 16px; right: 12px; left: 12px; text-align: center; }
}
