/* FuFu Offer's flat, high-contrast counter language adapted to Kongsi HR. */
@font-face {
  font-family: Anuphan;
  src: url('/fonts/Anuphan-variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --ink: #31200f;
  --muted: #6b4a26;
  --green: #4f7a35;
  --green-soft: #e8f0dc;
  --paper: #fff9ef;
  --line: #f1e2c4;
  --amber: #8d590f;
  --amber-soft: #ffe9c2;
  --red: #ad3023;
  --red-soft: #fbe3dd;
  --white: #fff;
  --radius: 16px;
  font-family: Anuphan, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--paper);
}

body { background: var(--paper); }
h1 { font-size: 30px; line-height: 1.25; letter-spacing: 0; }
h2 { font-size: 20px; line-height: 1.3; }
h3 { font-size: 17px; }
small { font-size: 13px; }
a, .text-btn, summary { color: var(--ink); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, :focus-visible {
  outline: 4px solid #c93e2c;
  outline-offset: 3px;
}

/* The navigation belongs to the HR app; only its visual hierarchy changes. */
.sidebar {
  background: #31200f;
  color: #fff9ef;
  border-right: 0;
}
.brand-name, .mobile-brand { color: #31200f; }
.sidebar .brand-name { color: #fff9ef; }
.sidebar .brand-sub, .side-footer p { color: #e9d8ba; }
.brand-line { height: 4px; background: #e8a13c; }
.nav button { color: #f5e8d3; border: 2px solid transparent; border-radius: 14px; font-size: 15px; }
.nav button:hover { background: #4a3018; color: #fff9ef; }
.nav button.active { background: #e8a13c; color: #31200f; border-color: #e8a13c; }
.nav .count { background: #c93e2c; color: #fff; font-weight: 700; }
.side-footer { border-color: #6b4a26; }
.side-footer b { font-size: 14px; }
.status-dot { background: #9ac273; }

.demo-banner {
  background: #ffe9c2;
  color: #4a3018;
  font-size: 13px;
  font-weight: 700;
}
.topbar { background: #fff9ef; border-bottom: 2px solid var(--line); }
.breadcrumb { font-size: 14px; }
.role-switch { background: #faf0dc; border: 2px solid var(--line); border-radius: 14px; padding: 2px; }
.role-switch button { color: #4a3018; font-size: 13px; border-radius: 10px; min-height: 36px; }
.role-switch button.active { color: #31200f; background: #fff; box-shadow: none; }
.profile { background: #4a3018; color: #fff9ef; }
.content { padding-top: 34px; }
.page-head { margin-bottom: 27px; }
.page-head p { font-size: 16px; }

/* Gold is the next action; green and berry are reserved for status/risk. */
.btn {
  min-height: 56px;
  padding: 14px 20px;
  border: 2px solid #31200f;
  border-radius: 14px;
  background: #e8a13c;
  color: #31200f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}
.btn:hover { filter: none; background: #f5c97b; }
.btn.secondary { min-height: 52px; border: 2px solid #31200f; background: #fff; color: #31200f; }
.btn.secondary:hover { background: #faf0dc; }
.btn.soft { min-height: 52px; background: #faf0dc; border-color: #f1e2c4; color: #31200f; }
.btn.soft:hover { background: #ffe9c2; }
.btn.danger { min-height: 52px; background: #fff; border-color: #c93e2c; color: #ad3023; }
.btn.danger:hover { background: #fbe3dd; }
.btn.small { min-height: 44px; padding: 9px 13px; font-size: 14px; border-radius: 10px; }
.text-btn { font-size: 15px; text-decoration: underline; }
.icon-btn { width: 44px; height: 44px; border: 2px solid #31200f; border-radius: 10px; }

.metrics, .panel, .login-card {
  border: 2px solid var(--line);
  background: #fff;
  box-shadow: none;
}
.metric, .panel-head, .person-card, .pay-summary { border-color: var(--line); }
.metric-label { color: #4a3018; font-size: 14px; font-weight: 700; }
.metric-value { color: #31200f; font-size: 36px; line-height: 1.35; letter-spacing: 0; }
.metric-value span { font-size: 15px; color: #4a3018; }
.metric-note, .panel-head p, .roster-detail, .request p,
.foot-note, .pay-metrics, .person-card p { font-size: 14px; }
.panel-head { padding-top: 22px; padding-bottom: 18px; }
.panel-head h2 { font-size: 20px; }
.notice, .blocker-list { background: #ffe9c2; color: #4a3018; font-size: 14px; border: 2px solid #f5c97b; }
.notice.neutral { background: #faf0dc; color: #4a3018; border-color: #f1e2c4; }
.roster-row { border-color: var(--line); }
.roster-name, .roster-end .time { font-size: 16px; }
.avatar { background: #faf0dc; color: #4a3018; }
.avatar.khaofang { background: #ffe9c2; color: #4a3018; }
.avatar.carrie { background: #e8f0dc; color: #315420; }
.avatar.empty { background: #faf0dc; }
.badge { background: #faf0dc; color: #4a3018; font-size: 13px; font-weight: 700; }
.badge.good { color: #315420; }
.badge.warn { background: #ffe9c2; color: #70460a; }
.badge.danger { color: #ad3023; }
.badge.neutral { background: #faf0dc; color: #4a3018; }
.empty-state, .request p, .mini-timeline .time, .mini-timeline .event,
.mini-timeline .event strong { font-size: 14px; }

input, select, textarea {
  min-height: 48px;
  border: 2px solid #a07a4e;
  border-radius: 10px;
  background: #fff;
  color: #31200f;
  font-size: 16px;
}
input:disabled, select:disabled, textarea:disabled { background: #faf0dc; }
label { font-size: 16px; font-weight: 700; }
.field small { font-size: 13px; }
table { font-size: 14px; }
th { background: #faf0dc; color: #4a3018; font-size: 14px; font-weight: 700; }
th, td { border-color: var(--line); }
.schedule-table th:first-child, .schedule-table td:first-child { background: #faf0dc; }
.schedule-table th.today { background: #ffe9c2; color: #31200f; }
.schedule-table td.today { background: #fff9ef; }
.slot-pick { min-height: 48px; border: 2px solid #f1e2c4; background: #faf0dc; color: #31200f; font-size: 14px; }
.slot-pick:hover { border-color: #31200f; }
.slot-pick.blank { border: 2px dashed #a07a4e; }
.slot-pick.conflict { border-color: #c93e2c; }
.off-list, .off-add, .coverage-line { font-size: 13px; }
.off-add { display: block; min-height: 44px; padding: 8px; text-decoration: underline; }
.period-toggle button { min-height: 44px; border: 2px solid var(--line); color: #4a3018; font-size: 14px; }
.period-toggle button.active { background: #ffe9c2; border-color: #31200f; color: #31200f; font-weight: 700; }
.day-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.day-chip { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px solid var(--line); border-radius: 12px; background: #faf0dc; color: #31200f; font-size: 15px; }
.day-chip small { font-size: 12px; color: #6b4a2a; }
.day-chip.from { border-style: dashed; border-color: #a07a4e; background: #fff9ef; }
.day-chip.on { background: #ffe9c2; border-color: #31200f; font-weight: 700; }
.day-chip:disabled { opacity: .4; }
#move-rest-preview { margin: 0 0 14px; color: var(--ink); font-size: 15px; font-weight: 700; }
#move-rest-preview:empty { display: none; }
.day-chip.busy { border-color: #d39a1c; }
.day-chip .who-off { color: #8a5a00; font-size: 11px; }
.swap-warn { color: #8a5a00; font-weight: 700; }
.swap-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 480px; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.check-row, .detail-row { font-size: 15px; }
.check-row input, .row-check { accent-color: #4f7a35; }
.form-error { border: 2px solid #c93e2c; font-size: 14px; }
.history-detail, .audit-item strong, .audit-item small { font-size: 13px; }

/* Attendance's time and photo actions remain the strongest employee landmark. */
.clock-card { background: #31200f; color: #fff9ef; border-radius: 16px; }
.clock-card:after { display: none; }
.clock-card small, .clock-date { color: #f1e2c4; }
.clock-card .employee-greeting { font-size: 24px; font-weight: 700; }
.clock-card .clock { font-size: clamp(48px, 5vw, 66px); font-weight: 700; line-height: 1.2; }
.clock-shift { border-color: #a07a4e; }
.clock-actions .btn { background: #e8a13c; color: #31200f; border-color: #e8a13c; min-height: 56px; }
.clock-actions .btn:hover { background: #f5c97b; }
.clock-actions .btn.secondary { background: #fff; color: #31200f; border-color: #fff; min-height: 52px; }
.clock-actions .btn.secondary:hover { background: #faf0dc; }
.camera-shell video, .attendance-photo { background: #31200f; }
.photo-missing { font-size: 12px; }
.pay-summary .net-amount, .pay-confirm-amount { color: #31200f; }
.pay-metrics { line-height: 1.6; }
.bar-track { background: #f1e2c4; }
.bar-track span { background: #4f7a35; }

dialog { border: 2px solid #31200f; box-shadow: none; }
dialog::backdrop { background: #31200f99; backdrop-filter: none; }
.dialog-head { background: #fff9ef; border-color: var(--line); }
#toast { background: #31200f; color: #fff9ef; border: 2px solid #e8a13c; box-shadow: none; font-size: 14px; }

@media (max-width: 1100px) {
  .content { padding-top: 26px; }
  .nav button { font-size: 14px; }
}

@media (max-width: 760px) {
  .sidebar { border-top: 0; background: #31200f; }
  .nav button { min-height: 58px; padding: 5px 2px; font-size: 11px; line-height: 1.2; gap: 4px; }
  .nav button:hover { background: #4a3018; }
  .nav button.active { background: #e8a13c; color: #31200f; }
  .demo-banner { font-size: 11px; }
  .topbar { background: #fff9ef; }
  .mobile-brand { font-size: 17px; }
  .page-head h1 { font-size: 24px; }
  .page-head p { font-size: 14px; }
  .page-head > .btn { min-height: 44px; padding: 9px 12px; font-size: 14px; }
  .metric-label { font-size: 13px; }
  .metric-note { font-size: 12px; }
  .metric-value { font-size: 30px; }
  .panel-head h2 { font-size: 18px; }
  .roster-detail, .request p { font-size: 13px; }
  .roster-end .badge { font-size: 12px; }
  .notice { font-size: 13px; }
  .clock-card .clock { font-size: clamp(45px, 12vw, 58px); }
  .clock-actions .btn { min-height: 56px; font-size: 15px; }
  .top-actions .btn { min-height: 40px; font-size: 12px; padding: 7px 9px; }
  .pay-summary .net-amount { font-size: 24px; }
  .person-card .btn, .payroll-card .actions .btn { min-height: 44px; }
}
/* สีกรอบชื่อตามผลลงเวลา (16 ต.ค. 2026) */
.slot-pick.att-came { border-color: #3f7a2a; background: #e6f2dd; }
.slot-pick.att-late { border-color: #d39a1c; background: #ffefc7; }
.slot-pick.att-absent { border-color: #c93e2c; background: #fbe1dc; }
.slot-pick:has(+ .att-leave) { border-style: dashed; opacity: .75; }
.att-tag.att-leave { color: #637168; }
.att-tag { display: block; margin-top: 4px; font-weight: 600; }
.att-tag.att-came { color: #315420; }
.att-tag.att-late { color: #70460a; }
.att-tag.att-absent { color: #ad3023; }
.legend-dot.att-came { background: #3f7a2a; }
.legend-dot.att-late { background: #d39a1c; }
.legend-dot.att-absent { background: #c93e2c; }

.slot-pick.mine { box-shadow: inset 0 0 0 2px #31200f; font-weight: 700; }

/* สถานะกะใหม่ + ต้องดูตอนนี้ (2 พ.ย. 2026) */
.slot-pick.att-missing { border-color: #d9722a; background: #ffe2cc; }
.slot-pick.att-leave-pending { border-color: #3b64b0; border-style: dashed; background: #e6edfa; }
.slot-pick.att-leave { border-color: #8a7a68; border-style: dashed; background: #f4efe7; }
.att-tag.att-missing { color: #8a3f0a; }
.att-tag.att-leave-pending { color: #274a8a; }
.att-tag.att-leave { color: #5c5145; }
.legend-dot.att-missing { background: #d9722a; }
.legend-dot.att-leave-pending { background: #3b64b0; }
.legend-dot.att-leave { background: #8a7a68; }
.attention-panel { border-color: #d9722a; margin-bottom: 16px; }
.attention-title { font-size: 13px; font-weight: 700; color: #8a3f0a; }
.attention-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 2px solid var(--line); }
.attention-row:last-child { border-bottom: 0; padding-bottom: 0; }
.attention-row > div:first-child { flex: 1 1 260px; min-width: 0; }
.attention-row strong { font-size: 17px; }
.attention-row p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.attention-row .actions { flex-wrap: wrap; }
.urgent-entry { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; text-align: center; }
.urgent-sent { margin-top: 12px; padding: 14px; border: 2px dashed #3b64b0; border-radius: 14px; background: #e6edfa; color: #31200f; text-align: left; }
.urgent-sent strong { color: #274a8a; font-size: 17px; }
.urgent-sent p { margin: 4px 0 10px; font-size: 14px; }

/* ปิดเงินเดือน 4 ขั้น (2 พ.ย. 2026) */
.pay-tabs { display: inline-flex; gap: 6px; padding: 4px; margin-bottom: 16px; background: #faf0dc; border: 2px solid var(--line); border-radius: 14px; }
.pay-tabs button { min-height: 44px; padding: 6px 16px; border: 0; border-radius: 10px; background: transparent; color: #31200f; font: inherit; font-weight: 700; cursor: pointer; }
.pay-tabs button.active { background: #fff; }
.pay-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pay-steps button { box-sizing: border-box; width: 100%; min-height: 64px; padding: 8px 12px; text-align: left; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: #31200f; font: inherit; cursor: pointer; }
.pay-steps button:disabled { cursor: not-allowed; color: #6b4a26; }
.pay-steps button.current { background: #e8a13c; border-color: #31200f; }
.pay-steps button.done { background: #e6f2dd; border-color: #3f7a2a; }
.pay-steps small { display: block; font-size: 12px; font-weight: 700; }
.pay-steps span { display: block; font-size: 15px; font-weight: 700; }
.stuck-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; margin-bottom: 8px; border: 2px solid var(--line); border-radius: 12px; }
.stuck-row.soft { background: #fdf6e8; }
.stuck-row.done { background: #e6f2dd; border-color: #3f7a2a; }
.stuck-row > div:first-child { flex: 1 1 240px; min-width: 0; }
.stuck-row p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.stuck-row .actions { flex-wrap: wrap; }
.pay-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.pay-line small { display: block; color: var(--muted); }
.pay-line-end { display: flex; align-items: center; gap: 8px; flex: none; }
.pay-line .minus { color: #ad3023; }
.pay-line.total { margin-top: 6px; padding-top: 10px; border-top: 2px solid var(--line); font-size: 16px; font-weight: 700; }
.pay-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.pay-more { margin-top: 12px; }
.pay-more summary { min-height: 32px; font-size: 14px; font-weight: 700; cursor: pointer; }
.pay-consequence { margin: 4px 0 0; padding-left: 20px; font-size: 14px; }
.pay-preview { margin-bottom: 12px; padding: 8px 10px; border-radius: 10px; background: #faf0dc; font-size: 14px; font-weight: 700; }
.form-warning { margin: 0 0 8px; color: #ad3023; font-weight: 700; }
.notice-good { margin-top: 10px; padding: 12px 14px; border: 2px solid #3f7a2a; border-radius: 12px; background: #e6f2dd; color: #315420; font-weight: 700; }

/* สิทธิ์ลาปีนี้ (2 พ.ย. 2026) */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.balance-name { margin: 8px 0 6px; }
.balance-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; }
.balance-item.over { border-color: #c93e2c; background: #fbe1dc; }
.balance-main { font-size: 18px; font-weight: 700; }
.balance-item small { color: var(--muted); }

/* ลากสลับกะ (2 พ.ย. 2026) */
.slot-pick[draggable="true"] { cursor: grab; }
.slot-pick.dragging { opacity: .45; }
.slot-pick.drop-target { outline: 3px solid #31200f; outline-offset: 2px; background: #ffe9c2; }
