:root {
  --primary: #F26522;
  --primary-rgb: 242, 101, 34;
  --primary-soft: rgba(var(--primary-rgb), .1);
  --sidebar-w: 15.75rem;
  --header-h: 4rem;
  --body-bg: #F7F7F7;
  --card-bg: #fff;
  --border: #E5E7EB;
  --text: #212529;
  --muted: #6B7280;
  --heading: #111827;
  --sidebar-bg: #fff;
  --sidebar-text: #374151;
  --sidebar-hover: #F8F9FA;
  --success: #03C95A; --info: #1B84FF; --warning: #FFC107; --danger: #E70D0D; --purple: #AB47BC; --pink: #FD3995; --teal: #02A8B5; --dark-c: #212529; --secondary-c: #3B7080;
}
[data-bs-theme=dark] {
  --body-bg: #0f1419; --card-bg: #1a2027; --border: #2b333d; --text: #d7dce2; --muted: #8b95a1; --heading: #f3f4f6;
  --sidebar-bg: #151b21; --sidebar-text: #c7cdd4; --sidebar-hover: #222a33;
}
[data-sidebar=dark] { --sidebar-bg: #1F2937; --sidebar-text: #D1D5DB; --sidebar-hover: #2b3747; }

body { font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--body-bg); color: var(--text); font-size: 0.875rem; }
.btn { font-size: .875rem; }
.form-control, .form-select { font-size: .875rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary); opacity: .85; }
h1,h2,h3,h4,h5,h6 { color: var(--heading); font-weight: 600; }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); filter: none; }
.btn-primary:hover { filter: brightness(.93); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--primary); border: 0; }
.btn-soft:hover { background: var(--primary); color: #fff; }
.btn-white { background: var(--card-bg); border: 1px solid var(--border); color: var(--text); }
.btn-white:hover { border-color: var(--primary); color: var(--primary); }
.form-control, .form-select { border-color: var(--border); font-size: 0.875rem; padding: .5rem .75rem; background-color: var(--card-bg); color: var(--text); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem var(--primary-soft); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-label { font-weight: 500; color: var(--heading); margin-bottom: .35rem; font-size: 0.8438rem; }
.req::after { content: " *"; color: var(--danger); }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.04); margin-bottom: 1.5rem; }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.card-header h5, .card-title { margin: 0; font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.table { --bs-table-bg: transparent; color: var(--text); margin: 0; }
.table thead th { background: rgba(0,0,0,.025); color: var(--heading); font-weight: 600; font-size: 0.8125rem; white-space: nowrap; border-bottom: 1px solid var(--border); padding: .8rem 1rem; }
[data-bs-theme=dark] .table thead th { background: rgba(255,255,255,.03); }
.table td { padding: .7rem .9rem; vertical-align: middle; border-color: var(--border); }
.table td.nw, .table td:last-child { white-space: nowrap; }
.table td.wrap, .table td .wrap { white-space: normal; min-width: 160px; }
.table-hover tbody tr:hover > * { background: rgba(var(--primary-rgb), .03); }
.table th a { color: inherit; }

/* ---------- layout ---------- */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: var(--sidebar-bg); border-right: 1px solid var(--border); z-index: 1040; display: flex; flex-direction: column; transition: width .2s, transform .2s; }
.sidebar-logo { height: var(--header-h); display: flex; align-items: center; gap: .6rem; padding: 0 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-logo img { max-height: 36px; max-width: 160px; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.062rem; flex-shrink: 0; }
.logo-text { font-weight: 700; font-size: 1.25rem; color: var(--heading); white-space: nowrap; letter-spacing: -.3px; }
.logo-text span { color: var(--primary); }
.sidebar-menu { overflow-y: auto; flex: 1; padding: .5rem .75rem 2rem; scrollbar-width: thin; }
.menu-title { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; color: var(--muted); padding: 1rem .5rem .4rem; letter-spacing: .4px; }
.sidebar-menu ul { list-style: none; padding: 0; margin: 0; }
.sidebar-menu a.nav-l { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; color: var(--sidebar-text); border-radius: 6px; font-weight: 500; font-size: 0.875rem; position: relative; }
.sidebar-menu a.nav-l:hover { background: var(--sidebar-hover); color: var(--primary); }
.sidebar-menu a.nav-l.active { background: var(--primary-soft); color: var(--primary); }
.sidebar-menu a.nav-l i { font-size: 1.062rem; width: 20px; text-align: center; }
.sidebar-menu a.nav-l .arrow { margin-left: auto; transition: transform .2s; font-size: 0.875rem; }
.sidebar-menu a.nav-l[aria-expanded=true] .arrow { transform: rotate(90deg); }
.sidebar-menu .sub { padding-left: 1.6rem; }
.sidebar-menu .sub a.nav-l { font-size: 0.8438rem; padding: .42rem .65rem; font-weight: 400; }
.sidebar-menu .sub a.nav-l::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .45; margin-right: .2rem; }
.sidebar-menu .sub a.nav-l.active::before { opacity: 1; }
.sidebar-menu .sub .sub { padding-left: .8rem; }

.page-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin .2s; }
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--header-h); background: var(--card-bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 1.25rem; gap: .75rem; }
.topbar .search { max-width: 340px; flex: 1; position: relative; }
.topbar .search input { padding-left: 2.2rem; background: var(--body-bg); }
.topbar .search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.icon-btn { width: 2.375rem; height: 2.375rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); display: inline-grid; place-items: center; position: relative; font-size: 1.125rem; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 0.625rem; line-height: 16px; text-align: center; padding: 0 4px; }
.content { padding: 1.5rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h3 { font-size: 1.25rem; margin: 0 0 .2rem; }
.breadcrumb { margin: 0; font-size: 0.8125rem; }
.breadcrumb a { color: var(--muted); }

body.mini .sidebar { width: 4.6rem; }
body.mini .sidebar .logo-text, body.mini .sidebar .menu-title, body.mini .sidebar .nav-l span, body.mini .sidebar .arrow, body.mini .sidebar .sub { display: none !important; }
body.mini .sidebar a.nav-l { justify-content: center; }
body.mini .page-wrapper { margin-left: 4.6rem; }
body.mini .sidebar:hover { width: var(--sidebar-w); }
body.mini .sidebar:hover .logo-text, body.mini .sidebar:hover .menu-title, body.mini .sidebar:hover .nav-l span, body.mini .sidebar:hover .arrow { display: initial !important; }
body.mini .sidebar:hover .sub.show { display: block !important; }
body.mini .sidebar:hover a.nav-l { justify-content: flex-start; }
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .page-wrapper, body.mini .page-wrapper { margin-left: 0; }
  .topbar .search { display: none; }
  .content { padding: 1rem; }
}
[dir=rtl] .sidebar { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--border); }
[dir=rtl] .page-wrapper { margin-left: 0; margin-right: var(--sidebar-w); }
[dir=rtl] .sidebar-menu .sub { padding-left: 0; padding-right: 1.6rem; }
[dir=rtl] .sidebar-menu a.nav-l .arrow { margin-left: 0; margin-right: auto; transform: rotate(180deg); }

/* ---------- widgets ---------- */
.avatar { width: 2.375rem; height: 2.375rem; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; font-weight: 600; font-size: 0.875rem; color: #fff; flex-shrink: 0; background: var(--secondary-c); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 1.875rem; height: 1.875rem; font-size: 0.75rem; }
.avatar-lg { width: 4rem; height: 4rem; font-size: 1.375rem; }
.avatar-xl { width: 5.5rem; height: 5.5rem; font-size: 2rem; }
.avatar-rounded { border-radius: 10px; }
.stat-card { display: flex; flex-direction: column; gap: .4rem; }
.stat-icon { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.375rem; margin-bottom: .6rem; }
.stat-card .label { color: var(--muted); font-size: 0.8438rem; font-weight: 500; }
.stat-card .value { font-size: 1.375rem; font-weight: 700; color: var(--heading); }
.stat-row { display: flex; align-items: center; justify-content: space-between; }
.soft-icon { width: 2.5rem; height: 2.5rem; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.bg-c-primary { background: var(--primary); } .bg-c-success { background: var(--success); } .bg-c-info { background: var(--info); } .bg-c-warning { background: var(--warning); }
.bg-c-danger { background: var(--danger); } .bg-c-purple { background: var(--purple); } .bg-c-pink { background: var(--pink); } .bg-c-teal { background: var(--teal); } .bg-c-dark { background: #212529; } .bg-c-secondary { background: var(--secondary-c); }
.soft-primary { background: var(--primary-soft); color: var(--primary); } .soft-success { background: rgba(3,201,90,.1); color: var(--success); } .soft-info { background: rgba(27,132,255,.1); color: var(--info); }
.soft-warning { background: rgba(255,193,7,.15); color: #c79200; } .soft-danger { background: rgba(231,13,13,.08); color: var(--danger); } .soft-purple { background: rgba(171,71,188,.1); color: var(--purple); }
.soft-dark { background: rgba(33,37,41,.08); color: var(--heading); } .soft-pink { background: rgba(253,57,149,.1); color: var(--pink); } .soft-teal { background: rgba(2,168,181,.1); color: var(--teal); }
.badge { font-weight: 500; padding: .38em .7em; border-radius: 5px; font-size: 0.75rem; }
.badge-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: middle; }
.welcome-card { background: linear-gradient(110deg, var(--card-bg) 55%, var(--primary-soft)); }
.progress { height: 7px; border-radius: 10px; background: var(--border); }
.progress-bar { background: var(--primary); }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px dashed var(--border); }
.list-clean li:last-child { border-bottom: 0; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 210px; }
.stars { color: #FFC107; letter-spacing: 1px; }
.stars .off { color: var(--border); }
.grid-card { text-align: center; position: relative; height: 100%; }
.grid-card .actions { position: absolute; top: .75rem; right: .75rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-bar .form-select, .filter-bar .form-control { width: auto; min-width: 140px; padding-top: .4rem; padding-bottom: .4rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 3rem; opacity: .4; display: block; margin-bottom: .5rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem 1.5rem; }
.detail-grid .lbl { color: var(--muted); font-size: 0.7812rem; margin-bottom: .15rem; }
.detail-grid .val { font-weight: 500; color: var(--heading); word-break: break-word; }
.detail-grid .wide { grid-column: 1 / -1; }
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.kanban-col { min-width: 290px; width: 290px; background: rgba(0,0,0,.025); border-radius: 10px; padding: .75rem; border: 1px solid var(--border); }
[data-bs-theme=dark] .kanban-col { background: rgba(255,255,255,.03); }
.kanban-col h6 { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; padding-left: .5rem; border-left: 3px solid var(--primary); }
.kanban-list { min-height: 80px; display: flex; flex-direction: column; gap: .6rem; }
.kanban-item { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: .8rem; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.kanban-item:active { cursor: grabbing; }
.sortable-ghost { opacity: .4; }
.toast-container { z-index: 2000; }
.nav-tabs .nav-link { color: var(--muted); border: 0; border-bottom: 2px solid transparent; font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.nav-pills .nav-link.active { background: var(--primary); }
.nav-pills .nav-link { color: var(--text); }
.settings-nav .list-group-item { border: 0; border-radius: 6px !important; color: var(--text); background: transparent; padding: .55rem .9rem; font-size: 0.8438rem; }
.settings-nav .list-group-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.settings-nav h6 { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); margin: 1rem .9rem .3rem; }
.dropdown-menu { border-color: var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.08); font-size: 0.875rem; background: var(--card-bg); }
.notif-item { white-space: normal; border-bottom: 1px solid var(--border); padding: .65rem 1rem; }
.chat-wrap { display: flex; height: calc(100vh - 190px); min-height: 480px; }
.chat-users { width: 300px; border-right: 1px solid var(--border); overflow-y: auto; }
.chat-users a { display: flex; gap: .65rem; padding: .75rem 1rem; color: var(--text); align-items: center; border-bottom: 1px solid var(--border); }
.chat-users a.active, .chat-users a:hover { background: var(--primary-soft); }
.chat-main { flex: 1; display: flex; flex-direction: column; }
.chat-body { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; background: var(--body-bg); }
.msg { max-width: 70%; padding: .6rem .9rem; border-radius: 12px; background: var(--card-bg); border: 1px solid var(--border); align-self: flex-start; }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-color: var(--primary); }
.msg small { display: block; opacity: .7; font-size: 0.6875rem; margin-top: .2rem; }
.auth-wrap { min-height: 100vh; display: flex; }
.auth-side { flex: 1; background: linear-gradient(135deg, var(--primary), #ff9a5a); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 4rem; }
.auth-side h1 { color: #fff; font-size: 2.125rem; }
.auth-form { width: 100%; max-width: 520px; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--card-bg); }
.auth-form .inner { width: 100%; max-width: 400px; }
@media (max-width: 991px) { .auth-side { display: none; } .auth-form { max-width: none; } }
.payslip-box { max-width: 900px; margin: auto; }
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1.1rem; }
.timeline-item::before { content: ""; position: absolute; left: -1.5rem; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--card-bg); border: 3px solid var(--primary); }
.punch-circle { width: 170px; height: 170px; border-radius: 50%; border: 6px solid var(--primary-soft); display: grid; place-items: center; margin: 1rem auto; text-align: center; }
.note-card { border-radius: 10px; padding: 1rem; height: 100%; border: 1px solid var(--border); }
.file-tile { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; text-align: center; height: 100%; background: var(--card-bg); }
.file-tile i { font-size: 2.375rem; }
.mail-list a { display: flex; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); }
.mail-list a.unread { font-weight: 600; background: var(--primary-soft); }
.insight { border-left: 4px solid; border-radius: 8px; padding: .85rem 1rem; background: var(--card-bg); border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.insight.success { border-left-color: var(--success); } .insight.warning { border-left-color: var(--warning); } .insight.danger { border-left-color: var(--danger); } .insight.info { border-left-color: var(--info); }
.color-swatch { width: 34px; height: 34px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.color-swatch.active { border-color: var(--heading); }
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }
.fs-12 { font-size: 0.75rem; } .fs-13 { font-size: 0.8125rem; } .fw-medium { font-weight: 500; }
@media print {
  .sidebar, .topbar, .no-print, .page-head .btn, .toast-container { display: none !important; }
  .page-wrapper { margin: 0 !important; }
  .content { padding: 0; }
  .card { border: 0; box-shadow: none; }
  body { background: #fff; }
}

/* ================= RESPONSIVE / DENSITY ================= */
.kpi-value { font-size: clamp(16px, 1.35vw, 22px); }
.card .h4, .card h4 { font-size: clamp(16px, 1.3vw, 21px); }
@media (max-width: 1599.98px) {
  :root { --sidebar-w: 236px; --header-h: 58px; }
  .content { padding: 1.15rem; }
  .card { margin-bottom: 1.15rem; }
  .card-body { padding: 1rem 1.1rem; }
  .card-header { padding: .8rem 1.1rem; }
  .table thead th { padding: .65rem .75rem; font-size: 0.7812rem; }
  .table td { padding: .6rem .75rem; }
  .stat-card .value { font-size: 1.188rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.188rem; margin-bottom: .4rem; }
  .soft-icon { width: 38px; height: 38px; font-size: 1.125rem; }
  .page-head h3 { font-size: 1.125rem; }
  .sidebar-menu a.nav-l { padding: .48rem .6rem; font-size: 0.8438rem; }
  .sidebar-menu .sub a.nav-l { font-size: 0.8125rem; padding: .36rem .6rem; }
  .chart-box { height: 250px; }
  .avatar-xl { width: 80px; height: 80px; font-size: 1.688rem; }
  .kanban-col { min-width: 265px; width: 265px; }
}
@media (max-width: 1299.98px) {
  .topbar .search { max-width: 220px; }
  .ai-label { display: none; }
  .filter-bar .form-select, .filter-bar .form-control { min-width: 120px; }
  .detail-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
@media (max-width: 767.98px) {
  .content { padding: .8rem; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head > div:last-child { justify-content: flex-start; }
  .card-header { flex-direction: column; align-items: stretch; }
  .filter-bar { width: 100%; }
  .filter-bar .form-select, .filter-bar .form-control, .filter-bar .ts-wrapper { flex: 1 1 140px; min-width: 0 !important; width: auto; }
  .chart-box { height: 220px; }
  .chart-box.sm { height: 190px; }
  .topbar { padding: 0 .75rem; gap: .4rem; }
  .icon-btn { width: 34px; height: 34px; font-size: 1rem; }
  .msg { max-width: 88%; }
  .chat-wrap { flex-direction: column; height: auto; }
  .chat-users { width: 100%; max-height: 220px; border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-body { min-height: 50vh; }
  .welcome-card .card-body { flex-direction: column; align-items: flex-start !important; }
  .auth-form { padding: 1.25rem; }
  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .nav-tabs .nav-link { white-space: nowrap; }
  .table thead th, .table td { padding: .5rem .6rem; }
  .payslip-box .card-body { padding: 1rem !important; }
  h3, .h3 { font-size: 1.125rem; }
}
@media (max-width: 991.98px) { .ai-label { display: none; } }

/* ---------- responsive scaling (whole UI scales like browser zoom on smaller screens) ---------- */
html { font-size: 16px; }
@media (max-width: 1599.98px) { html { font-size: 15px; } }
@media (max-width: 1199.98px) { html { font-size: 14.5px; } }
.page-wrapper { min-width: 0; }
.content { max-width: 100%; }
.card-body.stat-card .value, .card h4 { word-break: break-word; }
@media (max-width: 1199.98px) {
  .content { padding: 1.1rem; }
  .card-body { padding: 1rem; }
  .card-header { padding: .8rem 1rem; }
  .table td, .table thead th { padding: .6rem .75rem; }
  .kanban-col { min-width: 250px; width: 250px; }
}
@media (max-width: 767.98px) {
  .topbar { padding: 0 .75rem; gap: .4rem; }
  .topbar .hide-sm { display: none !important; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head > div:last-child { justify-content: flex-start; }
  .card-header { flex-direction: column; align-items: stretch; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-bar .form-select, .filter-bar .form-control, .filter-bar .ts-wrapper { min-width: 0 !important; width: 100% !important; }
  .filter-bar > .btn { width: 100%; }
  .chat-wrap { flex-direction: column; height: auto; }
  .chat-users { width: 100%; max-height: 220px; border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-body { min-height: 360px; }
  .msg { max-width: 88%; }
  .stat-card .value { font-size: 1.2rem; }
  .punch-circle { width: 140px; height: 140px; }
  .modal-dialog { margin: .5rem; }
  .payslip-box .card-body { padding: 1rem !important; }
}
@media (max-width: 420px) { .filter-bar { grid-template-columns: 1fr; } }
@media (max-width: 575.98px) {
  .stat-row .soft-icon { display: none; }
  .stat-card .stat-icon { width: 2.2rem; height: 2.2rem; font-size: 1.05rem; }
  .card-body h4 { font-size: 1.05rem; }
}

/* ================= FINAL SETTLEMENT ================= */
.fs-section { font-size: .95rem; font-weight: 700; color: var(--primary); border-left: 3px solid currentColor; padding-left: .5rem; margin-bottom: .6rem; }
.fs-sec-row td { background: #f8f9fa; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; color: #555; }
.fs-net { border: 2px solid var(--primary); border-radius: .5rem; padding: .9rem; background: var(--primary-soft); }
.fs-att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 3px; }
.fs-att { border: 1px solid #e5e7eb; border-radius: 4px; text-align: center; line-height: 1.1; padding: 2px 0; font-size: 11px; }
.fs-att small { display: block; color: #888; font-size: 10px; }
.fs-att.p { background: #e8f8ef; color: #198754; } .fs-att.l { background: #fff4e0; color: #b26a00; }
.fs-att.h { background: #e7f1ff; color: #0d6efd; } .fs-att.a { background: #fde8e8; color: #dc3545; }
.fs-att.lv { background: #f1e8fd; color: #6f42c1; } .fs-att.s, .fs-att.ho { background: #f3f4f6; color: #6b7280; }
.fs-att.gh { background: #fff0f6; color: #d63384; } .fs-att.n { color: #bbb; }
.fs-sign-line { border-top: 1px solid #333; margin: 0 1rem .35rem; padding-top: 2.5rem; }
@media print {
  .fs-statement .card-body { padding: 0 !important; }
  .fs-statement { font-size: 11px; }
  .fs-statement .table { margin-bottom: .5rem; }
  .fs-statement .col-lg-7 { width: 58%; } .fs-statement .col-lg-5 { width: 42%; } .fs-statement .col-lg-4 { width: 33.33%; }
  .fs-statement .col-lg-7, .fs-statement .col-lg-5, .fs-statement .col-lg-4 { flex: 0 0 auto; }
  .fs-statement .col-md { flex: 1 0 0; }
  .fs-att, .fs-sec-row td, .fs-net, .bg-light { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fs-statement .d-none.d-sm-table-cell { display: table-cell !important; }
  .fs-section { break-after: avoid; }
  .fs-statement .table-responsive { overflow: visible !important; }
  .fs-statement .table-sm > :not(caption) > * > * { padding: .2rem .3rem; }
  .fs-statement .fs-att-grid { grid-template-columns: repeat(16, 1fr); }
  .fs-net, .fs-sign { break-inside: avoid; }
  .fs-sign-line { padding-top: 1.8rem; }
  @page { size: A4; margin: 10mm; }
}
@media print { .fs-att-table { font-size: 9.5px !important; } }
@media (max-width: 575.98px) { .fs-statement .card-body { padding: 1rem !important; } .fs-statement .table th, .fs-statement .table td { white-space: nowrap; } .fs-statement .fs-net .fs-5 { font-size: 1rem !important; } }

/* ================= BIOMETRIC / LIVE ATTENDANCE ================= */
.live-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #03C95A; vertical-align: middle; animation: livepulse 1.6s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(3,201,90,.6); } 70% { box-shadow: 0 0 0 .55rem rgba(3,201,90,0); } 100% { box-shadow: 0 0 0 0 rgba(3,201,90,0); } }
.dev-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border-c, #e5e7eb); border-radius: 2rem; padding: .25rem .75rem; font-size: .8125rem; color: inherit; background: var(--card-bg, #fff); }
.dev-chip small { color: #888; margin-left: .25rem; }
.dev-chip .dot { width: .5rem; height: .5rem; border-radius: 50%; background: #E70D0D; }
.dev-chip.on .dot { background: #03C95A; box-shadow: 0 0 0 3px rgba(3,201,90,.2); }
.lv-feed { max-height: 640px; overflow-y: auto; }
.lv-punch { display: flex; align-items: center; gap: .65rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border-c, #f0f0f0); }
.lv-punch.new { animation: lvnew 2.5s ease-out; }
@keyframes lvnew { 0% { background: rgba(var(--primary-rgb), .22); } 100% { background: transparent; } }
.min-w-0 { min-width: 0; }

/* ================= FACE / CAMERA ATTENDANCE ================= */
.fe-cam { position: relative; border-radius: 16px; overflow: hidden; background: #0d1320; aspect-ratio: 4/3; max-height: 62vh; margin: 0 auto; }
.fe-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.fe-oval { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); width: 46%; aspect-ratio: 3/4; border-radius: 50%; border: 3px dashed rgba(255,255,255,.6); box-shadow: 0 0 0 9999px rgba(0,0,0,.3); pointer-events: none; transition: border-color .2s; }
.fe-oval.ok { border: 3px solid #03C95A; } .fe-oval.warn { border-color: #FFC107; } .fe-oval.bad { border: 3px solid #E70D0D; }
.fe-status { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(10,15,25,.75); color: #fff; padding: 6px 16px; border-radius: 30px; font-weight: 600; font-size: .9rem; white-space: nowrap; max-width: 94%; overflow: hidden; text-overflow: ellipsis; }
