/* ПРИЗВАНЯ — личный кабинет */

html, body.dash-page {
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--color-cream);
  display: block;
}

.dash-nav {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-cream);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-nav-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.dash-nav-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: var(--color-cream);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 4px;
  text-decoration: none;
  font-family: var(--font-sans);
}

.dash-nav-btn:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}

.dash-nav-btn-primary {
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}

.dash-nav-btn-primary:hover {
  background: var(--color-red);
  border-color: var(--color-red);
  color: #fff;
}

.dash-subbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px var(--space-md) 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 2;
  width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.dash-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: min(100%, 200px);
}

.dash-crumbs a {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-light);
  text-decoration: none;
}

.dash-crumbs a:hover { color: var(--color-navy); }
.dash-crumbs .sep { opacity: 0.45; color: var(--color-text-light); }

.dash-select-wrap {
  position: relative;
  flex: 1;
  max-width: 300px;
  min-width: 120px;
}

.dash-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--color-text-light);
  pointer-events: none;
}

.dash-page-wrap {
  padding: var(--space-lg) 0 var(--space-xl);
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

.dash-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  min-width: 0;
}

#main.main,
.main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* Profile header */
.profile-header {
  background: var(--color-cream-light);
  padding: var(--space-lg);
  border-radius: 8px;
  margin-bottom: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--color-border);
  gap: var(--space-md);
  flex-wrap: wrap;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
  flex: 1;
}

.profile-details {
  min-width: 0;
  flex: 1;
}

.profile-avatar,
.tb-ava {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-navy);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-details h1,
.ph-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-xs);
  letter-spacing: 0;
  line-height: 1.15;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.profile-details h1 em,
.ph-title em {
  font-style: normal;
  color: var(--color-red);
  background: none;
  -webkit-text-fill-color: var(--color-red);
}

.profile-details p,
.profile-meta {
  font-size: 14px;
  color: var(--color-text-light);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.profile-actions,
.ph-right {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
}

.dash-btn {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--color-navy);
  background: transparent;
  color: var(--color-navy);
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 4px;
  font-family: var(--font-sans);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-sizing: border-box;
  line-height: 1.3;
}

.dash-btn-primary,
.btn-test {
  background: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
  animation: none;
  box-shadow: none;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 24px;
}

.dash-btn-primary:hover,
.btn-test:hover {
  background: var(--color-red);
  border-color: var(--color-red);
  transform: translateY(-2px);
  box-shadow: none;
}

.btn-test::after { display: none; }

.dash-btn-outline:hover,
.btn-ghost:hover {
  background: var(--color-navy);
  color: var(--color-white);
}

.btn-ghost {
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: var(--color-cream);
  backdrop-filter: none;
  padding: 11px 22px;
  font-size: 13px;
}

/* Stats */
.dash-stats-grid,
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.dash-stat-card,
.ov-card {
  background: var(--color-cream-light);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s;
  backdrop-filter: none;
  box-shadow: none;
  min-width: 0;
  overflow: hidden;
}

.dash-stat-card:hover,
.ov-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(33, 40, 66, 0.1);
  border-color: var(--color-red);
}

.stat-icon {
  font-size: 28px;
  margin-bottom: var(--space-sm);
  line-height: 1;
}

.ov-label,
.dash-stat-label {
  font-size: 12px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.35;
  word-break: break-word;
}

.ov-val,
.dash-stat-number {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-xs);
  background: none;
  -webkit-text-fill-color: var(--color-navy);
  letter-spacing: 0;
  line-height: 1.1;
  word-break: break-word;
}

.ov-sub { font-size: 12px; color: var(--color-text-light); margin-top: 4px; }
.ov-card.ok-card .ov-val { color: var(--ok); -webkit-text-fill-color: var(--ok); }
.ov-card.warn-card .ov-val { color: var(--warn); -webkit-text-fill-color: var(--warn); }

/* Section headers */
.dash-section-header,
.section-header-block {
  margin-bottom: var(--space-lg);
}

.dash-section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px);
  color: var(--color-navy);
  margin-bottom: var(--space-xs);
  font-weight: 700;
  line-height: 1.15;
}

.dash-section-header p {
  font-size: 16px;
  color: var(--color-text-light);
}

/* Latest result */
.latest-result {
  background: var(--color-cream-light);
  padding: var(--space-lg);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-xl);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-lg);
  align-items: center;
}

.latest-result .result-info {
  min-width: 0;
}

.latest-result h3 {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 24px);
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
  word-break: break-word;
}

.result-meta-row {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: 14px;
  color: var(--color-text-light);
  flex-wrap: wrap;
}

.latest-result-desc {
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.latest-result .dash-btn,
.latest-result .btn-test {
  width: auto;
  display: inline-block;
  max-width: 100%;
  white-space: normal;
}

.result-type-block {
  text-align: center;
  flex-shrink: 0;
  min-width: 72px;
}

.result-type-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.result-type-letter {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 700;
  color: var(--color-red);
  line-height: 1;
}

/* Progress card in subnav */
.dash-progress-card {
  flex: 1 1 280px;
  max-width: 380px;
  min-width: 0;
  padding: 12px 16px;
  background: var(--color-cream-light);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.dash-progress-card .sbp-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sbp-fill {
  background: var(--color-red) !important;
  width: var(--w, 0);
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Cards / sections */
.sc {
  background: var(--color-cream-light);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 22px;
  backdrop-filter: none;
  box-shadow: none;
}

.sc-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-navy);
}

.sc-link { color: var(--color-red); font-size: 13px; cursor: pointer; }
.sc-link:hover { text-decoration: underline; opacity: 1; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-bottom: var(--space-md); }

/* Top results as career cards */
.saved-careers,
.top-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.career-card,
.tr-item-as-card {
  background: var(--color-cream-light);
  padding: var(--space-lg);
  border-left: 4px solid var(--color-red);
  border-radius: 0 8px 8px 0;
  border-top: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transition: all 0.3s;
  cursor: pointer;
}

.career-card:hover,
.tr-item-as-card:hover {
  transform: translateX(8px);
  box-shadow: 0 12px 24px rgba(33, 40, 66, 0.1);
}

.career-match,
.tr-pct-big {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-red);
  margin-bottom: var(--space-xs);
}

.career-name,
.tr-name {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: var(--space-xs);
  font-family: var(--font-serif);
  line-height: 1.25;
  word-break: break-word;
}

.career-category,
.tr-sub {
  font-size: 13px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Table */
.table-container {
  background: var(--color-cream-light);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: var(--space-xl);
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  contain: inline-size;
}

.dash-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.dash-table td,
.dash-table th {
  vertical-align: middle;
}

.dash-table td:first-child {
  word-break: break-word;
  max-width: 280px;
}

.dash-select-wrap select {
  background: var(--color-cream-light);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-navy);
  font-family: var(--font-sans);
  width: 100%;
  padding: 9px 36px 9px 12px;
  font-size: 13px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.dash-table thead {
  background: var(--color-navy);
  color: var(--color-white);
}

.dash-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dash-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

.dash-table tbody tr:hover { background: var(--color-white); }
.dash-table tbody tr:last-child td { border-bottom: none; }

.view-link { color: var(--color-red); font-weight: 600; text-decoration: none; }
.view-link:hover { text-decoration: underline; }

/* Tab pages */
.tab-content { display: none; animation: fadeInUp 0.4s ease; }
.tab-content.act { display: block; }

.page-header { padding: 0 0 var(--space-lg); }

/* Dark card */
.dark-card {
  background: var(--color-navy-deep);
  border-radius: 8px;
}

.dc-mesh {
  background: radial-gradient(ellipse 80% 80% at 0% 0%, rgba(78,0,0,.35) 0%, transparent 58%),
              radial-gradient(ellipse 60% 60% at 100% 100%, rgba(33,40,66,.45) 0%, transparent 55%) !important;
  animation: none !important;
}

.dc-h em { color: var(--color-red-soft); background: none; -webkit-text-fill-color: var(--color-red-soft); }

@media (max-width: 1024px) {
  .dash-stats-grid,
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .latest-result { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .profile-header { flex-direction: column; align-items: stretch; }
  .profile-actions { width: 100%; }
  .profile-actions .dash-btn,
  .profile-actions .btn-test,
  .profile-actions .btn-ghost {
    flex: 1 1 auto;
    white-space: normal;
    min-width: 0;
  }
  .dash-stats-grid,
  .overview-grid { grid-template-columns: 1fr; }
  .dash-nav-actions .dash-nav-user-name { display: none; }
  .dash-progress-card { flex: 1 1 100%; max-width: none; }
  .dash-nav-inner { gap: 12px; }
  .dash-nav-actions { flex-wrap: wrap; justify-content: flex-end; }
  .dash-page-wrap { padding: var(--space-md) 0 var(--space-lg); }
  .latest-result { padding: var(--space-md); }
  .dash-table { min-width: 480px; }
  .result-type-block {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
  }
  .result-type-label { margin-bottom: 0; }
}

/* ── Secondary tabs (test, results, profile, settings) ── */
@keyframes barIn { from { width: 0; } to { width: var(--w); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.r { opacity: 0; transform: translateY(16px); transition: opacity .55s cubic-bezier(.22,1,.36,1), transform .55s cubic-bezier(.22,1,.36,1); }
.r.on { opacity: 1; transform: none; }

.prog-sections { display: flex; flex-direction: column; gap: 10px; }
.prog-row { display: flex; flex-direction: column; gap: 5px; }
.pr-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.pr-name {
  font-size: 13px;
  color: var(--color-text-light);
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.pr-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pr-pct { font-family: var(--font-serif); font-size: 13px; font-weight: 700; color: var(--color-navy); }
.pr-status { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.st-done { background: rgba(31,187,130,.10); color: var(--ok); }
.st-active { background: rgba(33,40,66,.08); color: var(--color-navy); }
.st-locked { background: rgba(74,85,104,.10); color: var(--color-text-light); }
.pr-track { height: 4px; background: var(--color-border); border-radius: 4px; overflow: hidden; }
.pr-fill { height: 100%; width: var(--w, 0); border-radius: 4px; animation: barIn 1s ease both; }
.pr-fill.done { background: var(--ok); }
.pr-fill.active { background: var(--color-red); }

.sbp-bar-wrap { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sbp-bar { flex: 1; height: 4px; background: var(--color-border); border-radius: 4px; overflow: hidden; }
.sbp-pct { font-size: 12px; font-weight: 600; color: var(--color-navy); }
.sbp-role, .sbp-label { font-size: 12px; color: var(--color-text-light); margin-top: 4px; }

.activity-list { display: flex; flex-direction: column; gap: 8px; }
.act-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.act-item:last-child { border-bottom: none; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.act-dot.ind { background: var(--color-navy); }
.act-dot.ok { background: var(--ok); }
.act-text { font-size: 13px; color: var(--color-text); line-height: 1.4; }
.act-date { font-size: 11px; color: var(--color-text-light); margin-top: 2px; }

.result-header {
  background: var(--color-navy-deep);
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: 28px 30px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}
.rh-mesh { position: absolute; inset: 0; opacity: 0.4; pointer-events: none;
  background: radial-gradient(ellipse 80% 80% at 0% 0%, rgba(78,0,0,.35) 0%, transparent 58%),
              radial-gradient(ellipse 60% 60% at 100% 100%, rgba(33,40,66,.45) 0%, transparent 55%); }
.rh-inner { position: relative; z-index: 1; }
.rh-tag { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 8px; }
.rh-h { font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.rh-sub { font-size: 13px; color: rgba(255,255,255,.65); line-height: 1.5; }
.rh-score { position: relative; z-index: 1; text-align: right; }
.rhs-big { font-family: var(--font-serif); font-size: 52px; font-weight: 700; color: var(--color-red-soft); line-height: 1; }
.rhs-lbl { font-size: 11px; color: rgba(255,255,255,.55); }

.dir-list { display: flex; flex-direction: column; gap: 10px; }
.dl-item {
  background: var(--color-cream-light);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all .2s;
}
.dl-item:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(33,40,66,.08); }
.dl-item.top { border-color: var(--color-red); }
.dl-rank { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-light); }
.dl-name { font-family: var(--font-serif); font-size: 15px; font-weight: 700; color: var(--color-navy); }
.dl-level { font-size: 12px; color: var(--color-text-light); }
.dl-bar-track { height: 4px; background: var(--color-border); border-radius: 4px; overflow: hidden; margin-bottom: 4px; width: 80px; }
.dl-bar-fill { height: 100%; border-radius: 4px; background: var(--color-red); animation: barIn 1.1s ease both; }
.dl-pct { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--color-red); }
.dl-right { display: flex; align-items: center; gap: 14px; }

.profile-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.prof-field { display: flex; flex-direction: column; gap: 5px; }
.pf-label { font-size: 11px; font-weight: 600; letter-spacing: .10em; text-transform: uppercase; color: var(--color-text-light); }
.pf-input {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text);
  outline: none;
  width: 100%;
}
.pf-input:focus { border-color: var(--color-navy); box-shadow: 0 0 0 3px rgba(33,40,66,.1); }
.btn-save {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 4px;
  border: none;
  background: var(--color-navy);
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-save:hover { background: var(--color-red); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.toggle-row:last-child { border-bottom: none; }
.tg-name { font-size: 14px; color: var(--color-text); margin-bottom: 2px; }
.tg-desc { font-size: 12px; color: var(--color-text-light); }
.toggle { width: 42px; height: 24px; border-radius: 24px; background: var(--color-border); cursor: pointer; position: relative; flex-shrink: 0; transition: background .25s; }
.toggle.on { background: var(--color-navy); }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.toggle.on .toggle-knob { transform: translateX(18px); }

.dc-tag { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 8px; }
.dc-h { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: 6px; }
.dc-sub { font-size: 12px; color: rgba(255,255,255,.65); line-height: 1.6; margin-bottom: 16px; }
.dc-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.dc-btn:hover { background: rgba(255,255,255,.22); }
.dc-inner { position: relative; z-index: 1; }

.sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.ph-greeting { font-size: 13px; color: var(--color-text-light); margin-bottom: 4px; }

.tab-content { padding: 0; }

.dash-placeholder {
  padding: 16px;
  color: var(--color-text-light);
  font-size: 14px;
}
