:root {
  color-scheme: light;
  --bg: #efe8dc;
  --ink: #1b1916;
  --muted: #6f675e;
  --line: #e4d8c8;
  --card: #fffdf9;
  --accent: #0c6b52;
  --accent-soft: #e5f4ee;
  --accent-ink: #f6fffb;
  --danger: #9f2d2d;
  --shadow: 0 10px 30px rgba(60, 42, 20, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 420px at 0% -10%, #f7f1e6 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
}

button, input, select { font: inherit; }

.hidden { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow);
}

.app {
  width: min(1440px, calc(100% - 32px));
  margin: 28px auto 64px;
}

.eyebrow {
  margin: 0 0 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  font-weight: 650;
}

h1 { margin: 0; font-size: 32px; letter-spacing: -0.03em; }
h2 { margin: 0; font-size: 20px; }

.muted { color: var(--muted); margin: 0; }

label { display: grid; gap: 6px; font-size: 14px; }

input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

.ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

.error { min-height: 1.2em; color: var(--danger); margin: 0; }

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.stat b {
  display: block;
  font-size: 28px;
  letter-spacing: -0.03em;
  margin-top: 4px;
}

.stat span { color: var(--muted); font-size: 13px; }

.toolbar {
  display: grid;
  grid-template-columns: 1fr 168px 168px;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.filters label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filters select {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 450;
  font-size: 14px;
  background: #fff;
}

.directions { margin-bottom: 14px; }
.directions.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.direction-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.direction-tile span { font-weight: 700; }
.direction-tile b {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  min-width: 36px;
  padding: 4px 8px;
  text-align: center;
}
.directions:not(.tiles) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.direction-back,
.direction-chip {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
}
.direction-chip.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.direction-chip b { margin-left: 6px; }
.direction-chip.on b { color: inherit; }

.date-field {
  position: relative;
  display: block;
  margin: 0;
}

.date-field input {
  color: transparent;
}

.date-field input.has-value {
  color: var(--ink);
}

.date-field span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a8175;
  font-size: 14px;
  font-weight: 400;
  pointer-events: none;
}

.date-field:has(input.has-value) span {
  display: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip {
  flex: 0 0 auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.chip i {
  font-style: normal;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  min-width: 16px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.chip.active i {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.groups { display: grid; gap: 22px; }

.group {
  background: rgba(255, 253, 249, 0.55);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.badge {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 650;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.id-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  align-content: start;
  min-width: 0;
}
.id-info p { margin: 0; }
.id-info .id-value,
.id-info .id-meta { display: block; }

button.idcard {
  position: relative;
  width: 100%;
  text-align: left;
  color: #1b2430;
  background: linear-gradient(180deg, #e9f7fc 0%, #d3eef8 100%);
  border: 0;
  border-radius: 22px;
  padding: 14px 16px 12px;
  display: block;
  box-shadow: 0 12px 28px rgba(36, 92, 120, 0.12);
  overflow: hidden;
}

button.idcard:hover { filter: brightness(0.99); }

button.idcard.is-new {
  background: linear-gradient(180deg, #fff6d8 0%, #ffe08a 100%);
  box-shadow: 0 0 0 3px #e2b500, 0 14px 28px rgba(160, 110, 10, 0.22);
}
.id-new {
  flex: none;
  background: #9a3412;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fav {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #c5ced6;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(20, 40, 60, 0.12);
  cursor: pointer;
}
.idcard > .fav,
.card-acts {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
}
.card-acts {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-acts .fav { position: static; }
.card-act {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #9f2d2d;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(20, 40, 60, 0.12);
  cursor: pointer;
}
.card-act.restore { color: #0c6b52; }
.card-act svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.fav.on { color: #e21878; }
.fav.on svg { fill: currentColor; }

.id-head {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.id-logo {
  color: #2f86ea;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.id-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: -6px;
  margin-right: -8px;
  background: #e21878;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 15px;
  padding: 7px 46px 7px 14px;
}
.idcard.has-act .id-title { padding-right: 92px; }
.idcard.wide-acts .id-title { padding-right: 132px; }

.id-person {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
  text-transform: none;
}
.id-added {
  margin-left: auto;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}
.id-title.tone-none { background: #e2b500; color: #1b1916; }
.id-title.tone-expected { background: #2f86ea; }
.id-title.tone-arrived { background: #e05a5a; }
.id-title.tone-missed { background: #e08a2e; }
.id-title.tone-hired { background: #161616; }

.id-main {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 14px;
  min-height: 196px;
}

.id-photo, .id-photo-empty {
  width: 124px;
  height: 156px;
  object-fit: cover;
  background: #edf3f6;
  display: grid;
  place-items: center;
  color: #6d7b88;
  font-size: 12px;
}

.id-label {
  margin: 0;
  color: #667584;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.id-info { min-width: 0; }

.id-value {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.15;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.id-meta {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 650;
}

.id-number {
  margin: 0;
  color: #1d4f9c;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.id-serial {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.avatar {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.name { font-weight: 700; display: block; }
.sub { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.tag {
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f3eee6;
  color: var(--ink);
}

.tag.called { background: #e7f3ec; color: var(--accent); }
.tag.score { background: #fff4d8; color: #8a5a00; }

.review {
  border: 1px solid var(--line);
  margin: 0;
  padding: 6px 8px;
  display: grid;
  gap: 6px;
  background: #fff;
  border-radius: 12px;
  flex: none;
}

.review h3 { display: none; }
.review textarea { min-height: 32px; }
.review input, .review textarea, .choice button, .review button { padding: 6px 8px; }
.review label { font-size: 12px; gap: 2px; }

.review h3 { margin: 0; font-size: 16px; }

.review-grid {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
}

.choice {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.choice button {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

.choice button.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.review textarea {
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}

.review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.save-note { color: var(--accent); font-size: 13px; min-height: 1.2em; }

.empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}

.top-actions { display: flex; align-items: center; gap: 10px; }
.archive-btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
}
.archive-btn.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.account { position: relative; }
.whoami {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 14px 6px 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(36, 92, 120, 0.08);
}
.who-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e7f1ff;
  color: #2f86ea;
  display: grid;
  place-items: center;
}
.who-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.account.open .whoami {
  border-radius: 0;
  position: relative;
  z-index: 31;
}
.account-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  min-width: 100%;
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: -1px;
  padding: 6px 8px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 14px 30px rgba(36, 92, 120, 0.16);
  z-index: 30;
}
.account.open .account-menu { display: flex; }
.account-menu button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  border-radius: 0;
}
.account-menu button:hover { background: #f3f6fb; }
.account-menu #logout {
  background: #c83b3b;
  color: #fff;
  border-color: #c83b3b;
}
.account-menu #logout:hover { background: #b43232; }

.more { position: relative; }
.more-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  color: #243044;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(36, 92, 120, 0.08);
}
.more-btn svg { width: 18px; height: 18px; fill: currentColor; }
.more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 128px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(36, 92, 120, 0.14);
  z-index: 40;
}
.more.open .more-menu { display: flex; flex-direction: column; }
.more-menu button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  font-size: 13px;
}
.more-menu button:hover { background: #f3f6fb; }

.history-list { display: grid; gap: 8px; margin-top: 8px; }
.history-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.history-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.history-row p { margin: 4px 0 0; }
.history-top time { color: var(--muted); font-size: 13px; white-space: nowrap; }

dialog.staff-dialog {
  width: min(720px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100vh - 48px);
  margin: auto;
  border-radius: 22px;
  padding: 8px 18px 18px;
  background: var(--card);
  overflow: auto;
}
.staff-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.staff-form .error,
.staff-form .perms,
.staff-form button { grid-column: 1 / -1; }
.perms {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px 12px;
  display: grid;
  gap: 8px;
}
.perms legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.check input { width: 18px; height: 18px; }
.staff-list { margin-top: 16px; }
.staff-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.staff-row p { margin: 0; }
.staff-actions { display: flex; gap: 8px; }
.pass-interviewer { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.conduct-error { grid-column: 1 / -1; margin: 0; min-height: 18px; }

dialog {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #eef4fb;
  overflow: hidden;
}

#detail-body {
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 8px 8px;
  overflow: hidden;
}

.detail-head {
  position: relative;
  z-index: 2;
  padding: 8px 40px 0 12px;
  justify-content: flex-end;
  background: transparent;
}

.detail-head .eyebrow,
.detail-head h2 { display: none; }
#back-detail { margin-right: auto; }

.pass {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  overflow: auto;
  background: #f7fbfe;
  border: 1px solid #d5e2ee;
}

.pass-top {
  display: grid;
  grid-template-columns: 156px 1fr;
  gap: 8px 12px;
  align-items: start;
}
.pass-photo-col { grid-column: 1; grid-row: 1; }
.pass-identity { grid-column: 2; grid-row: 1; }
.pass-raise {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pass-photo-col {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.photo-frame { position: relative; width: 156px; }
.photo-download {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.94);
  color: #1b2430;
  border: 0;
  box-shadow: 0 2px 8px rgba(16, 32, 48, 0.18);
}
.photo-download svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pass-side {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.pass-photo-col img,
.pass-empty {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: #667584;
}

button.photo-open {
  width: 156px;
  height: 200px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #dfe7ee;
  display: block;
  cursor: zoom-in;
  overflow: hidden;
}

button.photo-open img,
.pass-empty {
  width: 156px;
  height: 200px;
  object-fit: cover;
  object-position: center top;
}

.info-block { margin-top: 18px; }
.info-block h3 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0c6b52;
}

.review-fields {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1.2fr 0.6fr 1.3fr;
  gap: 6px;
}

.review-fields .wide { grid-column: auto; }

button.danger {
  background: #9f2d2d;
  color: #fff;
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #1b2430;
  border: 1px solid var(--line);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn.danger {
  background: #fff;
  color: #9f2d2d;
  border-color: #e7c4c4;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 14, 20, 0.9);
  display: grid;
  place-items: center;
  padding: 28px;
}

.lightbox img {
  max-width: min(960px, 94vw);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  background: #111;
}

.lightbox .ghost,
.lightbox > .icon-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #fff;
}
.lightbox-tools {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}
.lightbox-tools .icon-btn {
  width: 44px;
  height: 44px;
  background: #fff;
  color: #17202a;
  border: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.lightbox-tools .icon-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.pass-identity {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.pass-who {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  grid-row: span 2;
}

.pass-next,
.pass-meta {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: subgrid;
  gap: 8px;
}
.pass-next { grid-row: 2; }
.pass-meta { grid-row: 3; }

.contract-launch {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  justify-self: stretch;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.25;
}
.contract-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 8px 12px 20px;
}
.contract-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.contract-head h2 { font-size: 22px; }
.contract-kind { position: relative; margin-left: auto; }
.contract-kind-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.contract-kind-btn::after {
  content: " ▾";
  color: var(--muted);
}
.contract-kind-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 6;
  min-width: 168px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e3edf5;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(20, 40, 60, 0.14);
  overflow: hidden;
}
.contract-kind-menu button {
  border: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
}
.contract-kind-menu button:hover { background: #f4f8fb; }
.contract-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.contract-cards .edit-card.editing .edit-view {
  display: none;
  visibility: visible;
}
.contract-cards .edit-card.editing .edit-box {
  position: static;
  display: block;
}
.contract-cards .edit-box input {
  width: 100%;
  height: auto;
  flex: none;
}
.contract-make {
  justify-self: start;
  margin-top: 4px;
}
.contract-line {
  background: #fff;
  border: 1px solid #e3edf5;
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 0;
}
.contract-line span {
  display: block;
  color: #6b7c8a;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.contract-line strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.pass-role {
  margin: 2px 0 0;
  color: #0c6b52;
  font-weight: 650;
}

.pass-kicker {
  margin: 0;
  color: #667584;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pass-name {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pass-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 8px;
  margin: 0;
  align-content: start;
}

.docs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.doc-slot {
  background: #fff;
  border: 1px dashed #c5d4e2;
  border-radius: 12px;
  padding: 8px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.doc-slot > span {
  color: #6b7c8a;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.doc-name {
  margin: 0;
  color: #243140;
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-empty {
  display: grid;
  place-items: center;
  height: 58px;
  border-radius: 8px;
  background: #eef3f8;
  color: #8aa;
  font-size: 13px;
  font-weight: 650;
}
.doc-open {
  height: 58px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #eef3f8;
  cursor: zoom-in;
}
.doc-open img,
.doc-open iframe {
  width: 100%;
  height: 58px;
  border: 0;
  display: block;
  pointer-events: none;
  object-fit: cover;
  background: #fff;
  opacity: 0.12;
  filter: blur(3px);
}
.lightbox iframe {
  width: min(920px, 94vw);
  height: min(86vh, 900px);
  border: 0;
  border-radius: 12px;
  background: #fff;
}
.doc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
label.doc-pick,
a.doc-save,
button.doc-clear {
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  line-height: 0;
}
label.doc-pick {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
}
a.doc-save {
  background: #fff;
  color: #1b2430;
  border: 1px solid var(--line);
  text-decoration: none;
}
button.doc-clear {
  background: #fff;
  color: #9f2d2d;
  border: 1px solid #e7c4c4;
}
.doc-actions svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pass-field {
  background: #fff;
  border: 1px solid #e3edf5;
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pass-field span {
  display: block;
  color: #6b7c8a;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pass-field strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pass-next .pass-field,
.pass-meta .pass-field {
  padding: 5px 8px;
  border-radius: 10px;
  background: #f4f8fb;
  border-color: #d7e4ef;
}
.pass-next .pass-field span,
.pass-meta .pass-field span {
  font-size: 9px;
  letter-spacing: 0.06em;
}
.pass-next .pass-field strong,
.pass-meta .pass-field strong {
  margin-top: 1px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.pass-field.wide { grid-column: span 1; }

.edit-box { display: none; }
.pass-field.editing { cursor: default; }
.pass-field.editing .edit-view { display: none; }
.pass-field.editing .edit-box { display: block; }
.edit-card { cursor: pointer; position: relative; }
.edit-box input, .edit-box textarea {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 14px;
}
.edit-card.editing:not([data-edit="interviewStatus"]):not([data-edit="note"]) .edit-view {
  display: block;
  visibility: hidden;
}
.edit-card.editing:not([data-edit="interviewStatus"]):not([data-edit="note"]) .edit-box {
  display: flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  margin: 0;
}
.edit-card.editing:not([data-edit="interviewStatus"]):not([data-edit="note"]) .edit-box input {
  width: 0;
  flex: 1 1 auto;
  height: 26px;
}
.contract-cards .edit-card.editing .edit-view {
  display: none;
  visibility: visible;
}
.contract-cards .edit-card.editing .edit-box {
  position: static;
  display: block;
  left: auto;
  right: auto;
  bottom: auto;
}
.contract-cards .edit-card.editing .edit-box input {
  width: 100%;
  height: auto;
  flex: none;
}
.hire-date {
  display: flex;
  align-items: center;
  gap: 6px;
}
.contract-cards .edit-card.editing .edit-box .hire-date input[name="hiredAt"] {
  width: auto;
  flex: 1;
}
.contract-cards .edit-card.editing .edit-box .hire-cal {
  width: 36px;
  height: 32px;
  flex: none;
  padding: 2px;
}
.edit-box textarea { min-height: 110px; resize: vertical; }
.pass > .edit-card[data-edit="note"] {
  width: 100%;
}
.pass > .edit-card[data-edit="note"] .edit-box textarea,
.pass > .edit-card[data-edit="note"] .edit-view {
  min-height: 72px;
}
.pass > .edit-card[data-edit="note"] .edit-box textarea {
  width: 100%;
  padding: 6px 8px;
}
.edit-card[data-edit="interviewStatus"] { position: relative; overflow: visible; }
.edit-card[data-edit="interviewStatus"].editing .edit-view { display: block; }
.edit-card[data-edit="interviewStatus"] .edit-box {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  width: max-content;
  min-width: 0;
  padding: 4px;
  background: #fff;
  border: 1px solid #e3edf5;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(20, 40, 60, 0.14);
}
.choice.mini { display: grid; gap: 2px; }
.choice.mini button {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
}
.score-pick {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.score-pick button {
  padding: 6px 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.score-pick button.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.choice.mini button.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.edit-card.tone-none { background: #fff3bf; border-color: #e2b500; }
.edit-card.tone-expected { background: #d9ebff; border-color: #4d93e6; }
.edit-card.tone-arrived { background: #ffd9d9; border-color: #e05a5a; }
.edit-card.tone-missed { background: #ffe4c4; border-color: #e08a2e; }
.edit-card.tone-hired { background: #161616; border-color: #000; color: #fff; }
.edit-card.tone-hired .edit-label,
.edit-card.tone-hired .edit-view { color: #fff; }

.card-save {
  margin: 0;
  width: auto;
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
}

dialog::backdrop { background: rgba(28, 25, 21, 0.48); }

.detail-head {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  padding: 8px 40px 0 12px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 18px 20px 22px;
}

.photo-large {
  width: 180px;
  height: 230px;
  object-fit: cover;
  border-radius: 16px;
  background: #efe6d8;
}

.fields {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 14px;
  margin: 0;
}

.fields dt { color: var(--muted); font-size: 13px; }
.fields dd { margin: 0; white-space: pre-wrap; }

@media (max-width: 760px) {
  h1 { font-size: 26px; }
  .stats, .toolbar, .detail-layout, .fields, .review-grid, .review-fields, .filters, .cards, .pass-grid { grid-template-columns: 1fr 1fr; }
  .person-card, .cards { grid-template-columns: 1fr; }
  .pass { grid-template-columns: 130px 1fr; }
  .pass-grid { grid-template-columns: 1fr 1fr; overflow: auto; }
  button.photo-open, button.photo-open img, .pass-empty { width: 112px; height: 146px; }
  .photo-frame { width: 112px; }
  .pass-name { font-size: 20px; }
  .id-logo { font-size: 24px; }
  .id-title { font-size: 12px; }
  .id-value { font-size: 18px; }
  .id-number { font-size: 20px; }
  .id-photo, .id-photo-empty { width: 96px; height: 124px; }
  .photo-large { width: 100%; height: 240px; }
  .app { width: min(100% - 20px, 1120px); }
}
