/* OCC/MCC desk dashboard: a wide, always-on screen. Brand tokens come from styles.css. */

.desk-body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; background: var(--bg) var(--chat-pattern); }

.desk-head {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 18px;
  background: var(--head-bg);
  color: #fff;
  flex-wrap: wrap;
}
.desk-head .spacer { flex: 1; }
.clock { font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; color: var(--ocean); }
.counters { display: flex; gap: 6px; flex-wrap: wrap; }
.counter { display: flex; align-items: baseline; gap: 5px; padding: 4px 10px; border-radius: 99px; background: rgb(255 255 255 / 0.12); font-size: 13px; }
.counter b { font-size: 17px; font-variant-numeric: tabular-nums; }
.counter.alert { background: var(--orange); color: #1d1300; }
.counter.danger { background: var(--pink); color: #fff; }
.head-btn { border: 1.5px solid rgb(255 255 255 / 0.45); background: none; color: #fff; border-radius: 99px; padding: 6px 14px; font-size: 14px; font-weight: 600; text-decoration: none; }
.head-btn:hover { border-color: var(--ocean); }
.head-btn[aria-pressed="true"] { background: var(--ocean); border-color: var(--ocean); color: var(--deep-sea); }

.desk-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(360px, 1fr) minmax(380px, 1fr);
  gap: 12px;
  padding: 12px;
}
@media (max-width: 1250px) {
  .desk-body { overflow: auto; }
  .desk-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(420px, 1fr); }
  .movements { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .desk-grid { grid-template-columns: 1fr; }
}

.panel { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { flex: 1; font-family: var(--display); font-weight: 500; font-size: 21px; color: var(--brand-ink); }
.panel-body { flex: 1; overflow-y: auto; min-height: 0; }
.sub-head { margin: 0; padding: 12px 14px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); border-top: 1px solid var(--line); }
.seg.small button { padding: 4px 9px; font-size: 12px; }

/* flights table */
.flights { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.flights th { position: sticky; top: 0; background: var(--panel-2); text-align: left; padding: 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.flights td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.flights tr { cursor: pointer; }
.flights tbody tr:hover { background: var(--panel-2); }
.flights tr.selected { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.flights tr.changed { animation: flash 2.5s ease-out 2; }
.flights .late { color: #b35d00; font-weight: 700; }
:root[data-theme="night"] .flights .late { color: var(--warn); }

/* movement log */
.events { list-style: none; margin: 0; padding: 0 0 8px; }
.events li { display: grid; grid-template-columns: 58px 110px 1fr; gap: 8px; padding: 6px 14px; font-size: 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.events li:hover { background: var(--panel-2); }
.events time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.events .fl { font-weight: 700; }
.events li.aircraft .txt, .events li.schedule .txt { color: #b35d00; font-weight: 600; }
.events li.crew .txt { color: #c21e6e; }
:root[data-theme="night"] .events li.aircraft .txt, :root[data-theme="night"] .events li.schedule .txt { color: var(--warn); }
:root[data-theme="night"] .events li.crew .txt { color: var(--urgent); }
.events li.fresh { animation: flash 2.5s ease-out 2; }

/* live feed */
.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.feed-item:hover { background: var(--panel-2); }
.feed-item.selected { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.feed-item.urgent { border-left: 4px solid var(--urgent); padding-left: 10px; background: color-mix(in srgb, var(--urgent-bg) 45%, transparent); }
.feed-item.sys { opacity: 0.8; }
.feed-item.fresh { animation: flash 2.5s ease-out 2; }
.feed-main { flex: 1; min-width: 0; }
.feed-top { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.feed-top .who { font-weight: 700; }
.feed-top time { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chat-chip { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700; line-height: 18px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); }
.chat-chip.flight { background: var(--deep-sea); border-color: var(--deep-sea); color: #fff; }
.chat-chip.desk-OCC { background: var(--orange-15); border-color: var(--orange); color: #1d1300; }
.chat-chip.desk-MCC { background: var(--pink-15); border-color: var(--pink); color: #5a0a31; }
:root[data-theme="night"] .chat-chip.desk-OCC, :root[data-theme="night"] .chat-chip.desk-MCC { background: var(--panel-2); color: var(--ink); }
.feed-text { font-size: 14px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* attention */
.side { display: grid; grid-template-rows: minmax(160px, 38%) minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.side > * { min-width: 0; }
.attention { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--line); }
.att-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.att-item:hover { background: var(--panel-2); }
.att-item .grow { min-width: 0; }
.att-item .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-item .d { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-tag { flex: none; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: 0.03em; }
.att-tag { letter-spacing: 0.05em; }
.att-tag.wait { background: var(--orange-30); color: #1d1300; }
.att-tag.late { background: var(--orange); color: #1d1300; }
.att-tag.urgent { background: var(--pink); color: #fff; }
.att-tag.ack { background: var(--ocean-30); color: var(--deep-sea); }
.att-empty { padding: 18px 14px; color: var(--ok); font-weight: 600; font-size: 14px; }

/* conversation panel */
.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-empty { margin: auto; padding: 24px; text-align: center; }
.thread .conv-head { padding: 8px 12px; }
.thread .messages { padding: 10px 12px; background: var(--chat-bg) var(--chat-pattern); }
.thread .msg { max-width: 88%; }
.thread .composer .compose-opts { padding-bottom: 6px; }
.thread-actions { display: flex; gap: 6px; }
.thread textarea {
  flex: 1;
  min-height: 48px;
  max-height: 160px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
}

@keyframes flash {
  0% { background: color-mix(in srgb, var(--ocean) 35%, transparent); }
  100% { background: transparent; }
}
