/* ==========================================================================
   Staff area — login + request dashboard
   ========================================================================== */

.staff-body { background: var(--color-offwhite); }

/* ---------- Login ---------- */
.staff-login-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: var(--space-5);
}
.staff-login-card {
  width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: var(--space-7) var(--space-6);
}
.staff-login-card h1 { font-size: var(--fs-xl); text-align: center; margin-bottom: var(--space-2); }

/* ---------- Dashboard shell ---------- */
.staff-topbar {
  position: sticky; top: 0; z-index: 50; background: var(--color-charcoal); color: #fff;
  padding-block: var(--space-3);
}
.staff-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.staff-topbar .brand { color: #fff; font-size: var(--fs-md); }
.staff-role-badge {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(255,255,255,0.12); padding: 0.3rem 0.7rem; border-radius: 999px; color: #cfe0f5;
}
.staff-topbar-actions { display: flex; align-items: center; gap: var(--space-3); }

.staff-main { padding-block: var(--space-6) var(--space-9); }

.staff-toolbar {
  display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5);
}
.staff-view-toggle { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }
.staff-view-toggle button {
  border: 0; background: #fff; padding: 0.55rem 1rem; font-weight: 600; font-size: var(--fs-sm); color: var(--color-text-muted);
}
.staff-view-toggle button.active { background: var(--color-primary); color: #fff; }

.filter-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.filter-chip {
  border: 1.5px solid var(--color-border); background: #fff; border-radius: 999px;
  padding: 0.45rem 0.9rem; font-size: var(--fs-xs); font-weight: 700; color: var(--color-charcoal-soft);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.filter-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.filter-group { display: flex; flex-direction: column; gap: var(--space-2); }
.filter-group-label { font-size: var(--fs-xs); font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.sort-select { min-height: 40px; padding: 0.4rem 2.2rem 0.4rem 0.8rem; font-size: var(--fs-sm); }

.new-category-form { display: inline-flex; gap: 6px; align-items: center; }
.new-category-input {
  min-height: 34px; padding: 0.35rem 0.6rem; font-size: var(--fs-xs);
  border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); width: 160px;
}

/* ---------- Request list ---------- */
.request-list { display: grid; gap: var(--space-4); }
.request-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-5); display: grid; gap: var(--space-3);
  border-left: 4px solid var(--color-border);
}
.request-card[data-status="new"] { border-left-color: var(--color-primary-light); }
.request-card[data-status="contacted"] { border-left-color: var(--color-star); }
.request-card[data-status="quoted"] { border-left-color: #8a5cd6; }
.request-card[data-status="scheduled"] { border-left-color: var(--color-success); }
.request-card[data-status="done"] { border-left-color: var(--color-text-muted); opacity: 0.7; }
.request-card[data-status="cancelled"] { border-left-color: var(--color-danger); opacity: 0.6; }
.request-card[data-priority="1"] { box-shadow: 0 0 0 2px rgba(217,104,47,0.35); }

.request-card-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); }
.request-title { font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-md); color: var(--color-charcoal); }
.request-sub { font-size: var(--fs-sm); color: var(--color-text-muted); }
.request-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700;
  padding: 0.25rem 0.6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-status-new { background: #eaf1fb; color: var(--color-primary); }
.badge-status-contacted { background: #fdf3e2; color: #a3720c; }
.badge-status-quoted { background: #f1eafc; color: #6a3fb8; }
.badge-status-scheduled { background: var(--color-success-bg); color: var(--color-success); }
.badge-status-done { background: #eef0f2; color: var(--color-text-muted); }
.badge-status-cancelled { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-priority { background: #fdece2; color: var(--color-accent-dark); }
.badge-category { background: #fff4d6; color: #9a6b00; }
.badge-city { background: #eef0f2; color: var(--color-charcoal-soft); }
.badge-value { background: var(--color-success-bg); color: var(--color-success); }

/* Quick status pills, right on the card */
.quick-status-row { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-status-pill {
  border: 1.5px solid var(--color-border); background: #fff; border-radius: 999px;
  padding: 0.3rem 0.75rem; font-size: var(--fs-xs); font-weight: 700; color: var(--color-charcoal-soft);
  text-transform: uppercase; letter-spacing: 0.02em; transition: all var(--duration-fast) var(--ease-out);
}
.quick-status-pill:hover { border-color: var(--color-primary-light); color: var(--color-primary); }
.quick-status-pill.active { background: var(--color-charcoal); border-color: var(--color-charcoal); color: #fff; cursor: default; }

.request-meta { display: grid; gap: var(--space-2); grid-template-columns: 1fr; font-size: var(--fs-sm); color: var(--color-text); }
@media (min-width: 640px) { .request-meta { grid-template-columns: repeat(2, 1fr); } }
.request-meta div strong { color: var(--color-text-muted); font-weight: 600; margin-right: 4px; }
.request-issue { font-size: var(--fs-sm); color: var(--color-text); background: var(--color-offwhite); border-radius: var(--radius-sm); padding: var(--space-3); }

.meta-link { color: var(--color-primary); font-weight: 600; }
.meta-link:hover { text-decoration: underline; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: #fff; color: var(--color-text-muted); vertical-align: middle;
  transition: all var(--duration-fast) var(--ease-out);
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { border-color: var(--color-primary-light); color: var(--color-primary); }
.icon-btn.copied { border-color: var(--color-success); color: var(--color-success); }

.request-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.request-actions .btn { min-height: 40px; padding: 0.5rem 1rem; font-size: var(--fs-sm); }

.btn-danger-outline { background: transparent; border-color: var(--color-danger); color: var(--color-danger); }
.btn-danger-outline:hover { background: var(--color-danger-bg); }
.btn-danger-outline.btn-danger-armed { background: var(--color-danger); color: #fff; }

.empty-state {
  text-align: center; padding: var(--space-9) var(--space-5); color: var(--color-text-muted);
  background: #fff; border: 1px dashed var(--color-border); border-radius: var(--radius-lg);
}

/* ---------- Calendar view ---------- */
.calendar-grid { background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.calendar-head-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-bottom: 1px; }
.calendar-head { background: var(--color-charcoal); color: #fff; padding: var(--space-2); text-align: center; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; }
.calendar-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-bottom: 1px; position: relative; }
.calendar-week:last-child { margin-bottom: 0; }
.calendar-cell { background: #fff; min-height: 96px; padding: var(--space-2); transition: background var(--duration-fast) var(--ease-out), outline var(--duration-fast) var(--ease-out); }
.calendar-cell.empty { background: var(--color-offwhite); }
.calendar-cell.dragover { background: #eaf1fb; outline: 2px dashed var(--color-primary); outline-offset: -2px; }
.calendar-date { font-size: var(--fs-xs); font-weight: 700; color: var(--color-text-muted); }
.calendar-cell-chips { display: flex; flex-direction: column; gap: 4px; }
.calendar-job {
  font-size: 0.7rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: #eaf1fb; color: var(--color-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: grab;
}
.calendar-job:active { cursor: grabbing; }
.calendar-job.dragging { opacity: 0.4; }
.calendar-job.status-scheduled { background: var(--color-danger-bg); color: var(--color-danger); }
.calendar-job.status-done { background: var(--color-success-bg); color: var(--color-success); }
.calendar-job.requested { background: #fdece2; color: var(--color-accent-dark); }
.calendar-job.priority { box-shadow: inset 0 0 0 1.5px var(--color-accent-dark); }

/* A multi-day job draws as one solid bar spanning every day it covers,
   instead of repeating as a separate chip per day — makes it easy to see
   at a glance how far out someone is booked, and who overlaps with whom. */
.calendar-bar {
  position: absolute; z-index: 2; display: flex; align-items: center;
  font-size: 0.7rem; font-weight: 700; padding: 0 6px; border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: grab; color: #fff;
}
.calendar-bar:active { cursor: grabbing; }
.calendar-bar.dragging { opacity: 0.4; }
.calendar-bar.status-scheduled { background: var(--color-danger); }
.calendar-bar.status-done { background: var(--color-success); }
.calendar-bar.requested { background: var(--color-accent-dark); }
.calendar-bar.priority { box-shadow: inset 0 0 0 1.5px #fff; }

.calendar-trash {
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1.5px solid var(--color-border);
  background: #fff; color: var(--color-text-muted); display: flex; align-items: center; justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
}
.calendar-trash svg { width: 18px; height: 18px; }
.calendar-trash.dragover { border-color: var(--color-danger); background: var(--color-danger-bg); color: var(--color-danger); }
.calendar-trash-confirm {
  display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm);
  background: var(--color-danger-bg); border: 1px solid #f3c9c3; border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.calendar-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; margin-bottom: var(--space-3); font-size: var(--fs-xs); font-weight: 700; color: var(--color-charcoal-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.calendar-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.calendar-legend-dot.requested { background: var(--color-accent-dark); }
.calendar-legend-dot.scheduled { background: var(--color-danger); }
.calendar-legend-dot.done { background: var(--color-success); }

/* ---------- Edit modal ---------- */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(32,36,43,0.55); z-index: 200;
  align-items: flex-start; justify-content: center; padding: var(--space-5); overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: #fff; border-radius: var(--radius-lg); max-width: 640px; width: 100%;
  margin-block: var(--space-7); box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5); border-bottom: 1px solid var(--color-border); }
.modal-head h2 { margin-bottom: 0; font-size: var(--fs-lg); }
.modal-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--color-border); background: #fff; display: flex; align-items: center; justify-content: center; }
.modal-body { padding: var(--space-5); display: grid; gap: var(--space-4); max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: var(--space-5); border-top: 1px solid var(--color-border); display: flex; gap: var(--space-3); justify-content: flex-end; flex-wrap: wrap; }

.loading-note { text-align: center; padding: var(--space-6); color: var(--color-text-muted); }
