/* ============================================================
   FusionPM Premium Table System v2
   HEIGHT LOCKED — cells never expand on edit
   ============================================================ */

/* ── Table base — fixed layout required for height lock ── */
.fpm-table,
#units-table,
#tenants-table,
#owners-table,
#workers-table,
#work-orders-table,
.hub-table {
  table-layout: fixed !important;
  border-collapse: collapse !important;
  width: 100%;
}

/* ── Column headers ── */
.fpm-table thead th,
.hub-table thead th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8ea0b8;
  border-bottom: 1px solid rgba(67,112,151,0.25);
  white-space: nowrap;
  user-select: none;
  background: rgba(5,18,35,0.6);
}

/* ── ROW — FIXED HEIGHT, NO EXPANSION ── */
.fpm-tr,
.hub-table tbody tr {
  height: 44px !important;
  max-height: 44px !important;
  border-bottom: 1px solid rgba(67,112,151,0.1);
  transition: background 0.12s;
  overflow: hidden;
}

.fpm-tr:hover,
.hub-table tbody tr:hover {
  background: rgba(255,255,255,0.025);
}



/* Adding row */
.fpm-tr--adding {
  background: rgba(255,192,34,0.04) !important;
  border-bottom: 2px solid rgba(255,192,34,0.2) !important;
  animation: fpmSlideIn 0.15s ease;
}

@keyframes fpmSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Empty state */
.fpm-tr--empty .fpm-td--empty {
  padding: 28px 16px;
  text-align: center;
  color: #8ea0b8;
  font-size: 13px;
  font-style: italic;
}

/* ── CELL — FIXED HEIGHT, NO EXPANSION ── */
.fpm-td,
.hub-table tbody td {
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 !important;
  vertical-align: middle !important;
  border-right: 1px solid rgba(67,112,151,0.08);
  position: relative;
  overflow: hidden !important;
  box-sizing: border-box;
}

.fpm-td:last-child,
.hub-table tbody td:last-child {
  border-right: none;
}

/* ── DISPLAY wrapper — always 44px ── */
.fpm-cell-display {
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 12px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #f6f8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.fpm-cell-display--muted { color: rgba(142,160,184,0.5); }
.fpm-cell-display--gold  { color: #ffc022; font-weight: 700; }

/* Editable hover */
.fpm-td--editable { cursor: text; }
.fpm-td--editable:hover { background: rgba(255,255,255,0.02); }
.fpm-td--editable:hover .fpm-cell-display {
  border-bottom: 1px dashed rgba(255,192,34,0.25);
}

/* Editing state */
.fpm-td--editing {
  background: rgba(255,192,34,0.05) !important;
  box-shadow: inset 0 0 0 1px rgba(255,192,34,0.3);
  overflow: hidden !important;
}

/* ── ALL INPUT TYPES — LOCKED TO 44px ── */
.fpm-cell-input,
.fpm-td input[type="text"],
.fpm-td input[type="email"],
.fpm-td input[type="tel"],
.fpm-td input[type="number"],
.fpm-td select {
  width: 100% !important;
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 12px !important;
  border: none !important;
  background: transparent !important;
  color: #f6f8ff !important;
  font-size: 13px !important;
  font-family: inherit !important;
  outline: none !important;
  box-sizing: border-box !important;
  caret-color: #ffc022;
  display: block !important;
  line-height: 44px !important;
}

.fpm-cell-input::placeholder { color: rgba(142,160,184,0.4); }
.fpm-cell-input:focus { color: #fff !important; }

.fpm-cell-input--number {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-weight: 600 !important;
  color: #ffc022 !important;
}

.fpm-cell-input--search { padding-right: 28px !important; }

/* ── Money ── */
.fpm-money-wrap {
  display: flex !important;
  align-items: center !important;
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 12px !important;
  overflow: hidden !important;
  box-sizing: border-box;
}

.fpm-money-prefix {
  color: #ffc022;
  font-weight: 700;
  font-size: 13px;
  margin-right: 2px;
  flex-shrink: 0;
  line-height: 44px;
}

.fpm-money-wrap input {
  flex: 1;
  padding: 0 !important;
  text-align: right;
  color: #ffc022 !important;
  font-weight: 700 !important;
}

/* ── Date ── */
.fpm-date-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 7px;
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 12px !important;
  position: relative;
  cursor: pointer;
  overflow: hidden !important;
  box-sizing: border-box;
}

.fpm-date-icon {
  font-size: 14px;
  color: #8ea0b8;
  flex-shrink: 0;
  pointer-events: none;
}

.fpm-date-display {
  font-size: 13px;
  color: #f6f8ff;
  pointer-events: none;
  white-space: nowrap;
}

.fpm-date-placeholder { color: rgba(142,160,184,0.4); }

.fpm-date-overlay {
  position: absolute !important;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
}

/* ── Status pill (legacy, kept for compat) ── */
.fpm-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: opacity 0.12s;
  flex-shrink: 0;
}
.fpm-status-pill:hover { opacity: 0.82; }

/* ── Status full-cell (fills entire cell with color) ── */
.fpm-status-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 44px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  cursor: pointer !important;
  user-select: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  transition: opacity 0.1s !important;
}
.fpm-status-cell:hover { opacity: 0.88 !important; }

/* Remove padding from status td so color fills edge-to-edge */
.fpm-td--status,
.fpm-td--view.fpm-td--status {
  padding: 0 !important;
  overflow: hidden !important;
}

/* ── Toggle ── */
.fpm-toggle-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 12px !important;
  cursor: pointer;
  overflow: hidden !important;
  box-sizing: border-box;
  user-select: none;
}

.fpm-toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(67,112,151,0.3);
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.fpm-toggle-track--on {
  background: rgba(255,192,34,0.25);
  border-color: rgba(255,192,34,0.5);
}

.fpm-toggle-thumb {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8ea0b8;
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
}

.fpm-toggle-track--on .fpm-toggle-thumb {
  transform: translateX(16px);
  background: #ffc022;
}

.fpm-toggle-label {
  font-size: 12px;
  font-weight: 600;
}

/* ── Assignee ── */
.fpm-assignee-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 4px;
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 10px !important;
  cursor: pointer;
  overflow: hidden !important;
  box-sizing: border-box;
  min-width: 60px;
}

.fpm-assignee-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #09131f;
  flex-shrink: 0;
  border: 2px solid rgba(5,18,35,0.6);
}

.fpm-assignee-more {
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(67,112,151,0.2);
  color: #8ea0b8;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.fpm-assignee-placeholder {
  color: rgba(142,160,184,0.4);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Searchable ── */
.fpm-searchable-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px !important;
  width: 100%;
  overflow: hidden;
}

.fpm-search-chevron {
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: #8ea0b8;
  pointer-events: none;
  transition: transform 0.18s;
}

/* ── Shared dropdown (always on body, position:fixed) ── */
.fpm-dropdown {
  background: #0c1b2e;
  border: 1px solid rgba(67,112,151,0.45);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.65);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.fpm-dropdown::-webkit-scrollbar { width: 4px; }
.fpm-dropdown::-webkit-scrollbar-thumb {
  background: rgba(67,112,151,0.4);
  border-radius: 4px;
}

.fpm-dropdown-search {
  width: 100% !important;
  height: 36px !important;
  padding: 0 12px !important;
  border: none !important;
  border-bottom: 1px solid rgba(67,112,151,0.2) !important;
  background: rgba(5,18,35,0.8) !important;
  color: #f6f8ff !important;
  font-size: 13px !important;
  outline: none !important;
  font-family: inherit !important;
  box-sizing: border-box;
}

.fpm-dropdown-search::placeholder { color: #4a5e74; }

.fpm-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  border-top: 1px solid rgba(67,112,151,0.07);
  transition: background 0.1s;
}

.fpm-dropdown-item:first-child { border-top: none; }
.fpm-dropdown-item:hover { background: rgba(255,192,34,0.07); }

.fpm-dropdown-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fpm-dropdown-label { font-size: 13px; font-weight: 600; color: #f6f8ff; flex: 1; }
.fpm-dropdown-sub { font-size: 11px; color: #8ea0b8; }
.fpm-dropdown-check { font-size: 14px; color: #ffc022; }

.fpm-dropdown-item--clear {
  color: #f34b45 !important;
  font-size: 12px;
  border-top: 1px solid rgba(243,75,69,0.15) !important;
}

.fpm-dropdown--assignee .fpm-dropdown-item { gap: 10px; }
.fpm-dropdown-empty {
  padding: 14px;
  text-align: center;
  color: #8ea0b8;
  font-size: 13px;
}

/* ── Actions cell ── */
.fpm-td--actions {
  opacity: 1 !important;
  padding: 0 8px !important;
  text-align: right !important;
  white-space: nowrap;
  width: 60px;
  height: 44px !important;
  vertical-align: middle !important;
}

.fpm-row-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #8ea0b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.12s;
}

.fpm-row-delete-btn:hover {
  background: rgba(243,75,69,0.12);
  color: #f34b45;
}

/* ── Add row action buttons ── */
.fpm-td--add-actions {
  opacity: 1 !important;
  padding: 0 10px !important;
  height: 44px !important;
  vertical-align: middle !important;
}

.fpm-add-save-btn {
  height: 28px;
  padding: 0 14px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(180deg, #ffd253, #ffb51c);
  color: #09131f;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  margin-right: 6px;
  font-family: inherit;
  transition: opacity 0.15s;
}

.fpm-add-save-btn:hover { opacity: 0.88; }
.fpm-add-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.fpm-add-cancel-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(67,112,151,0.35);
  background: transparent;
  color: #8ea0b8;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.fpm-add-cancel-btn:hover {
  background: rgba(243,75,69,0.1);
  border-color: rgba(243,75,69,0.3);
  color: #f34b45;
}

/* ── Count cell ── */
.fpm-td--count .fpm-cell-display {
  justify-content: center;
  color: #8ea0b8;
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════════
   HEIGHT LOCK — all rows and cells fixed at 44px, no expansion on edit
   ════════════════════════════════════════════════════════════════════════ */

/* Lock ALL rows */
.fpm-table tr,
#units-table tr,
#tenants-table tr,
#owners-table tr,
#workers-table tr,
#work-orders-table tr,
.hub-table tr {
  height: 44px !important;
  max-height: 44px !important;
  line-height: 44px !important;
}

/* Lock ALL cells */
.fpm-table td,
.fpm-table th,
#units-table td,
#tenants-table td,
#owners-table td,
#workers-table td,
#work-orders-table td,
.hub-table td,
.hub-table th {
  height: 44px !important;
  max-height: 44px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Lock all inputs inside cells */
.fpm-table td input,
.fpm-table td select,
#units-table td input,
#tenants-table td input,
#owners-table td input,
#workers-table td input,
#work-orders-table td input,
.hub-table td input,
.hub-table td select {
  height: 44px !important;
  max-height: 44px !important;
  line-height: 44px !important;
  padding: 0 12px !important;
  border: none !important;
  outline: none !important;
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  background: transparent !important;
}

/* Lock all inner wrappers */
.fpm-cell-display,
.fpm-money-wrap,
.fpm-date-wrap,
.fpm-toggle-wrap,
.fpm-assignee-wrap,
.fpm-searchable-wrap,
.fpm-cell-input,
.itr-cell-wrap {
  height: 44px !important;
  max-height: 44px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* ── Tenant avatar chips ── */
.fpm-avatars-wrap {
  display: flex;
  align-items: center;
  padding: 0 10px;
  height: 44px !important;
  gap: 3px;
  overflow: hidden;
}

.fpm-avatars-empty {
  color: rgba(142,160,184,0.4);
  font-size: 13px;
}

.fpm-avatar-chip {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #09131f;
  border: 2px solid rgba(5,18,35,0.7);
  cursor: default;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.fpm-avatar-chip:hover {
  transform: scale(1.15);
  z-index: 10;
}

.fpm-avatar-chip--more {
  background: rgba(67,112,151,0.3) !important;
  color: #8ea0b8 !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  border: 2px solid rgba(67,112,151,0.3) !important;
}

/* Tooltips are now body-appended via JS (fpm-avatar-tooltip-global) — no CSS needed here */

/* Allow avatars td to overflow so hover effects show */
.fpm-td--avatars {
  overflow: visible !important;
}
.fpm-td--view.fpm-td--avatars {
  overflow: visible !important;
  cursor: pointer !important;
}

/* Native date input rules removed — replaced by FusionCalendar */

/* ════════════════════════════════════════════════════════════════════════
   FUSION CALENDAR — custom iframe-safe date picker
   ════════════════════════════════════════════════════════════════════════ */

.fpm-cal {
  position: fixed;
  background: #0c1b2e;
  border: 1px solid rgba(67,112,151,0.45);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  z-index: 2147483647;
  width: 260px;
  padding: 12px;
  font-family: inherit;
  user-select: none;
}

.fpm-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fpm-cal-title {
  font-size: 13px;
  font-weight: 700;
  color: #f6f8ff;
}

.fpm-cal-nav {
  background: none;
  border: none;
  color: #8ea0b8;
  cursor: pointer;
  font-size: 18px;
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.1s;
}
.fpm-cal-nav:hover {
  background: rgba(67,112,151,0.25);
  color: #f6f8ff;
}

.fpm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.fpm-cal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #8ea0b8;
  padding: 2px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fpm-cal-day {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #f6f8ff;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.fpm-cal-day:hover {
  background: rgba(67,112,151,0.3);
}

.fpm-cal-day--today {
  color: #ffc022;
  font-weight: 800;
}

.fpm-cal-day--selected {
  background: #ffc022 !important;
  color: #09131f !important;
  font-weight: 800;
}

.fpm-cal-day--other {
  color: rgba(142,160,184,0.25);
  cursor: default;
  pointer-events: none;
}

.fpm-cal-clear {
  margin-top: 10px;
  width: 100%;
  height: 28px;
  background: transparent;
  border: 1px solid rgba(67,112,151,0.3);
  border-radius: 6px;
  color: #8ea0b8;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.fpm-cal-clear:hover {
  border-color: rgba(243,75,69,0.4);
  color: #f34b45;
}

/* ── Upload button cell ── */
.fpm-td--upload {
  width: 60px !important;
  min-width: 60px !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.fpm-upload-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(67,112,151,0.35);
  background: rgba(67,112,151,0.1);
  color: #8ea0b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.15s;
}

.fpm-upload-btn:hover {
  background: rgba(255,192,34,0.1);
  border-color: rgba(255,192,34,0.3);
  color: #ffc022;
}

.fpm-upload-has-file {
  color: #37cf8d;
  font-size: 16px;
}

.fpm-upload-no-file {
  color: rgba(142,160,184,0.4);
  font-size: 16px;
}

/* ── Unit with Property subtitle cell ── */
.fpm-uwp-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 12px;
  height: 44px;
  overflow: hidden;
  gap: 1px;
}

.fpm-uwp-label {
  font-size: 13px;
  font-weight: 600;
  color: #f6f8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.fpm-uwp-sub {
  font-size: 10px;
  font-weight: 500;
  color: #8ea0b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
