/* VE Portal: the sign-in screens (.auth-shell) and the signed-in pages (.portal-shell). */
.lang-switch { color: var(--vk-gray-70); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }

/* ── Sign-in screens: a brand panel and a form card ── */
.auth-shell { display: grid; min-height: 100vh; background: #fff; }
.auth-brand { position: relative; display: flex; min-height: 360px; flex-direction: column; overflow: hidden; background: var(--vk-primary-70); padding: 48px; color: #fff; }
.auth-brand::after { content: ''; position: absolute; right: -80px; bottom: -160px; width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.025); }
.auth-brand > div, .auth-brand > .ci-logo { position: relative; z-index: 1; }
/* The panel text sits at the same height on every auth page, whatever else the panel holds. */
.auth-brand > div { margin: auto 0; }
.auth-brand .eyebrow { color: rgba(255,255,255,.78); font-size: 14px; font-weight: 700; }
.auth-brand h1 { margin: 12px 0 16px; font-size: clamp(42px, 6vw, 64px); font-weight: 700; line-height: 1.2; letter-spacing: -.03em; }
.auth-brand p { font-size: 17px; line-height: 1.7; }
.auth-brand p:not(.eyebrow) { color: rgba(255,255,255,.68); }
.auth-brand > small { position: absolute; z-index: 1; left: 48px; bottom: 48px; color: rgba(255,255,255,.78); font-size: 13px; font-weight: 700; letter-spacing: .1em; }
.auth-brand .lang-switch { position: absolute; z-index: 1; top: 60px; right: 48px; color: rgba(255,255,255,.85); }

.auth-form-wrap { display: flex; align-items: center; justify-content: center; background: var(--vk-gray-5); padding: 64px 24px; }
.auth-form { width: min(100%, 480px); border: 1px solid var(--vk-gray-20); border-radius: var(--vk-radius-xl); background: #fff; padding: 40px; box-shadow: var(--vk-shadow-md); }
.auth-form header { margin-bottom: 32px; }
.auth-form header > p { margin: 0; color: var(--vk-primary-60); font-size: 14px; font-weight: 700; }
.auth-form h2 { margin: 8px 0; font-size: 34px; line-height: 1.3; letter-spacing: -.03em; }
.auth-form header > span { color: var(--vk-gray-70); font-size: 16px; }
.auth-form header > span b { color: var(--vk-gray-90); overflow-wrap: anywhere; }
.auth-form > label, .auth-form form > label { display: block; margin: 24px 0 8px; font-size: 15px; font-weight: 700; }
.auth-form .vk-alert { margin: 0 0 20px; }
#id_callsign { text-transform: uppercase; }
.input-note { position: relative; }
.input-note span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: rgba(24,33,43,.4); font-size: 11px; pointer-events: none; }
.check-row { display: flex; justify-content: space-between; margin-top: 20px; color: var(--vk-gray-70); font-size: 14px; }
.check-row label { display: flex; align-items: center; gap: 6px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--vk-primary-50); }
.submit-button { justify-content: space-between; margin-top: 32px; padding: 0 20px; }
.auth-foot { margin-top: 24px; color: var(--vk-gray-70); font-size: 15px; text-align: center; }
.auth-foot a { color: var(--vk-primary-60); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.password-help, .privacy-note { color: var(--vk-gray-50); font-size: 13px; line-height: 1.6; }
.password-help { margin: 8px 0; }
.privacy-note { margin-top: 16px; text-align: center; }

/* Signup steps and account status */
.signup-steps { display: flex; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; counter-reset: step; }
.signup-steps li { flex: 1; border-top: 4px solid var(--vk-gray-20); padding-top: 10px; color: var(--vk-gray-50); font-size: 13px; font-weight: 700; counter-increment: step; }
.signup-steps li::before { content: counter(step) ". "; }
.signup-steps li.done { border-color: var(--vk-success-60); color: var(--vk-success-60); }
.signup-steps li.current { border-color: var(--vk-primary-60); color: var(--vk-primary-60); }
.signup-steps li.stopped { border-color: var(--vk-danger-60); color: var(--vk-danger-60); }
.status-details { margin-top: 24px; border-top: 1px solid var(--vk-gray-20); padding-top: 20px; font-size: 15px; }
.status-details summary { cursor: pointer; color: var(--vk-gray-70); }
.status-note { margin: 0; color: var(--vk-gray-70); font-size: 15px; }
.status-note a { color: var(--vk-primary-60); text-decoration: underline; text-underline-offset: 4px; }
.no-profile-note { margin-top: 20px; }
.status-logout { margin-top: 32px; border-top: 1px solid var(--vk-gray-20); padding-top: 20px; text-align: center; }

/* ── Signed-in pages: sidebar + main ── */
.portal-shell { display: grid; min-height: 100vh; background: var(--vk-gray-5); }
.sidebar { display: none; border-right: 1px solid var(--vk-gray-20); background: #fff; padding: 32px 20px; color: var(--vk-gray-90); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; margin-top: 48px; }
.sidebar nav > p { padding: 0 13px; color: var(--vk-gray-50); font-size: 13px; font-weight: 700; letter-spacing: .03em; }
.sidebar nav > p:not(:first-child) { margin-top: 24px; }
.sidebar nav a { display: flex; align-items: center; gap: 13px; border-radius: var(--vk-radius-md); padding: 12px 14px; color: var(--vk-gray-70); font-size: 15px; }
.sidebar nav a:hover, .sidebar nav a.active { background: var(--vk-primary-5); color: var(--vk-primary-60); }
.sidebar nav i { width: 16px; font-style: normal; }
.sidebar nav small.count { margin-left: auto; border-radius: var(--vk-radius-pill); background: var(--vk-danger-60); padding: 1px 8px; color: #fff; font-size: 12px; font-weight: 700; }
.sidebar .lang-switch { margin: auto 0 16px 14px; }
.sidebar-user { display: flex; align-items: center; gap: 12px; margin-top: auto; border-top: 1px solid var(--vk-gray-20); padding-top: 22px; }
.sidebar .lang-switch + .sidebar-user { margin-top: 0; }
.sidebar-user > span { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--vk-radius-md); background: var(--vk-primary-60); color: #fff; font-size: 11px; font-weight: 500; }
.sidebar-user div { display: flex; min-width: 0; flex-direction: column; }
.sidebar-user b { color: var(--vk-gray-90); font-size: 14px; font-weight: 500; }
.sidebar-user small { max-width: 144px; overflow: hidden; color: var(--vk-gray-50); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { margin-top: 16px; border: 0; background: transparent; padding: 0; color: var(--vk-gray-50); font-size: 13px; cursor: pointer; }

.portal-main { min-width: 0; max-width: 1400px; padding: 48px; }
.portal-main > .vk-alert { margin: 24px 0 0; }
.portal-main > .vk-alert + .vk-alert { margin-top: 12px; }
.portal-header { display: flex; flex-direction: column; gap: 19px; }
.portal-header h1 { margin: 8px 0 0; font-size: clamp(32px, 4vw, 44px); line-height: 1.3; letter-spacing: -.03em; }
.portal-header > .vk-btn { align-self: flex-start; }
.verified { width: max-content; }
.staff-banner { display: block; color: var(--vk-primary-60); font-size: 15px; }

/* Summary tiles */
.summary-grid { display: grid; gap: 16px; margin-top: 40px; }
.summary-grid article { display: flex; min-height: 176px; flex-direction: column; border: 1px solid var(--vk-gray-20); border-radius: var(--vk-radius-lg); background: #fff; padding: 24px; }
.summary-grid article > p { margin: 0; color: var(--vk-primary-60); font-size: 13px; font-weight: 700; }
.summary-grid article strong { margin-top: auto; font-size: 26px; }
.summary-grid article span { margin-top: 8px; color: var(--vk-gray-50); font-size: 14px; }
.summary-grid .summary-primary { border-color: var(--vk-primary-60); background: var(--vk-primary-60); color: #fff; }
.summary-grid .summary-primary > p, .summary-grid .summary-primary span { color: rgba(255,255,255,.78); }
.summary-grid .summary-primary strong { font-size: 38px; font-weight: 500; line-height: 1.2; }
.status-active { color: var(--vk-success-60); text-transform: capitalize; }
.status-inactive { color: var(--vk-danger-60); text-transform: capitalize; }

/* Panels (.vk-card) */
.profile-panel { margin-top: 24px; scroll-margin-top: 16px; }
.panel-head { display: flex; flex-direction: column; gap: 16px; border-bottom: 1px solid var(--vk-gray-10); padding-bottom: 24px; }
.panel-head h2 { margin: 6px 0 0; font-size: 26px; }
.panel-head > span { color: var(--vk-gray-50); font-size: 14px; }
.panel-head .vk-link { font-size: 14px; }
.panel-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.panel-action > span { color: var(--vk-gray-50); font-size: 14px; }
.panel-empty { margin: 24px 0 0; color: var(--vk-gray-50); font-size: 15px; }
.profile-grid { display: grid; }
.profile-grid dl { margin: 0; }
.profile-grid dl div { display: grid; grid-template-columns: 112px 1fr; border-bottom: 1px solid var(--vk-gray-10); padding: 18px 0; }
.profile-grid dt { color: var(--vk-gray-50); font-size: 14px; }
.profile-grid dd { margin: 0; font-size: 16px; font-weight: 600; }
.data-note { margin: 24px 0 0; color: var(--vk-gray-70); font-size: 13px; line-height: 1.6; }
.muted { color: var(--vk-gray-50); font-size: 13px; font-weight: 400; }
.privacy-reminder { margin: 24px 0 0; color: var(--vk-gray-70); font-size: 14px; }

/* Session tables (.vk-table--plain) */
.table-scroll { overflow-x: auto; }
.table-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 20px; }
.table-search input[type=search] { flex: 0 1 320px; min-width: 0; }
.table-search .vk-link { font-size: 14px; }
.table-search + .table-scroll { margin-top: 8px; }
.table-count { margin: 16px 0 0; color: var(--vk-gray-70); font-size: 14px; }
.portal-table { min-width: 640px; }
.portal-table td { white-space: nowrap; }
.portal-table td:has(.ve-chips) { white-space: normal; }
.portal-table tr.mine td { background: var(--vk-primary-5); }
.portal-table tr.is-link.mine:hover td { background: var(--vk-primary-10); }
.portal-table .row-link { color: var(--vk-primary-60); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.portal-table code { font-family: inherit; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.portal-table .outcome { font-weight: 700; }
.portal-table .outcome.is-pass { color: var(--vk-success-60); }
.portal-table .outcome.is-fail { color: var(--vk-danger-60); }
.portal-table .pending, .panel-action .pending { color: var(--vk-gray-50); font-size: 14px; }
.portal-table .state { color: var(--vk-success-60); font-weight: 700; }
.portal-table .state.full { color: var(--vk-gray-50); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-table .row-actions { flex-wrap: nowrap; }
.ve-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ve-chips i { border: 1px solid var(--vk-gray-20); border-radius: var(--vk-radius-sm); background: #fff; padding: 1px 8px; color: var(--vk-gray-70); font-size: 13px; font-style: normal; font-weight: 700; }
.ve-chips i.me { border-color: var(--vk-primary-60); background: var(--vk-primary-5); color: var(--vk-primary-60); }
.ve-chips em { color: var(--vk-gray-50); font-size: 13px; font-style: normal; }

/* Dashboard notices */
.notice-rows { margin: 0; padding: 0; list-style: none; }
.notice-rows a { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--vk-gray-10); padding: 16px 0; }
.notice-rows a:hover b { color: var(--vk-primary-60); text-decoration: underline; text-underline-offset: 4px; }
.notice-rows .vk-tag { flex: none; }
.notice-rows b { flex: 1; min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.notice-rows .pinned { color: var(--vk-primary-60); font-size: 13px; font-style: normal; }
.notice-rows time { flex: none; color: var(--vk-gray-50); font-size: 14px; }

/* Answer sheet (built on exam_requests/results.css) */
.sheet-detail { margin-top: 32px; }
.sheet-detail .result-summary div, .sheet-detail .result-question { background: #fff; }

/* Signup approvals */
.approval-guide { max-width: 860px; margin: 24px 0 0; color: var(--vk-gray-70); font-size: 15px; }
.approval-card { margin-top: 24px; padding: 24px; }
.approval-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.approval-head strong { font-size: 26px; }
.approval-head span { color: var(--vk-gray-70); font-size: 15px; }
.approval-card dl { margin: 16px 0 0; }
.approval-card dl div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; border-top: 1px solid var(--vk-gray-10); padding: 12px 0; }
.approval-card dt { color: var(--vk-gray-50); font-size: 14px; }
.approval-card dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.approval-card dd .vk-tag { margin-right: 6px; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.approval-actions input[name=note] { flex: 1 1 260px; min-width: 0; }
.approval-empty { margin-top: 24px; border: 1px dashed var(--vk-gray-20); border-radius: var(--vk-radius-lg); background: #fff; padding: 32px; color: var(--vk-gray-70); text-align: center; }
.approval-history { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 14px; }
.approval-history th, .approval-history td { border-bottom: 1px solid var(--vk-gray-10); padding: 10px 8px; text-align: left; overflow-wrap: anywhere; }
.approval-history th { color: var(--vk-gray-50); font-weight: 700; }

/* Account forms and activity history */
.inline-form { margin-top: 28px; border-top: 1px solid var(--vk-gray-10); padding-top: 24px; }
.inline-form h3 { margin: 0; font-size: 19px; }
.inline-form .data-note { margin: 6px 0 0; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-top: 16px; }
.inline-fields label { display: flex; flex: 1 1 240px; flex-direction: column; gap: 6px; min-width: 0; margin: 0; font-size: 14px; font-weight: 700; }
.inline-fields .vk-field-error { margin: 0; font-style: normal; }
.pending-change { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 20px; border-radius: var(--vk-radius-md); background: var(--vk-primary-5); padding: 12px 16px; font-size: 15px; }
.pending-change p { margin: 0; overflow-wrap: anywhere; }
.year-bars { margin: 16px 0 0; padding: 0; list-style: none; }
.year-bars li { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 12px; padding: 8px 0; font-size: 15px; }
.year-bars .bar { height: 12px; overflow: hidden; border-radius: var(--vk-radius-pill); background: var(--vk-gray-10); }
.year-bars .bar i { display: block; height: 100%; border-radius: var(--vk-radius-pill); background: var(--vk-primary-50); }
.year-bars em { color: var(--vk-gray-70); font-style: normal; text-align: right; }
.count-rule { margin: 16px 0 0; color: var(--vk-gray-70); font-size: 14px; }
.count-rule-inline { display: block; margin-top: 2px; color: var(--vk-gray-50); font-size: 13px; }

/* Mobile menu: a top bar with a button that opens the sidebar as a drawer. */
.mobile-bar, .menu-close { display: none; }

@media (min-width: 800px) {
  .auth-shell { grid-template-columns: .9fr 1.1fr; align-items: start; }
  .auth-brand { position: sticky; top: 0; height: 100vh; min-height: 0; }
  .auth-form-wrap { min-height: 100vh; }
  .portal-shell { grid-template-columns: 260px 1fr; }
  .sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; }
  .portal-header { flex-direction: row; align-items: center; justify-content: space-between; }
  .summary-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .panel-head { flex-direction: row; align-items: end; justify-content: space-between; }
  .profile-grid { grid-template-columns: 1fr 1fr; gap: 48px; }
}

@media (max-width: 799px) {
  .auth-brand { min-height: 320px; padding: 32px 24px; }
  .auth-brand > small { left: 24px; bottom: 32px; }
  .auth-brand .lang-switch { top: 44px; right: 24px; }
  .auth-form-wrap { padding: 32px 16px; }
  .auth-form { padding: 28px 20px; }
  .portal-shell { grid-template-columns: minmax(0, 1fr); }
  .portal-main { padding: 32px 16px 64px; }
  .approval-card dl div { grid-template-columns: 1fr; gap: 2px; }
  .panel-action { margin-top: 4px; }

  .mobile-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--vk-gray-20); background: #fff; padding: 10px 16px; }
  .mobile-bar .ci-logo { gap: 10px; }
  .mobile-bar .ci-logo-mark { width: 34px; height: 34px; }
  .mobile-bar .ci-logo-name { font-size: 16px; }
  .mobile-bar .ci-logo-sub { display: none; }
  .menu-toggle { height: 40px; border: 1px solid var(--vk-gray-50); border-radius: var(--vk-radius-md); background: #fff; padding: 0 14px; color: var(--vk-gray-90); font-size: 15px; font-weight: 700; cursor: pointer; }
  .menu-toggle::before { content: "☰"; margin-right: 6px; }
  .sidebar.is-open { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; display: flex; width: min(300px, 86vw); flex-direction: column; overflow-y: auto; box-shadow: 0 8px 32px rgba(30,40,50,.24); }
  .sidebar.is-open .menu-close { position: absolute; top: 24px; right: 16px; display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 0; border-radius: var(--vk-radius-md); background: transparent; color: var(--vk-gray-70); font-size: 18px; cursor: pointer; }
  .sidebar.is-open nav { margin-top: 32px; }
  .sidebar.is-open .lang-switch { margin-top: 24px; }
  .sidebar-backdrop { position: fixed; z-index: 40; inset: 0; background: rgba(20,26,34,.45); }
  .vk-app.menu-open { overflow: hidden; }
}
