/* DPI HRMS - application styles (Bootstrap 5.3 base) */

:root {
    --app-primary: #2563eb;
    --app-sidebar-bg: #0f172a;
    --app-sidebar-fg: #cbd5e1;
    --app-sidebar-muted: #64748b;
    --app-sidebar-active: #1e293b;
    --app-sidebar-width: 256px;
    --app-topbar-height: 64px;
    --app-body-bg: #f1f5f9;
    --app-card-border: #e2e8f0;
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-link-color: #2563eb;
    --bs-link-color-rgb: 37, 99, 235;
    --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: .925rem;
}

body { background: var(--app-body-bg); color: #1e293b; }
.btn-primary { --bs-btn-bg: #2563eb; --bs-btn-border-color: #2563eb; --bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8; --bs-btn-active-bg: #1e40af; }

/* ------------------------------------------------------------ Shell */
.app-shell { display: flex; min-height: 100vh; }
.app-main  { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1 1 auto; padding: 1.5rem; }
.app-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--app-card-border); background: #fff; }

/* ------------------------------------------------------------ Sidebar */
.app-sidebar {
    width: var(--app-sidebar-width);
    background: var(--app-sidebar-bg);
    color: var(--app-sidebar-fg);
    display: flex; flex-direction: column;
}
@media (min-width: 992px) {
    /* Bootstrap's .offcanvas-lg forces a transparent background at >= lg; keep the dark sidebar. */
    .app-sidebar.offcanvas-lg { position: sticky; top: 0; height: 100vh; flex: 0 0 var(--app-sidebar-width); background-color: var(--app-sidebar-bg) !important; }
}
@media (max-width: 991.98px) {
    .app-sidebar.offcanvas-lg { --bs-offcanvas-width: var(--app-sidebar-width); --bs-offcanvas-bg: var(--app-sidebar-bg); }
}
.sidebar-brand { display: flex; align-items: center; height: var(--app-topbar-height); padding: 0 1.1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--app-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.brand-name { color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: .2px; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: .75rem .6rem 1rem; }
.sidebar-header { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--app-sidebar-muted); padding: 1rem .75rem .35rem; font-weight: 600; }
.sidebar-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .5rem .75rem; margin-bottom: 2px; border-radius: 7px;
    color: var(--app-sidebar-fg); text-decoration: none; font-size: .9rem;
}
.sidebar-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.sidebar-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-link.active { background: var(--app-primary); color: #fff; }
.sidebar-link.active i { opacity: 1; }
.sidebar-footer { padding: .75rem 1.1rem; color: var(--app-sidebar-muted); border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ------------------------------------------------------------ Topbar */
.app-topbar {
    position: sticky; top: 0; z-index: 1020;
    height: var(--app-topbar-height);
    display: flex; align-items: center; gap: .75rem;
    padding: 0 1.25rem; background: #fff; border-bottom: 1px solid var(--app-card-border);
}
.topbar-title { flex: 1 1 auto; min-width: 0; }
.topbar-title .breadcrumb { --bs-breadcrumb-divider-color: #94a3b8; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.company-switch { min-width: 220px; max-width: 280px; }
.btn-icon { border: 0; background: transparent; padding: .35rem .5rem; color: #475569; border-radius: 8px; }
.btn-icon:hover, .btn-icon:focus-visible { background: #f1f5f9; color: #0f172a; }
.btn-user { border: 0; background: transparent; padding: .25rem .4rem; border-radius: 8px; }
.btn-user:hover { background: #f1f5f9; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: #dbeafe; color: #1d4ed8; font-weight: 700; font-size: .8rem;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.avatar-sm { width: 30px; height: 30px; font-size: .7rem; }
.notif-menu { width: 360px; max-width: calc(100vw - 2rem); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: block; padding: .65rem 1rem; border-bottom: 1px solid #f1f5f9; color: inherit; text-decoration: none; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-item .notif-title { font-weight: 600; font-size: .85rem; }
.notif-item .notif-msg { font-size: .8rem; color: #475569; }
.notif-item .notif-time { font-size: .72rem; color: #94a3b8; }

/* ------------------------------------------------------------ Cards / widgets */
.card { border-color: var(--app-card-border); border-radius: 10px; }
.card-header { background: #fff; border-bottom-color: var(--app-card-border); font-weight: 600; }
.stat-card { padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: 1rem; height: 100%; }
.stat-card .stat-icon {
    width: 46px; height: 46px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.35rem; flex: 0 0 auto;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: #0f172a; }
.stat-card .stat-label { font-size: .8rem; color: #64748b; }
a.stat-link { text-decoration: none; color: inherit; display: block; height: 100%; }
a.stat-link .card { transition: box-shadow .15s, transform .15s; }
a.stat-link:hover .card { box-shadow: 0 4px 14px rgba(15,23,42,.08); transform: translateY(-1px); }
.tone-blue   { background: #dbeafe; color: #1d4ed8; }
.tone-green  { background: #dcfce7; color: #15803d; }
.tone-amber  { background: #fef3c7; color: #b45309; }
.tone-red    { background: #fee2e2; color: #b91c1c; }
.tone-violet { background: #ede9fe; color: #6d28d9; }
.tone-slate  { background: #e2e8f0; color: #334155; }
.tone-cyan   { background: #cffafe; color: #0e7490; }
.list-compact .list-group-item { padding: .6rem 1rem; border-color: #f1f5f9; }
.empty-state { padding: 1.5rem 1rem; text-align: center; color: #94a3b8; font-size: .85rem; }
.empty-state i { font-size: 1.6rem; display: block; margin-bottom: .35rem; }
.bar-track { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--app-primary); border-radius: 4px; }

/* ------------------------------------------------------------ Tables / forms */
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #64748b; background: #f8fafc; white-space: nowrap; }
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .3rem; }
.required::after { content: " *"; color: #dc2626; }
div.dt-container .dt-search input { min-width: 220px; }

/* ------------------------------------------------------------ Auth pages */
.auth-body { min-height: 100vh; background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-card { width: 100%; max-width: 420px; border: 0; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-card .card-body { padding: 2rem; }
.auth-logo { width: 52px; height: 52px; border-radius: 12px; background: var(--app-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 2.6rem; }
.password-wrap .toggle-password { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #64748b; padding: .25rem .45rem; }
.pw-rules li { font-size: .8rem; color: #64748b; }
.pw-rules li.ok { color: #15803d; }
.pw-rules li.ok::marker { content: "\2713  "; }

/* ------------------------------------------------------------ Public (candidate) pages */
.public-body { background: var(--app-body-bg); min-height: 100vh; }
.public-top { background: #fff; border-bottom: 1px solid var(--app-card-border); padding: .75rem 0; }
.public-logo { height: 40px; max-width: 160px; object-fit: contain; }
.kyc-nav .list-group-item { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.kyc-nav .list-group-item.active { background: #eff6ff; color: #1e3a8a; border-color: #bfdbfe; font-weight: 600; }
.kyc-nav .sec-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; flex: 0 0 auto; }
.kyc-row { border: 1px dashed #cbd5e1; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; position: relative; background: #fcfdff; }
.kyc-row .row-remove { position: absolute; top: .5rem; right: .5rem; }
.field-locked { background-color: #f1f5f9 !important; }
.remark-box { border-left: 3px solid #dc2626; background: #fef2f2; padding: .5rem .75rem; border-radius: 4px; font-size: .85rem; }
.review-section { border-left: 4px solid #cbd5e1; }
.review-section.is-approved { border-left-color: #16a34a; }
.review-section.is-rejected { border-left-color: #dc2626; }
.review-section.is-pending { border-left-color: #f59e0b; }
.kv { display: grid; grid-template-columns: minmax(140px, 35%) 1fr; gap: .35rem 1rem; font-size: .88rem; }
.kv dt { color: #64748b; font-weight: 500; }
.kv dd { margin: 0; word-break: break-word; }
.doc-thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid #e2e8f0; background: #f8fafc; }
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid #e2e8f0; margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--app-primary); border: 2px solid #fff; }
.timeline li:last-child { border-left-color: transparent; }

@media (max-width: 575.98px) {
    .app-content { padding: 1rem; }
    .app-topbar { padding: 0 .75rem; }
    .auth-card .card-body { padding: 1.5rem; }
}

/* Policy signature pad */
.sig-wrap { position: relative; }
.sig-pad { display: block; width: 100%; height: 160px; background: #fff; border: 1.5px dashed var(--bs-border-color, #cbd5e1); border-radius: .5rem; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #94a3b8; pointer-events: none; font-size: .95rem; }
