/**
 * WC Job Tracker — Frontend Styles
 *
 * Standalone stylesheet for the public-facing calendar page.
 * No wp-admin CSS dependencies — works inside any theme.
 *
 * Brand colours:
 *   Navy:   #1a2a3a  (primary dark)
 *   Orange: #f07622  (accent / CTA)
 *   White:  #ffffff
 *   Light:  #f4f6f8  (page background tint)
 *
 * Naming: all selectors use .wc-jf- (wc-job-frontend) prefix to avoid
 * collisions with admin styles (.wc-job-) or theme styles.
 */

/* ── Reset helpers scoped to our wrapper ───────────────────────────────── */

.wc-job-frontend-wrap *,
.wc-jf-modal-overlay * {
  box-sizing: border-box;
}

/* ── Overall page wrapper ──────────────────────────────────────────────── */

.wc-job-frontend-wrap {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
               Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #2c3e50;
}

/* ── Header ────────────────────────────────────────────────────────────── */

.wc-job-frontend-header {
  margin-bottom: 20px;
}

.wc-jf-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 700;
  color: #1a2a3a;
  margin: 0 0 4px;
  line-height: 1.2;
}

.wc-jf-title-icon {
  width: 28px;
  height: 28px;
  stroke: #f07622;
  flex-shrink: 0;
}

/* ── Button system (no wp-admin .button dependency) ────────────────────── */

.wc-jf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  min-height: 44px; /* WCAG touch target */
  white-space: nowrap;
}

.wc-jf-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
}

.wc-jf-btn:disabled,
.wc-jf-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Primary — orange */
.wc-jf-btn-primary {
  background: #f07622;
  color: #fff;
  box-shadow: 0 2px 6px rgba(240, 118, 34, 0.35);
}
.wc-jf-btn-primary:hover:not(:disabled) {
  background: #d9651a;
  box-shadow: 0 3px 10px rgba(240, 118, 34, 0.45);
  color: #fff;
  text-decoration: none;
}

/* Secondary — navy outline */
.wc-jf-btn-secondary {
  background: transparent;
  color: #1a2a3a;
  border: 2px solid #1a2a3a;
}
.wc-jf-btn-secondary:hover:not(:disabled) {
  background: #1a2a3a;
  color: #fff;
  text-decoration: none;
}

/* Ghost — light grey */
.wc-jf-btn-ghost {
  background: #eceff1;
  color: #546e7a;
  border: 1px solid #cfd8dc;
}
.wc-jf-btn-ghost:hover:not(:disabled) {
  background: #cfd8dc;
  text-decoration: none;
}

/* Danger — red */
.wc-jf-btn-danger {
  background: transparent;
  color: #c0392b;
  border: 2px solid #c0392b;
}
.wc-jf-btn-danger:hover:not(:disabled) {
  background: #c0392b;
  color: #fff;
  text-decoration: none;
}

/* Small variant */
.wc-jf-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 36px;
}

/* ── Toolbar ───────────────────────────────────────────────────────────── */

.wc-jf-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #dce1e7;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.wc-jf-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.wc-jf-filter-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #78909c;
  margin-right: 2px;
}

.wc-jf-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1.5px solid #dce1e7;
  border-radius: 20px;
  background: #f4f6f8;
  color: #546e7a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.wc-jf-filter-btn:hover {
  border-color: #f07622;
  color: #f07622;
}

.wc-jf-filter-btn.active {
  background: #1a2a3a;
  border-color: #1a2a3a;
  color: #fff;
}

.wc-jf-filter-btn[data-type="all"].active {
  background: #f07622;
  border-color: #f07622;
}

.wc-jf-filter-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wc-jf-toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Calendar container ────────────────────────────────────────────────── */

#wc-job-frontend-calendar {
  background: #fff;
  border: 1px solid #dce1e7;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

/* FullCalendar nav buttons — brand orange */
#wc-job-frontend-calendar .fc-button-primary {
  background-color: #1a2a3a !important;
  border-color: #1a2a3a !important;
  color: #fff !important;
  font-size: 13px !important;
  padding: 6px 12px !important;
  border-radius: 5px !important;
  transition: background 0.15s !important;
}

#wc-job-frontend-calendar .fc-button-primary:hover {
  background-color: #f07622 !important;
  border-color: #f07622 !important;
}

#wc-job-frontend-calendar .fc-button-active {
  background-color: #f07622 !important;
  border-color: #f07622 !important;
}

#wc-job-frontend-calendar .fc-toolbar-title {
  font-size: 19px !important;
  font-weight: 700 !important;
  color: #1a2a3a !important;
}

#wc-job-frontend-calendar .fc-daygrid-event {
  border-radius: 4px;
  border: none;
  padding: 2px 5px;
  cursor: pointer;
}

#wc-job-frontend-calendar .fc-event:hover {
  opacity: 0.88;
}

#wc-job-frontend-calendar .fc-col-header-cell {
  font-size: 12px;
  font-weight: 700;
  color: #78909c;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #f4f6f8;
}

#wc-job-frontend-calendar .fc-day-today {
  background: rgba(240, 118, 34, 0.06) !important;
}

/* List view */
#wc-job-frontend-calendar .fc-list-event:hover td {
  background: #fff8f3;
  cursor: pointer;
}

#wc-job-frontend-calendar .fc-list-day-cushion {
  background: #1a2a3a !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
}

/* ── Event inner (custom render) ───────────────────────────────────────── */

.wc-jf-event-inner {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  white-space: nowrap;
}

.wc-jf-event-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-jf-event-status {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 1px 5px;
  border-radius: 8px;
  color: #fff;
  flex-shrink: 0;
}

/* ── Modal overlay ─────────────────────────────────────────────────────── */

.wc-jf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 28, 40, 0.6);
  z-index: 999999; /* above The7 navigation and any theme headers */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
  padding: 16px;
}

.wc-jf-modal-overlay.wc-jf-modal-open {
  opacity: 1;
}

/* ── Modal box ─────────────────────────────────────────────────────────── */

.wc-jf-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 740px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.22s ease;
  position: relative;
}

.wc-jf-modal-open .wc-jf-modal {
  transform: translateY(0) scale(1);
}

/* ── Modal header ──────────────────────────────────────────────────────── */

.wc-jf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid #eceff1;
  position: sticky;
  top: 0;
  background: #fff;
  border-radius: 12px 12px 0 0;
  z-index: 1;
}

.wc-jf-modal-title-text {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1a2a3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 480px;
}

.wc-jf-modal-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wc-jf-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wc-jf-modal-close {
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: #90a4ae;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.wc-jf-modal-close:hover {
  color: #c0392b;
  background: #fdecea;
}

/* ── Modal body ────────────────────────────────────────────────────────── */

.wc-jf-modal-body {
  padding: 22px;
}

/* ── View mode detail grid ─────────────────────────────────────────────── */

.wc-jf-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}

.wc-jf-detail-item {
  padding: 7px 0;
  border-bottom: 1px solid #f0f2f5;
}

.wc-jf-detail-item label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #90a4ae;
  margin-bottom: 3px;
}

.wc-jf-detail-item span {
  font-size: 14px;
  color: #1a2a3a;
  word-break: break-word;
  line-height: 1.4;
}

.wc-jf-detail-item a {
  color: #f07622;
  text-decoration: none;
}

.wc-jf-detail-item a:hover {
  text-decoration: underline;
}

/* Type / status chips */
.wc-jf-type-chip,
.wc-jf-status-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  color: #fff;
}

/* View action row */
.wc-jf-view-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eceff1;
  flex-wrap: wrap;
}

/* ── Activity log / notes ──────────────────────────────────────────────── */

.wc-jf-activity-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #eceff1;
}

.wc-jf-activity-section h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #78909c;
  margin: 0 0 12px;
}

.wc-jf-note {
  padding: 10px 14px;
  background: #f4f6f8;
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 3px solid #f07622;
}

.wc-jf-note-new {
  animation: wc-jf-note-fadein 0.4s ease;
}

@keyframes wc-jf-note-fadein {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wc-jf-note-meta {
  font-size: 11px;
  font-weight: 700;
  color: #f07622;
  display: block;
  margin-bottom: 4px;
}

.wc-jf-note-text {
  font-size: 13px;
  color: #37474f;
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.wc-jf-no-notes {
  font-size: 13px;
  color: #90a4ae;
  font-style: italic;
  margin: 4px 0;
}

.wc-jf-add-note-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: flex-start;
}

.wc-jf-add-note-form textarea {
  flex: 1;
  resize: vertical;
  min-height: 52px;
  font-size: 13px;
  padding: 8px 12px;
  border: 1.5px solid #dce1e7;
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.wc-jf-add-note-form textarea:focus {
  border-color: #f07622;
  outline: none;
  box-shadow: 0 0 0 3px rgba(240, 118, 34, 0.15);
}

/* ── Edit / Add form ───────────────────────────────────────────────────── */

.wc-jf-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
}

.wc-jf-form-field {
  margin-bottom: 14px;
}

.wc-jf-form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #1a2a3a;
  margin-bottom: 5px;
}

.wc-jf-form-field input,
.wc-jf-form-field select,
.wc-jf-form-field textarea {
  width: 100%;
  font-size: 14px;
  padding: 9px 12px;
  border: 1.5px solid #dce1e7;
  border-radius: 6px;
  background: #fff;
  color: #1a2a3a;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  /* Native date picker works best on mobile with default sizing */
}

.wc-jf-form-field input:focus,
.wc-jf-form-field select:focus,
.wc-jf-form-field textarea:focus {
  border-color: #f07622;
  box-shadow: 0 0 0 3px rgba(240, 118, 34, 0.15);
  outline: none;
}

.wc-jf-form-field select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23546e7a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.wc-jf-form-error {
  margin: 12px 0;
  padding: 10px 16px;
  background: #fdecea;
  border: 1px solid #e57373;
  border-radius: 6px;
  color: #c0392b;
  font-size: 13px;
}

.wc-jf-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid #eceff1;
  flex-wrap: wrap;
}

/* ── Toast notifications ───────────────────────────────────────────────── */

.wc-jf-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 9999999;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  max-width: 340px;
}

.wc-jf-toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.wc-jf-toast-success {
  background: #2ecc71;
}

.wc-jf-toast-error {
  background: #e74c3c;
}

/* ── Login form styling ────────────────────────────────────────────────── */

.wc-job-login-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  min-height: 60vh;
}

.wc-job-login-box {
  background: #fff;
  border: 1px solid #dce1e7;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.wc-job-login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.wc-job-login-logo svg {
  width: 48px;
  height: 48px;
  stroke: #f07622;
}

.wc-job-login-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a2a3a;
  margin: 0 0 6px;
}

.wc-job-login-sub {
  font-size: 14px;
  color: #78909c;
  margin: 0 0 24px;
}

/* Override WP login form styles inside our box */
.wc-job-login-box #loginform {
  margin: 0;
  padding: 0;
  box-shadow: none;
  border: none;
  background: transparent;
}

.wc-job-login-box #loginform label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #1a2a3a;
  margin-bottom: 4px;
  text-align: left;
}

.wc-job-login-box #loginform input[type="text"],
.wc-job-login-box #loginform input[type="password"] {
  width: 100%;
  font-size: 14px;
  padding: 9px 12px;
  border: 1.5px solid #dce1e7;
  border-radius: 6px;
  margin-bottom: 14px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wc-job-login-box #loginform input[type="text"]:focus,
.wc-job-login-box #loginform input[type="password"]:focus {
  border-color: #f07622;
  box-shadow: 0 0 0 3px rgba(240, 118, 34, 0.15);
  outline: none;
}

.wc-job-login-box #loginform .forgetmenot {
  display: none; /* hide "Remember me" on the field-app login */
}

.wc-job-login-box #loginform input[type="submit"],
.wc-job-login-box #loginform .button-primary {
  width: 100%;
  background: #f07622;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  min-height: 48px;
  margin-top: 4px;
}

.wc-job-login-box #loginform input[type="submit"]:hover {
  background: #d9651a;
}

.wc-job-no-access {
  padding: 24px;
  background: #fff8f3;
  border: 1px solid #f07622;
  border-radius: 8px;
  color: #1a2a3a;
  font-size: 15px;
  text-align: center;
}

/* ── Responsive — Tablet (< 1024px) ───────────────────────────────────── */

@media screen and (max-width: 1024px) {
  .wc-job-frontend-wrap {
    padding: 18px 12px 40px;
  }
}

/* ── Responsive — Mobile (< 768px) ────────────────────────────────────── */

@media screen and (max-width: 768px) {
  .wc-jf-title {
    font-size: 20px;
  }

  /* Stack toolbar vertically */
  .wc-jf-toolbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
  }

  /* Filter bar scrolls horizontally on mobile */
  .wc-jf-filter-bar {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none; /* hide scrollbar on Firefox */
  }

  .wc-jf-filter-bar::-webkit-scrollbar {
    display: none; /* hide scrollbar on WebKit */
  }

  .wc-jf-filter-btn {
    flex-shrink: 0;
    font-size: 12px;
    padding: 8px 12px;
  }

  .wc-jf-toolbar-right {
    width: 100%;
  }

  .wc-jf-toolbar-right .wc-jf-btn {
    width: 100%;
    justify-content: center;
  }

  /* Calendar container */
  #wc-job-frontend-calendar {
    padding: 10px 8px;
    border-radius: 8px;
  }

  #wc-job-frontend-calendar .fc-toolbar-title {
    font-size: 15px !important;
  }

  #wc-job-frontend-calendar .fc-toolbar {
    flex-direction: column;
    gap: 10px;
  }

  /* Modal — full screen on mobile for comfort in the field */
  .wc-jf-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .wc-jf-modal {
    max-width: 100%;
    width: 100%;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }

  .wc-jf-modal-open .wc-jf-modal {
    transform: translateY(0);
  }

  /* Detail grid → single column */
  .wc-jf-detail-grid,
  .wc-jf-form-grid {
    grid-template-columns: 1fr;
  }

  .wc-jf-modal-header {
    padding: 14px 16px;
  }

  .wc-jf-modal-title-text {
    font-size: 16px;
    max-width: 240px;
  }

  .wc-jf-modal-body {
    padding: 16px;
  }

  /* Notes form stacks */
  .wc-jf-add-note-form {
    flex-direction: column;
  }

  .wc-jf-add-note-form .wc-jf-btn {
    align-self: flex-end;
  }

  /* Form actions → stack */
  .wc-jf-form-actions {
    flex-direction: column-reverse;
  }

  .wc-jf-form-actions .wc-jf-btn {
    width: 100%;
    justify-content: center;
  }

  /* Bigger touch targets for form fields */
  .wc-jf-form-field input,
  .wc-jf-form-field select,
  .wc-jf-form-field textarea {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 12px;
    min-height: 48px;
  }

  .wc-jf-form-field select {
    min-height: 48px;
  }

  /* Toast — full-width at bottom on mobile */
  .wc-jf-toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    text-align: center;
    max-width: none;
    border-radius: 10px;
  }

  /* View actions wrap nicely */
  .wc-jf-view-actions {
    flex-direction: column;
  }

  .wc-jf-view-actions .wc-jf-btn {
    width: 100%;
    justify-content: center;
  }

  /* Login box */
  .wc-job-login-box {
    padding: 28px 20px;
  }
}

/* ── Responsive — Small mobile (< 480px) ──────────────────────────────── */

@media screen and (max-width: 480px) {
  /* Admin edit link in modal header is not useful on small screens */
  .wc-jf-modal-header-actions .wc-jf-btn-secondary {
    display: none;
  }

  .wc-jf-title {
    font-size: 18px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   ── VIEW SWITCHER ─────────────────────────────────────────────────────────
   ══════════════════════════════════════════════════════════════════════════ */

.wc-jf-view-switch {
  display: flex;
  gap: 2px;
  background: #eceff1;
  border-radius: 8px;
  padding: 3px;
  align-items: center;
}

.wc-jf-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #546e7a;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.wc-jf-view-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
}

.wc-jf-view-btn:hover {
  background: rgba(26, 42, 58, 0.1);
  color: #1a2a3a;
}

.wc-jf-view-btn.active {
  background: #f07622;
  color: #fff;
  box-shadow: 0 1px 4px rgba(240, 118, 34, 0.4);
}

.wc-jf-view-btn.active:hover {
  background: #d9651a;
}

/* ══════════════════════════════════════════════════════════════════════════
   ── KANBAN BOARD ──────────────────────────────────────────────────────────
   ══════════════════════════════════════════════════════════════════════════ */

.wc-jf-kanban {
  width: 100%;
}

.wc-jf-kanban-columns {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
}

/* Hide scrollbar on Webkit but keep scrollability */
.wc-jf-kanban-columns::-webkit-scrollbar {
  height: 6px;
}

.wc-jf-kanban-columns::-webkit-scrollbar-track {
  background: transparent;
}

.wc-jf-kanban-columns::-webkit-scrollbar-thumb {
  background: #dce1e7;
  border-radius: 3px;
}

/* ── Individual column ── */

.wc-jf-kanban-col {
  flex: 1;
  min-width: 220px;
  max-width: 300px;
  background: #f4f6f8;
  border-radius: 10px;
  padding: 0 8px 8px;
  transition: box-shadow 0.15s ease;
}

.wc-jf-kanban-col.drag-over {
  box-shadow: 0 0 0 2px #f07622, 0 4px 16px rgba(240, 118, 34, 0.2);
  background: #fff8f3;
}

/* ── Column header ── */

.wc-jf-kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 10px;
  margin-bottom: 6px;
  border-radius: 8px 8px 0 0;
}

.wc-jf-kanban-col-header h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #1a2a3a;
  margin: 0;
}

.wc-jf-kanban-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #f07622;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 11px;
  line-height: 1;
}

/* ── Card drop zone ── */

.wc-jf-kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px; /* always droppable even when empty */
}

/* ── Job card ── */

.wc-jf-kanban-card {
  background: #fff;
  border: 1px solid #dce1e7;
  border-radius: 8px;
  padding: 10px 12px 10px 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease;
  position: relative;
  user-select: none;
}

.wc-jf-kanban-card::before {
  /* Left accent strip coloured by type — set inline via JS on the card-type pill */
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
}

.wc-jf-kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.wc-jf-kanban-card.dragging {
  opacity: 0.45;
  transform: rotate(1.5deg) scale(0.98);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

/* ── Card internals ── */

.wc-jf-kanban-card-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.wc-jf-kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a2a3a;
  margin: 0 0 4px;
  line-height: 1.35;
  word-break: break-word;
}

.wc-jf-kanban-card-customer {
  font-size: 12px;
  color: #546e7a;
  margin-bottom: 8px;
}

.wc-jf-kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #78909c;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   ── TABLE VIEW ────────────────────────────────────────────────────────────
   ══════════════════════════════════════════════════════════════════════════ */

.wc-jf-table-wrap {
  background: #fff;
  border: 1px solid #dce1e7;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

/* ── Table controls bar ── */

.wc-jf-table-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eceff1;
  flex-wrap: wrap;
  background: #fff;
}

/* ── Search box ── */

.wc-jf-table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  background: #f4f6f8;
  border: 1.5px solid #dce1e7;
  border-radius: 6px;
  padding: 0 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wc-jf-table-search:focus-within {
  border-color: #f07622;
  box-shadow: 0 0 0 3px rgba(240, 118, 34, 0.15);
  background: #fff;
}

.wc-jf-table-search svg {
  width: 16px;
  height: 16px;
  stroke: #90a4ae;
  flex-shrink: 0;
}

.wc-jf-table-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #1a2a3a;
  padding: 10px 0;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

.wc-jf-table-search input::placeholder {
  color: #90a4ae;
}

/* ── Status filter ── */

.wc-jf-table-filters select {
  font-size: 13px;
  padding: 9px 32px 9px 12px;
  border: 1.5px solid #dce1e7;
  border-radius: 6px;
  background: #f4f6f8;
  color: #1a2a3a;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23546e7a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s;
  min-height: 40px;
}

.wc-jf-table-filters select:focus {
  border-color: #f07622;
  box-shadow: 0 0 0 3px rgba(240, 118, 34, 0.15);
  outline: none;
}

/* ── Table container (horizontal scroll on overflow) ── */

.wc-jf-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Table ── */

.wc-jf-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

/* ── Table header ── */

.wc-jf-table thead tr {
  background: #1a2a3a;
}

.wc-jf-table thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  user-select: none;
}

.wc-jf-table thead th:first-child {
  border-radius: 0; /* inside the container already has rounded corners */
}

/* ── Sortable columns ── */

.wc-jf-table th.wc-jf-sortable {
  cursor: pointer;
  transition: background 0.12s;
}

.wc-jf-table th.wc-jf-sortable:hover {
  background: rgba(255, 255, 255, 0.1);
}

.wc-jf-table th.wc-jf-sort-active {
  color: #f07622;
}

.wc-jf-sort-icon {
  font-style: normal;
  font-size: 10px;
  vertical-align: middle;
}

/* ── Table body ── */

.wc-jf-table tbody tr.wc-jf-table-row {
  cursor: pointer;
  border-bottom: 1px solid #eceff1;
  transition: background 0.1s ease;
}

.wc-jf-table tbody tr.wc-jf-table-row:nth-child(even) {
  background: #f8f9fa;
}

.wc-jf-table tbody tr.wc-jf-table-row:hover {
  background: #fff8f3;
}

.wc-jf-table tbody td {
  padding: 11px 14px;
  font-size: 13px;
  color: #2c3e50;
  vertical-align: middle;
  line-height: 1.4;
}

.wc-jf-table-title {
  font-weight: 600;
  color: #1a2a3a !important;
  max-width: 200px;
}

.wc-jf-table-phone {
  color: #78909c;
  font-size: 11px;
}

.wc-jf-table-empty {
  text-align: center;
  color: #90a4ae;
  font-style: italic;
  padding: 32px !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   ── RESPONSIVE — KANBAN & TABLE ───────────────────────────────────────────
   ══════════════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 768px) {
  /* Kanban: columns scroll horizontally; narrower cards */
  .wc-jf-kanban-columns {
    gap: 8px;
  }

  .wc-jf-kanban-col {
    min-width: 200px;
  }

  /* View switch: keep compact even when toolbar stacks */
  .wc-jf-toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  /* Table controls stack vertically */
  .wc-jf-table-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .wc-jf-table-search {
    min-width: unset;
  }

  .wc-jf-table-filters select {
    width: 100%;
  }
}

@media screen and (max-width: 480px) {
  /* On tiny screens, kanban view-btn shrinks slightly */
  .wc-jf-view-btn {
    width: 36px;
    height: 36px;
  }

  .wc-jf-view-btn svg {
    width: 16px;
    height: 16px;
  }

  .wc-jf-kanban-col {
    min-width: 175px;
  }
}
