/* ==========================================================================
   13-crewmanage.css — CREW MANAGEMENT

   The same bones as 📅 Appearances and as the Suggestion viewer that
   followed it: a rounded card, a sticky heading row in small cyan capitals,
   thin separators, gold for the column you scan by, the whole row clickable,
   and the detail opening underneath rather than in a second dialog.
   ========================================================================== */

.cm-note {
  font-size: 11px; color: var(--muted); line-height: 1.55; margin-bottom: 12px;
}
.cm-note strong { color: var(--white); }
.cm-note em { color: var(--cyan); font-style: normal; }

.cm-locked {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--gold); line-height: 1.5;
  background: rgba(201, 168, 76, .12); border: 1.5px solid rgba(201, 168, 76, .35);
  border-radius: 6px; padding: 9px 12px; margin-bottom: 12px;
}
.cm-locked strong { color: var(--white); }

/* ---- the two rooms ------------------------------------------------------ */
.cm-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.cm-tab {
  background: var(--navy2); border: 1px solid var(--c-border); color: var(--muted);
  border-radius: 5px; padding: 6px 12px; font-size: 11px; cursor: pointer;
  min-height: 32px; letter-spacing: .3px;
}
.cm-tab:hover { color: var(--white); border-color: var(--cyan); }
.cm-tab.is-on {
  color: #000; background: var(--cyan); border-color: var(--cyan); font-weight: bold;
}

/* ---- permanent crew, or a call-in --------------------------------------- */
.cm-pm {
  font-size: 8px; font-weight: bold; letter-spacing: .4px;
  padding: 2px 6px; border-radius: 3px; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; line-height: 1.5;
}
.cm-pm.is-on  { background: rgba(52, 176, 119, .18); color: var(--green); border-color: var(--green); }
.cm-pm.is-off { background: rgba(255, 255, 255, .05); color: var(--muted); border-color: var(--c-border); }
button.cm-pm:hover { filter: brightness(1.35); }
.cm-pm-cell { white-space: nowrap; }

.cm-sub { font-size: 9px; color: var(--muted); margin-top: 2px; }
.cm-arc-tr { cursor: default; }
.cm-arc-tr:hover { background: rgba(255, 255, 255, .03); }
.cm-arc-act { text-align: right; white-space: nowrap; }

/* ---- the controls row --------------------------------------------------- */
.cm-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px;
}
.cm-search, .cm-select {
  padding: 7px 10px; border-radius: 5px; border: 1px solid var(--c-border);
  background: var(--navy2); color: var(--white); font-size: 12px;
}
.cm-search { flex: 1 1 220px; min-width: 160px; }
.cm-search:focus, .cm-select:focus { outline: none; border-color: var(--cyan); }
.cm-count { font-size: 10px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* ---- add ---------------------------------------------------------------- */
.cm-add {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px;
}
.cm-add-q {
  font-size: 10px; font-weight: bold; color: var(--brand);
  text-transform: uppercase; letter-spacing: .4px; margin-right: 2px;
}
.cm-sm { font-size: 10px; padding: 5px 10px; min-height: 30px; }
.cm-danger { border-color: var(--red); color: var(--red); }
.cm-danger:hover { background: rgba(239, 68, 68, .12); }

/* ---- the table ---------------------------------------------------------- */
.cm-card {
  background: var(--navy); border: 1px solid var(--c-border);
  border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.cm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-height: 56vh; overflow-y: auto; }

.cm-table { width: 100%; text-align: left; border-collapse: collapse; font-size: 11px; }
.cm-table thead { position: sticky; top: 0; background: var(--navy2); z-index: 3; }
.cm-table thead tr {
  color: var(--cyan); font-size: 9px; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid rgba(255, 255, 255, .2);
}
.cm-table th, .cm-table td { padding: 6px 8px; vertical-align: top; }

/* The department heading. One line, stated once, rather than a word repeated
   down a column -- the same reason Appearances groups by speaker. */
.cm-group td {
  background: rgba(0, 180, 216, .10); color: var(--gold);
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  padding: 5px 8px; border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.cm-tr { cursor: pointer; border-bottom: 1px solid rgba(255, 255, 255, .05); transition: background .15s; }
.cm-tr:hover { background: rgba(255, 255, 255, .04); }
.cm-tr.is-open { background: rgba(0, 180, 216, .12); border-left: 3px solid var(--cyan); }

.cm-num   { color: var(--muted); font-family: monospace; }
.cm-last  { color: var(--gold); font-weight: bold; }
.cm-first { color: var(--white); }
.cm-role  { color: var(--cyan); }
.cm-dept  { color: var(--muted); white-space: nowrap; }
.cm-state { color: var(--muted); white-space: nowrap; }
.cm-key {
  font-size: 8px; background: var(--brand); color: #000;
  padding: 1px 4px; border-radius: 3px; font-weight: bold; vertical-align: middle;
}

/* ---- the row that opens underneath -------------------------------------- */
.cm-detail-row { border-bottom: 1px solid rgba(255, 255, 255, .05); }
.cm-detail {
  padding: 10px 12px 12px 14px; border-left: 3px solid var(--cyan);
  background: rgba(0, 180, 216, .05);
}
.cm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px), (max-height: 520px) {
  .cm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cm-grid { grid-template-columns: minmax(0, 1fr); }
}
.cm-f { display: block; min-width: 0; }
.cm-f-wide { grid-column: 1 / -1; }
.cm-f-q {
  display: block; font-size: 9px; font-weight: bold; color: var(--cyan);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px;
}
.cm-in {
  width: 100%; box-sizing: border-box; padding: 6px 8px; border-radius: 5px;
  border: 1px solid var(--c-border); background: var(--navy2); color: var(--white);
  font-size: 12px;
}
.cm-in:focus { outline: none; border-color: var(--cyan); }
.cm-f-check {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--white);
}
.cm-f-check input { width: auto; }

.cm-foot { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 10px; }

.cm-empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 22px; }
.cm-empty span { font-size: 12px; display: block; margin-top: 8px; }

/* ==========================================================================
   THE USER MANAGEMENT SHAPE

   "Crew Management needs to match similar in format as User Format as well
    as update help sections and roles sections respectively."

   The same four pieces in the same order as User Accounts: a bar of the
   things you came to do, a summary of the DEPARTMENTS (this screen's roles),
   the list, and a closing note saying honestly what the screen does to
   everything else. These rules deliberately mirror .xp-um-bar,
   .xp-um-roles and .xp-um-role-line in css/04-components.css -- the two
   screens should not merely resemble each other, they should be the same
   furniture at the same sizes.
   ========================================================================== */
.cm-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cm-hint { font-size: 10px; color: var(--muted); }

.cm-roles {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.cm-role-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 10.5px;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}
.cm-role-line:hover { background: rgba(0, 180, 216, .07); }
.cm-role-line.is-on { background: rgba(0, 180, 216, .13); border-left-color: var(--cyan); }
.cm-role {
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: 9.5px;
  flex: 0 0 150px;
}
.cm-role-blurb { color: var(--muted); flex: 1 1 200px; min-width: 0; }
.cm-role-people { color: var(--white); white-space: nowrap; }
.cm-role-callin {
  color: #fcd34d;
  white-space: nowrap;
  font-size: 9.5px;
}
.cm-role-warn {
  color: #fca5a5;
  white-space: nowrap;
  font-size: 9.5px;
}
.cm-role-line.is-all .cm-role { color: var(--muted); }

/* The closing note. Same component as User Management's, same brand rule
   down its left edge, so the two screens end the same way. */
.cm-truth { border-left-color: var(--brand); margin-top: 16px; }

@media (max-width: 760px) {
  .cm-role { flex: 1 1 100%; }
  .cm-role-blurb { flex: 1 1 100%; }
}
