﻿:root {
  --bg: #eef2f4;
  --card: #fff;
  --ink: #1a242e;
  --muted: #5e6d7b;
  --line: #e3e9ee;
  --accent: #0c7c76;
  --accent-hover: #0a6762;
  --accent-soft: #e7f5f4;
  --accent-ink: #085550;
  --header: #17212b;
  --danger: #c0362c;
  --orange: #c05621;
  --blue: #1d4ed8;
  --violet: #6d28d9;
  --red: #b42318;
  --gray: #667085;
  --green: #067647;
  --warn-bg: #fff6ef;
  --shadow: 0 1px 2px rgba(23, 33, 43, .04), 0 10px 28px rgba(23, 33, 43, .05);
  --radius: 12px;
  --header-h: 60px;
  --control-h: 38px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(12, 124, 118, .06), transparent 55%),
    var(--bg);
}
::selection { background: #c7ebe8; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-weight: 400; }
button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  min-height: var(--control-h);
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
button:hover { background: var(--accent-hover); }
button:focus-visible, a:focus-visible, .chk:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 400;
}
button.ghost:hover { background: #f4f7f8; }
button.danger { background: var(--danger); }
button.danger:hover { background: #9d2b23; }
button.ghost.danger {
  background: #fff;
  color: var(--danger);
  border-color: #f3c7c3;
}
button.ghost.danger:hover { background: #fdeceb; }
button.icon-btn {
  width: var(--control-h);
  min-width: var(--control-h);
  padding: 0;
}
button:disabled { opacity: .55; cursor: default; }
.hidden, [hidden] { display: none !important; }

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: 8px 10px;
  border: 1px solid #d5dee6;
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover { border-color: #c3ced8; }
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(12, 124, 118, .16);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(720px 420px at 0% 0%, rgba(20, 184, 166, .22), transparent 60%),
    radial-gradient(640px 380px at 100% 100%, rgba(23, 33, 43, .1), transparent 55%),
    #e7eef0;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  padding: 28px 28px 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 24px 60px rgba(23, 33, 43, .12);
  display: grid;
  gap: 14px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.login-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.login-brand .muted { margin: 2px 0 0; font-size: 13px; }
.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(160deg, #2ad4c8, #0c7c76);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.login-card label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.login-card button[type="submit"] { min-height: 42px; margin-top: 2px; }

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
  padding: 0 18px;
  background: var(--header);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 8px 24px rgba(23, 33, 43, .12);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
  letter-spacing: -.02em;
  flex: 0 0 auto;
}
.brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.brand:hover { text-decoration: none; color: #fff; }
.top nav {
  display: flex;
  gap: 4px;
  min-width: 0;
}
.top nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c5d0da;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}
.top nav a:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, .08);
}
.top nav a.active {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, .14);
  font-weight: 600;
}
.search {
  position: relative;
  margin-left: auto;
  width: min(340px, 30vw);
  flex: 0 1 340px;
}
.search input[type="search"] {
  height: 36px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 12px 0 34px;
  background-color: rgba(255, 255, 255, .08);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aabba' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M11 11l3 3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
  color: #fff;
  box-shadow: none;
}
.search input[type="search"]::placeholder { color: #9aabba; }
.search input[type="search"]:hover { border-color: transparent; background-color: rgba(255, 255, 255, .12); }
.search input[type="search"]:focus {
  background-color: #fff;
  color: var(--ink);
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(42, 212, 200, .28);
}
.user-chip {
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #d7e2ec;
  font-size: 13px;
  font-weight: 400;
}
.top .ghost {
  color: #e8eef3;
  border-color: rgba(255, 255, 255, .18);
  background: transparent;
  min-height: 34px;
  flex: 0 0 auto;
}
.top .ghost:hover { background: rgba(255, 255, 255, .08); }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e24b2d;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

main { padding: 22px 24px 48px; }
.view { max-width: 1180px; margin: 0 auto; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 16px;
}
.toolbar h2 {
  margin: 0 auto 0 0;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.toolbar a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 400;
  text-decoration: none;
}
.toolbar a:hover { background: #f4f7f8; text-decoration: none; }
.toolbar a.count {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.toolbar a.count:hover { background: #d7eeec; }
#new-candidate::before,
#new-vacancy::before { content: "+"; margin-right: 6px; font-weight: 500; }
.count { font-variant-numeric: tabular-nums; font-weight: 600; }
.result-count {
  margin: 0 0 8px 2px;
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filters .field.wide { grid-column: 1 / -1; min-width: 0; }
.filters > label, .field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.field.full { grid-column: 1 / -1; }
.field.full input, .field.full textarea, .field.full select { min-width: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}
.section-label {
  margin: 2px 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-label + .section-label,
.grid + .section-label,
.chk + .section-label { margin-top: 18px; }
.show-closed { margin-top: 10px; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.actions .danger { margin-left: auto; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}
th, td {
  padding: 10px 8px;
  border-bottom: 1px solid #eef2f5;
  text-align: left;
  vertical-align: middle;
}
td { font-variant-numeric: tabular-nums; }
th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .01em;
  background: #f7f9fb;
  line-height: 1.3;
}
tr:last-child td { border-bottom: 0; }
.cell-main { font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f3faf9; }
tr.overdue td { background: var(--warn-bg); }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 #e08a45; }
tr.clickable.overdue:hover td { background: #ffefe4; }
td a.count {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
td a.count:hover { background: #d7eeec; text-decoration: none; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .ghost { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.row-actions .ghost + .ghost { margin-left: 6px; }
.empty {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
  border-style: dashed;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  background: #e8eef3;
  color: #3e4d5c;
  white-space: nowrap;
}
.pill.orange { background: #ffead6; color: var(--orange); }
.pill.blue { background: #dbeafe; color: var(--blue); }
.pill.violet { background: #ede9fe; color: var(--violet); }
.pill.red { background: #fee4e2; color: var(--red); }
.pill.gray { background: #e7e9ec; color: var(--gray); }
.pill.green { background: #d1fadf; color: var(--green); }

.meta { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.error { color: var(--danger); margin: 8px 0 0; font-size: 13px; font-weight: 400; }
.error:empty { display: none; }
.muted { color: var(--muted); }
.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 10px 5px 8px;
  border: 1px solid #e1e7ec;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 400;
  color: #5c6b7a;
  cursor: pointer;
  user-select: none;
}
.chk input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}
.chk:has(input:checked) {
  background: var(--accent-soft);
  border-color: #b7dfdc;
  color: var(--accent-ink);
}
.status-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.status-checks .chk { display: inline-flex; }
.overdue { background: var(--warn-bg); }
.linkish {
  display: inline;
  background: none;
  color: var(--accent);
  padding: 0;
  border: 0;
  font-weight: 400;
  cursor: pointer;
}
.linkish:hover { background: none; text-decoration: underline; }

.block-title {
  margin: 22px 0 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.block-title.tone-warn { color: #9a3412; }
.resume {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.resume .resume-text { flex: 1 0 100%; margin: 4px 0 0; }
.attach-more { margin: 2px 0 0; }
.resume.muted {
  border-style: dashed;
  box-shadow: none;
  background: transparent;
}
.resume-text {
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 13px;
  background: #f7f9fb;
  padding: 10px;
  border-radius: 8px;
  margin: 8px 0 0;
}

.remind-row, .init-row { margin-bottom: 8px; }
.remind-row.compose {
  display: grid;
  grid-template-columns: 148px 112px minmax(160px, 1fr) minmax(150px, 220px) auto;
  gap: 8px;
  align-items: center;
  margin: 0;
}
#remind-list { display: grid; gap: 8px; }
#remind-list .remind-row {
  display: grid;
  grid-template-columns: minmax(132px, 168px) auto minmax(0, 1.4fr) minmax(0, 180px) auto;
  gap: 8px 12px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
#remind-list .remind-row.overdue {
  background: var(--warn-bg);
  border-color: #f3d2bc;
  box-shadow: inset 3px 0 0 #e08a45;
}
.init-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
}
.init-row > input:not([type="checkbox"]) { width: 100%; min-width: 0; }

@media (max-width: 1100px) {
  .search { width: 200px; flex-basis: 200px; }
}

@media (max-width: 940px) {
  .top {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px 12px;
    gap: 10px;
  }
  .brand { order: 1; }
  .user-chip { order: 2; margin-left: auto; }
  #logout-btn { order: 3; }
  .top nav {
    order: 4;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .search { order: 5; width: 100%; max-width: none; flex-basis: 100%; margin-left: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  main { padding: 16px 12px 36px; }
  .toolbar h2 { flex: 1 1 auto; font-size: 1.35rem; }
  .grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; padding: 12px; }
  .card, .login-card { padding: 16px; }
  .actions .danger { margin-left: 0; }
  .remind-row.compose { grid-template-columns: 1fr 1fr; }
  .remind-row.compose input[name="text"],
  .remind-row.compose select,
  .remind-row.compose button { grid-column: 1 / -1; }
  #remind-list .remind-row { grid-template-columns: 1fr auto; }
  #remind-list .remind-row > :nth-child(3),
  #remind-list .remind-row > :nth-child(4) { grid-column: 1 / -1; }
  .row-actions { white-space: normal; }
  .row-actions .ghost { margin: 0 6px 6px 0; }

  .table-scroll {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  table { min-width: 0; }
  table thead { display: none; }
  table tr {
    display: grid;
    gap: 2px 12px;
    margin-bottom: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
  }
  table td {
    display: grid;
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
    align-items: baseline;
    gap: 12px;
    padding: 3px 0;
    border: 0;
    text-align: left;
    overflow-wrap: anywhere;
  }
  table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    text-align: left;
  }
  table td.cell-main {
    display: block;
    text-align: left;
    font-size: 16px;
    padding-bottom: 6px;
  }
  table td.cell-main::before { content: none; }
  table td[data-label=""]::before { content: none; }
  table td.row-actions { justify-content: flex-start; text-align: left; }
  tr.clickable:hover { background: #f4faf9; }
  tr.clickable:hover td { background: transparent; }
  tr.clickable.overdue:hover { background: #fff1e8; }
  tr.overdue td { background: transparent; }
  tr.overdue td:first-child { box-shadow: none; }
  tr.overdue {
    background: var(--warn-bg);
    box-shadow: inset 3px 0 0 #e08a45;
  }
  tr:last-child td { border: 0; }
}
