@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 200 600;
  font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 600;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f5;
  --surface: #FFFFFF;
  --surface-2: #F5F4EE;
  --subtle: #e4e4e4;
  --border: rgba(26, 25, 23, 0.09);
  --border-strong: rgba(26, 25, 23, 0.18);
  --text: #1A1917;
  --muted: #6B6860;
  --accent: #000DFF;
  --accent-hover: #000ACC;
  --accent-soft: rgba(0, 13, 255, 0.08);
  --highlight: #E90066;
  --highlight-soft: rgba(233, 0, 102, 0.09);
  --ok: #157347;
  --ok-soft: rgba(21, 115, 71, 0.10);
  --warn: #A15C07;
  --warn-soft: rgba(161, 92, 7, 0.10);
  --err: #B42318;
  --err-soft: rgba(180, 35, 24, 0.10);
  --shadow-sm: 0 1px 2px rgba(20, 18, 14, 0.04);
  --shadow-md: 0 1px 3px rgba(20, 18, 14, 0.05), 0 8px 24px rgba(20, 18, 14, 0.04);
  --auth-glow: #FFFFFF;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Bricolage Grotesque", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1F1E1D;
  --surface: #2B2A27;
  --surface-2: #242321;
  --subtle: #353430;
  --border: rgba(240, 238, 230, 0.10);
  --border-strong: rgba(240, 238, 230, 0.19);
  --text: #F0EEE6;
  --muted: #A6A299;
  --accent: #3B46FF;
  --accent-hover: #525CFF;
  --accent-soft: rgba(59, 70, 255, 0.17);
  --highlight: #FF3385;
  --highlight-soft: rgba(233, 0, 102, 0.16);
  --ok: #4ADE80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --warn: #FACC15;
  --warn-soft: rgba(250, 204, 21, 0.12);
  --err: #F87171;
  --err-soft: rgba(248, 113, 113, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.30), 0 10px 28px rgba(0, 0, 0, 0.25);
  --auth-glow: #2A2926;
}

@media (prefers-color-scheme: dark) {

  :root[data-theme="system"],
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #1F1E1D;
    --surface: #2B2A27;
    --surface-2: #242321;
    --subtle: #353430;
    --border: rgba(240, 238, 230, 0.10);
    --border-strong: rgba(240, 238, 230, 0.19);
    --text: #F0EEE6;
    --muted: #A6A299;
    --accent: #3B46FF;
    --accent-hover: #525CFF;
    --accent-soft: rgba(59, 70, 255, 0.17);
    --highlight: #FF3385;
    --highlight-soft: rgba(233, 0, 102, 0.16);
    --ok: #4ADE80;
    --ok-soft: rgba(74, 222, 128, 0.12);
    --warn: #FACC15;
    --warn-soft: rgba(250, 204, 21, 0.12);
    --err: #F87171;
    --err-soft: rgba(248, 113, 113, 0.12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.30), 0 10px 28px rgba(0, 0, 0, 0.25);
    --auth-glow: #2A2926;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

strong,
b {
  font-weight: 600;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.svg-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.svg-icon-sm {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.portal-logo-img {
  height: 14px;
  width: auto;
  display: block;
}

.rel {
  position: relative;
}

.m-0 {
  margin: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-xs {
  margin-bottom: 6px;
}

.mb-sm {
  margin-bottom: 10px;
}

.mb-md {
  margin-bottom: 14px;
}

.mt-xs {
  margin-top: 4px;
}

.mt-sm {
  margin-top: 12px;
}

.gap-sm {
  gap: 8px;
}

.plan-desc {
  margin: 0 0 12px;
}

body.modal-open {
  overflow: hidden;
}

/* ---- AUTH ---- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 24px 32px;
  background: radial-gradient(circle at 50% 0%, var(--auth-glow) 0%, var(--bg) 68%);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 17px;
  width: auto;
  display: block;
}

.logo-dark {
  display: none;
}

:root[data-theme="dark"] .logo-light {
  display: none;
}

:root[data-theme="dark"] .logo-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {

  :root[data-theme="system"] .logo-light,
  :root:not([data-theme]) .logo-light {
    display: none;
  }

  :root[data-theme="system"] .logo-dark,
  :root:not([data-theme]) .logo-dark {
    display: block;
  }
}

.auth-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.auth-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.auth-heading {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  margin: 0 0 18px;
  text-align: center;
}

.btn-google {
  gap: 9px;
  font-weight: 550;
}

.google-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--subtle);
  padding: 3px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 7px 10px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.theme-icon-group {
  display: inline-flex;
  align-items: center;
  background: var(--subtle);
  padding: 2px;
  border-radius: 7px;
  gap: 2px;
}

.theme-icon-btn {
  width: 26px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.theme-icon-btn:hover {
  color: var(--text);
}

.theme-icon-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.theme-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.theme-menu-item:hover {
  background: var(--subtle);
}

.theme-menu-item .check-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--highlight);
  opacity: 0;
}

.theme-menu-item.active .check-dot {
  opacity: 1;
}

.account-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}

.account-trigger:hover {
  background: var(--subtle);
}

.account-popover {
  position: absolute;
  bottom: 62px;
  left: 8px;
  right: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-md);
  z-index: 40;
}

.popover-top-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.popover-top-btn:hover {
  color: var(--text);
  background: var(--subtle);
}

.popover-floating {
  position: absolute;
  top: 62px;
  right: 32px;
  width: 176px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-md);
  z-index: 40;
}

.popover-row-static {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.popover-sep {
  height: 1px;
  background: var(--border);
  margin: 5px 0;
}

.popover-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.popover-item:hover {
  background: var(--subtle);
}

.cv-text-fallback {
  padding: 16px 18px;
  max-height: 420px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-2);
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1px solid rgba(26, 25, 23, 0.08);
}

/* ---- SHELL ---- */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px 1fr;
  background: var(--surface);
  transition: grid-template-columns 0.18s ease;
}

.shell.sidebar-collapsed {
  grid-template-columns: 58px 1fr;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 2px 4px;
}

.sidebar-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.sidebar-toggle-btn:hover {
  background: var(--subtle);
  color: var(--text);
}

.sidebar-chevron {
  transition: transform 0.16s ease;
  transform-origin: 17px 12px;
}

.shell.sidebar-collapsed .sidebar-chevron {
  transform: rotate(180deg);
}

.shell.sidebar-collapsed .wordmark,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .nav-badge,
.shell.sidebar-collapsed .user-info-text,
.shell.sidebar-collapsed .account-chevron {
  display: none;
}

.shell.sidebar-collapsed .sidebar-top {
  justify-content: center;
}

.shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 9px;
}

.shell.sidebar-collapsed .account-trigger {
  justify-content: center;
  padding: 6px;
}

.shell.sidebar-collapsed .account-popover {
  left: 8px;
  right: auto;
  width: 216px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 24px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.nav-item-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.nav-item:hover {
  background: var(--subtle);
  color: var(--text);
}

.nav-item.active {
  background: var(--subtle);
  color: var(--text);
  font-weight: 500;
  border-color: transparent;
}

.side-foot {
  position: relative;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popover-user-email {
  padding: 4px 8px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.user-info-text {
  min-width: 0;
  flex: 1;
}

.admin-role-label {
  font-weight: 600;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--subtle);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-pane {
  padding: 36px 48px 72px;
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
  background: var(--surface);
}

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

.pane-title {
  margin: 0;
  font-family: var(--sans);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.25;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 24px;
  margin-bottom: 16px;
}

.panel-table {
  padding: 0;
  overflow-x: auto;
}

.cv-file-name {
  font-weight: 600;
  font-size: 13.5px;
}

.pdf-loading {
  color: #FFFFFF;
}

.job-title-link {
  font-weight: 600;
}

.details-summary {
  cursor: pointer;
}

.app-status-select {
  width: auto;
  padding: 4px 8px;
  font-size: 12.5px;
}

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

.panel-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}

.cv-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.cv-file-meta {
  display: flex;
  align-items: center;
  gap: 11px;
}

.cv-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(12, 12, 18, 0.76);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  padding: 40px 20px 56px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pdf-modal::-webkit-scrollbar {
  display: none;
}

.pdf-modal-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 20, 26, 0.72);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 130;
  transition: background 0.14s ease, transform 0.14s ease;
}

.pdf-modal-close:hover {
  background: rgba(20, 20, 26, 0.94);
  transform: scale(1.04);
}

.pdf-modal-pages {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.pdf-page-canvas {
  display: block;
  width: min(780px, 100%);
  height: auto;
  background: #FFFFFF;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.pdf-fallback-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 15px 17px;
}

.stat-k {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.stat-v {
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- FORMS ---- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

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

.between {
  justify-content: space-between;
}

.wrap {
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field>span {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.btn {
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  transition: all 0.14s ease;
}

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

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--subtle);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: var(--subtle);
  color: var(--muted);
}

.pill-accent {
  background: var(--highlight-soft);
  color: var(--highlight);
}

.pill-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

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

th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  background: transparent;
  border-bottom-color: var(--border-strong);
}

tbody tr:hover td {
  background: var(--bg);
}

tr:last-child td {
  border-bottom: none;
}

.notice {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--subtle);
}

.notice.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.notice.err {
  background: var(--err-soft);
  color: var(--err);
}

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

.small {
  font-size: 12.5px;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 12px;
  }

  .nav-item {
    width: auto;
  }

  .main-pane {
    padding: 20px 16px;
  }

  .stats-row,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}