/* AxisOne — clean finance UI: navy sidebar, white cards, one teal accent */
:root {
    --fh-navy: #0f1b2d;
    --fh-navy-2: #16253b;
    --fh-accent: #0f766e;
    --fh-accent-soft: #e6f4f2;
    --fh-bg: #f5f7fa;
    --fh-line: #e4e8ee;
    --fh-text: #14202e;
    --fh-muted: #677489;
    --bs-primary: #0f766e;
    --bs-primary-rgb: 15, 118, 110;
    --bs-link-color: #0f766e;
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color-rgb: 11, 92, 86;
    --bs-link-hover-color: #0b5c56;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html { font-size: 14px; }
body { background: var(--fh-bg); color: var(--fh-text); font-family: var(--bs-body-font-family); }
a { text-decoration: none; }

.btn-primary { --bs-btn-bg: #0f766e; --bs-btn-border-color: #0f766e; --bs-btn-hover-bg: #0b5c56; --bs-btn-hover-border-color: #0b5c56; --bs-btn-active-bg: #0a514c; --bs-btn-disabled-bg: #0f766e; --bs-btn-disabled-border-color: #0f766e; }
.btn-outline-primary { --bs-btn-color: #0f766e; --bs-btn-border-color: #0f766e; --bs-btn-hover-bg: #0f766e; --bs-btn-hover-border-color: #0f766e; --bs-btn-active-bg: #0b5c56; }
.form-control:focus, .form-select:focus { border-color: #5eb3aa; box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .15); }
.form-check-input:checked { background-color: #0f766e; border-color: #0f766e; }
.form-label { font-weight: 500; font-size: 13px; color: #33415a; margin-bottom: 4px; }
.text-muted { color: var(--fh-muted) !important; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 252px; background: var(--fh-navy) !important; color: #c9d3e1; display: flex; flex-direction: column; flex-shrink: 0; }
@media (min-width: 992px) {
    .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.sidebar.offcanvas-lg { --bs-offcanvas-bg: var(--fh-navy); --bs-offcanvas-width: 260px; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-link { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #14b8a6, #0f766e); display: grid; place-items: center; font-size: 16px; }
.brand-name { display: block; font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.brand-sub { display: block; font-size: 11.5px; color: #8b9ab0; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { padding: 10px 10px 18px; flex: 1; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #6f7f97; margin: 16px 10px 6px; font-weight: 600; }
.nav-link-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #c9d3e1; font-size: 13.5px; font-weight: 500; transition: background .15s, color .15s; }
.nav-link-item i { font-size: 15px; width: 18px; text-align: center; color: #8b9ab0; }
.nav-link-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link-item.active { background: rgba(20,184,166,.14); color: #fff; box-shadow: inset 3px 0 0 #14b8a6; }
.nav-link-item.active i { color: #5eead4; }
.sidebar-foot { padding: 12px 18px; font-size: 11.5px; color: #6f7f97; border-top: 1px solid rgba(255,255,255,.06); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--fh-line); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: 12.5px; color: var(--fh-muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn-icon { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--fh-line); background: #fff; display: grid; place-items: center; font-size: 17px; color: #33415a; }
.btn-icon:hover { background: #f1f4f8; }
.bell-count { position: absolute; top: -5px; right: -5px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; min-width: 18px; text-align: center; }
.notif-menu { width: 340px; max-height: 460px; overflow-y: auto; }
.notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid #f0f2f5; color: var(--fh-text); }
.notif-item:hover { background: #f7f9fb; }
.notif-item.unread { background: var(--fh-accent-soft); }
.user-chip { display: flex; align-items: center; gap: 9px; border: 1px solid var(--fh-line); background: #fff; border-radius: 12px; padding: 4px 10px 4px 4px; }
.avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--fh-navy); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.user-name { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.2; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 11px; color: var(--fh-muted); max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 24px 28px 48px; }
@media (max-width: 767.98px) {
    .content { padding: 16px; }
    .topbar { padding: 10px 16px; }
}

/* ---------- Cards and panels ---------- */
.card { border: 1px solid var(--fh-line); border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--fh-line); padding: 14px 18px; border-radius: 14px 14px 0 0 !important; }
.card-header h2, .card-title-sm { font-size: 15px; font-weight: 600; margin: 0; }
.card-body { padding: 18px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-actions .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.kpi { background: #fff; border: 1px solid var(--fh-line); border-radius: 14px; padding: 16px 18px; height: 100%; display: block; color: var(--fh-text); transition: border-color .15s; }
a.kpi:hover { border-color: #9ccfc9; color: var(--fh-text); }
.kpi-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--fh-accent-soft); color: var(--fh-accent); font-size: 17px; margin-bottom: 10px; }
.kpi-label { font-size: 12.5px; color: var(--fh-muted); }
.kpi-value { font-size: 21px; font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 11.5px; color: var(--fh-muted); }

.task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--fh-line); border-radius: 12px; background: #fff; color: var(--fh-text); transition: border-color .15s, transform .15s; }
.task:hover { border-color: #9ccfc9; color: var(--fh-text); }
.task-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #eef2f7; color: #33415a; font-size: 17px; flex-shrink: 0; }
.task.urgent .task-icon { background: #fde8e8; color: #b42318; }
.task-count { margin-left: auto; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.task.urgent .task-count { color: #b42318; }
.task-section { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--fh-muted); }

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: #f7fafb; margin-bottom: 0; }
.table > thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--fh-muted); font-weight: 600; background: #f9fafb; border-bottom: 1px solid var(--fh-line); white-space: nowrap; }
.table td, .table th { padding: 10px 12px; vertical-align: middle; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td, .table tfoot th { font-weight: 600; background: #f9fafb; }
.table-responsive { border-radius: 0 0 14px 14px; }
tr[data-href] { cursor: pointer; }
.empty { text-align: center; padding: 42px 16px; color: var(--fh-muted); }
.empty i { font-size: 30px; display: block; margin-bottom: 8px; color: #a3aebd; }

/* ---------- Status badges ---------- */
.st { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-green { background: #e7f6ec; color: #17733a; }
.st-amber { background: #fff4e0; color: #9a5b00; }
.st-red { background: #fdecec; color: #b42318; }
.st-blue { background: #e8f0fe; color: #1d4ed8; }
.st-grey { background: #eef1f5; color: #4a5568; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 30px; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--fh-line); }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #eef1f5; color: #8b9ab0; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--fh-line); }
.tl-done .tl-dot { background: #17733a; color: #fff; box-shadow: none; }
.tl-current .tl-dot { background: #f59e0b; color: #fff; box-shadow: 0 0 0 4px #fff4e0; }
.tl-rejected .tl-dot { background: #b42318; color: #fff; box-shadow: none; }
.tl-label { font-weight: 600; font-size: 13px; }
.tl-meta { font-size: 12px; color: var(--fh-muted); }
.tl-note { font-size: 12px; background: #f7f9fb; border-radius: 8px; padding: 6px 9px; margin-top: 4px; }

/* ---------- Detail lists ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 22px; margin: 0; }
.dl-grid dt { font-size: 11.5px; font-weight: 500; color: var(--fh-muted); text-transform: uppercase; letter-spacing: .4px; }
.dl-grid dd { margin: 2px 0 0; font-weight: 500; }

.entry-box { border: 1px dashed #9ccfc9; background: #f6fbfa; border-radius: 12px; }
.entry-box .entry-title { font-size: 12px; font-weight: 600; color: var(--fh-accent); text-transform: uppercase; letter-spacing: .5px; }
.rule-box { border-left: 3px solid var(--fh-accent); background: #f6fbfa; padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 13px; color: #24413d; }
.action-panel { border: 1px solid #f3d9a4; background: #fffaf0; border-radius: 14px; }
.action-panel .card-header { background: #fff4e0; border-bottom-color: #f3d9a4; }
.match-ok { color: #17733a; }
.match-bad { color: #b42318; font-weight: 600; }
.check-row { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--fh-line); }
.check-row:last-child { border-bottom: 0; }
.check-icon { font-size: 20px; }
.step-card { border: 1px solid var(--fh-line); border-radius: 12px; padding: 14px; background: #fff; height: 100%; }
.step-card.done { border-color: #b7e0c4; background: #f5fbf7; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: #eef1f5; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; margin-right: 8px; }
.step-card.done .step-num { background: #17733a; color: #fff; }

/* ---------- Line editor ---------- */
.line-table td { padding: 6px 6px; }
.line-table input, .line-table select { min-width: 70px; }
.line-table .w-desc { min-width: 220px; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at 10% 10%, #134e4a 0%, var(--fh-navy) 55%); color: #d7e1ee; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { color: #fff; font-weight: 700; font-size: 30px; letter-spacing: -.6px; line-height: 1.2; }
.auth-flow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.auth-flow span { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; }
.auth-form { display: grid; place-items: center; padding: 32px; background: #fff; }
.auth-card { width: 100%; max-width: 380px; }
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .no-print, .alert { display: none !important; }
    .content { padding: 0; }
    .card { border: 0; box-shadow: none; }
    body { background: #fff; }
}

/* ---------- HR: attendance sheet and calendar ---------- */
.att-table { font-size: 12px; }
.att-table th, .att-table td { padding: 5px 3px !important; text-align: center; white-space: nowrap; }
.att-table th.att-name, .att-table td.att-name { text-align: left; padding-left: 12px !important; position: sticky; left: 0; background: #fff; z-index: 1; }
.att-table th.att-off { color: var(--fh-muted); background: #f7f8fa; }
.att { display: inline-block; min-width: 24px; padding: 2px 3px; border-radius: 5px; font-weight: 600; font-size: 11px; text-align: center; }
.att-P { background: #e7f6ec; color: #17733a; }
.att-L { background: #fff4e0; color: #9a5b00; }
.att-LV, .att-UL { background: #e8f0fe; color: #1d4ed8; }
.att-A { background: #fdecec; color: #b42318; }
.att-O, .att-H { background: #eef1f5; color: #8a94a6; }
.att-fix { box-shadow: inset 0 0 0 1.5px #9a5b00; }
.att-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--fh-muted); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 11px; font-weight: 600; color: var(--fh-muted); text-align: center; text-transform: uppercase; }
.cal-day { border: 1px solid var(--fh-line); border-radius: 8px; padding: 6px; min-height: 64px; font-size: 12px; background: #fff; }
.cal-day.cal-blank { border: 0; background: transparent; }
.cal-day.cal-today { border-color: var(--fh-accent); }
.cal-n { font-weight: 600; margin-bottom: 4px; }
.cal-time { color: var(--fh-muted); font-size: 11px; margin-top: 3px; }
.score-bar { height: 6px; border-radius: 3px; background: #eef1f5; overflow: hidden; }
.score-bar > span { display: block; height: 100%; background: var(--fh-accent); }

/* ---------- Help assistant ---------- */
.assistant { position: fixed; right: 20px; bottom: 20px; z-index: 1060; }
.assistant-fab { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--fh-accent); color: #fff;
    font-weight: 600; box-shadow: 0 8px 24px rgba(15, 118, 110, .35); }
.assistant-fab i { font-size: 18px; }
.assistant-fab:hover { background: #0b5c56; }
.assistant.open .assistant-fab { display: none; }
.assistant-panel { width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 40px); background: #fff; border-radius: 16px;
    box-shadow: 0 16px 48px rgba(15, 27, 45, .25); display: flex; flex-direction: column; overflow: hidden; }
.assistant-panel[hidden] { display: none; }
.assistant-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--fh-navy); color: #fff; }
.assistant-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--fh-accent); }
.assistant-title { font-weight: 600; line-height: 1.2; }
.assistant-sub { font-size: 11.5px; opacity: .75; }
.assistant-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--fh-bg); display: flex; flex-direction: column; gap: 10px; }
.assistant-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.assistant-msg.from-bot { align-self: flex-start; background: #fff; border: 1px solid var(--fh-line); border-bottom-left-radius: 4px; }
.assistant-msg.from-user { align-self: flex-end; background: var(--fh-accent); color: #fff; border-bottom-right-radius: 4px; }
.assistant-msg.typing { color: var(--fh-muted); letter-spacing: 2px; }
.assistant-text { white-space: pre-wrap; word-wrap: break-word; }
.assistant-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.assistant-note { margin-top: 6px; font-size: 11px; color: var(--fh-muted); }
.assistant-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: #fff; }
.assistant-chip { border: 1px solid var(--fh-accent); color: var(--fh-accent); background: var(--fh-accent-soft); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.assistant-chip:hover { background: var(--fh-accent); color: #fff; }
.assistant-input { display: flex; gap: 8px; padding: 10px 12px 12px; background: #fff; border-top: 1px solid var(--fh-line); }
.assistant-input textarea { flex: 1; resize: none; border: 1px solid var(--fh-line); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; max-height: 120px; }
.assistant-input textarea:focus { outline: none; border-color: var(--fh-accent); }
@media (max-width: 576px) { .assistant { right: 12px; bottom: 12px; } .assistant-fab-text { display: none; } }
@media print { .assistant { display: none; } }
