/* ==========================================================================
   32-tools.css — UNDO, SEARCH, THE DEPARTMENT MENU, THE DATA GUARD (1.90.0)

   The app's own colours and shapes, nothing new: navy panels, the cyan edge
   for whatever has focus, gold for the one action that matters.
   ========================================================================== */

/* ---- the Undo bar -------------------------------------------------------- */
.xp-undo-bar {
  position: fixed; left: 20px; bottom: 20px; z-index: 100002;
  display: flex; align-items: center; gap: 10px;
  max-width: min(560px, calc(100vw - 40px));
  background: var(--navy2); color: var(--white);
  border: 1px solid var(--c-border); border-left: 3px solid var(--cyan);
  border-radius: 6px; padding: 8px 10px 8px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  font-size: 12px; line-height: 1.4;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.xp-undo-bar.is-on { opacity: 1; transform: none; pointer-events: auto; }
.xp-undo-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.xp-undo-btn {
  flex: 0 0 auto; background: transparent; color: var(--cyan);
  border: 1px solid var(--cyan); border-radius: 4px;
  padding: 5px 12px; font-size: 11px; font-weight: bold; cursor: pointer; min-height: 30px;
}
.xp-undo-btn:hover, .xp-undo-btn:focus-visible { background: rgba(0, 180, 216, .15); color: var(--white); }
.xp-undo-x {
  flex: 0 0 auto; background: none; border: 0; color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 4px 6px;
}
.xp-undo-x:hover { color: var(--white); }

/* ---- Search everything ---------------------------------------------------- */
.xp-search {
  position: fixed; inset: 0; z-index: 100003;
  display: none; align-items: flex-start; justify-content: center;
  padding: 10vh 16px 16px;
  background: rgba(4, 8, 16, .62);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.xp-search.is-on { display: flex; }
.xp-search-card {
  width: min(680px, 100%); max-height: 76vh;
  display: flex; flex-direction: column;
  background: var(--navy); border: 1px solid var(--c-border);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.xp-search-top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--c-border);
}
.xp-search-ico { font-size: 16px; }
.xp-search-q {
  flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: 0;
  color: var(--white); font-size: 16px; padding: 6px 0; font-family: inherit;
}
.xp-search-q::placeholder { color: var(--muted); }
/* One clear button, ours: the browser draws its own inside a search box too. */
.xp-search-q::-webkit-search-cancel-button, .xp-search-q::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.xp-search-x { background: none; border: 0; color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px 6px; }
.xp-search-x:hover { color: var(--white); }
.xp-search-list { overflow-y: auto; padding: 6px 0 8px; }
.xp-search-group {
  padding: 10px 16px 4px; font-size: 9.5px; font-weight: bold;
  letter-spacing: .6px; text-transform: uppercase; color: var(--cyan);
}
.xp-search-row {
  padding: 8px 16px; cursor: pointer; border-left: 3px solid transparent;
}
.xp-search-row.is-sel { background: rgba(0, 180, 216, .12); border-left-color: var(--cyan); }
.xp-search-title { font-size: 13px; color: var(--white); font-weight: 600; }
.xp-search-sub { font-size: 11px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.xp-search-row mark { background: rgba(201, 168, 76, .28); color: inherit; border-radius: 2px; padding: 0 1px; }
.xp-search-hint { padding: 18px 16px; font-size: 12px; color: var(--muted); }
.xp-search-foot {
  border-top: 1px solid var(--c-border); padding: 7px 14px;
  font-size: 10px; color: var(--muted); letter-spacing: .3px;
}

/* ---- Crew: the department menu under "+ Add somebody" --------------------- */
.cm-dept-menu {
  position: fixed; z-index: 100004; min-width: 220px;
  background: var(--navy2); border: 1px solid var(--cyan); border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.cm-dept-menu-q {
  font-size: 9.5px; font-weight: bold; letter-spacing: .5px; text-transform: uppercase;
  color: var(--cyan); padding: 6px 8px 4px;
}
.cm-dept-menu-item {
  text-align: left; background: transparent; border: 0; border-radius: 4px;
  color: var(--white); font-size: 12px; padding: 8px 10px; cursor: pointer;
}
.cm-dept-menu-item:hover, .cm-dept-menu-item:focus-visible { background: rgba(0, 180, 216, .15); outline: none; }

/* ---- the data guard ------------------------------------------------------ */
.dg-sum { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dg-tile {
  flex: 1 1 160px; background: var(--navy2); border: 1px solid var(--c-border);
  border-left: 3px solid var(--cyan); border-radius: 6px; padding: 10px 12px;
}
.dg-tile.is-good { border-left-color: var(--green); }
.dg-tile.is-warn { border-left-color: var(--gold); }
.dg-tile.is-bad  { border-left-color: var(--red); }
.dg-tile-v { font-size: 20px; font-weight: bold; color: var(--white); }
.dg-tile-k { font-size: 9.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--cyan); font-weight: bold; }
.dg-tile-s { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.dg-sec { font-size: 11px; font-weight: bold; color: var(--gold); letter-spacing: .4px; text-transform: uppercase; margin: 14px 0 6px; }
.dg-ok { font-size: 12px; color: #86efac; padding: 10px 0; }

.dg-list { display: flex; flex-direction: column; gap: 4px; }
.dg-item {
  display: flex; gap: 10px; align-items: baseline;
  background: var(--navy2); border: 1px solid var(--c-border); border-left: 3px solid var(--cyan);
  border-radius: 5px; padding: 8px 10px; font-size: 11.5px; line-height: 1.45; color: #e2e8f0;
}
.dg-item.is-bad  { border-left-color: var(--red); }
.dg-item.is-warn { border-left-color: var(--gold); }
.dg-item-area {
  flex: 0 0 92px; font-size: 9.5px; font-weight: bold; letter-spacing: .5px;
  text-transform: uppercase; color: var(--cyan);
}
.dg-item-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.dg-item-text em { color: var(--muted); font-style: normal; }
.dg-foot { font-size: 10px; color: var(--muted); margin-top: 12px; line-height: 1.45; }

/* The dot on the Options row when the start-up check found something serious. */
#opt-data-health.dg-has-bad .opt-icon { position: relative; }
#opt-data-health.dg-has-bad .opt-icon::after {
  content: ''; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--navy2);
}

/* Backup & Restore: the automatic copies, under the two halves. */
.dg-auto {
  margin-top: 14px; background: var(--navy); border: 1px solid var(--c-border);
  border-left: 4px solid var(--cyan); border-radius: 8px; padding: 14px 16px;
}
.dg-auto-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.dg-auto-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--white); }
.dg-auto-head p { margin: 3px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }
.dg-auto-head .btn { flex: 0 0 auto; }
.dg-rows { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; }
.dg-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-top: 1px solid var(--c-border); font-size: 11px;
}
.dg-row-when { flex: 0 0 200px; color: var(--white); font-weight: 600; }
.dg-row-what { flex: 1 1 auto; min-width: 0; color: var(--muted); }
.dg-empty { font-size: 11px; color: var(--muted); padding: 6px 0; }

/* Data saved by a newer release. */
.dg-newer {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100005;
  display: flex; gap: 12px; align-items: center; justify-content: center;
  background: var(--navy2); color: var(--white); border-bottom: 2px solid var(--gold);
  padding: 10px 16px; font-size: 12px; line-height: 1.4; box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
.dg-newer strong { color: var(--gold); }
.dg-newer button { background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px 6px; }
.dg-newer button:hover { color: var(--white); }

@media (max-width: 700px) {
  .xp-undo-bar { left: 10px; right: 10px; bottom: 10px; max-width: none; }
  .xp-search { padding-top: 12px; }
  .xp-search-card { max-height: calc(100vh - 24px); }
  .dg-row { flex-wrap: wrap; }
  .dg-row-when { flex-basis: 100%; }
  .dg-item { flex-direction: column; gap: 2px; }
  .dg-item-area { flex-basis: auto; }
}
/* Four buttons across a phone, now that Search has joined Help, Sign In and
   Options: a little less air inside each, and a second row rather than a
   button past the edge if a narrower phone still cannot fit them. */
@media (max-width: 480px) {
  .landing-top .landing-btns { gap: 6px; flex-wrap: wrap; justify-content: center; }
  .landing-top .landing-btns > .btn { padding-left: 10px !important; padding-right: 10px !important; }
}
@media print {
  .xp-undo-bar, .xp-search, .cm-dept-menu, .dg-newer { display: none !important; }
}

/* ==========================================================================
   PICTURE UPLOADS (js/03d-upload.js) — 1.90.6
   ========================================================================== */
.opt-pill { font-size: 9px; padding: 2px 8px; border-radius: 3px; font-weight: bold; white-space: nowrap; }
.opt-pill.is-off  { background: rgba(148,163,184,.2); color: var(--muted); }
.opt-pill.is-on   { background: rgba(34,197,94,.18); color: var(--green, #22c55e); }
.opt-pill.is-warn { background: rgba(234,179,8,.18);  color: var(--gold, #eab308); }
.pu-wrap { display: flex; flex-direction: column; gap: 12px; }
.pu-lead, .pu-foot { margin: 0; color: var(--muted); line-height: 1.5; }
.pu-foot { font-size: 11px; }
.pu-msg { padding: 10px 12px; border-radius: 6px; background: rgba(255,255,255,.04); border: 1px solid var(--c-border); line-height: 1.5; }
.pu-msg.pu-ok  { border-color: rgba(34,197,94,.45); }
.pu-msg.pu-bad { border-color: rgba(239,68,68,.5); }
.pu-bad { color: var(--red, #ef4444); }
.pu-q-head { font-weight: 700; margin-bottom: 4px; }
.pu-q { margin: 0; padding-left: 18px; max-height: 160px; overflow: auto; }
.pu-q li { margin: 2px 0; word-break: break-all; }
.pu-q-empty { color: var(--muted); font-size: 12px; }
