/* ==========================================================================
   MM Jobnet – stylesheet
   ========================================================================== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e7ee;
  --border-strong: #c9d1dc;
  --text: #16202e;
  --text-2: #3f4b5c;
  --muted: #6b7788;
  --primary: #1f4fd8;
  --primary-hover: #1a43b8;
  --primary-soft: #e8eefc;
  --primary-ink: #173a9e;
  --good: #0ca30c;      --good-soft: #e6f6e6;
  --warning: #fab219;   --warning-soft: #fff4d6;
  --serious: #ec835a;
  --critical: #d03b3b;  --critical-soft: #fbe7e7;
  --info: #2f6fed;      --info-soft: #e8eefc;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 6px 18px rgba(16, 24, 40, .10);
  --container: 1180px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  display: flex; flex-direction: column; min-height: 100vh;
}
.site-main { flex: 1; padding-bottom: 3rem; }
img, svg { vertical-align: middle; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; } h4, .h4 { font-size: 1rem; }
.h2 { font-size: 1.6rem; } .h3 { font-size: 1.25rem; }
p { margin: 0 0 .75rem; }
ul, ol { margin: 0 0 .75rem; padding-left: 1.25rem; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 .3em; font-size: .9em; }
.muted { color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--primary); color: #fff; padding: .5rem .75rem; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: .5rem; }
:focus-visible { outline: 3px solid rgba(31, 79, 216, .45); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.container.narrow { max-width: 820px; }
.section { padding-top: 2.25rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.section-head a { display: inline-flex; align-items: center; gap: .25rem; font-weight: 500; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 2rem 0 1.25rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head p { margin: 0; }
.page-head-brand { display: flex; align-items: center; gap: 1rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.two-col-wide { grid-template-columns: minmax(0, 1fr) 300px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }

/* ---------------------------------------------------------------- header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--primary); display: inline-flex; }
.brand-footer { font-size: 1.1rem; }
.site-nav { display: flex; align-items: center; gap: .25rem; flex: 1; }
.site-nav > a { padding: .45rem .75rem; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.site-nav > a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.site-nav > a.is-active { color: var(--primary-ink); background: var(--primary-soft); }
.nav-spacer { flex: 1; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .4rem .5rem; color: var(--text); cursor: pointer; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; padding: .3rem .6rem .3rem .3rem; border-radius: 999px; border: 1px solid var(--border); }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--surface-2); }
.user-name { font-weight: 500; font-size: .92rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .4rem; display: flex; flex-direction: column; z-index: 60; }
.user-menu-panel a, .menu-button { display: block; width: 100%; text-align: left; padding: .55rem .75rem; border-radius: var(--radius-sm); color: var(--text); font: inherit; background: none; border: 0; cursor: pointer; }
.user-menu-panel a:hover, .menu-button:hover { background: var(--surface-2); text-decoration: none; }
.user-menu-panel form { border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .3rem; }
.menu-button { color: var(--critical); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.is-disabled { opacity: .6; cursor: default; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-2); }
.btn-ghost { background: transparent; color: var(--primary-ink); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-light { background: #fff; color: var(--primary-ink); }
.btn-light:hover { background: var(--primary-soft); }
.btn-danger { color: var(--critical); }
.btn-danger:hover { background: var(--critical-soft); }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .45rem .6rem; background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.save-btn.is-saved { color: var(--primary-ink); border-color: var(--primary); background: var(--primary-soft); }
.save-btn.is-saved svg { fill: currentColor; }
.save-form, .inline-form { display: inline-flex; margin: 0; }
.form-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.link-sm { font-size: .88rem; }

/* ---------------------------------------------------------------- flash / notices */
.flash-stack { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-radius: var(--radius-sm); border: 1px solid; font-weight: 500; transition: opacity .35s, transform .35s; }
.flash.is-leaving { opacity: 0; transform: translateY(-4px); }
.flash-success { background: var(--good-soft); border-color: #b7e3b7; color: #0a5c0a; }
.flash-info, .flash-message { background: var(--info-soft); border-color: #c7d6f7; color: var(--primary-ink); }
.flash-warning { background: var(--warning-soft); border-color: #f2d58a; color: #6b4b00; }
.flash-error, .flash-critical { background: var(--critical-soft); border-color: #f0b8b8; color: #8f1f1f; }
.flash-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .7; }
.flash-close:hover { opacity: 1; }
.notice { padding: .75rem 1rem; border-radius: var(--radius-sm); border: 1px solid; margin: .75rem 0; font-weight: 500; }
.notice-warning { background: var(--warning-soft); border-color: #f2d58a; color: #6b4b00; }
.notice-critical { background: var(--critical-soft); border-color: #f0b8b8; color: #8f1f1f; }
.notice-info { background: var(--info-soft); border-color: #c7d6f7; color: var(--primary-ink); }

/* ---------------------------------------------------------------- hero + search */
.hero { background: linear-gradient(135deg, #12306f 0%, #1f4fd8 60%, #3b6fe8 100%); color: #fff; padding: 4rem 0 3.5rem; }
.hero-inner { max-width: 880px; text-align: center; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); margin-bottom: .5rem; letter-spacing: -.02em; }
.hero-sub { font-size: 1.15rem; opacity: .9; margin-bottom: 1.75rem; }
.hero-links { margin-top: 1rem; color: rgba(255, 255, 255, .8); }
.hero-links a { color: #fff; font-weight: 500; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); margin-left: .25rem; }
.search-bar { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: .5rem; background: #fff; padding: .5rem; border-radius: 14px; box-shadow: var(--shadow-md); text-align: left; }
.search-field { display: flex; align-items: center; gap: .5rem; padding: 0 .75rem; border-radius: var(--radius-sm); color: var(--muted); background: var(--surface-2); border: 1px solid transparent; }
.search-field:focus-within { border-color: var(--primary); background: #fff; }
.search-field input { flex: 1; border: 0; background: transparent; padding: .8rem 0; font: inherit; font-size: 1rem; color: var(--text); min-width: 0; }
.search-field input:focus { outline: none; }
.search-strip { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem 0; }
.search-bar-compact { box-shadow: none; padding: 0; background: transparent; }
.search-bar-compact .search-field { border-color: var(--border); background: #fff; }
.inline-search { display: flex; gap: .5rem; }
.inline-search .search-field { border-color: var(--border); background: #fff; min-width: 280px; }
.inline-search .search-field input { padding: .6rem 0; }

/* ---------------------------------------------------------------- stat tiles (KPI row) */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-row-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-tile { display: flex; flex-direction: column; gap: .15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; color: var(--text); box-shadow: var(--shadow); }
a.stat-tile:hover { text-decoration: none; border-color: var(--primary); }
.stat-label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: .82rem; }

/* ---------------------------------------------------------------- categories / companies */
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.category-card { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); }
.category-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-md); }
.category-name { font-weight: 600; }
.company-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.company-card { display: flex; gap: .9rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); align-items: flex-start; }
.company-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-md); }
.company-card-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.company-card-name { font-weight: 700; }
.company-card-tagline { color: var(--text-2); font-size: .92rem; }
.company-card-jobs { color: var(--primary-ink); font-weight: 600; font-size: .9rem; margin-top: .25rem; }
.company-hero { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.company-hero-body { flex: 1; min-width: 240px; }
.company-hero h1 { margin-bottom: .25rem; }
.meta-inline { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.meta-inline span { display: inline-flex; align-items: center; gap: .35rem; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; background: linear-gradient(135deg, #12306f, #1f4fd8); color: #fff; padding: 2rem 2.25rem; border-radius: var(--radius); margin-bottom: 1rem; }
.cta-band h2 { color: #fff; }
.cta-band p { margin: 0; opacity: .9; max-width: 560px; }

/* ---------------------------------------------------------------- logo badge */
.logo { display: inline-flex; align-items: center; justify-content: center; background: var(--logo, #4f46e5); color: #fff; font-weight: 700; border-radius: 10px; flex-shrink: 0; letter-spacing: .02em; }
.logo-sm { width: 32px; height: 32px; font-size: .72rem; border-radius: 8px; }
.logo-md { width: 48px; height: 48px; font-size: .95rem; }
.logo-lg { width: 60px; height: 60px; font-size: 1.15rem; border-radius: 14px; }
.logo-xl { width: 88px; height: 88px; font-size: 1.7rem; border-radius: 18px; }

/* ---------------------------------------------------------------- job cards */
.job-list { display: flex; flex-direction: column; gap: .75rem; }
.job-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.job-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.job-card-logo { line-height: 0; }
.job-card-title { font-size: 1.08rem; margin: 0 0 .15rem; }
.job-card-title a { color: var(--text); }
.job-card-title a:hover { color: var(--primary); }
.job-card-company { margin: 0 0 .5rem; color: var(--text-2); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.job-card-company a { color: var(--text-2); font-weight: 500; }
.dot { color: var(--border-strong); }
.job-card-salary { margin: .5rem 0 .4rem; font-weight: 600; color: var(--text); }
.job-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; font-size: .85rem; white-space: nowrap; }
.pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .8rem; font-weight: 500; color: var(--text-2); }
.pill-link { color: var(--primary-ink); background: var(--primary-soft); border-color: transparent; }
.pill-muted { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.tag { display: inline-flex; padding: .1rem .55rem; border-radius: 6px; background: var(--primary-soft); color: var(--primary-ink); font-size: .78rem; font-weight: 500; }
a.tag:hover { background: #d9e3fa; text-decoration: none; }
.job-rows { display: flex; flex-direction: column; }
.job-row { display: flex; gap: .75rem; align-items: center; padding: .65rem 0; border-top: 1px solid var(--border); color: var(--text); }
.job-row:first-child { border-top: 0; padding-top: 0; }
.job-row:hover { text-decoration: none; }
.job-row:hover .job-row-title { color: var(--primary); }
.job-row-body { display: flex; flex-direction: column; min-width: 0; font-size: .9rem; }
.job-row-title { font-weight: 600; }

/* ---------------------------------------------------------------- search layout + filters */
.search-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.5rem; padding-top: 1.5rem; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow: auto; }
.filters-toggle { display: none; grid-column: 1 / -1; }
.filter-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .5rem; }
.filter-head h2 { font-size: 1.05rem; margin: 0; }
.filter-head a { font-size: .85rem; }
.filter-group { border: 0; padding: .75rem 0; margin: 0; border-top: 1px solid var(--border); }
.filter-group legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: .35rem; float: left; width: 100%; }
.check { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; font-size: .92rem; cursor: pointer; clear: both; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; flex-shrink: 0; }
.filter-submit { margin-top: .75rem; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.results-title { font-size: 1.25rem; margin: 0; }
.results-title em { font-style: normal; color: var(--primary-ink); }
.sort-links { display: flex; align-items: center; gap: .25rem; font-size: .9rem; }
.sort-link { padding: .3rem .6rem; border-radius: 999px; color: var(--text-2); }
.sort-link:hover { background: var(--surface-2); text-decoration: none; }
.sort-link.is-active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.pagination { display: flex; justify-content: center; align-items: center; gap: .3rem; margin: 1.75rem 0 0; flex-wrap: wrap; }
.page-link { padding: .45rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 500; }
.page-link:hover { border-color: var(--primary); text-decoration: none; }
.page-link.is-current { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-ellipsis { padding: 0 .3rem; color: var(--muted); }

/* ---------------------------------------------------------------- job detail */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; padding-top: 1.5rem; align-items: start; }
.detail-header { padding: 1.5rem; }
.detail-title-row { display: flex; gap: 1.25rem; align-items: flex-start; }
.detail-title { font-size: 1.75rem; margin-bottom: .25rem; }
.detail-company { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; color: var(--text-2); font-size: 1.02rem; margin-bottom: .6rem; }
.detail-company a { color: var(--text-2); font-weight: 600; }
.detail-salary { font-size: 1.15rem; font-weight: 700; margin: 1rem 0 .15rem; }
.detail-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.applied-state { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--text-2); }
.applied-state .icon-check { color: var(--good); }
.detail-body { margin-top: 1rem; padding: 1.5rem; }
.rich h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.rich h2:first-child { margin-top: 0; }
.rich h3 { font-size: 1rem; margin: 1rem 0 .35rem; }
.rich p, .rich ul { color: var(--text-2); }
.rich li { margin-bottom: .25rem; }
.detail-footer-cta { margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-weight: 600; }
.company-side-head { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: .75rem; }
.company-side-head a { color: var(--text); }
.meta-list { margin: 0 0 1rem; display: flex; flex-direction: column; gap: .5rem; }
.meta-list div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.meta-list dt { color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.meta-list dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- forms */
.form .field { margin-bottom: 1.1rem; }
.field label, .field legend, .field > legend { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.req { color: var(--critical); }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; color: var(--text); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 79, 216, .18); }
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7788' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2.2rem; }
.field-help { font-size: .84rem; color: var(--muted); margin: .35rem 0 0; }
.field-error { font-size: .86rem; color: var(--critical); font-weight: 500; margin: .35rem 0 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--critical); }
.char-counter { text-align: right; }
.color-field { display: flex; align-items: center; gap: .75rem; }
.color-field input[type="color"] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.file-input { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); background: var(--surface-2); font-weight: 500; }
.file-input:hover { border-color: var(--primary); color: var(--primary-ink); }
.file-input input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-input:focus-within { outline: 3px solid rgba(31, 79, 216, .35); }
.file-drop { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.is-hidden { display: none !important; }
.file-current { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: .5rem; flex-wrap: wrap; }
.file-current .check { margin-left: auto; padding: 0; }
.status-form { align-items: center; gap: .5rem; }
.status-form select { width: auto; padding: .45rem 2rem .45rem .7rem; font-size: .9rem; }

/* ---------------------------------------------------------------- auth */
.auth-layout { display: flex; justify-content: center; padding: 3rem 1.25rem; }
.auth-card { width: 100%; max-width: 460px; padding: 2rem; }
.auth-card h1 { margin-bottom: .25rem; }
.auth-card .btn-block { margin-top: .5rem; }
.auth-switch { text-align: center; margin: 1.25rem 0 0; color: var(--text-2); }
.demo-accounts { margin-top: 1.25rem; font-size: .88rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: .75rem; }
.demo-accounts summary { cursor: pointer; font-weight: 500; }
.demo-accounts ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.role-picker legend { grid-column: 1 / -1; }
.role-option { display: flex; gap: .75rem; align-items: center; padding: .9rem; border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; color: var(--text-2); }
.role-option input { position: absolute; opacity: 0; }
.role-option span { display: flex; flex-direction: column; font-size: .9rem; }
.role-option strong { color: var(--text); }
.role-option.is-selected { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.role-option:focus-within { outline: 3px solid rgba(31, 79, 216, .35); }

/* ---------------------------------------------------------------- status pills (always colour + label) */
.status { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .65rem .18rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.status-info { background: var(--info-soft); color: var(--primary-ink); }
.status-warning { background: var(--warning-soft); color: #6b4b00; }
.status-warning .status-dot { background: var(--warning); }
.status-good { background: var(--good-soft); color: #0a5c0a; }
.status-good .status-dot { background: var(--good); }
.status-critical { background: var(--critical-soft); color: #8f1f1f; }
.status-critical .status-dot { background: var(--critical); }
.status-muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge { display: inline-flex; align-items: center; padding: .05rem .5rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .74rem; font-weight: 700; }

/* ---------------------------------------------------------------- tables */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .85rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-muted td { opacity: .65; }
.table a strong { color: var(--text); }
.table a:hover strong { color: var(--primary); }
.t-right { text-align: right !important; }
.cell-job { display: flex; gap: .75rem; align-items: flex-start; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn, .actions-cell form { vertical-align: middle; }

/* ---------------------------------------------------------------- dashboards */
.meter { height: 10px; border-radius: 999px; background: var(--primary-soft); overflow: hidden; margin: .5rem 0 .5rem; }
.meter > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }
.checklist { list-style: none; padding: 0; margin: .5rem 0 1rem; display: flex; flex-direction: column; gap: .35rem; }
.checklist li { display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.checklist li .icon { color: var(--border-strong); }
.checklist li.is-done { color: var(--text); }
.checklist li.is-done .icon { color: var(--good); }
.onboarding { padding: 2rem; margin-top: 2rem; }
.steps { padding-left: 1.25rem; margin-bottom: 1.5rem; }
.steps li { margin-bottom: .5rem; color: var(--text-2); }
.tips ul { padding-left: 1.1rem; color: var(--text-2); font-size: .92rem; }
.tips li { margin-bottom: .5rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab { padding: .6rem .9rem; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.is-active { color: var(--primary-ink); border-bottom-color: var(--primary); }
.tab-count { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .78rem; text-align: center; margin-left: .2rem; }
.tab.is-active .tab-count { background: var(--primary-soft); border-color: transparent; }
.applicant-list { display: flex; flex-direction: column; gap: 1rem; }
.applicant-card { display: flex; flex-direction: column; gap: .75rem; }
.applicant-card + .applicant-card { margin-top: 0; }
.applicant-head { display: flex; gap: 1rem; align-items: flex-start; }
.applicant-id { flex: 1; min-width: 0; }
.applicant-id h2 { margin-bottom: .1rem; }
.applicant-id p { margin: 0; }
.applicant-contact { font-size: .9rem; }
.applicant-status { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; font-size: .85rem; white-space: nowrap; }
.applicant-summary { color: var(--text-2); margin: 0; }
.cover-letter summary { cursor: pointer; font-weight: 600; color: var(--primary-ink); }
.cover-letter .rich { padding: .5rem 0 0; }
.applicant-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: .75rem; }
.apply-summary { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.apply-summary h1 { margin-bottom: .1rem; }
.apply-summary p { margin: 0; }
.applicant-preview { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 1.25rem; }
.applicant-preview p { margin: 0; font-size: .9rem; }
.applicant-preview .link-sm { margin-left: auto; }
.breadcrumbs { font-size: .88rem; color: var(--muted); padding-top: 1.25rem; }
.breadcrumbs a { color: var(--text-2); }

/* ---------------------------------------------------------------- empty + error */
.empty-state { text-align: center; padding: 3rem 1.5rem; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-state h3 { margin-bottom: .25rem; }
.empty-state .btn { margin-top: .75rem; }
.error-page { text-align: center; padding: 5rem 1rem; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--primary-soft); line-height: 1; margin: 0; }
.error-page .form-actions { justify-content: center; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 2rem; padding: 2.5rem 0 1.5rem; font-size: .92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 3rem; }
.footer-links h4 { margin-bottom: .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.footer-links a { display: block; color: var(--text-2); padding: .15rem 0; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
  .stat-row, .stat-row-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .company-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout, .two-col, .two-col-wide { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: .75rem 1.25rem 1rem; gap: .25rem; box-shadow: var(--shadow-md); }
  .site-nav.is-open { display: flex; }
  .site-nav > a { padding: .7rem .75rem; }
  .nav-spacer { display: none; }
  .user-menu > summary { width: 100%; justify-content: flex-start; border: 0; padding-left: .75rem; }
  .user-menu-panel { position: static; box-shadow: none; border: 0; padding-left: 1.25rem; }
  .site-nav .btn { margin-top: .25rem; }
  .search-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { display: none; position: static; max-height: none; }
  .filters.is-open { display: block; }
  .filters-toggle { display: inline-flex; justify-self: start; }
  .search-bar { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2.5rem; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.55rem; }
  .stat-row, .stat-row-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stat-value { font-size: 1.6rem; }
  .category-grid, .company-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .job-card { grid-template-columns: auto minmax(0, 1fr); }
  .job-card-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .detail-title-row { flex-direction: column; }
  .detail-title { font-size: 1.4rem; }
  .role-picker { grid-template-columns: 1fr; }
  .applicant-head { flex-wrap: wrap; }
  .applicant-status { align-items: flex-start; width: 100%; flex-direction: row; justify-content: space-between; }
  .footer-links { gap: 1.5rem; flex-wrap: wrap; }
  .page-head { padding-top: 1.25rem; }
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
}
@media print {
  .site-header, .site-footer, .detail-actions, .filters, .flash-stack { display: none !important; }
  .card { box-shadow: none; }
}

/* Buttons inside the main nav must keep their own colours (nav-link rule is more specific). */
.site-nav > a.btn-primary { color: #fff; background: var(--primary); }
.site-nav > a.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.site-nav > a.btn-ghost { color: var(--primary-ink); }

/* Keep an icon attached to its label when a line wraps; keep sort labels intact. */
.loc { display: inline-flex; align-items: center; gap: .3rem; }
.sort-link { white-space: nowrap; }

/* Language-specific font fallback: default OS fonts vary in Myanmar/Thai glyph coverage. */
html[lang="my"] {
  --font: "Noto Sans Myanmar", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}
html[lang="th"] {
  --font: "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}
.lang-switch select {
  font-family: inherit;
  border: 1px solid var(--border, #d8dce6);
  border-radius: 6px;
  padding: .3rem .5rem;
  background: transparent;
  color: inherit;
}
