/* Hasama — one stylesheet for site + dashboards. RTL-first, logical properties. */
:root {
  --bg: #f6f7f4; --card: #fff; --ink: #17201b; --muted: #5f6b64; --line: #e3e7e1;
  --brand: #14532d; --brand-2: #166534; --brand-soft: #e8f3ec; --accent: #a3e635;
  --warn: #92400e; --warn-soft: #fef3c7; --err: #991b1b; --err-soft: #fee2e2; --ok: #166534; --ok-soft: #dcfce7;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(20,40,30,.06);
  --font: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412; --card: #171e1b; --ink: #e7ece9; --muted: #9aa8a0; --line: #26302b;
    --brand: #4ade80; --brand-2: #86efac; --brand-soft: #16271e; --accent: #a3e635;
    --warn: #fbbf24; --warn-soft: #33270f; --err: #fca5a5; --err-soft: #3a1717; --ok: #86efac; --ok-soft: #132a1c;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap-gap { flex-wrap: wrap; justify-content: space-between; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.inline { display: inline; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 8px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 99; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

/* Buttons & forms */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 20px; font: 600 1rem var(--font); cursor: pointer; text-decoration: none; transition: filter .15s; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .btn, button.btn { color: #0b130e; } }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.sm { padding: 6px 14px; font-size: .9rem; }
.btn.lg { padding: 14px 28px; font-size: 1.1rem; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.danger { background: var(--err); }
.btn.light { background: var(--card); color: var(--brand); }
.btn:disabled, .btn.busy { opacity: .6; cursor: wait; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: 1rem var(--font); }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 10px 0; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }

/* Cards, tables, pills */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: .82rem; background: var(--bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.clickable:hover td { background: var(--brand-soft); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.st-open, .st-placed, .st-active { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.st-draft, .st-new, .st-sent { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.st-interview, .st-offer, .st-shortlisted, .st-submitted { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.st-rejected, .st-closed, .st-suspended, .st-withdrawn, .st-archived { background: var(--err-soft); color: var(--err); border-color: transparent; }
.tag { font-size: .75rem; padding: 1px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 28px; border-radius: 8px; font-weight: 800; font-size: .92rem; padding: 0 6px; }
.score.hi { background: #16a34a; color: #fff; } .score.good { background: #84cc16; color: #142; }
.score.mid { background: #fbbf24; color: #3b2a00; } .score.low { background: #f87171; color: #fff; } .score.none { background: var(--bg); color: var(--muted); }
.score.xl { min-width: 72px; height: 72px; font-size: 1.8rem; border-radius: 18px; }
.flash { padding: 12px 16px; border-radius: 10px; margin: 12px 0; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--err-soft); color: var(--err); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.banner { padding: 10px 20px; font-weight: 600; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: var(--warn-soft); color: var(--warn); } .banner.err { background: var(--err-soft); color: var(--err); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: .9rem; }
.tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .tabs a.on { color: #0b130e; } }
.pager { display: flex; gap: 6px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); }
.pager .cur { background: var(--brand); color: #fff; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: block; color: var(--ink); }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat b { display: block; font-size: 1.8rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
.prose { white-space: normal; }
.prose p:last-child { margin-bottom: 0; }

/* Public site */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .row { justify-content: space-between; min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.3rem; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.logo { color: var(--accent); background: var(--brand); width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-weight: 500; }
.nav a { color: var(--ink); }
.nav a.btn { color: #fff; }
.nav a.btn:hover { text-decoration: none; }
@media (prefers-color-scheme: dark) { .nav a.btn { color: #0b130e; } }
.nav .nav-join { color: var(--brand); font-weight: 700; }
.nav .lang { font-weight: 700; font-size: .85rem; border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; }
.hero { background: linear-gradient(135deg, #14532d, #166534 55%, #3f6212); color: #fff; padding: 56px 0 72px; }
.hero h1 { color: #fff; max-width: 720px; }
.hero p.lead { font-size: 1.15rem; opacity: .92; max-width: 640px; }
.search { background: var(--card); border-radius: 18px; padding: 10px; display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; margin-top: 24px; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.search input, .search select { border: 0; background: var(--bg); }
@media (max-width: 800px) { .search { grid-template-columns: 1fr; } }
.hero-stats { display: flex; gap: 24px; margin-top: 18px; opacity: .9; font-size: .95rem; flex-wrap: wrap; }
.layout-2 { display: grid; grid-template-columns: 260px 1fr; gap: 24px; margin-top: -36px; }
@media (max-width: 900px) { .layout-2 { grid-template-columns: 1fr; margin-top: 16px; } }
.filters { position: sticky; top: 84px; align-self: start; }
.job-list { display: grid; gap: 12px; }
.job-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: block; color: var(--ink); transition: border-color .15s, transform .15s; }
.job-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.job-card h3 { margin: 0 0 4px; font-size: 1.12rem; color: var(--ink); }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .9rem; margin-top: 6px; }
.job-card .agency { color: var(--brand); font-weight: 600; font-size: .92rem; }
.cta-agencies { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 28px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; margin: 32px 0; }
.cta-agencies h2 { color: #fff; margin: 0 0 4px; }
.cta-agencies p { margin: 0; opacity: .9; }
@media (max-width: 700px) { .cta-agencies { grid-template-columns: 1fr; } }
.job-page { display: grid; grid-template-columns: 1fr 340px; gap: 24px; margin: 28px auto; }
@media (max-width: 900px) { .job-page { grid-template-columns: 1fr; } }
.job-page .apply-box { position: sticky; top: 84px; align-self: start; }
.section-title { margin-top: 24px; }
.footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 48px; background: var(--card); font-size: .92rem; }
.footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.narrow { max-width: 560px; margin: 32px auto; }
.auth-box { text-align: center; }
.auth-box .or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 18px 0; font-size: .9rem; }
.auth-box .or::before, .auth-box .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#gsi-btn { display: flex; justify-content: center; min-height: 44px; }
.code-input { font-size: 1.6rem; letter-spacing: 10px; text-align: center; direction: ltr; }
.legal h2 { margin-top: 1.6em; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 20px 0; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feature .ic { font-size: 1.6rem; }

/* App shell (agency + admin) */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--card); border-inline-end: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-agency { padding: 10px; background: var(--bg); border-radius: 10px; }
.side-agency select { padding: 6px 8px; font-weight: 700; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { padding: 9px 12px; border-radius: 9px; color: var(--ink); font-weight: 500; }
.side-nav a:hover { background: var(--bg); text-decoration: none; }
.side-nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; padding: 8px 12px; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.app-top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 10; }
.app-top-title { font-weight: 700; flex: 1; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 1.2rem; padding: 2px 10px; color: var(--ink); cursor: pointer; }
.content { padding: 24px; max-width: 1200px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 50; transform: translateX(100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  [dir=ltr] .side { transform: translateX(-100%); }
  .side.open { transform: none !important; }
  .menu-btn { display: inline-block; }
  .content { padding: 16px; }
  .app-top { padding: 10px 16px; }
}
.ai-box { border: 1.5px solid var(--brand-soft); background: linear-gradient(180deg, var(--brand-soft), var(--card) 60%); }
.ai-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.ai-box ul { margin: 4px 0 10px; padding-inline-start: 20px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { direction: ltr; font-size: .85rem; }
@media (max-width: 900px) {
  .filters { position: static; padding: 12px; }
  .filters form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
  .filters .field { margin: 0; }
  .filters label { font-size: .78rem; }
  .filters select { padding: 7px 8px; font-size: .9rem; }
}
.ai-alert { border-color: var(--err); background: var(--err-soft); }
.jc-avatar { display: none; }
.em { font-style: normal; }
