/* Copyright (c) 2025-2026 Ioannis Belesiotis. All rights reserved.
   This source code is proprietary and confidential. */
/* ── Redistribute Allocations Modal ─────────────────────────────────────────── */

#redistributeModal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}

#redistributeModal[hidden] {
  display: none;
}

.rdst-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 34, 60, 0.50);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}

.rdst-dialog {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: calc(100vw - 32px);
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.rdst-header {
  position: relative;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.rdst-title {
  margin: 0;
  font-size: var(--font-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

/* ── Body — two panes ───────────────────────────────────────── */

.rdst-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 360px;
}

.rdst-left {
  display: flex;
  flex-direction: column;
  flex: 0 0 44%;
  overflow: hidden;
  padding: 0 12px 12px;
  border-right: 1px solid var(--color-border);
}

.rdst-right {
  display: flex;
  flex-direction: column;
  flex: 0 0 56%;
  overflow: hidden;
  padding: 0 12px 12px;
}

/* ── Pane headers ───────────────────────────────────────────── */

.rdst-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  gap: 8px;
}

.rdst-pane-title {
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.rdst-sel-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.rdst-text-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-accent);
  font-size: var(--font-xs);
  padding: 0;
  line-height: 1;
}

.rdst-text-btn:hover {
  text-decoration: underline;
}

.rdst-sep {
  color: var(--color-text-muted);
  font-size: var(--font-xs);
}

/* ── Task list (left pane) ──────────────────────────────────── */

.rdst-task-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rdst-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
  -webkit-user-select: none; user-select: none;
}

.rdst-task-row:hover {
  background: var(--color-surface-alt);
}

.rdst-task-row input[type="checkbox"] {
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--color-accent);
  width: 14px;
  height: 14px;
}

.rdst-task-key {
  font-size: var(--font-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.rdst-task-title {
  font-size: var(--font-sm);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ── Add-recipient row (right pane header) ──────────────────── */

.rdst-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}

/* Checklist picker button — mirrors .resource-filter-btn */
.rdst-picker-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  font-size: var(--font-xs);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}

.rdst-picker-btn:hover {
  border-color: var(--color-accent);
}

#rdstPickerLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dropdown panel — mirrors .resource-filter-panel */
.rdst-picker-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
}

.rdst-picker-panel.hidden {
  display: none;
}

.rdst-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: var(--font-xs);
  cursor: pointer;
  transition: background 0.1s;
}

.rdst-picker-option:hover {
  background: var(--color-accent-subtle);
}

.rdst-picker-option input[type="checkbox"] {
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

/* ── Recipient list (right pane) ────────────────────────────── */

.rdst-recipient-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}

.rdst-guidance {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  text-align: center;
  padding: 6px 16px;
  margin: 0;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
}

.rdst-empty-hint {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  text-align: center;
  padding: 24px 12px;
  line-height: 1.6;
}

.rdst-empty-hint.compact {
  padding: 8px 4px;
}

/* ── Recipient card ─────────────────────────────────────────── */

.rdst-recipient-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.rdst-recipient-card:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}

/* Highlight all cards when tasks are selected in left pane */
.rdst-has-selection .rdst-recipient-card {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.rdst-card-name {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.rdst-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rdst-remove-recipient {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.rdst-remove-recipient:hover {
  color: var(--color-danger);
}

.rdst-card-hint {
  font-size: var(--font-xs);
  color: var(--color-accent);
  font-style: italic;
  font-weight: var(--font-weight-normal);
}

.rdst-card-empty {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  font-style: italic;
  padding: 2px 0;
}

.rdst-card-tasks {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rdst-assigned-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
}

.rdst-assigned-task-key {
  color: var(--color-text-muted);
  flex-shrink: 0;
  font-weight: var(--font-weight-medium);
}

.rdst-assigned-task-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
}

.rdst-remove-task {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.rdst-remove-task:hover {
  color: var(--color-danger);
}

/* ── Footer ─────────────────────────────────────────────────── */

.rdst-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.rdst-stats {
  flex: 1;
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}
