/* ── PALLETS ROLLCALL CSS ── build 1001
   Styles for Crew, Cast, DOOD, Contacts, and Call Sheet tabs.
   Depends on: base.css
   ─────────────────────────────────────────────────────────── */

/* ── MODULE SHELL ── */
.rollcall-module {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: var(--ws-bg);
}

/* ── TAB BAR ── */
.rc-tab-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--ws-border);
  background: var(--ws-surface);
  flex-shrink: 0;
  height: 44px;
}

.rc-tab {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-on-ws-2);
  padding: 0 1rem;
  height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.rc-tab:hover  { color: var(--text-on-ws); }
.rc-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }

.rc-tab-spacer { flex: 1; }

.rc-tab-action {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-on-ws-2);
  background: none;
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.rc-tab-action:hover { border-color: var(--accent); color: var(--accent-text); }
.rc-tab-action.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.rc-tab-action.accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ── TAB PANELS ── */
.rc-panel {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
}
.rc-panel.active { display: flex; }

/* ── PANEL SCROLL ── */
.rc-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* ── EMPTY STATE ── */
.rc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 0.6rem;
  padding: 3rem;
}
.rc-empty-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-on-ws);
  opacity: 0.35;
}
.rc-empty-sub {
  font-size: 12px;
  color: var(--text-on-ws-2);
  text-align: center;
  max-width: 280px;
  line-height: 1.6;
}

/* ── DEPARTMENT SECTION ── */
.rc-dept-section {
  margin-bottom: 2rem;
}

.rc-dept-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rc-dept-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-on-ws-2);
}

.rc-dept-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-on-ws-2);
  opacity: 0.6;
}

.rc-dept-line {
  flex: 1;
  height: 1px;
  background: var(--ws-border);
}

/* ── PERSON CARD ── */
.rc-person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.rc-person-card {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.rc-person-card:hover {
  border-color: rgba(240, 95, 0, 0.3);
  box-shadow: 0 2px 8px rgba(26,23,20,0.06);
}

.rc-person-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.rc-person-info {
  flex: 1;
  min-width: 0;
}

.rc-person-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-on-ws);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-person-nickname {
  font-size: 11px;
  color: var(--text-on-ws-2);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-person-role {
  font-size: 11px;
  color: var(--text-on-ws-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.rc-person-status {
  flex-shrink: 0;
}

.rc-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ws-border);
}
.rc-status-dot.active  { background: var(--success); }
.rc-status-dot.wrapped { background: var(--text-on-ws-2); }
.rc-status-dot.hold    { background: var(--warning); }

/* App user indicator on card */
.rc-person-user-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 1px 5px;
  flex-shrink: 0;
}

/* ── CAST TAB SPECIFICS ── */
.rc-cast-number {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-on-ws-2);
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.rc-cast-character {
  font-size: 11px;
  color: var(--accent-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-cast-status {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
}
.rc-cast-status.confirmed  { background: rgba(46,125,79,0.12); color: #2e7d4f; }
.rc-cast-status.offer      { background: rgba(212,133,10,0.12); color: #d4850a; }
.rc-cast-status.hold       { background: rgba(26,23,20,0.07);  color: var(--text-on-ws-2); }
.rc-cast-status.released   { background: rgba(192,57,43,0.1);  color: var(--danger); }
.rc-cast-status.negotiating { background: rgba(240,95,0,0.1);  color: var(--accent-text); }

/* ── CONTACTS TAB ── */
.rc-contacts-search {
  padding: 1rem 1.5rem 0;
  flex-shrink: 0;
}

.rc-search-input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-sm);
  background: var(--ws-surface);
  color: var(--text-on-ws);
  outline: none;
  transition: border-color var(--transition-fast);
}
.rc-search-input:focus { border-color: rgba(240,95,0,0.4); }
.rc-search-input::placeholder { color: var(--text-on-ws-2); }

.rc-contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rc-contact-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.rc-contact-row:hover { border-color: rgba(240,95,0,0.3); }

.rc-contact-info { flex: 1; min-width: 0; }
.rc-contact-name { font-size: 13px; font-weight: 600; color: var(--text-on-ws); }
.rc-contact-meta { font-size: 11px; color: var(--text-on-ws-2); margin-top: 1px; }
.rc-contact-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.rc-contact-dept  { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-on-ws-2); }
.rc-contact-phone { font-size: 11px; color: var(--text-on-ws-2); }

/* ── PERSON MODAL (PROFILE DRAWER) ── */
.rc-person-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
}

.rc-person-modal.open { display: flex; }

.rc-person-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14,13,11,0.4);
}

.rc-person-drawer {
  position: relative;
  z-index: 1;
  width: 480px;
  max-width: 95vw;
  height: 100%;
  background: var(--ws-surface);
  border-left: 1px solid var(--ws-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 24px rgba(14,13,11,0.15);
}

.rc-drawer-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--ws-border);
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.rc-drawer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-text);
  flex-shrink: 0;
}

.rc-drawer-identity {
  flex: 1;
  min-width: 0;
}

.rc-drawer-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-on-ws);
  line-height: 1.2;
}

.rc-drawer-nickname {
  font-size: 12px;
  color: var(--text-on-ws-2);
  font-style: italic;
  margin-top: 2px;
}

.rc-drawer-role-dept {
  font-size: 12px;
  color: var(--text-on-ws-2);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rc-drawer-close {
  background: none;
  border: none;
  color: var(--text-on-ws-2);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}
.rc-drawer-close:hover { color: var(--text-on-ws); }

/* Drawer inner tabs */
.rc-drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--ws-border);
  padding: 0 1.5rem;
  flex-shrink: 0;
}

.rc-drawer-tab {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-on-ws-2);
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  user-select: none;
}
.rc-drawer-tab:hover  { color: var(--text-on-ws); }
.rc-drawer-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }

.rc-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

/* Drawer field groups */
.rc-field-group {
  margin-bottom: 1.5rem;
}

.rc-field-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-ws-2);
  margin-bottom: 0.625rem;
}

.rc-field-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}

.rc-field-label {
  font-size: 11px;
  color: var(--text-on-ws-2);
  min-width: 100px;
  padding-top: 7px;
  flex-shrink: 0;
}

.rc-field-input {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-sm);
  background: var(--ws-bg);
  color: var(--text-on-ws);
  outline: none;
  transition: border-color var(--transition-fast);
}
.rc-field-input:focus { border-color: rgba(240,95,0,0.4); background: var(--ws-surface); }
.rc-field-input:disabled { opacity: 0.5; cursor: not-allowed; }
.rc-field-input::placeholder { color: var(--text-on-ws-2); }

.rc-field-select {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-sm);
  background: var(--ws-bg);
  color: var(--text-on-ws);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.rc-field-select:focus { border-color: rgba(240,95,0,0.4); }

.rc-field-value {
  flex: 1;
  font-size: 13px;
  color: var(--text-on-ws);
  padding: 7px 0;
  line-height: 1.4;
}

.rc-field-value.muted { color: var(--text-on-ws-2); font-style: italic; }

/* Pallets user notice */
.rc-user-notice {
  font-size: 11px;
  color: var(--text-on-ws-2);
  background: var(--ws-bg);
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Notes */
.rc-note-item {
  background: var(--ws-bg);
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 12px;
  color: var(--text-on-ws);
  line-height: 1.5;
  position: relative;
}

.rc-note-meta {
  font-size: 10px;
  color: var(--text-on-ws-2);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rc-note-private-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warning);
  background: rgba(212,133,10,0.1);
  border-radius: 3px;
  padding: 1px 5px;
}

.rc-note-add {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: flex-start;
}

.rc-note-textarea {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 7px 10px;
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-sm);
  background: var(--ws-bg);
  color: var(--text-on-ws);
  outline: none;
  resize: none;
  min-height: 60px;
  transition: border-color var(--transition-fast);
  line-height: 1.5;
}
.rc-note-textarea:focus { border-color: rgba(240,95,0,0.4); }
.rc-note-textarea::placeholder { color: var(--text-on-ws-2); }

.rc-note-controls {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* Visibility toggle */
.rc-visibility-toggle {
  display: flex;
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.rc-vis-btn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  background: none;
  border: none;
  color: var(--text-on-ws-2);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.rc-vis-btn.active.team    { background: var(--ws-bg); color: var(--text-on-ws); }
.rc-vis-btn.active.private { background: rgba(212,133,10,0.1); color: #d4850a; }

/* ── ADD PERSON MODAL ── */
.rc-add-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(14,13,11,0.55);
  display: none;
  align-items: center;
  justify-content: center;
}
.rc-add-modal-overlay.open { display: flex; }

.rc-add-modal {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rc-add-modal-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--ws-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.rc-add-modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-on-ws);
}

.rc-add-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rc-add-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ws-border);
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Email match prompt */
.rc-email-match {
  background: var(--accent-soft);
  border: 1px solid rgba(240,95,0,0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 12px;
  color: var(--text-on-ws);
  line-height: 1.5;
  display: none;
}
.rc-email-match.visible { display: block; }
.rc-email-match strong { color: var(--accent-text); }

.rc-email-match-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

/* Drawer save bar */
.rc-drawer-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ws-border);
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Shared button styles inside Rollcall */
.rc-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ws-border);
  background: var(--ws-surface);
  color: var(--text-on-ws);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.rc-btn:hover { border-color: var(--text-on-ws-2); }
.rc-btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.rc-btn.accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.rc-btn.full { flex: 1; text-align: center; }
.rc-btn.sm { font-size: 11px; padding: 5px 12px; }

/* ── INVITE SECTION IN DRAWER ── */
.rc-invite-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ws-border);
}

.rc-invite-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-ws-2);
  margin-bottom: 0.625rem;
}

.rc-invite-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.rc-role-select {
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--ws-border);
  border-radius: var(--radius-sm);
  background: var(--ws-bg);
  color: var(--text-on-ws);
  outline: none;
  cursor: pointer;
}
