:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --text: #182235;
  --muted: #687386;
  --soft-muted: #9099a8;
  --line: #e3e8f0;
  --accent: #355fe8;
  --accent-soft: #edf2ff;
  --shadow: 0 12px 36px rgba(21, 32, 55, 0.07);
  --green: #1b805b;
  --red: #c24747;
  --gold: #9b6d07;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #e8edff, transparent 34%), var(--bg); }
.login-card { width: min(100%, 420px); padding: 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: #233052; color: #fff; font-weight: 800; font-size: 22px; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 11px; font-size: 16px; }
.eyebrow { margin: 20px 0 6px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.login-card h1 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.login-copy { margin: 10px 0 24px; color: var(--muted); }
.field-label, .select-field > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; height: 46px; margin-top: 7px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; outline: none; }
.login-card input:focus, .select-field select:focus, .select-field input:focus, .search-field input:focus, .inline-field input:focus { border-color: #9aafff; box-shadow: 0 0 0 3px rgba(53, 95, 232, .1); }
.button { min-height: 40px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--text); font-weight: 700; transition: background .15s, transform .15s, border-color .15s; }
.button:hover { background: #f5f7fb; }
.button:active { transform: translateY(1px); }
.button.primary { border-color: var(--accent); background: var(--accent); color: white; }
.button.primary:hover { background: #244dd0; }
.button.secondary { border-color: #d5def8; background: #f5f7ff; color: #2e52c7; }
.button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.login-button { width: 100%; margin-top: 14px; }
.form-message { min-height: 22px; margin: 12px 0 0; color: var(--red); font-size: 13px; }

.topbar { position: sticky; top: 0; z-index: 20; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 max(22px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid rgba(225, 230, 239, .9); background: rgba(255, 255, 255, .9); backdrop-filter: blur(16px); }
.brand, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.brand { color: var(--text); text-decoration: none; font-weight: 800; }
.topbar-actions { gap: 14px; }
.role-badge, .scope-pill { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid #dfe5f1; border-radius: 999px; background: #f6f8fb; color: #536074; font-size: 12px; font-weight: 750; white-space: nowrap; }
.container { width: min(1180px, 100%); margin: 0 auto; padding: 28px 22px 70px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 28px 30px; margin-bottom: 24px; border-radius: 22px; background: linear-gradient(125deg, #172033, #2b3b62); box-shadow: var(--shadow); color: white; }
.hero .eyebrow { margin: 0 0 7px; color: #aabaff; }
.hero h1 { margin: 0; font-size: clamp(27px, 4vw, 38px); line-height: 1.15; letter-spacing: -.035em; }
.hero p:not(.eyebrow) { margin: 8px 0 0; color: rgba(255,255,255,.72); }
.page-tabs { display: flex; gap: 6px; padding: 5px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; background: rgba(255,255,255,.08); }
.page-tab { padding: 9px 14px; border: 0; border-radius: 9px; background: transparent; color: rgba(255,255,255,.75); font-weight: 750; white-space: nowrap; }
.page-tab:hover { background: rgba(255,255,255,.1); color: white; }
.page-tab.active { background: white; color: #24345a; box-shadow: 0 3px 10px rgba(0,0,0,.13); }
.page-view { animation: rise-in .18s ease-out; }
@keyframes rise-in { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 2px 14px; }
.section-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: 0 3px 14px rgba(25, 40, 68, .03); }
.date-filter-card { margin-bottom: 14px; }
.filter-intro, .card-heading, .owner-tools { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.filter-intro h3, .card-heading h3, .summary-card h3, .owner-tools h3 { margin: 0; font-size: 15px; }
.filter-intro p, .owner-tools p { max-width: 660px; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.select-field { display: grid; gap: 5px; min-width: 145px; }
.select-field select, .select-field input, .search-field input { width: 100%; min-width: 0; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--text); outline: none; }
.compact-field { min-width: 170px; }
.date-range { display: flex; justify-content: flex-end; align-items: end; gap: 10px; padding-top: 14px; }
.date-range .select-field { min-width: 150px; }
.status-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.status-stat { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; text-align: left; font-weight: 750; transition: transform .15s, box-shadow .15s; }
.status-stat:hover { transform: translateY(-2px); box-shadow: 0 7px 18px rgba(28, 40, 66, .08); }
.status-stat span { font-size: 13px; }
.status-stat strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.status-stat.status-unapplied { background: #fff; color: #536074; }
.status-stat.status-submitted { background: #f0f2f5; color: #586273; border-color: #dfe3e9; }
.status-stat.status-assessment { background: #edf4ff; color: #2d62cb; border-color: #cfe0ff; }
.status-stat.status-interview { background: #eaf8f1; color: #18784f; border-color: #ccebd9; }
.status-stat.status-offer { background: linear-gradient(135deg, #fff8df, #ffefb2); color: #8b6100; border: 1px solid #eac85b; box-shadow: inset 0 0 0 1px rgba(255,255,255,.75); }
.status-stat.status-failed { background: #fff0f0; color: #b93939; border-color: #f0caca; }
.status-stat.status-partial { background: #fff7df; color: #946600; border-color: #eddda5; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, .75fr); gap: 14px; }
.subtle { color: var(--soft-muted); font-size: 12px; }
.category-stats { display: grid; gap: 9px; margin-top: 13px; }
.category-stat { display: grid; grid-template-columns: minmax(130px, 1.1fr) minmax(60px, 2fr) 30px; align-items: center; gap: 10px; padding: 2px 0; border: 0; background: transparent; text-align: left; }
.category-name { overflow: hidden; color: #4d596b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.category-track { height: 8px; overflow: hidden; border-radius: 99px; background: #eef1f6; }
.category-fill { height: 100%; border-radius: inherit; background: #8699db; transition: width .2s; }
.category-count { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.summary-total { display: flex; align-items: baseline; gap: 8px; margin: 13px 0 4px; }
.summary-total strong { font-size: 42px; line-height: 1; letter-spacing: -.04em; }
.summary-total span, .summary-card p { color: var(--muted); }
.summary-card p { min-height: 38px; margin: 9px 0 14px; font-size: 13px; }
.wide-button { width: 100%; }
.owner-tools { margin-top: 14px; }
.file-button { position: relative; overflow: hidden; flex: 0 0 auto; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.list-heading { margin-bottom: 13px; }
.list-heading-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.scope-pill { max-width: 48%; white-space: normal; text-align: center; justify-content: center; }
.list-filters { display: grid; grid-template-columns: minmax(210px, 1.6fr) repeat(3, minmax(130px, .8fr)) auto; align-items: end; gap: 10px; margin-bottom: 12px; }
.search-field { display: grid; gap: 5px; }
.search-field input { height: 43px; padding: 0 13px; }
.list-filters .select-field select { height: 43px; }
.clear-button { height: 43px; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 2px; color: var(--muted); font-size: 13px; }
.pagination-actions { display: flex; align-items: center; gap: 7px; }
.pagination-actions .button { min-height: 34px; padding: 5px 10px; }
.pagination-actions select { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.company-list { display: grid; gap: 9px; }
.company-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 2px 9px rgba(25, 40, 68, .025); }
.company-card[open] { border-color: #c7d4ff; box-shadow: var(--shadow); }
.company-summary { display: grid; grid-template-columns: 42px minmax(140px, 1fr) minmax(112px, 142px) minmax(142px, 162px) minmax(160px, 190px) auto 20px; align-items: center; gap: 10px; min-height: 71px; padding: 10px 13px; list-style: none; cursor: pointer; }
.company-summary::-webkit-details-marker { display: none; }
.company-number { width: 34px; height: 29px; display: inline-grid; place-items: center; border-radius: 9px; background: #f0f2f7; color: #596579; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.company-name { min-width: 0; overflow-wrap: anywhere; font-weight: 780; }
.status-select { min-width: 0; height: 37px; padding: 0 25px 0 9px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 780; outline: none; }
.status-select.status-unapplied { background: white; color: #4c586a; border-color: #e1e6ee; }
.status-select.status-submitted { background: #eef0f3; color: #5d6673; border-color: #dde2e8; }
.status-select.status-assessment { background: #edf4ff; color: #2d62cb; border-color: #cfe0ff; }
.status-select.status-interview { background: #eaf8f1; color: #18784f; border-color: #ccebd9; }
.status-select.status-offer { background: #fff1bb; color: #8b6100; border-color: #eac85b; font-weight: 850; }
.status-select.status-failed { background: #fff0f0; color: #b93939; border-color: #f0caca; }
.status-select.status-partial { background: #fff7df; color: #946600; border-color: #eddda5; }
.inline-field { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.inline-field input { min-width: 0; width: 100%; height: 35px; padding: 0 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); outline: none; font-size: 12px; }
.inline-field.note-field input { padding: 0 9px; }
.list-career-link { padding: 8px 9px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.list-career-link:hover { background: #dfe8ff; }
.chevron { color: var(--soft-muted); transition: transform .16s; }
.company-card[open] .chevron { transform: rotate(180deg); }
.details-body { display: grid; gap: 14px; padding: 16px 20px 18px 65px; border-top: 1px solid var(--line); }
.details-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { padding: 4px 9px; border-radius: 999px; background: #edf2ff; color: #465ba9; font-size: 11px; font-weight: 750; }
.pill.muted { background: #f2f4f7; color: #687386; }
.deadline-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfe; font-size: 12px; }
.deadline-line strong { color: var(--text); }
.deadline-line a, .detail-links a { color: var(--accent); font-weight: 700; text-decoration: none; }
.deadline-line a { margin-left: auto; }
.company-description { margin: 0; color: #525e70; font-size: 13px; line-height: 1.75; }
.detail-edit-grid { display: grid; grid-template-columns: minmax(210px, .75fr) minmax(220px, 1.25fr); gap: 12px; }
.detail-edit { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.detail-edit h4 { margin: 0; font-size: 12px; }
.detail-edit input { width: 100%; height: 37px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: white; outline: none; }
.date-edit-row { display: flex; align-items: center; gap: 8px; }
.date-edit-row input { min-width: 0; }
.date-empty { min-width: 24px; color: var(--soft-muted); font-size: 12px; }
.detail-note-input { font-size: 13px; }
.char-count { color: var(--soft-muted); font-size: 11px; text-align: right; }
.detail-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; }
.empty-state { padding: 42px 16px; color: var(--muted); text-align: center; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(440px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 10px; background: #172033; color: white; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.17); opacity: 0; pointer-events: none; transform: translateY(8px); transition: .18s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .status-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .list-filters { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .search-field { grid-column: 1 / 3; }
  .clear-button { grid-column: 3 / 4; }
  .company-summary { grid-template-columns: 38px minmax(130px, 1fr) minmax(110px, 130px) minmax(140px, 155px) auto; }
  .company-summary .note-field { grid-column: 2 / 4; grid-row: 2; }
  .company-summary .list-career-link { grid-column: 4 / 5; grid-row: 1 / 3; justify-self: end; }
  .company-summary .chevron { display: none; }
}

@media (max-width: 680px) {
  .topbar { height: 56px; padding: 0 12px; }
  .brand { gap: 7px; font-size: 13px; }
  .brand-mark.small { width: 30px; height: 30px; }
  .topbar-actions { gap: 4px; }
  .container { padding: 16px 11px 50px; }
  .hero { display: grid; gap: 16px; padding: 20px 17px; border-radius: 17px; }
  .hero h1 { font-size: 28px; }
  .page-tabs { width: fit-content; }
  .page-tab { padding: 8px 12px; font-size: 13px; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 19px; }
  .dashboard-card { padding: 13px; border-radius: 14px; }
  .filter-intro { align-items: start; flex-direction: column; }
  .compact-field { width: 100%; }
  .date-range { display: grid; grid-template-columns: 1fr 1fr; justify-content: initial; }
  .date-range .button { grid-column: 1 / -1; }
  .status-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .status-stat { min-height: 68px; padding: 10px; }
  .status-stat span { font-size: 12px; }
  .status-stat strong { font-size: 22px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .category-stat { grid-template-columns: minmax(105px, 1.1fr) minmax(45px, 2fr) 26px; gap: 7px; }
  .owner-tools { align-items: start; flex-direction: column; }
  .list-filters { grid-template-columns: 1fr 1fr; gap: 8px; }
  .search-field { grid-column: 1 / -1; }
  .clear-button { grid-column: 1 / -1; }
  .pagination-bar { align-items: start; flex-direction: column; }
  .pagination-actions { width: 100%; justify-content: space-between; }
  .list-heading-actions { max-width: 54%; gap: 0; }
  .list-heading-actions .button { padding: 5px 7px; font-size: 11px; }
  .company-summary { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 7px; min-height: 0; padding: 11px 9px; }
  .company-number { width: 30px; }
  .company-name { font-size: 13px; }
  .company-summary .status-select { grid-column: 2 / 3; grid-row: 2; width: fit-content; max-width: 100%; }
  .company-summary .date-field { grid-column: 2 / 4; grid-row: 3; }
  .company-summary .note-field { grid-column: 2 / 4; grid-row: 4; }
  .company-summary .list-career-link { grid-column: 3 / 4; grid-row: 1 / 3; align-self: center; }
  .details-body { padding: 13px; }
  .detail-edit-grid { grid-template-columns: 1fr; }
  .deadline-line a { margin-left: 0; }
  .login-card { padding: 26px 22px; }
}
