.login-screen {
  display: flex;
}

/* ── App shell: left sidebar layout ── */
:root {
  --fd-blue: #2563eb;
  --fd-blue-dark: #1d4ed8;
  --fd-blue-soft: #eff4ff;
  --fd-ink: #0f1f3d;
  --fd-bg: #f4f7fd;
}

#app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--fd-bg);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv11", "tnum";
  -webkit-font-smoothing: antialiased;
}

.side-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 14.5rem;
  height: 100vh;
  flex-shrink: 0;
  border-right: 1px solid #e7edf6;
  background: #fff;
  padding: 1rem 0.75rem;
}

.side-brand {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem 1rem;
}

.side-logo {
  height: 2rem;
  width: auto;
}

.side-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.side-group {
  margin: 0.875rem 0 0.25rem;
  padding: 0 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.side-footer {
  border-top: 1px solid #eef2f9;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.side-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  min-width: 0;
}

.side-business {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--fd-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-sign-out {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  border: none;
  border-radius: 0.625rem;
  background: transparent;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}

.side-sign-out:hover {
  background: #f1f5f9;
  color: #334155;
}

.side-sign-out svg {
  width: 1rem;
  height: 1rem;
}

.app-main {
  flex: 1;
  min-width: 0;
  max-width: 90rem;
  padding: 1.75rem 2rem 3rem;
}

@media (max-width: 860px) {
  #app-shell {
    flex-direction: column;
  }
  .side-nav {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-right: none;
    border-bottom: 1px solid #e7edf6;
  }
  .side-menu {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .side-group {
    display: none;
  }
  .side-footer {
    border-top: none;
    padding-top: 0;
    flex-direction: row;
    align-items: center;
  }
  .side-account {
    display: none;
  }
  .side-sign-out span {
    display: none;
  }
  .app-main {
    padding: 1.25rem 1rem 2.5rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  border: none;
  border-radius: 0.625rem;
  background: transparent;
  padding: 0.5625rem 0.625rem;
  font-size: 0.8438rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
  transition: background 140ms cubic-bezier(0.2, 0, 0, 1), color 140ms;
}

.tab-btn svg {
  width: 1.0625rem;
  height: 1.0625rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.tab-btn:hover {
  background: var(--fd-blue-soft);
  color: var(--fd-blue);
}

.tab-btn.active {
  background: var(--fd-blue);
  color: #fff;
  box-shadow: 0 4px 10px -3px rgba(37, 99, 235, 0.45);
}

@media (max-width: 860px) {
  .tab-btn {
    width: auto;
  }
  .tab-btn span {
    display: none;
  }
}

.card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.metric-value {
  margin-top: 0.25rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fd-ink);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.btn-primary {
  border: none;
  border-radius: 0.625rem;
  background: var(--fd-blue);
  padding: 0.625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px -3px rgba(37, 99, 235, 0.4);
  transition: background 140ms, transform 140ms cubic-bezier(0.2, 0, 0, 1);
}

.btn-primary:hover {
  background: var(--fd-blue-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.btn-secondary:hover {
  background: #f8fafc;
}

.field {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
}

.field:focus {
  outline: none;
  border-color: var(--fd-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field--sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 0.625rem;
}

.btn--sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .form-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Schedule dispatch board */
.schedule-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.schedule-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.schedule-mode-picker {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background: #e2e8f0;
}

.schedule-mode-btn {
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  background: transparent;
  cursor: pointer;
}

.schedule-mode-btn.active {
  background: #fff;
  color: var(--fd-ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.schedule-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.schedule-week-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--fd-ink);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.week-day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.5rem 0.25rem;
  background: #fff;
  cursor: pointer;
}

.week-day-btn.selected {
  background: var(--fd-blue);
  color: #fff;
}

.week-day-btn.has-conflict:not(.selected) {
  border-color: #f87171;
}

.week-day-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.8;
}

.week-day-num {
  font-size: 1rem;
  font-weight: 800;
}

.week-day-dots {
  min-height: 0.75rem;
  font-size: 0.625rem;
}

.schedule-conflict-banner {
  margin-bottom: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #b91c1c;
}

.timeline-card {
  padding: 0.75rem;
}

.timeline-scroll {
  display: flex;
  gap: 0.5rem;
  max-height: 32rem;
  overflow: auto;
}

.timeline-hours {
  flex: 0 0 3.5rem;
}

.timeline-hour {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
  padding-top: 0.125rem;
}

.timeline-lane {
  position: relative;
  flex: 1;
  min-height: 28rem;
}

.timeline-slots {
  position: absolute;
  inset: 0;
}

.timeline-slot {
  border-top: 1px solid #e2e8f0;
}

.timeline-slot.drop-target {
  background: #e0f2fe;
}

.timeline-blocks {
  position: relative;
  min-height: 100%;
}

.timeline-block {
  position: absolute;
  left: 0.375rem;
  right: 0.375rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  border: 1px solid #7dd3fc;
  border-left: 3px solid #0284c7;
  border-radius: 0.625rem;
  background: rgba(2, 132, 199, 0.12);
  padding: 0.375rem 0.5rem;
  text-align: left;
  cursor: grab;
}

.timeline-block.is-conflict {
  border-color: #f87171;
  border-left-color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

.timeline-block-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--fd-ink);
  line-height: 1.2;
}

.timeline-block-meta {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #0369a1;
}

.timeline-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: #64748b;
}

.crew-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.crew-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.crew-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: var(--fd-ink);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
}

.crew-name {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fd-ink);
}

.crew-remove {
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.crew-add-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Minimal utility classes used across tab markup (no Tailwind runtime). */
.block { display: block; }
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-xl { font-size: 1.25rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-admiral-navy { color: var(--fd-ink); }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
@media (min-width: 640px) {
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
}

/* ── Status tokens (raw values shared with iOS) ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: currentColor;
}
.status-pill.status-scheduled { background: #fffbeb; color: #b45309; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25); }
.status-pill.status-dispatched { background: #eef2ff; color: #4338ca; box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.25); }
.status-pill.status-on_site { background: #f0f9ff; color: #0369a1; box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.25); }
.status-pill.status-in_progress { background: #f5f3ff; color: #6d28d9; box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25); }
.status-pill.status-completed { background: #ecfdf5; color: #047857; box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.25); }

/* ── Dispatch split panel ── */
.dispatch-split {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

@media (max-width: 860px) {
  .dispatch-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dispatch-backlog {
  padding: 0;
  overflow: hidden;
}

.dispatch-backlog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.dispatch-backlog-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
}

.dispatch-backlog-sub {
  margin: 0;
  font-size: 0.6875rem;
  color: #94a3b8;
}

.dispatch-backlog-count {
  border-radius: 9999px;
  background: #f1f5f9;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.dispatch-backlog-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-height: 36rem;
  overflow-y: auto;
  padding: 0.75rem;
}

.dispatch-backlog-empty {
  margin: 0;
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.backlog-card {
  border: 1px solid #f1f5f9;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.75rem;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), box-shadow 140ms cubic-bezier(0.2, 0, 0, 1), border-color 140ms;
}

.backlog-card:hover {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.1);
}

.backlog-card:active {
  cursor: grabbing;
}

.backlog-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.backlog-card-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.backlog-card-row {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backlog-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.backlog-card-hours {
  color: #6366f1;
}

/* FullCalendar drag mirror of a backlog card */
.fc-event-dragging.fc-event-mirror {
  opacity: 0.9;
}

/* ── FullCalendar skin ── */
.dispatch-calendar-card {
  padding: 0.5rem 0.75rem 0.75rem;
}

#dispatch-calendar .fc {
  --fc-border-color: #f1f5f9;
  --fc-today-bg-color: rgba(99, 102, 241, 0.04);
  --fc-now-indicator-color: #6366f1;
  --fc-page-bg-color: transparent;
  font-size: 0.8125rem;
}

#dispatch-calendar .fc .fc-scrollgrid {
  border: 0;
}

#dispatch-calendar .fc .fc-timegrid-slot {
  height: 2.5rem;
}

#dispatch-calendar .fc .fc-timegrid-slot-label-cushion {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
}

#dispatch-calendar .fc .fc-col-header-cell {
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}

.lane-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem;
}

.lane-head-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
}

.lane-head-owner {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

#dispatch-calendar .fc .fc-timegrid-event {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0.625rem;
  cursor: grab;
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), box-shadow 140ms cubic-bezier(0.2, 0, 0, 1);
}

#dispatch-calendar .fc .fc-timegrid-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.12);
  z-index: 30;
}

#dispatch-calendar .fc .fc-event-main {
  padding: 0;
}

#dispatch-calendar .fc .fc-highlight {
  background: rgba(99, 102, 241, 0.08);
  border: 1.5px dashed rgba(99, 102, 241, 0.5);
  border-radius: 0.5rem;
}

.dispatch-event {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  height: 100%;
  overflow: hidden;
  border-radius: 0.625rem;
  padding: 0.375rem 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.dispatch-event-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-event-client {
  font-size: 0.6875rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-event-meta {
  margin-top: auto;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dispatch-event.status-scheduled { background: #fffbeb; border-left: 3px solid #f59e0b; }
.dispatch-event.status-scheduled .dispatch-event-meta { color: #b45309; }
.dispatch-event.status-dispatched { background: #eef2ff; border-left: 3px solid #6366f1; }
.dispatch-event.status-dispatched .dispatch-event-meta { color: #4338ca; }
.dispatch-event.status-on_site { background: #f0f9ff; border-left: 3px solid #0ea5e9; }
.dispatch-event.status-on_site .dispatch-event-meta { color: #0369a1; }
.dispatch-event.status-in_progress { background: #f5f3ff; border-left: 3px solid #8b5cf6; }
.dispatch-event.status-in_progress .dispatch-event-meta { color: #6d28d9; }
.dispatch-event.status-completed { background: #ecfdf5; border-left: 3px solid #10b981; opacity: 0.85; }
.dispatch-event.status-completed .dispatch-event-meta { color: #047857; }

/* ── Operations dashboard ── */
#tab-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.375rem 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #f8faff 55%, #eff4ff 100%);
  border-color: #e3ebf8;
}

.dash-eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fd-blue);
  letter-spacing: 0.02em;
}

.dash-title {
  margin: 0.25rem 0 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fd-ink);
  line-height: 1.2;
}

.dash-lead {
  margin: 0.5rem 0 0;
  max-width: 36rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #64748b;
}

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dash-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .dash-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-stat-pill {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.875rem 1rem;
  border: 1px solid #e7edf6;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.dash-stat-value {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--fd-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dash-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.metric-card {
  display: flex;
  flex-direction: column;
  min-height: 10.5rem;
  padding: 1.125rem 1.25rem 1rem;
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), box-shadow 140ms cubic-bezier(0.2, 0, 0, 1);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.12);
}

.metric-card-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.625rem;
  flex-shrink: 0;
}

.metric-icon svg {
  width: 1.0625rem;
  height: 1.0625rem;
}

.metric-icon--green { background: #ecfdf5; color: #059669; }
.metric-icon--blue { background: #eff6ff; color: var(--fd-blue); }
.metric-icon--amber { background: #fffbeb; color: #d97706; }
.metric-icon--violet { background: #f5f3ff; color: #7c3aed; }

.metric-card--green { border-top: 3px solid #10b981; }
.metric-card--blue { border-top: 3px solid var(--fd-blue); }
.metric-card--amber { border-top: 3px solid #f59e0b; }
.metric-card--violet { border-top: 3px solid #8b5cf6; }

.metric-label {
  margin: 0;
}

.metric-value {
  margin-top: 0;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.metric-sub {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.metric-chart-wrap {
  margin-top: auto;
  padding-top: 0.75rem;
}

.metric-chart {
  display: block;
  width: 100%;
}

.dash-columns {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 960px) {
  .dash-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dash-panel {
  padding: 1.125rem 1.25rem;
}

.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.dash-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fd-ink);
}

.dash-panel-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.dash-empty {
  margin: 0;
  padding: 2rem 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.5;
}

.dash-visit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.dash-visit {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid #f1f5f9;
}

.dash-visit:first-child {
  border-top: none;
  padding-top: 0;
}

.dash-visit-time {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.dash-visit-start {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--fd-ink);
  font-variant-numeric: tabular-nums;
}

.dash-visit-end {
  font-size: 0.6875rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.dash-visit-body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.dash-visit-title {
  font-size: 0.8438rem;
  font-weight: 600;
  color: var(--fd-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-visit-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.util-list {
  display: flex;
  flex-direction: column;
}

.util-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid #f1f5f9;
}

.util-row:first-child {
  border-top: none;
  padding-top: 0;
}

.util-row-copy {
  display: flex;
  flex-direction: column;
  min-width: 8.5rem;
}

.util-row-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--fd-ink);
}

.util-row-hours {
  font-size: 0.6875rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.util-row-meter {
  flex: 1;
  height: 0.4375rem;
  border-radius: 9999px;
  background: #eef2f9;
  overflow: hidden;
}

.util-row-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 300ms cubic-bezier(0.2, 0, 0, 1);
}

.util-row-meter--high .util-row-fill { background: #10b981; }
.util-row-meter--mid .util-row-fill { background: var(--fd-blue); }
.util-row-meter--low .util-row-fill { background: #cbd5e1; }

.util-row-pct {
  width: 2.5rem;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

/* ── All Jobs page ── */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.jobs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.875rem;
}

.jobs-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 9rem;
}

.jobs-filter--grow {
  flex: 1;
  min-width: 12rem;
}

.jobs-filter > span {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
}

.jobs-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.jobs-pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.page-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid #dbe4f0;
  border-radius: 0.5rem;
  background: #fff;
  color: #475569;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 140ms, color 140ms;
}

.page-arrow:hover:not(:disabled) {
  background: var(--fd-blue-soft);
  color: var(--fd-blue);
}

.page-arrow:disabled {
  opacity: 0.4;
  cursor: default;
}

.jobs-table-card {
  padding: 0.375rem 1rem;
}

.jobs-table th {
  padding: 0.875rem 0.625rem;
  border-bottom: 1px solid #eef2f9;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.jobs-table td {
  padding: 0.875rem 0.625rem;
  border-bottom: 1px solid #f4f7fc;
  vertical-align: middle;
}

.job-row {
  cursor: pointer;
  transition: background 140ms;
}

.job-row:hover {
  background: #f8fafd;
}

.job-row.is-expanded {
  background: #f8fafd;
}

.job-row.is-expanded td {
  border-bottom-color: transparent;
}

.job-name {
  font-size: 0.8438rem;
  font-weight: 600;
  color: var(--fd-ink);
}

.assignee {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.crew-avatar--sm {
  width: 1.625rem;
  height: 1.625rem;
  font-size: 0.625rem;
  background: var(--fd-blue);
}

.job-cell-time {
  white-space: nowrap;
}

.job-time {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  font-variant-numeric: tabular-nums;
}

.job-date {
  display: block;
  font-size: 0.6875rem;
  color: #94a3b8;
}

.job-cell-actions {
  text-align: right;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  border: 1px solid #e7edf6;
  border-radius: 0.5rem;
  background: #fff;
  color: #94a3b8;
  cursor: pointer;
  transition: color 140ms, border-color 140ms, background 140ms;
}

.icon-btn svg {
  width: 0.9375rem;
  height: 0.9375rem;
}

.icon-btn--danger:hover {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

.job-detail-row td {
  padding: 0 0.625rem 0.875rem;
  border-bottom: 1px solid #f4f7fc;
}

.job-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  border: 1px dashed #dbe4f0;
  border-radius: 0.75rem;
  background: #fbfcfe;
  padding: 0.875rem 1.25rem;
}

.job-detail-cell {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.job-detail-cell--wide {
  flex: 1;
  min-width: 12rem;
}

.job-detail-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--fd-ink);
  font-variant-numeric: tabular-nums;
}

.job-detail-label {
  font-size: 0.6875rem;
  color: #94a3b8;
}

.jobs-empty {
  margin: 0;
  padding: 3rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #64748b;
}
