/* =============================================================
   IIHR Staff Order — drag-and-drop admin page
   ============================================================= */

.iihr-staff-order-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* Header */
.iihr-staff-order-header {
  margin-bottom: 20px;
}
.iihr-staff-order-title {
  font-size: 22px;
  font-weight: 700;
  color: #16650a;
  margin: 0 0 6px;
}
.iihr-staff-order-title .fa {
  margin-right: 8px;
  opacity: 0.7;
}
.iihr-staff-order-subtitle {
  font-size: 13px;
  color: #555;
  margin: 0;
}

/* Toolbar: save button + status + back */
.iihr-staff-order-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.iihr-back-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #115100;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s;
}
.iihr-back-btn:hover {
  background: #1c6b2a;
}

.iihr-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 22px;
  background: #16650a;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.iihr-save-btn:hover  { background: #0f4a07; }
.iihr-save-btn:active { background: #0a3505; }
.iihr-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.iihr-save-btn--dirty {
  background: #d4880a;
  box-shadow: 0 0 0 3px rgba(212,136,10,0.25);
}
.iihr-save-btn--dirty:hover { background: #b37208; }
.iihr-save-btn--saving { opacity: 0.7; }

/* Status bar */
.iihr-staff-order-status {
  min-height: 22px;
  font-size: 13px;
  font-weight: 600;
}
.iihr-order-status--ok    { color: #16650a; }
.iihr-order-status--error { color: #c0392b; }

/* Division rows */
.iihr-order-division-row {
  background: #fff;
  border: 1px solid #cfe0cf;
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}

.iihr-order-div-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: #eaf4ea;
  border-bottom: 1px solid #cfe0cf;
  cursor: pointer;
  user-select: none;
}
.iihr-order-div-header:hover {
  background: #d8edda;
}

/* Collapse arrow */
.iihr-div-arrow {
  font-size: 11px;
  color: #7a9a7a;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.iihr-order-div-header[aria-expanded="true"] .iihr-div-arrow {
  transform: rotate(180deg);
}

/* Collapsed member list */
.iihr-order-member-list.iihr-members-collapsed {
  display: none;
}

.iihr-order-division-label {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: #145d01;
}

.iihr-order-count {
  font-size: 12px;
  color: #7a9a7a;
}

/* Member list */
.iihr-order-member-list {
  list-style: none;
  margin: 0;
  padding: 4px 0 4px 38px;
  min-height: 32px;
}

.iihr-order-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 0;
  border-bottom: 1px solid #f0f7f0;
  background: #fff;
  transition: background 0.12s;
}
.iihr-order-member-row:last-child { border-bottom: none; }
.iihr-order-member-row:hover { background: #f5fbf5; }

.iihr-order-member-label {
  font-size: 13px;
  color: #333;
}

.iihr-order-member-desig {
  font-size: 12px;
  color: #888;
  font-style: italic;
  margin-left: 4px;
}

/* Drag handles */
.iihr-order-handle {
  font-size: 16px;
  color: #b0c8b0;
  cursor: grab;
  padding: 0 2px;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}
.iihr-order-handle:active { cursor: grabbing; }
.iihr-division-handle {
  font-size: 20px;
  color: #5a9a5a;
}
.iihr-order-div-header:hover .iihr-division-handle,
.iihr-order-member-row:hover .iihr-member-handle {
  color: #16650a;
}

/* SortableJS feedback classes */
.iihr-sortable-ghost {
  opacity: 0.3;
  background: #d4edd4 !important;
  border: 2px dashed #16650a !important;
  border-radius: 4px;
}
.iihr-sortable-chosen {
  box-shadow: 0 4px 16px rgba(22,101,10,0.18);
  border-color: #16650a !important;
}
.iihr-sortable-drag { opacity: 0.92; }

/* Success popup */
.iihr-save-popup {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.iihr-save-popup--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.iihr-save-popup-inner {
  background: #115100;
  color: #fff;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 8px;
}
.iihr-save-popup-inner .fa-check-circle {
  font-size: 20px;
  color: #8bc34a;
}

@media (max-width: 600px) {
  .iihr-staff-order-wrap { padding: 0 8px 30px; }
  .iihr-order-member-list { padding-left: 18px; }
  .iihr-order-div-header { padding: 9px 12px; }
}
