/* LinkJob UI — built on Bootstrap 5.3 */
:root {
  --lj-primary: #5b5bf0;
  --lj-primary-600: #4f46e5;
  --lj-accent: #06b6d4;
  --lj-ink: #1e1b4b;
  --lj-text: #2b2f45;
  --lj-muted: #6b7190;
  --lj-bg: #f5f6fb;
  --lj-card: #ffffff;
  --lj-line: #e8eaf3;
  --lj-soft: #f0f1ff;
  --lj-radius: 16px;
  --lj-shadow: 0 1px 2px rgba(30, 27, 75, .04), 0 6px 24px rgba(30, 27, 75, .06);
  --lj-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);

  --bs-primary: #5b5bf0;
  --bs-primary-rgb: 91, 91, 240;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: #3730a3;
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--lj-text);
  --bs-body-bg: var(--lj-bg);
  --bs-border-color: var(--lj-line);
  --bs-border-radius: 10px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 14px;
}

body { background: var(--lj-bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { color: var(--lj-ink); font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.text-muted { color: var(--lj-muted) !important; }
.fw-semibold { font-weight: 600 !important; }

/* ---------- buttons & forms ---------- */
.btn { font-weight: 600; border-radius: 10px; }
.btn:hover { text-decoration: none; }
.btn-primary {
  --bs-btn-bg: var(--lj-primary); --bs-btn-border-color: var(--lj-primary);
  --bs-btn-hover-bg: var(--lj-primary-600); --bs-btn-hover-border-color: var(--lj-primary-600);
  --bs-btn-active-bg: #4338ca; --bs-btn-active-border-color: #4338ca;
  --bs-btn-disabled-bg: var(--lj-primary); --bs-btn-disabled-border-color: var(--lj-primary);
}
.btn-gradient { background: var(--lj-gradient); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(91, 91, 240, .28); }
.btn-gradient:hover, .btn-gradient:focus { color: #fff; filter: brightness(1.05); box-shadow: 0 8px 22px rgba(91, 91, 240, .36); }
.btn-outline-primary {
  --bs-btn-color: var(--lj-primary-600); --bs-btn-border-color: #c9c9fb;
  --bs-btn-hover-bg: var(--lj-soft); --bs-btn-hover-color: var(--lj-primary-600); --bs-btn-hover-border-color: #b4b4f8;
  --bs-btn-active-bg: #e4e4ff; --bs-btn-active-color: var(--lj-primary-600);
}
.btn-soft { background: var(--lj-soft); color: var(--lj-primary-600); border: 1px solid transparent; }
.btn-soft:hover { background: #e4e4ff; color: #3730a3; }
.btn-success { --bs-btn-bg: #12b886; --bs-btn-border-color: #12b886; --bs-btn-hover-bg: #0ca678; --bs-btn-hover-border-color: #0ca678; }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-sm.btn-icon { width: 32px; height: 32px; }

.form-control, .form-select { border-color: var(--lj-line); border-radius: 10px; padding: .6rem .85rem; background-color: #fbfbfe; }
.form-control-sm, .form-select-sm { padding: .35rem .6rem; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: #a5a5f7; box-shadow: 0 0 0 .22rem rgba(91, 91, 240, .15); background-color: #fff; }
.form-label { font-weight: 600; font-size: .875rem; color: var(--lj-ink); margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--lj-primary); border-color: var(--lj-primary); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(91, 91, 240, .15); border-color: #a5a5f7; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--lj-muted); pointer-events: none; }
.input-icon > .form-control, .input-icon > .form-select { padding-left: 2.4rem; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--lj-line); border-radius: var(--lj-radius); box-shadow: var(--lj-shadow); background: var(--lj-card); }
.card-title-sm { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lj-muted); font-weight: 700; }
.section-title { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.section-title .icon-bubble { width: 36px; height: 36px; border-radius: 10px; background: var(--lj-soft); color: var(--lj-primary-600); display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; flex: none; }

/* ---------- top bar ---------- */
.lj-topbar { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--lj-line); }
.lj-topbar .inner { height: 64px; display: flex; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; color: var(--lj-ink); }
.brand:hover { text-decoration: none; color: var(--lj-ink); }
.brand img { width: 36px; height: 36px; }
.brand .grad { background: var(--lj-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lj-nav { display: flex; gap: .25rem; margin: 0 auto; }
.lj-nav a { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border-radius: 10px; color: var(--lj-muted); font-weight: 600; font-size: .925rem; }
.lj-nav a:hover { background: var(--lj-soft); color: var(--lj-primary-600); text-decoration: none; }
.lj-nav a.active { background: var(--lj-soft); color: var(--lj-primary-600); }
.lj-nav .count { background: #ef4444; color: #fff; border-radius: 999px; font-size: .7rem; padding: .05rem .45rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--lj-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; flex: none; }
.user-btn { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--lj-line); background: #fff; border-radius: 999px; padding: .2rem .7rem .2rem .2rem; font-weight: 600; color: var(--lj-ink); }
.user-btn:hover { background: var(--lj-soft); }
.dropdown-menu { border: 1px solid var(--lj-line); border-radius: 14px; box-shadow: 0 12px 32px rgba(30, 27, 75, .12); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-weight: 500; }
.dropdown-item i { width: 1.25rem; display: inline-block; color: var(--lj-muted); }

/* ---------- bottom tab bar (phones) ---------- */
.lj-tabbar { display: none; }
@media (max-width: 991.98px) {
  .lj-nav { display: none; }
  .lj-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--lj-line); padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); }
  .lj-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem 0; border-radius: 12px; color: var(--lj-muted); font-size: .72rem; font-weight: 600; position: relative; }
  .lj-tabbar a i { font-size: 1.25rem; line-height: 1; }
  .lj-tabbar a.active { color: var(--lj-primary-600); background: var(--lj-soft); }
  .lj-tabbar a:hover { text-decoration: none; }
  .lj-tabbar .count { position: absolute; top: .1rem; left: calc(50% + .45rem); background: #ef4444; color: #fff; border-radius: 999px; font-size: .62rem; padding: 0 .35rem; }
  body.has-tabbar main { padding-bottom: 6.5rem !important; }
  .user-btn .name { display: none; }
  .user-btn { padding: .2rem; }
}

/* ---------- page header / hero ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--lj-muted); }
.hero { background: var(--lj-gradient); color: #fff; border-radius: 20px; padding: 1.6rem 1.75rem; position: relative; overflow: hidden; margin-bottom: 1.5rem; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero::before { content: ""; position: absolute; right: 90px; bottom: -90px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero h1 { color: #fff; font-size: 1.75rem; font-weight: 800; margin: 0 0 .25rem; position: relative; z-index: 1; }
.hero p { margin: 0; opacity: .92; position: relative; z-index: 1; max-width: 46rem; }
.hero .chip { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); color: #fff; }
@media (max-width: 575.98px) { .hero { padding: 1.25rem; border-radius: 16px; } .hero h1 { font-size: 1.35rem; } .page-head h1 { font-size: 1.35rem; } }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #f1f3f9; color: var(--lj-text); border: 1px solid var(--lj-line); white-space: nowrap; }
.chip-success { background: #e8f8f1; color: #0f8a5f; border-color: #c6eedb; }
.chip-warning { background: #fff6e6; color: #a15c00; border-color: #ffe2b0; }
.chip-danger { background: #fdecec; color: #c0322e; border-color: #f8c9c8; }
.chip-info { background: #e6f7fb; color: #0b7c93; border-color: #bfeaf3; }
.chip-primary { background: var(--lj-soft); color: var(--lj-primary-600); border-color: #dcdcfd; }
.chip-muted { background: #f4f5f9; color: var(--lj-muted); }
.badge { font-weight: 600; border-radius: 999px; padding: .32em .65em; }

.src { color: #fff; }
.src-linkedin { background: #0a66c2; } .src-rozee { background: #e8501c; } .src-hiredly { background: #6d28d9; }
.src-kalibrr { background: #1d4ed8; } .src-careerjet { background: #0f766e; } .src-google { background: #16a34a; }
.src-jooble { background: #7c3aed; } .src-adzuna { background: #0d9488; }

/* status pills */
.status { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-done { background: #e8f8f1; color: #0f8a5f; }
.status-running { background: #e6f7fb; color: #0b7c93; }
.status-running::before { animation: lj-pulse 1.2s infinite; }
.status-pending { background: #f1f3f9; color: var(--lj-muted); }
.status-failed { background: #fdecec; color: #c0322e; }
.status-cancelled { background: #fff6e6; color: #a15c00; }
@keyframes lj-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- search form ---------- */
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .55rem; }
.source-tile { position: relative; display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--lj-line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; margin: 0; }
.source-tile:hover { border-color: #c9c9fb; }
.source-tile input { position: absolute; opacity: 0; pointer-events: none; }
.source-tile .tick { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #c8cbe0; flex: none; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .8rem; transition: all .15s; }
.source-tile .name { font-weight: 700; color: var(--lj-ink); font-size: .9rem; line-height: 1.2; }
.source-tile .desc-sm { font-size: .75rem; color: var(--lj-muted); line-height: 1.3; margin-top: .15rem; }
.source-tile .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: .3rem; vertical-align: middle; }
.source-tile:has(input:checked) { border-color: var(--lj-primary); background: #f7f7ff; box-shadow: 0 0 0 3px rgba(91, 91, 240, .12); }
.source-tile:has(input:checked) .tick { background: var(--lj-primary); border-color: var(--lj-primary); }
.source-tile:has(input:focus-visible) { outline: 2px solid var(--lj-primary); outline-offset: 2px; }
.source-tile.is-disabled { cursor: not-allowed; background: #fafbfd; }
.source-tile.is-disabled .name, .source-tile.is-disabled .desc-sm { opacity: .6; }
.source-tile .need-key { font-size: .72rem; color: #a15c00; margin-top: .2rem; }
.source-tile .need-key code { font-size: .7rem; }
.source-tile.not-here { opacity: .45; }

.option-row { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .85rem; border: 1px solid var(--lj-line); border-radius: 12px; background: #fff; }
.option-row + .option-row { margin-top: .5rem; }
.option-row .form-check-input { margin: .15rem 0 0; flex: none; width: 2.4em; height: 1.3em; }
.option-row .title { font-weight: 600; color: var(--lj-ink); font-size: .9rem; }
.option-row .hint { font-size: .78rem; color: var(--lj-muted); }

/* ---------- stats ---------- */
.stat { padding: 1rem 1.1rem; border-radius: 14px; background: #fff; border: 1px solid var(--lj-line); height: 100%; }
.stat .label { font-size: .75rem; color: var(--lj-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.45rem; font-weight: 800; color: var(--lj-ink); line-height: 1.2; margin-top: .2rem; }
.stat .value small { font-size: .85rem; color: var(--lj-muted); font-weight: 600; }
.stat .progress { height: 6px; border-radius: 99px; background: #eef0f7; margin-top: .55rem; }
.stat .progress-bar { background: var(--lj-gradient); border-radius: 99px; }
.stat .progress-bar.bg-warning { background: #f59e0b !important; }
.stat .progress-bar.bg-danger { background: #ef4444 !important; }

/* ---------- lists ---------- */
.list-item { display: flex; align-items: center; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid var(--lj-line); }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .icon { width: 42px; height: 42px; border-radius: 12px; background: var(--lj-soft); color: var(--lj-primary-600); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; flex: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; color: var(--lj-ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: .8rem; color: var(--lj-muted); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--lj-muted); }
.empty i { font-size: 2.4rem; color: #c3c6dd; display: block; margin-bottom: .5rem; }

/* ---------- job cards ---------- */
.job-card { padding: 1.1rem 1.2rem; }
.job-card + .job-card { margin-top: .75rem; }
.job-title { font-size: 1.05rem; font-weight: 700; color: var(--lj-ink); line-height: 1.3; }
.job-title:hover { color: var(--lj-primary-600); }
.company-line { font-weight: 600; color: var(--lj-text); }
.company-line a { color: inherit; }
.meta-line { font-size: .82rem; color: var(--lj-muted); display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-top: .2rem; }
.meta-line i { margin-right: .2rem; }
.contact-box { background: #fafbfe; border: 1px solid var(--lj-line); border-radius: 12px; padding: .6rem .75rem; font-size: .85rem; }
.contact-box .row-c { display: flex; gap: .5rem; align-items: flex-start; min-width: 0; }
.contact-box .row-c + .row-c { margin-top: .35rem; }
.contact-box .row-c > i { color: var(--lj-muted); margin-top: .1rem; flex: none; }
.contact-box a { word-break: break-all; }
.job-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.desc { max-height: 280px; overflow: auto; white-space: pre-wrap; font-size: .85rem; background: #fafbfe; border: 1px solid var(--lj-line); border-radius: 12px; padding: .85rem; }
@media (max-width: 575.98px) {
  .job-actions .btn { flex: 1 1 auto; }
  .job-card { padding: 1rem; }
}

/* filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-bar .grow { flex: 1 1 220px; }
.scroll-x { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--lj-line); background: #fff; font-weight: 600; font-size: .85rem; color: var(--lj-text); white-space: nowrap; }
.pill:hover { border-color: #c9c9fb; text-decoration: none; color: var(--lj-primary-600); }
.pill.active { background: var(--lj-ink); color: #fff; border-color: var(--lj-ink); }
.pill .n { background: rgba(0, 0, 0, .07); border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }
.pill.active .n { background: rgba(255, 255, 255, .2); }

/* ---------- alerts ---------- */
.alert { border-radius: 12px; border-width: 1px; }
.flash-stack { display: grid; gap: .5rem; margin-bottom: 1rem; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background: var(--lj-gradient); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.auth-side .brand { color: #fff; }
.auth-side .brand .grad { background: none; color: #fff; -webkit-background-clip: initial; background-clip: initial; }
.auth-side h2 { color: #fff; font-size: 2.1rem; font-weight: 800; line-height: 1.15; max-width: 28rem; }
.auth-side ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .8rem; position: relative; z-index: 1; }
.auth-side li { display: flex; gap: .7rem; align-items: center; font-weight: 500; }
.auth-side li i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .18); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; }
.auth-mobile-brand { display: none; }
@media (max-width: 991.98px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: flex; justify-content: center; margin-bottom: 1.5rem; }
  .auth-main { align-items: flex-start; padding-top: 3rem; }
}

/* ---------- admin board ---------- */
.user-card { padding: 1rem 1.1rem; }
.user-card + .user-card { margin-top: .75rem; }
.limit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 991.98px) { .limit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.limit-box { border: 1px solid var(--lj-line); border-radius: 12px; padding: .6rem .7rem; background: #fafbfe; }
.limit-box .lbl { font-size: .72rem; color: var(--lj-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.limit-box .used { font-size: .75rem; color: var(--lj-muted); margin-top: .25rem; }
.limit-cell .form-check-label { font-size: .8rem; }

/* misc */
footer.lj-footer { color: var(--lj-muted); font-size: .8rem; padding: 1.5rem 0 2rem; text-align: center; }
.text-break-all { word-break: break-all; }
.gap-xs { gap: .35rem !important; }
.nowrap { white-space: nowrap; }
