:root {
  color-scheme: dark;
  --bg-main: #0b0d12;
  --bg-sidebar: #07090d;
  --bg-panel: #111722;
  --bg-panel-strong: #151d2a;
  --bg-panel-soft: #1b2432;
  --bg-input: #0d131c;
  --border: #263243;
  --border-soft: #1d2838;
  --text-main: #f5f7fb;
  --text-muted: #a9b1c3;
  --text-subtle: #738094;
  --accent: #d4af37;
  --accent-strong: #f0c54a;
  --success: #22c55e;
  --warning: #f5b11b;
  --danger: #ef4444;
  --info: #3b82f6;
  --violet: #9b5cf6;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
  --sidebar-width: 232px;
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.06), transparent 34%),
    linear-gradient(135deg, #090b10 0%, #0c1119 52%, #0d131c 100%);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 14px;
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.98), rgba(8, 13, 19, 0.94));
  border-right: 1px solid var(--border-soft);
}

.brand-block {
  padding: 0 10px 22px;
}

.brand {
  display: block;
  color: #ffffff;
  font-size: 32px;
  font-weight: 850;
  line-height: 1;
}

.brand-subtitle {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.22), rgba(212, 175, 55, 0.08));
}

.nav-link.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  color: var(--text-main);
}

.user-card strong,
.user-card span {
  display: block;
}

.user-card strong {
  font-size: 13px;
}

.user-card span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #101419;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #ffffff);
}

.main-area {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 16px 26px;
  background: rgba(9, 13, 19, 0.86);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(18px);
}

.topbar-eyebrow {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 24px 26px 34px;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.page-head h2,
.panel-title h2,
.panel-title h3 {
  margin: 0;
}

.page-head h2 {
  font-size: 22px;
}

.page-head p,
.panel-title p {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 23, 34, 0.96), rgba(13, 19, 28, 0.96));
  box-shadow: var(--shadow);
}

.panel-pad {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-title {
  min-width: 0;
}

.panel-title h3 {
  font-size: 16px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.metric-card {
  position: relative;
  min-height: 116px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(21, 29, 42, 0.98), rgba(14, 20, 30, 0.96));
}

.metric-card::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 50%;
  content: "";
}

.metric-card span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--text-subtle);
}

.metric-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: rgba(59, 130, 246, 0.18);
}

.metric-card.metric-gold .metric-icon {
  color: #171a10;
  background: var(--accent);
}

.metric-card.metric-green .metric-icon {
  background: rgba(34, 197, 94, 0.22);
}

.metric-card.metric-red .metric-icon {
  background: rgba(239, 68, 68, 0.22);
}

.metric-card.metric-purple .metric-icon {
  background: rgba(155, 92, 246, 0.22);
}

.metric-icon.metric-gold {
  color: #171a10;
  background: var(--accent);
}

.metric-icon.metric-green {
  background: rgba(34, 197, 94, 0.22);
}

.metric-icon.metric-purple {
  background: rgba(155, 92, 246, 0.22);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
}

.status-list {
  display: grid;
  gap: 12px;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(90px, 3fr) 48px;
  align-items: center;
  gap: 12px;
}

.status-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-main);
  font-weight: 700;
}

.status-label span {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.status-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.status-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--info), var(--accent));
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.recent-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.recent-main strong,
.recent-main span {
  display: block;
}

.recent-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-main span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.filters-bar {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(160px, 0.7fr) minmax(180px, 0.8fr) minmax(220px, 1.1fr) auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 23, 34, 0.72);
}

.filters-bar.filters-compact {
  grid-template-columns: minmax(180px, 0.8fr) minmax(160px, 0.7fr) minmax(220px, 1fr) auto;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.input-wrap {
  position: relative;
}

.input-wrap .icon {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 17px;
  height: 17px;
  color: var(--text-subtle);
  transform: translateY(-50%);
  pointer-events: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg-input);
}

textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #6f7a8d;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(212, 175, 55, 0.75);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.table-status-select {
  min-width: 150px;
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: var(--info);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, opacity 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn .icon,
.icon-btn .icon,
.nav-icon .icon,
.metric-icon .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, #2f7df4, #145bd6);
}

.btn-accent {
  color: #15130b;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
}

.btn-ghost {
  color: var(--text-main);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.btn-danger {
  background: var(--danger);
}

.btn-link {
  min-height: auto;
  padding: 0;
  color: var(--info);
  background: transparent;
}

.icon-btn {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease;
}

.icon-btn:hover {
  color: #ffffff;
  border-color: rgba(212, 175, 55, 0.68);
  transform: translateY(-1px);
}

.icon-btn.is-blue {
  color: #a7c7ff;
  border-color: rgba(59, 130, 246, 0.42);
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #d9dfeb;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.025);
}

td {
  color: var(--text-main);
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover,
tbody tr.is-selected {
  background: rgba(59, 130, 246, 0.08);
}

.cell-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.cell-main strong,
.cell-main span {
  display: block;
}

.cell-main span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.cell-muted {
  color: var(--text-muted);
}

.cell-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-number {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-info {
  color: #d8e8ff;
  background: rgba(59, 130, 246, 0.26);
}

.badge-warning {
  color: #231a05;
  background: var(--warning);
}

.badge-success {
  color: #e8fff1;
  background: rgba(34, 197, 94, 0.28);
}

.badge-danger {
  color: #ffe8e8;
  background: rgba(239, 68, 68, 0.32);
}

.badge-neutral {
  color: #dde4ee;
  background: rgba(148, 163, 184, 0.18);
}

.distance-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.distance-chip span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.distance-success {
  color: #64e88f;
}

.distance-success span {
  background: var(--success);
}

.distance-warning {
  color: #ffd365;
}

.distance-warning span {
  background: var(--warning);
}

.distance-danger {
  color: #ff7777;
}

.distance-danger span {
  background: var(--danger);
}

.distance-neutral span {
  background: #788496;
}

.avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.32), rgba(59, 130, 246, 0.18));
}

.avatar img,
.avatar-fallback {
  width: 100%;
  height: 100%;
}

.avatar img {
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 850;
}

.avatar-sm {
  width: 36px;
  height: 36px;
}

.avatar-md {
  width: 48px;
  height: 48px;
}

.avatar-lg {
  width: 132px;
  height: 150px;
}

.avatar-xl {
  width: 160px;
  height: 180px;
}

.is-hidden {
  display: none !important;
}

.candidate-workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(520px, 1.45fr) minmax(260px, 0.5fr);
  gap: 14px;
}

.legend-panel {
  align-self: start;
}

.legend-list {
  display: grid;
  gap: 12px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-weight: 700;
}

.legend-row span {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.dot-green {
  background: var(--success);
}

.dot-yellow {
  background: var(--warning);
}

.dot-red {
  background: var(--danger);
}

.dot-gray {
  background: #788496;
}

.resume-preview {
  color: #13203a;
  border-radius: var(--radius);
  background: #f8fafc;
  box-shadow: var(--shadow);
}

.resume-preview-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  padding: 22px;
  border-bottom: 1px solid #dbe2ef;
}

.resume-name {
  margin: 0;
  color: #0b1430;
  font-size: 28px;
}

.resume-role {
  margin: 6px 0 0;
  color: #2c3b55;
  font-weight: 700;
}

.resume-contact {
  display: grid;
  gap: 8px;
  color: #2c3b55;
  font-size: 13px;
}

.resume-contact .icon {
  width: 15px;
  height: 15px;
}

.resume-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resume-body {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1fr 1fr;
  gap: 0;
  padding: 18px 22px 24px;
}

.resume-column {
  min-height: 170px;
  padding: 0 18px;
  border-left: 1px solid #dbe2ef;
}

.resume-column:first-child {
  padding-left: 0;
  border-left: 0;
}

.resume-column h4 {
  margin: 0 0 10px;
  color: #0b1430;
  font-size: 13px;
  text-transform: uppercase;
}

.resume-column p {
  margin: 0;
  color: #26344f;
  line-height: 1.5;
  white-space: pre-line;
}

.resume-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 22px;
  color: #4a5b77;
  border-top: 1px solid #dbe2ef;
  font-size: 12px;
}

.summary-panel {
  display: grid;
  align-self: start;
  gap: 10px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.summary-card .metric-icon {
  margin: 0;
}

.summary-card strong,
.summary-card span {
  display: block;
}

.summary-card strong {
  font-size: 22px;
  line-height: 1;
}

.summary-card span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.donut-card {
  padding: 14px;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.donut {
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--success) 0 30%, var(--info) 30% 58%, var(--warning) 58% 78%, var(--danger) 78% 100%);
}

.donut::after {
  display: block;
  width: 44px;
  height: 44px;
  margin: 21px;
  border-radius: 50%;
  background: var(--bg-panel);
  content: "";
}

.donut-legend {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.donut-legend div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
}

.profile-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-head h2 {
  margin: 0;
  font-size: 24px;
}

.profile-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.info-item {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.info-item span,
.info-item strong {
  display: block;
}

.info-item span {
  margin-bottom: 6px;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.info-item strong {
  word-break: break-word;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 5px;
  padding-left: 18px;
}

.timeline-item::before {
  position: absolute;
  top: 4px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.timeline-item strong {
  font-size: 13px;
}

.timeline-item span,
.timeline-item p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.distance-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.distance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.distance-row strong,
.distance-row span {
  display: block;
}

.distance-row span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(0, 0, 0, 0.68);
}

.modal-shell {
  width: min(980px, 100%);
  max-height: calc(100vh - 52px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}

.modal-shell.modal-wide {
  width: min(1180px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  max-height: calc(100vh - 142px);
  overflow: auto;
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .field-full {
  grid-column: 1 / -1;
}

.modal-actions,
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 800;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #788496;
}

.connection-pill.is-online .status-dot {
  background: var(--success);
}

.connection-pill.is-offline .status-dot {
  background: var(--danger);
}

.connection-pill.is-checking .status-dot {
  background: var(--warning);
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  background: rgba(17, 23, 34, 0.98);
  box-shadow: var(--shadow);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.45);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.55);
}

.loading-state,
.empty-state,
.error-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 26px;
  text-align: center;
}

.loading-state {
  gap: 12px;
  color: var(--text-muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.empty-state strong,
.error-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-main);
  font-size: 16px;
}

.empty-state span,
.error-state span {
  color: var(--text-muted);
}

.error-state {
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: var(--radius);
  background: rgba(239, 68, 68, 0.06);
}

.skeleton-line {
  display: block;
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.report-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.readonly-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.readonly-note .icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.resume-print-area {
  background: #ffffff;
}

.public-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.07), transparent 38%),
    linear-gradient(135deg, #090b10 0%, #0c1119 52%, #0d131c 100%);
}

.public-form-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 36px 18px;
}

.public-form-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 23, 34, 0.97), rgba(13, 19, 28, 0.97));
  box-shadow: var(--shadow);
}

.public-form-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--border-soft);
}

.public-form-head h1 {
  margin: 0;
  font-size: 24px;
}

.public-form-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.public-form {
  padding: 22px;
}

.public-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.public-result {
  padding: 0 22px 22px;
}

.public-result-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.public-result-success {
  border-color: rgba(34, 197, 94, 0.5);
}

.public-result-error {
  border-color: rgba(239, 68, 68, 0.58);
}

.public-result-info {
  border-color: rgba(59, 130, 246, 0.48);
}

.submit-frame {
  position: absolute;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1200px) {
  .grid-cards {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .candidate-workbench,
  .dashboard-grid,
  .detail-grid,
  .report-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .legend-panel {
    order: 2;
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    padding: 12px;
  }

  .brand-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px 10px;
  }

  .brand {
    font-size: 26px;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-link {
    flex: 0 0 auto;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    top: 82px;
  }

  .filters-bar,
  .filters-bar.filters-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-actions,
  .page-head,
  .panel-header,
  .table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .content {
    padding: 18px 14px 28px;
  }

  .grid-cards,
  .filters-bar,
  .filters-bar.filters-compact,
  .form-grid,
  .info-grid,
  .resume-preview-header,
  .resume-body {
    grid-template-columns: 1fr;
  }

  .resume-preview-header {
    text-align: left;
  }

  .resume-column {
    padding: 16px 0 0;
    border-top: 1px solid #dbe2ef;
    border-left: 0;
  }

  .resume-column:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-body {
    padding: 14px;
  }
}

@media print {
  body.printing {
    background: #ffffff;
  }

  body.printing .app-shell,
  body.printing .toast-stack,
  body.printing .modal-header,
  body.printing .resume-actions {
    display: none !important;
  }

  body.printing .modal-backdrop {
    position: static;
    display: block;
    padding: 0;
    background: #ffffff;
  }

  body.printing .modal-shell,
  body.printing .modal-body {
    width: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  body.printing .resume-preview {
    color: #111827;
    box-shadow: none;
  }
}
