/* ============================================================
   styles-ext.css — expansion: dark mode, nav, vacancies, status
   timeline, notifications, toasts, print. Loads after styles.css
   ============================================================ */

/* NOTE: no transition on theme-driven properties — instant swap so
   dark mode never strands when the animation clock is throttled. */
*, *::before, *::after {
  transition-property: transform, box-shadow, opacity !important;
}

/* ============================================================
   DARK THEME
   ============================================================ */
[data-theme="dark"] {
  --accent: #2b9fe0; --accent-600: #39a8e6; --accent-700: #74c4f0; --accent-800: #a6d8f6;
  --accent-tint: #122838; --accent-tint-2: #173a52; --accent-ring: rgba(56,163,224,.28);
  --ink: #e9eef6; --ink-2: #b6c3d4; --ink-3: #8d9cae; --ink-4: #687889;
  --line: #263548; --line-2: #1b2735;
  --surface: #131c28; --canvas: #0b121b; --canvas-2: #1b2734;
  --ok: #35cc8d; --ok-tint: #102619; --ok-line: #1e4e38;
  --err: #f0726a; --err-tint: #2a1715; --err-line: #5b2a26;
  --warn: #e2ad45; --warn-tint: #2a2113;
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -14px rgba(0,0,0,.7);
  --sh-3: 0 2px 8px rgba(0,0,0,.5), 0 26px 60px -22px rgba(0,0,0,.8);
}
[data-theme="dark"] .hdr { background: rgba(11,18,27,.85); }
/* Mobil sticky bottom nav — dark mode */
@media (max-width: 860px) {
  [data-theme="dark"] .formnav { background: rgba(19,28,40,.96); }
}
[data-theme="dark"] select.inp { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238d9cae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
[data-theme="dark"] .btn-primary { box-shadow: 0 1px 2px rgba(0,0,0,.5); }
[data-theme="dark"] .up-prev.pdf { background: #2a1715; }
[data-theme="dark"] img { opacity: .92; }

/* ============================================================
   TOP NAV
   ============================================================ */
.nav-tabs { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-3); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; }
.nav-tab svg { width: 17px; height: 17px; }
.nav-tab:hover { background: var(--canvas-2); color: var(--ink-2); }
.nav-tab.on { background: var(--accent-tint); color: var(--accent-800); }
.nav-tab .nbadge { position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--err); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: .15s; }
.icon-btn:hover { border-color: var(--ink-4); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .nbadge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--err); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }

/* mobile bottom tab bar */
.tabbar { display: none; }

/* ============================================================
   VIEW TRANSITIONS
   ============================================================ */
.view { animation: viewin .32s ease; }
@keyframes viewin { from { opacity: 0; transform: translateY(10px); } }

/* ============================================================
   VACANCIES
   ============================================================ */
.filters { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.filters .search { position: relative; flex: 1; min-width: 220px; }
.filters .search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-4); }
.filters .search input { width: 100%; height: 46px; padding: 0 14px 0 44px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); outline: none; font-size: 14.5px; color: var(--ink); }
.filters .search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.filters select.inp { width: auto; min-width: 160px; }
.vac-count { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; font-weight: 500; }
.vac-count b { color: var(--ink); }

.vac-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.vac { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 14px; transition: .18s; }
.vac:hover { border-color: var(--accent); box-shadow: var(--sh-2); transform: translateY(-2px); }
.vac-top { display: flex; gap: 13px; align-items: flex-start; }
.vac-logo { width: 46px; height: 46px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-700); font-weight: 800; font-size: 17px; }
.vac-h { flex: 1; min-width: 0; }
.vac-title { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.vac-org { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.vac-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 7px; background: var(--canvas-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.tag svg { width: 13px; height: 13px; color: var(--ink-4); }
.vac-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-2); margin-top: auto; }
.vac-salary { font-size: 15px; font-weight: 700; color: var(--ink); }
.vac-salary span { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.vac-deadline { font-size: 12px; font-weight: 600; }
.vac-deadline.soon { color: var(--err); }
.vac-deadline.ok { color: var(--ink-3); }
.vac-actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   STATUS TIMELINE
   ============================================================ */
.status-head { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-1); margin-bottom: 22px; flex-wrap: wrap; }
.status-head .sh-id { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--accent-800); }
.status-head .sh-l { font-size: 12px; color: var(--ink-4); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.status-head .sh-v { font-size: 14.5px; font-weight: 600; margin-top: 2px; }
.status-head .sh-sep { width: 1px; align-self: stretch; background: var(--line); }
.status-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.status-pill .d { width: 8px; height: 8px; border-radius: 50%; }

.timeline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 24px; box-shadow: var(--sh-1); }
.tl-row { display: flex; gap: 18px; padding: 18px 0; position: relative; }
.tl-row:not(:last-child)::after { content: ''; position: absolute; left: 17px; top: 46px; bottom: -18px; width: 2px; background: var(--line); }
.tl-row.done:not(:last-child)::after { background: var(--ok); }
.tl-dot { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--surface); color: var(--ink-4); z-index: 1; }
.tl-dot svg { width: 18px; height: 18px; }
.tl-row.done .tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl-row.current .tl-dot { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-700); box-shadow: 0 0 0 5px var(--accent-ring); }
.tl-body { flex: 1; padding-top: 5px; }
.tl-t { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.tl-row.upcoming .tl-t { color: var(--ink-4); }
.tl-h { font-size: 13px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.tl-meta { display: inline-flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 8px; background: var(--accent-tint); color: var(--accent-800); }
.tl-meta svg { width: 14px; height: 14px; }
.tl-stamp { font-size: 12px; color: var(--ink-4); font-weight: 600; margin-top: 6px; font-family: var(--mono); }
.tl-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; margin-left: 10px; vertical-align: middle; }
.tl-tag.done { background: var(--ok-tint); color: var(--ok); }
.tl-tag.current { background: var(--accent-tint); color: var(--accent-700); }

/* ============================================================
   NOTIFICATIONS PANEL
   ============================================================ */
.notif-layer { position: fixed; inset: 0; z-index: 69; }
.notif-back { position: fixed; inset: 0; background: rgba(15,27,45,.45); }
.status-actions { display: flex; gap: 12px; margin-top: 22px; justify-content: space-between; }
.notif-pop { position: absolute; top: calc(100% + 10px); right: 0; width: 380px; max-width: 92vw; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); z-index: 70; overflow: hidden; }
.notif-pop-h { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.notif-pop-h h4 { margin: 0; font-size: 15px; font-weight: 700; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.notif:hover { background: var(--canvas-2); }
.notif.unread { background: var(--accent-tint); }
.notif.unread:hover { background: var(--accent-tint-2); }
.notif-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; }
.notif-ic svg { width: 18px; height: 18px; }
.notif-ic.invite { background: var(--accent-tint); color: var(--accent-700); }
.notif-ic.status { background: var(--ok-tint); color: var(--ok); }
.notif-ic.message { background: var(--warn-tint); color: var(--warn); }
.notif-c { flex: 1; min-width: 0; }
.notif-t { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.notif-t .dotnew { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.notif-b { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.notif-ago { font-size: 11.5px; color: var(--ink-4); margin-top: 5px; font-weight: 500; }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--ink-4); font-size: 13.5px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 11px; background: var(--ink); color: #fff; padding: 13px 16px 13px 14px; border-radius: 12px; box-shadow: var(--sh-3); font-size: 13.5px; font-weight: 600; pointer-events: auto; max-width: 92vw; }
[data-theme="dark"] .toast { background: #1e2c3c; border: 1px solid var(--line); }
.toast .ti { width: 28px; height: 28px; flex: none; border-radius: 8px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.toast .ti svg { width: 16px; height: 16px; }
.toast .ti.ok { background: var(--ok); }
.toast button { background: none; border: 0; color: var(--accent-800); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; margin-left: 4px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 60px 20px; max-width: 420px; margin: 0 auto; }
.empty-state .es-ic { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 20px; background: var(--accent-tint); color: var(--accent-700); display: grid; place-items: center; }
.empty-state .es-ic svg { width: 34px; height: 34px; }
.empty-state h3 { font-size: 19px; font-weight: 700; margin: 0 0 8px; }
.empty-state p { color: var(--ink-3); font-size: 14.5px; margin: 0 0 22px; line-height: 1.55; }

/* ============================================================
   ACCESSIBILITY — visible keyboard focus
   ============================================================ */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, .vac:focus-visible, .nav-tab:focus-visible {
  outline: 3px solid var(--accent-ring); outline-offset: 2px; border-radius: 6px;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { left: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .nav-tabs { display: none; }
  .vac-grid { grid-template-columns: 1fr; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .search { min-width: 0; width: 100%; }
  .filters select.inp { width: 100%; min-width: 0; }
  .status-actions { flex-direction: column-reverse; }
  .status-actions .btn { width: 100%; }
  .notif-pop { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; max-height: 80vh; }
  .notif-list { max-height: calc(80vh - 60px); }

  /* bottom tab bar */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  [data-theme="dark"] .tabbar { background: rgba(11,18,27,.96); }
  .tabbar.hidden { display: none; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; font: inherit; font-size: 11px; font-weight: 600; color: var(--ink-4); cursor: pointer; padding: 6px 0; position: relative; text-decoration: none; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--accent-700); }
  .tabbar a .nbadge { position: absolute; top: 0; right: 50%; margin-right: -22px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--err); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
  .status-head .sh-sep { display: none; }
  .status-pill { margin-left: 0; }
}

/* ============================================================
   PRINT — receipt only
   ============================================================ */
@media print {
  body * { visibility: hidden !important; }
  #print-receipt, #print-receipt * { visibility: visible !important; }
  #print-receipt { position: absolute; inset: 0; margin: 0; padding: 40px; display: block !important; }
  .no-print { display: none !important; }
}
