/* View-specific styles: profile, salary input, dashboard chart, controls. */

/* profile */
.prof-head { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.prof-id { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.prof-id > div:last-child { display: flex; flex-direction: column; gap: 6px; }
.prof-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prof-name h1 { font-size: 24px; }
.sline { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.sline > span { display: flex; align-items: center; gap: 8px; }
.sline small { margin-right: 10px; }
.sline.total { background: var(--tint); border-radius: 8px; padding: 9px 8px; font-weight: 700; border: 0; margin: 4px 0; }
.sline.total b { font-size: 15px; font-weight: 800; }
.split-bar { display: flex; gap: 3px; height: 14px; border-radius: 8px; overflow: hidden; }
.split-bar span { border-radius: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; padding: 0 0 16px 24px; display: flex; flex-direction: column; gap: 2px; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px #D5ECE7; }
.timeline li::after { content: ''; position: absolute; left: 5px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.future::before { background: #fff; border: 2px dashed #B9B3A6; box-shadow: none; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.mbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; }
.mbar { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mbar-track { width: 100%; max-width: 42px; height: 140px; border-radius: 12px; background: var(--tint-2); display: flex; align-items: flex-end; overflow: hidden; }
.mbar-fill { width: 100%; border-radius: 12px; background: var(--blue); }

/* salary input */
.sal-input { display: flex; flex-direction: column; gap: 12px; }
.sal-status { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--tint); border: 1px solid var(--line-soft); }
.sal-lines { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.delta-line { font-weight: 700; font-size: 13.5px; }
.delta-line.up { color: var(--green-dark); }
.delta-line.down { color: var(--red); }

/* dashboard department chart */
.dept-chart, .dept-labels { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 14px; }
.dept-chart { align-items: end; height: 220px; }
.dc-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.dc-bar { width: 100%; max-width: 64px; border-radius: 12px; transition: height .25s; }
.dept-labels { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.dc-label { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 12.5px; font-weight: 600; }

/* controls */
.ctl-body { min-width: 0; }
.rules td, .rules th { padding: 8px 12px; }
.rules input { height: 38px; max-width: 140px; }
.rules .pk { max-width: 180px; }
.fy-nav { display: flex; align-items: center; gap: 6px; }

/* ---------- payroll ---------- */
.steps { list-style: none; margin: 0; padding: 12px; background: #fff; border: 1px solid var(--card-line); border-radius: var(--r-lg);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.step { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; flex: 1 1 150px; min-width: 0; }
.step > div { display: flex; flex-direction: column; min-width: 0; }
.step strong { font-size: 13.5px; }
.step small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; background: var(--tint-2); color: var(--faint); }
.step.done .step-dot { background: var(--green-bg); color: var(--green-dark); }
.step.now { background: var(--teal-bg); }
.step.now .step-dot { background: var(--teal); color: #fff; }
.steps-actions { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.kpi.accent .kpi-value { color: var(--teal); }
.empty-card { align-items: flex-start; padding: 28px; }

.tbl.pay { font-size: 13px; }
.tbl.pay th.c-emp { width: 24%; }
.tbl.pay td:first-child { max-width: 260px; }
.tbl.pay th, .tbl.pay td { padding: 8px 8px; }
.tbl.pay th { white-space: normal; line-height: 1.2; }
.tbl.pay th.net, .tbl.pay td.net { background: #F1EFE9; }
.tbl.pay th.c, .tbl.pay td.c { text-align: center; }
.tbl.pay tr.open > td { background: #FBFAF6; border-bottom-color: transparent; }
.tbl.pay tr.detail > td { background: #FBFAF6; padding: 4px 12px 16px; }
.who-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--ink); width: 100%; min-width: 0; }
.who-btn strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.who-btn small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.who-btn:hover strong { color: var(--teal); }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.flag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--tint-2); color: #4A4F55; }
.flag.warn { background: var(--orange-bg); color: var(--orange-dark); }
.flag.info { background: var(--purple-bg); color: #5B3BB0; }
.days { display: flex; flex-direction: column; align-items: flex-end; }
.days small { white-space: nowrap; }
.cell-in { width: 100%; max-width: 84px; height: 32px; border: 1px solid #DCD6CA; border-radius: 8px; padding: 0 7px; text-align: right; background: #fff; outline: none; font-variant-numeric: tabular-nums; }
.cell-in:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.bal { display: block; font-size: 10.5px; }
.det { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 22px; padding: 12px 14px; background: #fff; border: 1px solid var(--line-soft); border-radius: 14px; }
.det-col { display: flex; flex-direction: column; gap: 4px; }
.det-col.wide { grid-column: 1 / -1; }
.det h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.det .kv { flex-direction: row; justify-content: space-between; gap: 8px; font-size: 13px; }
.det .kv.strong { font-weight: 800; border-top: 1px solid var(--line-soft); padding-top: 4px; }
.det-att { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.mini-fld { display: flex; flex-direction: column; gap: 3px; }
.note-in { height: 30px; border: 1px solid #DCD6CA; border-radius: 8px; padding: 0 8px; font-size: 12.5px; }
@media (max-width: 1180px) { .hide-md { display: none; } }
@media (max-width: 760px) { .tbl.pay th, .tbl.pay td { padding: 7px 5px; } .tbl.pay td:first-child, .tbl.pay th.c-emp { max-width: 130px; width: auto; } .det { grid-template-columns: minmax(0, 1fr); } .tbl.pay tr.detail > td { padding: 4px 6px 12px; } .tbl.pay { font-size: 12.5px; } .cell-in { max-width: 64px; } }

/* month switch */
.month-switch { display: flex; align-items: center; gap: 4px; }
.month-switch .fld { flex: 0 0 auto; }
.month-switch .pk-btn { min-width: 190px; }
.month-switch .pk-pop { right: 0; left: auto; }

/* attendance */
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.pill-row .pk { flex: 0 1 220px; }
.chart-wrap { display: grid; grid-template-columns: minmax(170px, 220px) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 760px) { .chart-wrap { grid-template-columns: 1fr; } }
.chart-kpis { display: flex; flex-direction: column; gap: 10px; }
.ck { border: 1px solid var(--card-line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.ck strong { font-size: 22px; font-weight: 800; }
.lc { position: relative; }
.lc-svg { width: 100%; height: auto; display: block; }
.lc-grid { stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lc-tick { fill: #8A8F95; font-size: 11px; font-family: var(--font); }
.lc-guide { stroke: var(--ink); stroke-dasharray: 3 4; opacity: .35; vector-effect: non-scaling-stroke; }
.lc-tip { position: absolute; top: 4px; min-width: 170px; background: #fff; border: 1px solid #E2DDD2; border-radius: 10px; padding: 8px 10px; box-shadow: 0 6px 18px rgba(40, 34, 20, .10); font-size: 12.5px; pointer-events: none; display: flex; flex-direction: column; gap: 3px; }
.lc-row { display: flex; align-items: center; gap: 6px; }
.lc-row b { margin-left: auto; }
.tbl.att td { padding: 6px 12px; }
.tbl.att tr.missing td { background: #FFF9F4; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(3px, 1fr); gap: 2px; height: 18px; min-width: 120px; }
.sd { border-radius: 2px; background: var(--tint-2); }
.sd-FD, .sd-P { background: var(--teal); }
.sd-HD { background: var(--teal-soft); }
.sd-A { background: #F4C9A8; }
.sd-WO { background: #DCE6FB; }
.warn-note { background: var(--orange-bg); border-color: #F6D3BC; color: #7A3209; }
.mbar-fill.open { background: #C9D7F6; }

.only-sm { display: none; }
@media (max-width: 760px) { .only-sm { display: flex; } }
