/* ══════════════════════════════════════════
   MD3 TOKENS – Google Drive aesthetic
══════════════════════════════════════════ */
:root {
  --md-primary: #0b57d0;
  --md-on-primary: #ffffff;
  --md-primary-cont: #d3e3fd;
  --md-on-primary-cont: #041e49;
  --md-surface: #f8fafd;
  --md-surface-1: #ffffff;
  --md-surface-2: #f0f4fc;
  --md-surface-var: #dde3ea;
  --md-bg: #f0f4f9;
  --md-outline: #c4c7c5;
  --md-outline-var: #e0e3e7;
  --md-on-surface: #1f1f1f;
  --md-on-surf-med: #444746;
  --md-on-surf-low: #747775;
  --md-shadow-1:
    0 1px 2px rgba(60, 64, 67, 0.15), 0 1px 3px 1px rgba(60, 64, 67, 0.08);
  --md-shadow-2:
    0 1px 2px rgba(60, 64, 67, 0.15), 0 2px 6px 2px rgba(60, 64, 67, 0.1);
  --md-shadow-3:
    0 4px 8px 3px rgba(60, 64, 67, 0.12), 0 1px 3px rgba(60, 64, 67, 0.15);
  --md-shape-xs: 4px;
  --md-shape-sm: 8px;
  --md-shape-md: 12px;
  --md-shape-lg: 16px;
  --md-shape-xl: 28px;
  --md-shape-full: 9999px;
  --md-ease: cubic-bezier(0.2, 0, 0, 1);
  --md-dur-fast: 150ms;
  --md-dur-med: 250ms;
  --font-display: "Google Sans", Roboto, sans-serif;
  --font-body: Roboto, "Google Sans", sans-serif;
  --font-mono: "Roboto Mono", monospace;
}
[data-theme="dark"] {
  --md-primary: #a8c7fa;
  --md-on-primary: #062e6f;
  --md-primary-cont: #0842a0;
  --md-on-primary-cont: #d3e3fd;
  --md-surface: #1a1c1e;
  --md-surface-1: #1e2124;
  --md-surface-2: #22262a;
  --md-surface-var: #414749;
  --md-bg: #111416;
  --md-outline: #8e9294;
  --md-outline-var: #3d4144;
  --md-on-surface: #e2e3e5;
  --md-on-surf-med: #c5c7ca;
  --md-on-surf-low: #8e9294;
  --md-shadow-1:
    0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px 1px rgba(0, 0, 0, 0.25);
  --md-shadow-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 6px 2px rgba(0, 0, 0, 0.3);
}

[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--md-bg);
  color: var(--md-on-surface);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition:
    background var(--md-dur-med),
    color var(--md-dur-med);
}
::selection {
  background: var(--md-primary-cont);
  color: var(--md-on-surface);
}
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--md-outline);
  border-radius: 4px;
  border: 2px solid var(--md-bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--md-primary);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--md-outline) transparent;
}
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
img,
.material-icons-round {
  -webkit-user-select: none;
  user-select: none;
}

/* APP BAR */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 20px;
  background: var(--md-surface-1);
  border-bottom: 1px solid var(--md-outline-var);
  transition:
    background var(--md-dur-med),
    box-shadow var(--md-dur-fast);
}
.app-bar--scrolled {
  box-shadow: var(--md-shadow-1);
  border-bottom-color: transparent;
}
.app-bar__start {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.app-bar__back {
  text-decoration: none;
  color: var(--md-on-surf-med);
  flex-shrink: 0;
}
.app-bar__wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--md-on-surf-med);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-bar__end {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* User chip: hardcoded in HTML, always visible without JS */
.app-bar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--md-shape-full);
  border: 1px solid var(--md-outline-var);
  margin-left: 4px;
  cursor: default;
  user-select: none;
  transition: background var(--md-dur-fast);
}
.app-bar__user:hover {
  background: var(--md-surface-2);
}
.app-bar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--md-primary);
  color: var(--md-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  user-select: none;
}
.app-bar__username {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--md-on-surf-med);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .app-bar__username {
    display: none;
  }
}

/* ICON BUTTON */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--md-on-surf-med);
  position: relative;
  overflow: hidden;
  transition: color var(--md-dur-fast);
  text-decoration: none;
}
.icon-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--md-dur-fast);
}
.icon-btn:hover::before {
  opacity: 0.08;
}
.icon-btn:active::before {
  opacity: 0.14;
}
.icon-btn .material-icons-round {
  font-size: 22px;
  position: relative;
  z-index: 1;
}

/* PAGE LAYOUT */
.page-main {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* PROFILE */
.profile-section {
  padding: 32px 0 28px;
}
.profile-inner {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--md-primary);
  color: var(--md-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  flex-shrink: 0;
  user-select: none;
}
.profile-info {
  flex: 1;
  min-width: 220px;
}
.profile-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--md-on-surface);
  line-height: 1.2;
  margin-bottom: 4px;
}
.profile-title {
  font-size: 14px;
  color: var(--md-on-surf-med);
  margin-bottom: 14px;
}
.profile-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  padding-top: 4px;
}

/* CHIPS */
.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--md-shape-full);
  border: 1px solid var(--md-outline-var);
  background: var(--md-surface-1);
  font-size: 12px;
  font-weight: 500;
  color: var(--md-on-surf-med);
  white-space: nowrap;
  user-select: none;
}

/* CONTACT BUTTONS */
.contact-btn {
  -webkit-user-select: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--md-shape-full);
  background: var(--md-primary);
  color: var(--md-on-primary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition:
    box-shadow var(--md-dur-fast),
    filter var(--md-dur-fast);
}
.contact-btn:hover {
  box-shadow: var(--md-shadow-2);
  filter: brightness(1.07);
}
.contact-btn--outline {
  background: transparent;
  color: var(--md-primary);
  border: 1px solid var(--md-outline-var);
}
.contact-btn--outline:hover {
  background: var(--md-primary-cont);
  border-color: var(--md-primary);
  filter: none;
  box-shadow: none;
}
.contact-btn .material-icons-round {
  font-size: 16px;
}

/* SECTION DIVIDER */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--md-on-surf-low);
}
.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--md-outline-var);
}
.section-divider__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.section-divider__label .material-icons-round {
  font-size: 16px;
}

/* COMPANY BLOCK */
.company-block {
  background: var(--md-surface-1);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-shape-xl);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--md-shadow-1);
  --company-accent: var(--md-primary);
  transition: box-shadow var(--md-dur-fast);
}
.company-block:hover {
  box-shadow: var(--md-shadow-2);
}
.company-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--md-outline-var);
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.company-header__left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.company-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--md-shape-sm);
  object-fit: contain;
  flex-shrink: 0;
}
.company-logo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--md-shape-sm);
  background: var(--company-accent, var(--md-primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.company-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--md-on-surface);
  transition: color var(--md-dur-fast);
}
.company-header:hover .company-name {
  color: var(--company-accent, var(--md-primary));
}
.company-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--md-on-surf-low);
  margin-top: 2px;
  flex-wrap: wrap;
}
.company-meta .material-icons-round {
  font-size: 13px;
}
.company-meta__sep {
  opacity: 0.5;
}
.company-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--md-on-surf-low);
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: color var(--md-dur-fast);
}
.company-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--md-dur-fast);
}
.company-link:hover {
  color: var(--company-accent, var(--md-primary));
}
.company-link:hover::before {
  opacity: 0.08;
}
.company-link .material-icons-round {
  font-size: 18px;
  position: relative;
  z-index: 1;
}
.company-desc {
  padding: 12px 20px 0;
  font-size: 13px;
  color: var(--md-on-surf-med);
  line-height: 1.6;
}

/* POSITION CARD */
.positions-list {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pos-card {
  border: 1px solid var(--md-outline-var);
  border-left: 3px solid var(--company-accent, var(--md-primary));
  border-radius: var(--md-shape-lg);
  padding: 16px 18px;
  background: var(--md-surface-1);
  transition:
    box-shadow var(--md-dur-fast),
    background var(--md-dur-fast);
}
.pos-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.pos-card__head-left {
  flex: 1;
  min-width: 0;
}
.pos-card__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--md-on-surface);
  line-height: 1.3;
  margin-top: 6px;
}
.pos-card__prev {
  font-size: 12px;
  color: var(--md-on-surf-low);
  margin-top: 2px;
}
.pos-card__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--md-on-surf-low);
  white-space: nowrap;
  padding-top: 2px;
  flex-shrink: 0;
}
.pos-card__desc {
  font-size: 13px;
  color: var(--md-on-surf-med);
  line-height: 1.6;
  margin-bottom: 12px;
}
.pos-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

/* Stats */
.pos-stats {
  display: flex;
  margin: 14px 0 4px;
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-shape-md);
  overflow: hidden;
  background: var(--md-surface-1);
}
.pos-stat {
  flex: 1;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-right: 1px solid var(--md-outline-var);
  gap: 2px;
}
.pos-stat:last-child {
  border-right: none;
}
.pos-stat__value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--company-accent, var(--md-primary));
  line-height: 1;
}
.pos-stat__label {
  font-size: 10px;
  color: var(--md-on-surf-low);
  text-align: center;
  line-height: 1.3;
}

/* Documents */
.pos-docs {
  margin-top: 14px;
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-shape-md);
  overflow: hidden;
  background: var(--md-surface-1);
}
.pos-docs__title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-on-surf-med);
  background: var(--md-surface-2);
  border-bottom: 1px solid var(--md-outline-var);
}
.pos-docs__title .material-icons-round {
  font-size: 16px;
}
.pos-docs__list {
  display: flex;
  flex-direction: column;
}
.doc-item {
  display: grid;
  grid-template-columns: 20px 1fr auto 20px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--md-on-surface);
  border-bottom: 1px solid var(--md-outline-var);
  transition: background var(--md-dur-fast);
}
.doc-item:last-child {
  border-bottom: none;
}
.doc-item:hover {
  background: var(--md-surface-2);
}
.doc-item__icon {
  font-size: 18px !important;
  color: var(--md-on-surf-low);
}
.doc-item__name {
  font-size: 13px;
  font-weight: 500;
}
.doc-item__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--md-on-surf-low);
  white-space: nowrap;
}
.doc-item__arrow {
  font-size: 18px !important;
  color: var(--md-on-surf-low);
}

/* Status badge */
.pos-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--md-shape-full);
  font-size: 11px;
  font-weight: 500;
  user-select: none;
  width: fit-content;
}
.pos-badge .material-icons-round {
  font-size: 13px;
}
.pos-badge--attestation {
  background: #e6f4ea;
  color: #1e7e34;
}
[data-theme="dark"] .pos-badge--attestation {
  background: rgba(30, 126, 52, 0.2);
  color: #6bcf7f;
}
.pos-badge--active {
  background: var(--md-primary-cont);
  color: var(--md-primary);
}
.pos-badge--past {
  background: var(--md-surface-var);
  color: var(--md-on-surf-low);
}

/* SKELETON */
.skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.skeleton {
  border-radius: var(--md-shape-xl);
  background: linear-gradient(
    90deg,
    var(--md-surface-2) 25%,
    var(--md-surface-var) 50%,
    var(--md-surface-2) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton--company {
  height: 180px;
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: -100% 50%;
  }
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 0;
  color: var(--md-on-surf-low);
  text-align: center;
}
.empty-state .material-icons-round {
  font-size: 56px;
  opacity: 0.4;
}
.empty-state p {
  font-size: 14px;
}
.empty-state code {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* FOOTER */
.page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 24px;
  font-size: 12px;
  color: var(--md-on-surf-low);
  border-top: 1px solid var(--md-outline-var);
}
.page-footer__dot {
  opacity: 0.4;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .page-main {
    padding: 0 12px 60px;
  }
  .profile-avatar {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }
  .profile-name {
    font-size: 22px;
  }
  .profile-actions {
    align-items: flex-start;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .pos-card__date {
    display: none;
  }
  .pos-stats {
    flex-wrap: wrap;
  }
  .pos-stat {
    min-width: 80px;
  }
  .doc-item {
    grid-template-columns: 20px 1fr 20px;
  }
  .doc-item__date {
    display: none;
  }
}
