/* ============================================================
   FumeOffice — Blue Admin Theme
   ============================================================ */

:root {
  --fo-bg:          #f1f5f9;
  --fo-surface:     #ffffff;
  --fo-surface2:    #f8fafc;
  --fo-border:      #e2e8f0;
  --fo-accent:      #2563eb;
  --fo-accent2:     #1d4ed8;
  --fo-text:        #1e293b;
  --fo-muted:       #64748b;
  --fo-green:       #16a34a;
  --fo-blue:        #2563eb;
  --fo-orange:      #ea6c0a;
  --fo-purple:      #9333ea;
  --fo-red:         #dc2626;
  --fo-radius:      8px;
  --fo-radius-lg:   14px;
  --fo-shadow:      0 4px 24px rgba(0,0,0,0.1);
  --fo-transition:  0.2s ease;
}

/* ---- Reset within plugin scope ---- */
#fumeoffice-app *,
.fo-settings-wrap * {
  box-sizing: border-box;
}

/* ============================================================
   APP SHELL
   ============================================================ */
#fumeoffice-app {
  background: var(--fo-bg);
  min-height: 100vh;
  padding: 0;
  margin: -20px -20px 0 -20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--fo-text);
}

/* ---- Top Navigation ---- */
.fo-topnav {
  background: var(--fo-surface);
  border-bottom: 1px solid var(--fo-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 60px;
  position: sticky;
  top: 32px; /* WP admin bar */
  z-index: 100;
}

.fo-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--fo-accent2);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 32px;
  white-space: nowrap;
}

.fo-logo .dashicons {
  color: var(--fo-accent);
  font-size: 22px;
  width: 22px;
  height: 22px;
}

.fo-nav-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}

.fo-nav-tab {
  background: transparent;
  border: none;
  color: var(--fo-muted);
  padding: 8px 18px;
  border-radius: var(--fo-radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--fo-transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fo-nav-tab:hover {
  color: var(--fo-text);
  background: var(--fo-surface2);
}

.fo-nav-tab.active {
  color: var(--fo-accent2);
  background: rgba(37,99,235,0.12);
}

.fo-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.fo-nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.fo-topnav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.fo-settings-link {
  color: var(--fo-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  transition: color var(--fo-transition);
  padding: 0;
}

.fo-settings-link:hover { color: var(--fo-text); }
.fo-settings-link.active { color: var(--fo-accent2); }

/* ---- Page sections ---- */
.fo-page {
  display: none;
  padding: 28px 28px 48px;
  animation: foFadeIn 0.2s ease;
}
.fo-page.active { display: block; }

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

/* ============================================================
   STAT CARDS
   ============================================================ */
.fo-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.fo-stat-card {
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 4px solid transparent;
  transition: transform var(--fo-transition);
}
.fo-stat-card:hover { transform: translateY(-2px); }

.fo-stat-card.green  { border-left-color: var(--fo-green); }
.fo-stat-card.blue   { border-left-color: var(--fo-blue); }
.fo-stat-card.orange { border-left-color: var(--fo-orange); }
.fo-stat-card.red    { border-left-color: var(--fo-red); }

.fo-stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--fo-muted);
}

.fo-stat-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.fo-stat-card.green  .fo-stat-value { color: var(--fo-green); }
.fo-stat-card.blue   .fo-stat-value { color: var(--fo-blue); }
.fo-stat-card.orange .fo-stat-value { color: var(--fo-orange); }
.fo-stat-card.red    .fo-stat-value { color: var(--fo-red); }

.fo-stat-link { cursor: pointer; }

/* Urgent flash — used when jobs are within the deadline window. */
.fo-stat-flash {
  border-color: var(--fo-red);
  border-left-color: var(--fo-red);
  animation: fo-stat-flash 1s ease-in-out infinite alternate;
}
.fo-stat-flash .fo-stat-label,
.fo-stat-flash .fo-stat-value {
  color: #ffffff !important;
}
@keyframes fo-stat-flash {
  from { background: rgba(220,38,38,0.85); }
  to   { background: rgba(220,38,38,1); }
}

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.fo-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.fo-dashboard-col { display: flex; flex-direction: column; gap: 20px; }

.fo-card {
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius-lg);
  padding: 20px 24px;
}

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

.fo-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fo-text);
}

.fo-view-all {
  font-size: 12px;
  color: var(--fo-accent);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color var(--fo-transition);
}
.fo-view-all:hover { color: var(--fo-accent2); }

/* ============================================================
   TABLES
   ============================================================ */
.fo-table-wrap {
  overflow-x: auto;
}

.fo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fo-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--fo-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--fo-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.fo-table th:hover { color: var(--fo-text); }
.fo-table th .sort-icon { margin-left: 4px; opacity: 0.5; }
.fo-table th.sorted .sort-icon { opacity: 1; color: var(--fo-accent); }

.fo-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(46,50,88,0.5);
  vertical-align: middle;
  color: var(--fo-text);
}

.fo-table tr:last-child td { border-bottom: none; }

.fo-table tbody tr {
  cursor: pointer;
  transition: background var(--fo-transition);
}
.fo-table tbody tr:hover { background: var(--fo-surface2); }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.fo-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.fo-badge-scheduled   { background: rgba(59,130,246,0.15);  color: var(--fo-blue);   border: 1px solid rgba(59,130,246,0.3); }
.fo-badge-inprogress  { background: rgba(249,115,22,0.15);  color: var(--fo-orange); border: 1px solid rgba(249,115,22,0.3); }
.fo-badge-completed   { background: rgba(34,197,94,0.15);   color: var(--fo-green);  border: 1px solid rgba(34,197,94,0.3); }
.fo-badge-rescheduled { background: rgba(168,85,247,0.15);  color: var(--fo-purple); border: 1px solid rgba(168,85,247,0.3); }
.fo-badge-cancelled   { background: rgba(100,116,139,0.15); color: #475569;          border: 1px solid rgba(100,116,139,0.3); }
.fo-badge-pending     { background: rgba(239,68,68,0.15);   color: var(--fo-red);    border: 1px solid rgba(239,68,68,0.3); }

/* ============================================================
   BULK ACTION BAR
   ============================================================ */
.fo-bulk-bar {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: var(--fo-radius);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.fo-bulk-bar.visible { display: flex; }

.fo-bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--fo-accent2);
  white-space: nowrap;
}

.fo-bulk-select {
  padding: 6px 10px;
  font-size: 13px;
}

.fo-bulk-msg {
  font-size: 13px;
}
.fo-bulk-ok    { color: var(--fo-green); }
.fo-bulk-error { color: var(--fo-red); }

/* Status icon cells (Gas / AG / Notice columns) */
.fo-col-icon {
  width: 52px !important;
  text-align: center !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.fo-status-icon {
  font-size: 18px !important;
  width: 18px !important;
  height: 18px !important;
  line-height: 18px !important;
  vertical-align: middle;
}

.fo-status-ok { color: var(--fo-green); }
.fo-status-no { color: var(--fo-red); }

/* Checkbox column */
.fo-check-col {
  width: 36px !important;
  padding-left: 14px !important;
  cursor: default;
}

/* ============================================================
   FUMIGATIONS PAGE
   ============================================================ */
.fo-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.fo-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--fo-text);
  margin: 0;
}

.fo-page-header input,
.fo-page-header select {
  line-height: normal;
}

.fo-search-wrap {
  position: relative;
  flex: 1;
  min-width: 360px;
}

.fo-search-wrap .dashicons {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fo-muted);
  pointer-events: none;
  font-size: 16px !important;
  width: 16px !important;
  height: 16px !important;
  line-height: 16px !important;
}

.fo-search {
  width: 100%;
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  color: var(--fo-text);
  padding: 7px 32px 7px 38px !important;
  font-size: 13px;
  outline: none;
  transition: border-color var(--fo-transition);
}
.fo-search:focus { border-color: var(--fo-accent); }
.fo-search::placeholder { color: var(--fo-muted); }

.fo-search-clear {
  display: none;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--fo-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--fo-transition), color var(--fo-transition);
}
.fo-search-clear.visible { display: inline-flex; align-items: center; justify-content: center; }
.fo-search-clear:hover   { background: var(--fo-bg); color: var(--fo-text); }

.fo-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Keep filter bar buttons the same height as the search input and select */
.fo-filters .fo-btn {
  padding: 7px 12px;
  font-size: 13px;
}

.fo-select {
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  color: var(--fo-text);
  padding: 7px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--fo-transition);
}
.fo-select:focus { border-color: var(--fo-accent); }

.fo-date-input {
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  color: var(--fo-text);
  padding: 7px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--fo-transition);
  color-scheme: light;
}
.fo-date-input:focus { border-color: var(--fo-accent); }

/* ============================================================
   BUTTONS
   ============================================================ */
.fo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--fo-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--fo-transition);
  white-space: nowrap;
}

.fo-btn-primary {
  background: var(--fo-accent);
  color: #fff;
}
.fo-btn-primary:hover { background: #1e40af; }

.fo-btn-secondary {
  background: var(--fo-surface2);
  color: var(--fo-text);
  border: 1px solid var(--fo-border);
}
.fo-btn-secondary:hover { background: var(--fo-border); }

.fo-btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--fo-red);
  border: 1px solid rgba(239,68,68,0.3);
}
.fo-btn-danger:hover { background: var(--fo-red); color: #fff; }

.fo-btn-warning {
  background: rgba(234,108,10,0.12);
  color: var(--fo-orange);
  border: 1px solid rgba(234,108,10,0.3);
}
.fo-btn-warning:hover { background: var(--fo-orange); color: #fff; }

.fo-btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.fo-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px 4px;
}

.fo-page-btn {
  background: var(--fo-surface2);
  border: 1px solid var(--fo-border);
  color: var(--fo-muted);
  padding: 5px 11px;
  border-radius: var(--fo-radius);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--fo-transition);
}
.fo-page-btn:hover:not(:disabled) { color: var(--fo-text); border-color: var(--fo-accent); }
.fo-page-btn.active { background: var(--fo-accent); color: #fff; border-color: var(--fo-accent); }
.fo-page-btn:disabled { opacity: 0.4; cursor: default; }

.fo-per-page {
  display: flex;
  align-items: center;
}

.fo-per-page-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fo-muted);
}

.fo-per-page-select {
  padding: 4px 8px;
  font-size: 13px;
}

.fo-page-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fo-page-info {
  font-size: 13px;
  color: var(--fo-muted);
  padding: 0 4px;
}

/* ============================================================
   DATE FILTER DROPDOWN
   ============================================================ */
.fo-date-filter-wrap {
  position: relative;
}

.fo-date-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fo-date-filter-btn .dashicons {
  font-size: 14px !important;
  width: 14px !important;
  height: 14px !important;
  line-height: 14px !important;
}

.fo-date-filter-btn.fo-date-filter-active {
  background: var(--fo-accent);
  color: #fff;
  border-color: var(--fo-accent);
}

.fo-date-preset-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 9999;
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  box-shadow: var(--fo-shadow);
  min-width: 220px;
  padding: 8px 0 0;
}

.fo-date-preset-panel.fo-panel-open {
  display: block;
}

.fo-preset-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fo-preset-item {
  padding: 9px 16px;
  font-size: 13px;
  color: var(--fo-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--fo-transition);
}

.fo-preset-item::before {
  content: '';
  display: inline-block;
  width: 14px;
  flex-shrink: 0;
}

.fo-preset-item:hover {
  background: var(--fo-surface2);
}

.fo-preset-item.fo-preset-active {
  color: var(--fo-accent);
  font-weight: 600;
}

.fo-preset-item.fo-preset-active::before {
  content: '\2713';
  font-size: 13px;
}

.fo-custom-range {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--fo-border);
}

.fo-custom-date-input {
  width: 100%;
}

.fo-preset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--fo-border);
  margin-top: 4px;
}

/* ============================================================
   MODAL
   ============================================================ */
.fo-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.fo-modal-overlay.open { display: flex; }

.fo-modal {
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius-lg);
  box-shadow: var(--fo-shadow);
  width: 92vw;
  max-width: 920px;
  height: 95vh;
  display: flex;
  flex-direction: column;
  animation: foSlideUp 0.22s ease;
}

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

.fo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--fo-border);
  flex-shrink: 0;
  position: relative;
}

.fo-modal-subtitle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--fo-muted);
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
}

/* ---- Modal loading overlay ---- */
#fo-modal-loader {
  position: absolute;
  inset: 0;
  background: var(--fo-surface);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 0 0 var(--fo-radius-lg) var(--fo-radius-lg);
}

.fo-modal-loader-bar {
  width: 220px;
  height: 4px;
  background: var(--fo-border);
  border-radius: 99px;
  overflow: hidden;
}

.fo-modal-loader-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--fo-accent), var(--fo-accent2));
  animation: foLoaderSlide 1.2s ease-in-out infinite;
  width: 40%;
}

@keyframes foLoaderSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(650%); }
}

.fo-modal-loader-text {
  color: var(--fo-muted);
  font-size: 13px;
}

.fo-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--fo-text);
}

.fo-modal-close {
  background: none;
  border: none;
  color: var(--fo-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--fo-transition);
}
.fo-modal-close:hover { color: var(--fo-text); background: var(--fo-surface2); }

/* ---- Tabs ---- */
.fo-tab-bar {
  display: flex;
  gap: 2px;
  padding: 12px 24px 0;
  border-bottom: 1px solid var(--fo-border);
  flex-shrink: 0;
}

.fo-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fo-muted);
  padding: 8px 16px 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fo-transition);
  margin-bottom: -1px;
}
.fo-tab-btn:hover { color: var(--fo-text); }
.fo-tab-btn.active { color: var(--fo-accent2); border-bottom-color: var(--fo-accent); }

.fo-tab-pane { display: none; }
.fo-tab-pane.active { display: block; }

/* ---- Modal body / form ---- */
.fo-modal-body {
  overflow-y: auto;
  padding: 20px 24px;
  flex: 1;
  position: relative;
}

.fo-form-row {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.fo-form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.fo-form-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.fo-form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.fo-form-row.cols-1 { grid-template-columns: 1fr; }

.fo-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.fo-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fo-muted);
}

.fo-input,
.fo-select-field,
.fo-textarea {
  background: var(--fo-bg);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  color: var(--fo-text);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color var(--fo-transition);
  color-scheme: light;
}

.fo-input:focus,
.fo-select-field:focus,
.fo-textarea:focus {
  border-color: var(--fo-accent);
}

.fo-input[readonly],
.fo-select-field[disabled] {
  opacity: 0.6;
  cursor: default;
}

.fo-textarea {
  min-height: 90px;
  resize: vertical;
  font-family: inherit;
}

/* ---- Mapbox address autofill dropdown ---- */
.fo-address-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  box-shadow: var(--fo-shadow);
  z-index: 999;
  overflow: hidden;
}

.fo-address-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--fo-border);
  transition: background var(--fo-transition);
}
.fo-address-option:last-child { border-bottom: none; }
.fo-address-option:hover { background: var(--fo-bg); }

.fo-address-opt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fo-text);
}

.fo-address-opt-sub {
  font-size: 11px;
  color: var(--fo-muted);
}

/* ---- Company / Crew autocomplete ---- */
.fo-ac-field {
  position: relative;
}

.fo-ac-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  box-shadow: var(--fo-shadow);
  z-index: 1000;
  overflow: hidden;
  max-height: 200px;
  overflow-y: auto;
}

.fo-ac-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--fo-text);
  border-bottom: 1px solid var(--fo-border);
  transition: background var(--fo-transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.fo-ac-option:last-child { border-bottom: none; }
.fo-ac-option:hover { background: var(--fo-bg); }

.fo-ac-add {
  color: var(--fo-accent2);
  font-weight: 500;
}
.fo-ac-add .dashicons {
  font-size: 14px !important;
  width: 14px !important;
  height: 14px !important;
}

/* ---- Fumigations search typeahead dropdown ---- */
.fo-search-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  box-shadow: var(--fo-shadow);
  z-index: 1000;
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
  min-width: 360px;
}

.fo-search-option {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  grid-template-areas:
    "date    company  badge"
    "date    addr     badge";
  column-gap: 10px;
  row-gap: 2px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--fo-border);
  transition: background var(--fo-transition);
  font-size: 13px;
}
.fo-search-option:last-child { border-bottom: none; }
.fo-search-option:hover      { background: var(--fo-bg); }

.fo-search-date {
  grid-area: date;
  align-self: center;
  color: var(--fo-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fo-search-company {
  grid-area: company;
  color: var(--fo-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fo-search-addr {
  grid-area: addr;
  color: var(--fo-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fo-search-badge {
  grid-area: badge;
  align-self: center;
  white-space: nowrap;
}

.fo-search-group {
  padding: 6px 12px;
  background: var(--fo-bg);
  color: var(--fo-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--fo-border);
  border-bottom: 1px solid var(--fo-border);
}

.fo-search-empty {
  padding: 10px 12px;
  color: var(--fo-muted);
  font-size: 13px;
  font-style: italic;
}

/* ---- Status cycle button ---- */
.fo-status-cycle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  cursor: pointer;
  width: 100%;
  transition: border-color var(--fo-transition);
  text-align: left;
}
.fo-status-cycle-btn:hover { border-color: var(--fo-accent); }

.fo-status-cycle-hint {
  font-size: 11px;
  color: var(--fo-muted);
  margin-left: auto;
}

/* ---- Lock bar ---- */
.fo-lock-bar {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--fo-radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--fo-blue);
  font-size: 13px;
}

.fo-lock-bar .dashicons { flex-shrink: 0; }
.fo-lock-bar-text { flex: 1; }

/* ---- Locked field visual indicator ---- */
.fo-field-locked {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  background: var(--fo-surface2) !important;
}

/* ---- Form section divider ---- */
.fo-form-divider {
  border: none;
  border-top: 1px solid #c7d4e3;
  margin: 6px 0 14px;
}

/* ---- Reschedule banner ---- */
.fo-reschedule-banner {
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: var(--fo-radius);
  padding: 10px 14px;
  color: var(--fo-purple);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.fo-reschedule-banner.visible { display: block; }

/* ---- Notice save warning ---- */
.fo-new-job-notice {
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: var(--fo-radius);
  padding: 12px 16px;
  color: var(--fo-accent2);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

/* ---- PDF upload dropzone ---- */
.fo-upload-dropzone {
  border: 2px dashed var(--fo-border);
  border-radius: var(--fo-radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--fo-transition);
  background: var(--fo-bg);
  position: relative;
  overflow: hidden;
}

.fo-upload-dropzone:hover,
.fo-upload-dropzone.dragging {
  border-color: var(--fo-accent);
  background: rgba(37,99,235,0.05);
}

.fo-upload-icon {
  font-size: 40px !important;
  width: 40px !important;
  height: 40px !important;
  color: var(--fo-muted);
  display: block;
  margin: 0 auto 12px;
}

.fo-upload-label {
  color: var(--fo-text);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}

.fo-upload-sub {
  color: var(--fo-muted);
  font-size: 13px;
  margin: 0;
}

/* ---- Upload progress ---- */
.fo-upload-progress-wrap {
  padding: 16px 0 8px;
  text-align: center;
}

.fo-upload-progress-track {
  background: var(--fo-border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.fo-upload-progress-fill {
  background: var(--fo-accent);
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
  border-radius: 99px;
}

.fo-upload-status-text {
  color: var(--fo-muted);
  font-size: 13px;
}

/* ---- PDF card (when PDF exists) ---- */
.fo-pdf-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--fo-bg);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.fo-pdf-card-icon .dashicons {
  font-size: 28px;
  width: 28px;
  height: 28px;
  color: var(--fo-accent2);
}

.fo-pdf-card-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fo-pdf-filename {
  font-size: 14px;
  font-weight: 500;
  color: var(--fo-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fo-pdf-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.fo-pdf-embed-wrap {
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  overflow: hidden;
  background: #fff;
}

.fo-pdf-embed-wrap {
  margin-top: 12px;
  margin-bottom: 20px;
}

.fo-pdf-embed-wrap iframe {
  display: block;
  width: 100%;
  height: 520px;
  border: none;
  border-radius: var(--fo-radius);
}

/* ---- Multi-PDF list ---- */
.fo-pdf-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.fo-pdf-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--fo-bg);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
}

.fo-pdf-list-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fo-text);
  min-width: 0;
  overflow: hidden;
}

.fo-pdf-list-info .dashicons {
  color: var(--fo-muted);
  flex-shrink: 0;
}

.fo-pdf-list-info .fo-pdf-filename {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fo-pdf-list-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.fo-pdf-drag-handle {
  font-size: 18px;
  color: var(--fo-muted);
  cursor: grab;
  padding: 0 6px 0 2px;
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}
.fo-pdf-drag-handle:active { cursor: grabbing; }

.fo-pdf-list-item.fo-pdf-dragging {
  opacity: 0.4;
}

.fo-pdf-list-item.fo-pdf-drag-over {
  border-color: var(--fo-accent);
  background: rgba(37,99,235,0.08);
}

.fo-pdf-merge-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* ============================================================
   ACTIVITY TIMELINE
   ============================================================ */
.fo-activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}

.fo-activity-entry {
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: 20px;
}

.fo-activity-entry:last-child { padding-bottom: 0; }

.fo-activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fo-accent);
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
  z-index: 1;
}

.fo-activity-entry:not(:last-child) .fo-activity-dot::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--fo-border);
  /* height extends to next entry */
  height: calc(100% + 20px);
}

.fo-activity-content { flex: 1; min-width: 0; }

.fo-activity-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.fo-activity-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--fo-text);
}

.fo-activity-meta {
  font-size: 11px;
  color: var(--fo-muted);
  white-space: nowrap;
}

/* ---- Diff block ---- */
.fo-diff-block {
  background: var(--fo-bg);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fo-diff-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.fo-diff-field {
  color: var(--fo-muted);
  font-weight: 600;
  min-width: 120px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.fo-diff-from {
  color: var(--fo-red);
  text-decoration: line-through;
  background: rgba(239,68,68,0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.fo-diff-to {
  color: var(--fo-green);
  background: rgba(34,197,94,0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.fo-diff-empty { color: var(--fo-border); }

/* ---- Modal footer ---- */
.fo-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--fo-border);
  flex-shrink: 0;
  gap: 10px;
}

.fo-modal-msg {
  font-size: 13px;
  flex: 1;
}
.fo-modal-msg.success { color: var(--fo-green); }
.fo-modal-msg.error   { color: var(--fo-red); }

.fo-footer-actions { display: flex; gap: 8px; }

/* To-Do modal — full job-modal width but auto height so the
   shorter form doesn't stretch to fill the viewport. */
.fo-todo-modal-sized {
  height: auto;
  max-height: 90vh;
}

/* DB edit modal is smaller than the job modal */
.fo-db-edit-modal {
  height: auto;
  max-height: 90vh;
  width: 540px;
  max-width: 94vw;
}

/* Edit button in DB list */
.fo-db-edit-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--fo-muted) !important;
  cursor: pointer;
  padding: 2px 4px !important;
  min-height: auto !important;
  height: auto !important;
  line-height: 1 !important;
}
.fo-db-edit-btn:hover { color: var(--fo-accent) !important; }
.fo-db-edit-btn .dashicons { font-size: 16px !important; width: 16px !important; height: 16px !important; }

.fo-db-item-actions { display: flex; align-items: center; gap: 2px; }

/* ============================================================
   CHART WRAPPER
   ============================================================ */
.fo-chart-wrap {
  position: relative;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   LOADING / EMPTY STATES
   ============================================================ */
.fo-loading {
  text-align: center;
  color: var(--fo-muted);
  padding: 32px;
  font-size: 13px;
}

.fo-loading::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--fo-border);
  border-top-color: var(--fo-accent);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: foSpin 0.8s linear infinite;
}

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

.fo-empty {
  text-align: center;
  color: var(--fo-muted);
  padding: 32px;
  font-size: 13px;
}

/* ============================================================
   SETTINGS — in-app section
   ============================================================ */
.fo-settings-section {
  margin-bottom: 24px;
  max-width: 720px;
}

.fo-field-hint {
  font-size: 12px;
  color: var(--fo-muted);
  margin-top: 3px;
}

.fo-field-hint code {
  background: var(--fo-bg);
  border: 1px solid var(--fo-border);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 11px;
}

.fo-settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

/* ============================================================
   SETTINGS PAGE (outside the app shell — legacy)
   ============================================================ */
.fo-settings-wrap {
  background: var(--fo-bg);
  min-height: 100vh;
  margin: -20px -20px 0 -20px;
  padding: 32px 32px 64px;
  color: var(--fo-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.fo-settings-wrap h1 {
  color: var(--fo-text);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fo-settings-card {
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius-lg);
  padding: 28px 32px;
  max-width: 640px;
}

.fo-settings-card h2 {
  color: var(--fo-text);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}

.fo-settings-desc {
  color: var(--fo-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.fo-form-table th,
.fo-form-table td {
  padding: 10px 0;
  color: var(--fo-text);
}

.fo-form-table th {
  font-size: 13px;
  font-weight: 600;
  color: var(--fo-muted);
  padding-right: 20px;
  white-space: nowrap;
  vertical-align: top;
  padding-top: 14px;
}

.fo-form-table .regular-text {
  background: var(--fo-bg);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  color: var(--fo-text);
  padding: 8px 12px;
  font-size: 13px;
  width: 360px;
}

.fo-form-table .regular-text:focus {
  border-color: var(--fo-accent);
  outline: none;
}

.fo-form-table .description {
  color: var(--fo-muted);
  font-size: 12px;
  margin-top: 4px;
}

.fo-test-result {
  font-size: 13px;
  font-weight: 500;
}
.fo-test-result.fo-ok   { color: var(--fo-green); }
.fo-test-result.fo-fail { color: var(--fo-red); }

/* ---- Settings page tabs ---- */
.fo-settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--fo-border);
  margin-bottom: 24px;
}

.fo-settings-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fo-muted);
  padding: 10px 22px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fo-transition);
  margin-bottom: -1px;
  font-family: inherit;
}
.fo-settings-tab-btn:hover { color: var(--fo-text); }
.fo-settings-tab-btn.active { color: var(--fo-accent2); border-bottom-color: var(--fo-accent); }

.fo-settings-tab-pane { display: none; }
.fo-settings-tab-pane.active { display: block; }

/* ---- Logs tab ---- */
.fo-log-count {
  font-size: 12px;
  color: var(--fo-muted);
}
.fo-log-entries {
  max-height: 600px;
  overflow-y: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
}
.fo-log-empty {
  color: var(--fo-muted);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 0;
}
.fo-log-entry {
  display: grid;
  grid-template-columns: 72px 200px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--fo-border);
  line-height: 1.4;
}
.fo-log-entry:last-child { border-bottom: none; }
.fo-log-entry.fo-log-error { background: rgba(239,68,68,.05); }
.fo-log-entry.fo-log-warn  { background: rgba(234,179, 8,.05); }
.fo-log-ts     { color: var(--fo-muted); font-size: 11px; white-space: nowrap; }
.fo-log-action { color: var(--fo-accent2); word-break: break-all; }
.fo-log-msg    { color: var(--fo-text); }
.fo-log-error .fo-log-msg { color: var(--fo-red); }
.fo-log-warn  .fo-log-msg { color: #f59e0b; }
.fo-log-info  .fo-log-msg { color: var(--fo-muted); }
.fo-log-detail {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 6px 8px;
  background: var(--fo-surface2);
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 11px;
  color: var(--fo-muted);
  max-height: 150px;
  overflow-y: auto;
}

/* ---- Database settings list ---- */
.fo-db-list {
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  margin-bottom: 16px;
  max-height: 280px;
  overflow-y: auto;
}

.fo-db-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--fo-border);
  font-size: 13px;
  color: var(--fo-text);
  transition: background var(--fo-transition);
}
.fo-db-item:last-child { border-bottom: none; }
.fo-db-item:hover { background: var(--fo-bg); }
.fo-db-item-name { flex: 1; }

.fo-db-delete-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--fo-muted) !important;
  cursor: pointer;
  padding: 2px 4px !important;
  min-height: auto !important;
  height: auto !important;
  line-height: 1 !important;
}
.fo-db-delete-btn:hover { color: var(--fo-red) !important; }
.fo-db-delete-btn .dashicons { font-size: 16px !important; width: 16px !important; height: 16px !important; }

.fo-db-empty {
  padding: 16px;
  color: var(--fo-muted);
  font-size: 13px;
  text-align: center;
}

.fo-db-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fo-db-add-form { margin-top: 12px; }

/* ---- Manage table view (companies / crews full table) ---- */
.fo-manage-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.fo-manage-header .fo-manage-title { flex: 1; }

.fo-manage-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fo-text);
  margin: 0;
}

.fo-manage-table td {
  vertical-align: middle;
  font-size: 13px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fo-manage-table tbody tr { cursor: default; }
.fo-manage-table tbody tr:hover { background: var(--fo-surface2); }

.fo-manage-actions {
  white-space: nowrap;
  width: 72px;
}

.fo-db-add-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.fo-db-add-input {
  background: var(--fo-bg) !important;
  border: 1px solid var(--fo-border) !important;
  border-radius: var(--fo-radius) !important;
  color: var(--fo-text) !important;
  font-size: 13px !important;
  padding: 6px 10px !important;
}
.fo-db-add-input:focus {
  border-color: var(--fo-accent) !important;
  outline: none !important;
}

.fo-db-item-sub {
  display: block;
  font-size: 11px;
  color: var(--fo-muted);
  margin-top: 2px;
}

/* ============================================================
   COMPANY INFO TAB
   ============================================================ */
.fo-ci-card {
  background: var(--fo-bg);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius-lg);
  padding: 20px 24px;
}

.fo-ci-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--fo-text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fo-border);
}

.fo-ci-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--fo-border);
  font-size: 13px;
}
.fo-ci-row:last-child { border-bottom: none; }

.fo-ci-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fo-muted);
  min-width: 140px;
  flex-shrink: 0;
}

.fo-ci-value {
  color: var(--fo-text);
  flex: 1;
  word-break: break-word;
}

/* ---- Export / Import layout ---- */
.fo-settings-io {
  display: flex;
  gap: 0;
  align-items: flex-start;
}

.fo-settings-io-col { flex: 1; }

.fo-settings-io-divider {
  width: 1px;
  background: var(--fo-border);
  align-self: stretch;
  margin: 0 28px;
}

.fo-settings-io-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fo-text);
  margin: 0 0 4px;
}

@media (max-width: 640px) {
  .fo-settings-io { flex-direction: column; }
  .fo-settings-io-divider { width: auto; height: 1px; margin: 20px 0; }
}

/* ============================================================
   FLATPICKR LIGHT THEME OVERRIDES
   ============================================================ */
.flatpickr-calendar {
  border: 1px solid var(--fo-border) !important;
  border-radius: var(--fo-radius-lg) !important;
  box-shadow: var(--fo-shadow) !important;
}

.flatpickr-day {
  border-radius: var(--fo-radius) !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--fo-accent) !important;
  border-color: var(--fo-accent) !important;
  color: #fff !important;
}

.flatpickr-day.today {
  border-color: var(--fo-accent) !important;
}

.flatpickr-day.today.selected {
  color: #fff !important;
}

/* Input styling when flatpickr is active */
.fo-input.flatpickr-input,
.fo-date-input.flatpickr-input {
  cursor: pointer;
}

/* ============================================================
   NOTICE OVERRIDES
   ============================================================ */
.fo-settings-wrap .notice {
  background: var(--fo-surface);
  border-left-color: var(--fo-accent);
  color: var(--fo-text);
  border-radius: var(--fo-radius);
  margin-bottom: 16px;
}

.fo-settings-notice {
  padding: 10px 16px;
  border-radius: var(--fo-radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  border-left: 4px solid transparent;
}
.fo-settings-notice-success {
  background: rgba(22, 163, 74, 0.12);
  border-left-color: var(--fo-green);
  color: var(--fo-green);
}
.fo-settings-notice-error {
  background: rgba(220, 38, 38, 0.12);
  border-left-color: var(--fo-red);
  color: var(--fo-red);
}
.fo-settings-notice-warning {
  background: rgba(234, 108, 10, 0.12);
  border-left-color: var(--fo-orange);
  color: var(--fo-orange);
}

/* ============================================================
   FULLSCREEN MODE — hide all WP admin chrome on the main app page
   ============================================================ */
.fumeoffice-fullscreen #wpadminbar,
.fumeoffice-fullscreen #adminmenuwrap,
.fumeoffice-fullscreen #adminmenuback,
.fumeoffice-fullscreen #wpfooter {
  display: none !important;
}

/* Remove padding/margin WordPress adds for the admin bar and sidebar */
.fumeoffice-fullscreen html,
.fumeoffice-fullscreen body.wp-admin {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.fumeoffice-fullscreen #wpbody { padding-top: 0 !important; }

.fumeoffice-fullscreen #wpcontent,
.fumeoffice-fullscreen #wpbody-content {
  margin-left: 0 !important;
  padding-top: 0 !important;
}

/* App shell fills the viewport edge-to-edge with no negative-margin trick */
.fumeoffice-fullscreen #fumeoffice-app { margin: 0; }

/* Sticky nav no longer needs to clear the 32px admin bar */
.fumeoffice-fullscreen .fo-topnav { top: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .fo-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .fo-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .fo-stat-grid { grid-template-columns: 1fr; }
  .fo-form-row.cols-3,
  .fo-form-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .fo-modal { width: 98vw; max-height: 95vh; }
  .fo-page { padding: 16px 14px; }
  .fo-topnav { padding: 0 12px; }
  .fo-logo span:last-child { display: none; }
}

@media (max-width: 480px) {
  .fo-form-row.cols-3,
  .fo-form-row.cols-2,
  .fo-form-row.cols-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   GAS COMPANY PAGE — status badges
   ============================================================ */
.fo-badge-gas-send    { background: rgba(37,99,235,0.12);  color: var(--fo-blue);   border: 1px solid rgba(37,99,235,0.25); }
.fo-badge-gas-confirm { background: rgba(234,108,10,0.12); color: var(--fo-orange); border: 1px solid rgba(234,108,10,0.25); }
.fo-badge-gas-cancel  { background: rgba(220,38,38,0.12);  color: var(--fo-red);    border: 1px solid rgba(220,38,38,0.25); }
.fo-badge-gas-cxl     { background: rgba(147,51,234,0.12); color: var(--fo-purple); border: 1px solid rgba(147,51,234,0.25); }
.fo-badge-ag-notsent  { background: rgba(234,108,10,0.12); color: var(--fo-orange); border: 1px solid rgba(234,108,10,0.25); }

/* Highlight checked rows on Fumigations / Gas / AG tables. */
#fo-jobs-body tr:has(.fo-row-check:checked),
#fo-gas-body  tr:has(.fo-row-check:checked),
#fo-ag-body   tr:has(.fo-row-check:checked) {
  background: rgba(37,99,235,0.10);
}
#fo-jobs-body tr:has(.fo-row-check:checked):hover,
#fo-gas-body  tr:has(.fo-row-check:checked):hover,
#fo-ag-body   tr:has(.fo-row-check:checked):hover {
  background: rgba(37,99,235,0.16);
}

.fo-bulk-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--fo-muted);
}

/* ============================================================
   SCHEDULE OVERVIEW
   ============================================================ */
.fo-schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;
}

.fo-schedule-col {
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  overflow: hidden;
}

.fo-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fo-schedule-table thead th {
  background: var(--fo-surface2);
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: var(--fo-text);
  border-bottom: 1px solid var(--fo-border);
  white-space: nowrap;
}
.fo-schedule-table thead th:first-child { width: 40%; }
.fo-schedule-table thead th:nth-child(2),
.fo-schedule-table thead th:nth-child(3) { text-align: center; }

.fo-schedule-table td {
  padding: 6px 10px;
  border-top: 1px solid rgba(0,0,0,0.04);
  white-space: nowrap;
}

.fo-schedule-row { cursor: pointer; }
.fo-schedule-row:hover { filter: brightness(0.96); }

.fo-schedule-date   { font-weight: 600; }
.fo-schedule-num    { text-align: center; font-variant-numeric: tabular-nums; }
.fo-schedule-status { font-weight: 700; }

.fo-bg-avail  { background: rgba(34,197,94,0.20);  color: #14532d; }
.fo-bg-low    { background: rgba(234,179,8,0.30);  color: #713f12; }
.fo-bg-booked { background: rgba(220,38,38,0.85);  color: #ffffff; }
.fo-bg-past   { background: rgba(100,116,139,0.20); color: #334155; }

.fo-schedule-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--fo-muted);
  flex-wrap: wrap;
}
.fo-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .fo-schedule-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   TO-DO type pills
   ============================================================ */
.fo-todo-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.fo-todo-type-measure   { background: rgba(34,197,94,0.16);  color: #166534; border: 1px solid rgba(34,197,94,0.35); }
.fo-todo-type-appt      { background: rgba(234,179,8,0.20);  color: #854d0e; border: 1px solid rgba(234,179,8,0.40); }
.fo-todo-type-complaint { background: rgba(220,38,38,0.85);  color: #ffffff; border: 1px solid rgba(220,38,38,1); }
.fo-todo-type-general   { background: rgba(37,99,235,0.16);  color: #1d4ed8; border: 1px solid rgba(37,99,235,0.35); }

/* AG queue — past-due rows are highlighted red so overdue notices
   stand out when the page loads. */
#fo-ag-body tr.fo-row-past-due,
#fo-ag-body tr.fo-row-past-due:hover {
  background: rgba(220,38,38,0.10);
}
#fo-ag-body tr.fo-row-past-due td { color: var(--fo-red); font-weight: 500; }
#fo-ag-body tr.fo-row-past-due:has(.fo-row-check:checked),
#fo-ag-body tr.fo-row-past-due:has(.fo-row-check:checked):hover {
  background: rgba(220,38,38,0.20);
}

/* ============================================================
   CREW SCHEDULE — Closes / Caps / Opens stacked tables
   ============================================================ */
.fo-cs-card { margin-bottom: 12px; }
/* The card uses padding:0 so the table aligns flush with the edges,
   but the header still needs internal padding so the title doesn't
   sit on top of the card border. */
.fo-cs-card .fo-card-header {
  padding: 12px 16px 8px;
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 8px;
}
.fo-cs-subtitle {
  margin-left: 10px;
  font-size: 12px;
  color: var(--fo-muted);
  font-weight: 400;
}
.fo-cs-date-label { color: var(--fo-text); font-weight: 500; }

/* Compact table — pack rows tightly so as much info fits as possible. */
.fo-cs-table { font-size: 12px; }
.fo-cs-table th {
  padding: 6px 8px;
  font-size: 10px;
  white-space: nowrap;
}
.fo-cs-table td {
  padding: 3px 8px;
  vertical-align: middle;
}
.fo-cs-table tr.fo-cs-row { height: 28px; }
.fo-cs-table .fo-check-col { width: 28px; padding-left: 12px; padding-right: 4px; }

.fo-cs-table .fo-cs-static {
  cursor: pointer;
}
.fo-cs-table tr.fo-cs-row:hover .fo-cs-static {
  color: var(--fo-accent);
}

.fo-cs-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 5px;
  font: inherit;
  font-size: 12px;
  color: var(--fo-text);
  border-radius: 3px;
  box-sizing: border-box;
  line-height: 1.2;
}
.fo-cs-input:focus,
.fo-cs-input:hover {
  background: var(--fo-surface2);
  border-color: var(--fo-border, rgba(255,255,255,0.08));
  outline: none;
}
.fo-cs-input:focus {
  border-color: var(--fo-accent);
}

.fo-cs-table td.fo-cs-saving { background: rgba(234,179,8,0.10); }
.fo-cs-table td.fo-cs-saved  { background: rgba(34,197,94,0.18); transition: background 600ms; }
.fo-cs-table td.fo-cs-error  { background: rgba(220,38,38,0.18); }

.fo-cs-old-crew { color: var(--fo-muted); font-size: 12px; }

/* Crew Schedule: per-cell layout for inputs */
.fo-cs-cell {
  vertical-align: middle;
  position: relative;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}
.fo-cs-cell .fo-cs-input {
  width: 100%;
  box-sizing: border-box;
}

/* Old Crew columns */
.fo-cs-old { color: var(--fo-muted); font-size: 12px; }

/* Highlighted rows — yellow band so selected rows stand out for everyone */
.fo-cs-row-highlight,
.fo-cs-row-highlight:hover {
  background: rgba(234, 179, 8, 0.18) !important;
}
.fo-cs-row-highlight td { font-weight: 500; }

/* Crew autocomplete dropdown anchored inside the cell */
.fo-cs-crew-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 180px;
  overflow-y: auto;
  background: var(--fo-surface);
  border: 1px solid var(--fo-border, rgba(255,255,255,0.12));
  border-top: none;
  border-radius: 0 0 4px 4px;
  display: none;
  box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}
.fo-cs-crew-dropdown .fo-ac-option {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--fo-text);
}
.fo-cs-crew-dropdown .fo-ac-option:hover {
  background: var(--fo-accent);
  color: #fff;
}

/* ============================================================
   SCHEDULE OVERRIDES tab on the job modal
   ============================================================ */
.fo-schedule-overrides-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.fo-schedule-overrides-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--fo-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--fo-border, rgba(255,255,255,0.10));
}
.fo-check-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fo-text);
  margin: 6px 0;
  cursor: pointer;
}

@media (max-width: 720px) {
  .fo-schedule-overrides-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Phase-date PIPELINE STRIP — visible above the modal tabs
   ============================================================ */
.fo-pipeline-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 20px;
  background: var(--fo-surface2, rgba(255,255,255,0.03));
  border-top: 1px solid var(--fo-border, rgba(255,255,255,0.08));
  border-bottom: 1px solid var(--fo-border, rgba(255,255,255,0.08));
  font-size: 12px;
  flex-wrap: wrap;
}
.fo-pipeline-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fo-pipeline-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--fo-muted);
  font-size: 10px;
}
.fo-pipeline-date {
  color: var(--fo-text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.fo-pipeline-arrow {
  color: var(--fo-muted);
}
