.review-search-wrap {
  position: relative;
  flex-shrink: 0;
}

.review-search-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 55;
  width: 16.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  padding: 0.85rem 0.85rem 0.75rem;
}

.review-search-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.review-search-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.review-search-form .field span {
  color: var(--muted);
}

.review-search-form input[type="text"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}

.review-search-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.review-search-form .combo-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.review-search-form .combo-list li span {
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.75rem;
}

.review-search-actions {
  display: flex;
  justify-content: flex-end;
}

.review-search-actions button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  padding: 0.4rem 0.85rem;
}

.review-search-actions button:hover {
  border-color: var(--accent);
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 14rem 18rem 1fr;
}

.pane, .detail {
  min-height: 0;
  overflow: auto;
  padding: 0.85rem;
}

.pane {
  border-right: 1px solid var(--line);
  background: var(--panel);
}

h1, h2 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h2 small, .flight-head p {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }

.day, .sector {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.15rem;
}

.when, .route, .mono { font-variant-numeric: tabular-nums; }

.route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.pilot-mark {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--accent);
}

.pilot-mark svg {
  width: 1.6rem;
  height: 1.6rem;
  display: block;
}
.meta { color: var(--muted); font-size: 0.78rem; }
.flag { color: var(--danger); font-style: normal; font-size: 0.75rem; }
.quiet { color: var(--ok); font-style: normal; font-size: 0.75rem; }
.empty { color: var(--muted); }

.flight-head h1 {
  font-size: 1.15rem;
  text-transform: none;
  letter-spacing: 0;
}

.flight-pilot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.flight-pilot p {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.pilot-assign {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.pilot-assign input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  min-width: 10rem;
}

.pilot-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
}

.pilot-assign button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.pilot-assign button[type="submit"] {
  background: #2a2418;
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.event {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.event.high { border-color: #6d3036; }
.event.medium { border-color: #6b5424; }

.event-main {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.event-meta {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.event-actions button,
.event-close-form button {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  background: #0c0f14;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.event-actions .event-confirm {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.event-close-form .event-close-submit {
  background: #2a2418;
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.event-close-form .event-close-submit:disabled {
  opacity: 0.4;
  cursor: default;
}

.event-close-form {
  display: grid;
  gap: 0.5rem;
}

.event-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.event-chip.is-on {
  border-color: var(--accent);
  color: var(--accent);
  background: #2a2418;
}

.event-close-form textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  background: #0c0f14;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
}

.event-close-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.3rem; align-content: flex-start; }
.actions button { padding: 0.2rem 0.45rem; font-size: 0.75rem; }

.measures { margin-top: 1.2rem; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
th {
  position: sticky;
  top: 0;
  background: #121722;
  color: var(--muted);
  font-weight: 600;
}
tr.hot { background: #1e1818; }
td.hit.high { background: #4d1f25; }
td.hit.medium { background: #4a3a18; }
td.hit.low { background: #3a322c; }
td.hit.high .cell { color: #ff9aa0; }
td.hit.medium .cell { color: #f0c36a; }
td.hit.low .cell { color: #e0b4a8; }
.mono { font-family: var(--mono); }

.cell {
  width: 100%;
  text-align: right;
  font-family: var(--mono);
  background: transparent;
  padding: 0.15rem 0.3rem;
}

.cell.corrected { color: var(--accent); }
.cell i { font-style: normal; margin-left: 0.25rem; color: var(--accent); font-size: 0.7rem; }

.cell.has-lock {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
}

.lock-mini {
  width: 0.72rem;
  height: 0.72rem;
  color: #e07a7a;
  flex: 0 0 auto;
}

td.locked-admin {
  box-shadow: inset 2px 0 0 #a84848;
}

td.locked-value {
  background: #3a2226;
}

td.locked-value .cell.locked {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.35rem;
  color: #e07070;
  cursor: default;
}

td.locked-value .cell.locked .lock-mini {
  width: 0.95rem;
  height: 0.95rem;
}

.edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.edit-actions button {
  background: #0c0f14;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
}

.edit-actions button[data-lock] {
  color: #f0c2c2;
}

button.cell.is-editing {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

td.flash,
tr.flash {
  animation: cell-flash 1.1s ease;
}

@keyframes cell-flash {
  0%,
  65% { box-shadow: inset 0 0 0 2px #f5c518; }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

.correction-panel {
  position: fixed;
  z-index: 35;
  width: min(18.5rem, calc(100vw - 1rem));
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0.7rem 0.75rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.correction-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.correction-head strong {
  font-size: 0.92rem;
  line-height: 1.3;
}

.correction-head [data-cancel] {
  position: absolute;
  top: -0.62rem;
  right: -0.62rem;
  z-index: 1;
  width: 1.45rem;
  height: 1.45rem;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #e15b5b;
  background: #3a1618;
  color: #ffd6d6;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 3px #12161c;
  cursor: pointer;
}

.correction-head [data-cancel]:hover {
  background: #5c2226;
  color: #fff;
}

.correction-panel input[name="value"] {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  padding: 0.4rem 0.5rem;
  background: #0c0f14;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.correction-comment span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.comment-combo {
  position: relative;
  display: flex;
}

.comment-combo input {
  flex: 1;
  min-width: 0;
  background: #0c0f14;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  padding: 0.4rem 0.5rem;
}

.comment-chevron {
  background: #0c0f14;
  border: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
  padding: 0 0.55rem;
  cursor: pointer;
  color: var(--muted);
}

.comment-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  z-index: 2;
}

.comment-menu.is-up {
  top: auto;
  bottom: calc(100% + 0.25rem);
}

.comment-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
}

.comment-menu button:hover {
  background: #1c2430;
}

.correction-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.correction-save {
  background: #2a2418;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}
