/* HR Solutions – app styles (on top of Bootstrap 5) */
:root {
  --brand: #2f5bea;
  --brand-dark: #1e3fb3;
  --sidebar-bg: #111a2e;
  --sidebar-fg: #aab4c8;
  --sidebar-w: 248px;
  --bg: #f4f6fb;
  --border: #e5e8f0;
  --text-muted: #6b7489;
  --bs-primary: #2f5bea;
  --bs-primary-rgb: 47, 91, 234;
  --bs-link-color: #2f5bea;
  --bs-link-color-rgb: 47, 91, 234;
  --bs-body-font-size: .9rem;
}
body { background: var(--bg); color: #1d2433; font-size: .9rem; }
a { text-decoration: none; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.text-primary { color: var(--brand) !important; }
.form-control, .form-select { font-size: .875rem; }
.form-label { font-weight: 500; font-size: .8rem; color: #3b4458; margin-bottom: .3rem; }
.table { --bs-table-bg: transparent; font-size: .85rem; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; background: #f8f9fc; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-hover tbody tr:hover { --bs-table-hover-bg: #f7f9ff; }

/* ---------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-fg); position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; transition: transform .2s ease; }
.brand { display: flex; align-items: center; gap: .65rem; padding: .9rem .9rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-logo-full { display: block; width: 100%; background: #fff; border-radius: 12px; padding: 8px 12px; }
.brand-logo-full img { display: block; width: 100%; height: auto; }
.doc-logo { max-height: 84px; max-width: 240px; width: auto; height: auto; object-fit: contain; }
.logo-preview { width: 180px; height: 90px; border: 1px dashed var(--border); border-radius: 10px; display: grid; place-items: center; padding: 8px; background: #fafbfd; text-align: center; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 11px; padding: 3px; flex-shrink: 0; }
.login-logo { width: 200px; max-width: 70%; height: auto; background: #fff; border-radius: 18px; padding: 12px 14px; box-shadow: 0 4px 18px rgba(31,42,107,.10); }
.print-brand { display: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #4b7bff, #2f5bea); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; }
.brand-text { font-weight: 700; line-height: 1.1; }
.brand-text small { display: block; font-weight: 400; font-size: .7rem; color: var(--sidebar-fg); }
.side-nav { padding: .5rem .6rem 2rem; }
.nav-section { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: #69748c; padding: 1rem .75rem .35rem; }
.side-nav .nav-link { display: flex; align-items: center; gap: .7rem; color: var(--sidebar-fg); padding: .5rem .75rem; border-radius: 8px; font-size: .86rem; margin-bottom: 1px; }
.side-nav .nav-link i { font-size: 1.05rem; width: 1.1rem; text-align: center; }
.side-nav .nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav .nav-link.active { background: var(--brand); color: #fff; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; background: #fff; border-bottom: 1px solid var(--border); height: 60px; display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem; }
.content { padding: 1.25rem; flex: 1; }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; padding: 0; font-size: 1.15rem; color: #3b4458; }
.btn-icon:hover { background: #f1f3f8; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.user-chip { display: flex; align-items: center; gap: .5rem; border: 0; padding: .25rem .4rem; font-size: .8rem; }
.notif-dot { position: absolute; top: 3px; right: 1px; background: #e5484d; color: #fff; font-size: .6rem; font-weight: 700; border-radius: 10px; padding: 1px 5px; line-height: 1.3; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #e8eeff; color: var(--brand); display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }

/* global search */
.global-search { position: relative; flex: 1; max-width: 520px; }
.global-search > i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.global-search .form-control { padding-left: 2.2rem; background: #f4f6fb; border-color: transparent; border-radius: 10px; height: 38px; }
.global-search .form-control:focus { background: #fff; border-color: #c9d4f6; box-shadow: none; }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border-radius: 10px; border: 1px solid var(--border); max-height: 420px; overflow-y: auto; z-index: 1050; }
.search-results .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: .55rem .9rem .2rem; }
.search-results a { display: block; padding: .45rem .9rem; color: #1d2433; }
.search-results a:hover, .search-results a.active { background: #f1f4ff; }
.search-results a small { color: var(--text-muted); }

/* ---------- components */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.3rem; font-weight: 700; margin: 0; }
.page-head .sub { color: var(--text-muted); font-size: .82rem; }
.card { border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.card-header { background: #fff; border-bottom: 1px solid var(--border); font-weight: 600; padding: .8rem 1rem; border-radius: 12px 12px 0 0 !important; }
.card-title-sm { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }
.stat-card { display: flex; align-items: center; gap: .9rem; padding: 1rem; height: 100%; color: inherit; }
a.stat-card:hover { background: #fafbff; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .76rem; color: var(--text-muted); }
.filter-bar { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: .75rem; margin-bottom: 1rem; }
.filter-bar .form-control, .filter-bar .form-select { font-size: .82rem; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem 1.25rem; margin: 0; }
.dl-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; }
.dl-grid dd { margin: 0; font-weight: 500; word-break: break-word; }
.nav-tabs-scroll { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; border-bottom: 1px solid var(--border); }
.nav-tabs-scroll .nav-link { white-space: nowrap; color: var(--text-muted); border: 0; border-bottom: 2px solid transparent; font-weight: 500; font-size: .86rem; }
.nav-tabs-scroll .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }
.nav-tabs-scroll .nav-link .count { font-size: .7rem; background: #eef1f7; color: #4a5368; border-radius: 10px; padding: 1px 6px; margin-left: 3px; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2rem; display: block; margin-bottom: .5rem; color: #b6bfd3; }
.skill-chip { display: inline-block; background: #eef2ff; color: #3a4fb8; border-radius: 6px; font-size: .72rem; padding: 2px 7px; margin: 0 3px 3px 0; }
.skill-chip.match { background: #dcfce7; color: #166534; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: #e6e9f2; }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.timeline .when { font-size: .74rem; color: var(--text-muted); }
.req-card { border-left: 4px solid var(--brand); }
.score-pill { font-weight: 700; font-size: .75rem; border-radius: 20px; padding: 2px 8px; }
.score-hi { background: #dcfce7; color: #166534; } .score-mid { background: #fef3c7; color: #92400e; } .score-lo { background: #f1f5f9; color: #475569; }
.replacement-banner { background: linear-gradient(90deg, #eef7ff, #fff); border: 1px solid #cfe3ff; border-radius: 10px; padding: .6rem .9rem; }
.no-fee-banner { background: #fff7e6; border: 1px solid #ffd591; color: #874d00; border-radius: 10px; padding: .6rem .9rem; font-weight: 600; }

/* soft badges */
.badge { font-weight: 600; font-size: .7rem; padding: .35em .6em; border-radius: 6px; }
.badge-soft-primary { background: #e6edff; color: #2849c4; }
.badge-soft-secondary { background: #eef0f4; color: #4d566b; }
.badge-soft-success { background: #dcfce7; color: #15803d; }
.badge-soft-danger { background: #fee2e2; color: #b91c1c; }
.badge-soft-warning { background: #fef3c7; color: #a16207; }
.badge-soft-info { background: #e0f2fe; color: #0369a1; }
.badge-soft-dark { background: #e2e4ea; color: #1f2937; }
.badge-soft-teal { background: #ccfbf1; color: #0f766e; }
.badge-soft-orange { background: #ffedd5; color: #c2410c; }
.badge-soft-indigo { background: #e0e7ff; color: #4338ca; }
.bg-soft-primary { background: #e6edff; color: #2849c4; } .bg-soft-success { background: #dcfce7; color: #15803d; }
.bg-soft-warning { background: #fef3c7; color: #a16207; } .bg-soft-danger { background: #fee2e2; color: #b91c1c; }
.bg-soft-info { background: #e0f2fe; color: #0369a1; } .bg-soft-teal { background: #ccfbf1; color: #0f766e; }
.bg-soft-indigo { background: #e0e7ff; color: #4338ca; } .bg-soft-orange { background: #ffedd5; color: #c2410c; }
.text-indigo { color: #4338ca; }
.bg-soft-secondary { background: #eef0f4; color: #4d566b; } .bg-soft-dark { background: #e2e4ea; color: #1f2937; }

/* ---------- kanban */
.kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .75rem; scroll-snap-type: x proximity; }
.kanban-col { flex: 0 0 260px; background: #eceff6; border-radius: 12px; display: flex; flex-direction: column; max-height: 72vh; scroll-snap-align: start; }
.kanban-col-head { padding: .65rem .8rem; font-weight: 600; font-size: .8rem; display: flex; justify-content: space-between; align-items: center; }
.kanban-col-body { padding: 0 .5rem .5rem; overflow-y: auto; min-height: 60px; flex: 1; }
.kanban-col-body.drag-over { background: #dfe6fb; border-radius: 10px; }
.kanban-card { background: #fff; border-radius: 10px; padding: .6rem .7rem; margin-bottom: .5rem; border: 1px solid var(--border); cursor: grab; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.kanban-card.dragging { opacity: .5; }
.kanban-card .name { font-weight: 600; font-size: .85rem; }
.kanban-card .meta { font-size: .74rem; color: var(--text-muted); }
.kanban-card .form-select { font-size: .74rem; padding-top: .2rem; padding-bottom: .2rem; }

/* ---------- guest / login */
body.guest { background: radial-gradient(circle at 20% 20%, #e6edff, #f4f6fb 60%); }
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 100%; max-width: 410px; }
.error-icon i { font-size: 2.5rem; color: var(--brand); }

/* ---------- responsive */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; }
  .main { margin-left: 0; }
  .content { padding: 1rem .75rem; }
  .topbar { padding: 0 .75rem; }
}
@media (max-width: 575.98px) {
  .page-head h1 { font-size: 1.1rem; }
  .table-responsive-cards thead { display: none; }
  .table-responsive-cards tbody tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin-bottom: .6rem; background: #fff; padding: .35rem 0; }
  .table-responsive-cards tbody td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .75rem; text-align: right; }
  .table-responsive-cards tbody td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); font-size: .72rem; text-transform: uppercase; text-align: left; }
  .table-responsive-cards tbody td[data-label=""]::before { content: none; }
  .kanban-col { flex-basis: 84vw; }
}

/* ---------- print */
@media print {
  .sidebar, .topbar, .no-print, .breadcrumb, #flash-area, .filter-bar .btn, .pagination { display: none !important; }
  .main { margin: 0; }
  .print-brand { display: flex !important; align-items: center; gap: 12px; border-bottom: 2px solid #f59e0b; padding-bottom: 8px; margin-bottom: 14px; }
  .invoice-doc ~ .print-brand, body:has(.invoice-doc) .print-brand { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
  .invoice-doc, .col-xl-8:has(.invoice-doc) { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
  .table-responsive-cards thead { display: table-header-group !important; }
  a { color: inherit !important; text-decoration: none !important; }
}
