.fx-theme-attendance { --fx: #a51c1c; --fx-dark: #7f1414; --fx-soft: #fbe4e4; --fx-accent: #f22929; --fx-ring: rgba(165, 28, 28, .18); }
.fx-theme-payslip { --fx: #33597f; --fx-dark: #264565; --fx-soft: #e3ebf4; --fx-accent: #6b8fb5; --fx-ring: rgba(51, 89, 127, .2); }

.fx-wrap { max-width: 64rem; margin: 0 auto; width: 100%; padding: 16px 12px; }
@media (min-width: 768px) { .fx-wrap { padding: 20px; } }
.fx-back-row { margin-bottom: 12px; }

.fx-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.fx-tabs { display: flex; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.fx-tab-btn {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 12px; border: 1px solid #e2e8f0;
  background: #fff; color: #475569; font-size: 12px; font-weight: 800;
}
.fx-tab-btn.active { background: var(--fx); border-color: var(--fx); color: #fff; }
.fx-tab-btn .fx-dot.hidden { display: none; }
.fx-tab-btn .fx-dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--fx-accent); color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }

.fx-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.fx-card + .fx-card, .fx-stack > * + * { margin-top: 14px; }
.fx-section-title { font-size: 14px; font-weight: 800; color: #1e293b; }
.fx-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.fx-muted { color: #64748b; font-size: 12px; font-weight: 600; }
.fx-empty { text-align: center; color: #94a3b8; font-size: 13px; font-weight: 700; padding: 26px 12px; }
.fx-link-btn { color: var(--fx); font-size: 12px; font-weight: 800; }

.fx-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; background: #e2e8f0; color: #475569; white-space: nowrap; }
.fx-chip.ok { background: #dcfce7; color: #166534; }
.fx-chip.late { background: #fef3c7; color: #92400e; }
.fx-chip.bad { background: #ffe4e6; color: #9f1239; }
.fx-chip.info { background: #dbeafe; color: #1e40af; }
.fx-chip.trip { background: #ede9fe; color: #5b21b6; }
.fx-chip.overtime { background: #cffafe; color: #0e7490; }
.fx-chip.accent { background: var(--fx-soft); color: var(--fx); }

.fx-btn { min-height: 46px; border-radius: 14px; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; transition: background-color .15s ease, transform .1s ease, opacity .15s ease; }
.fx-btn:active { transform: scale(.98); }
.fx-btn.primary { background: var(--fx); color: #fff; }
.fx-btn.primary:hover { background: var(--fx-dark); }
.fx-btn.primary:disabled, .fx-btn:disabled { opacity: .5; cursor: not-allowed; }
.fx-btn.ghost { background: #f1f5f9; color: #334155; }
.fx-btn.ghost:hover { background: #e2e8f0; }
.fx-btn.outline { background: #fff; color: var(--fx); border: 1.5px solid var(--fx); }
.fx-btn.danger { background: #fee2e2; color: #b91c1c; }
.fx-btn.danger:hover { background: #fecaca; }
.fx-btn.small { min-height: 36px; font-size: 12px; border-radius: 11px; padding: 0 12px; }

.fx-btn.primarywo { background: #cbd5e1; color: #1e293b; }
.fx-btn.primarywo:hover { background: #e2e8f0; }
.fx-btn.primarywo:disabled, .fx-btn:disabled { opacity: .5; cursor: not-allowed; }

.fx-field { display: flex; flex-direction: column; gap: 6px; }
.fx-label { display: block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.fx-input, .fx-textarea, .fx-select {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 11px 12px; font-size: 16px; font-weight: 700;
  color: #1e293b; background: #fff; outline: none;
}
.fx-input:focus, .fx-textarea:focus, .fx-select:focus { border-color: var(--fx); box-shadow: 0 0 0 3px var(--fx-ring); }
.fx-textarea { min-height: 78px; resize: vertical; font-weight: 600; }
.fx-date-wrap { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 46px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; padding: 0 12px; display: flex; align-items: center; overflow: hidden; }
.fx-date-wrap .apu-fixed-date-display { min-width: 0; font-size: 15px; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-date-wrap .apu-fixed-date-native { font-size: 16px !important; -webkit-appearance: none; appearance: none; }
.fx-date-wrap:focus-within { border-color: var(--fx) !important; box-shadow: 0 0 0 3px var(--fx-ring) !important; }
.fx-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fx-grid-2 > *, .fx-field { min-width: 0; }
.fx-modal-body { min-width: 0; }
.fx-hint { font-size: 11px; font-weight: 600; color: #94a3b8; line-height: 1.5; }
.fx-error { font-size: 12px; font-weight: 700; color: #be123c; }

.fx-segment { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: #f1f5f9; border-radius: 14px; }
.fx-segment button { min-height: 38px; border-radius: 11px; font-size: 12px; font-weight: 800; color: #64748b; padding: 0 8px; }
.fx-segment button.active { background: var(--fx); color: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .18); }

.fx-spinner { width: 28px; height: 28px; border: 3px solid #e2e8f0; border-top-color: var(--fx); border-radius: 50%; animation: fxSpin .75s linear infinite; flex: 0 0 auto; }
@keyframes fxSpin { to { transform: rotate(360deg); } }
.fx-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 0; color: #64748b; font-size: 12px; font-weight: 700; }

.fx-modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .7); z-index: 55; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.fx-modal-overlay.hidden { display: none; }
.fx-modal-overlay.is-top { z-index: 62; }
.fx-modal-overlay.is-confirm { z-index: 65; }
.fx-modal-overlay.is-photo { z-index: 60; background: rgba(2, 6, 23, .94); }
.fx-modal-card {
  width: 100%; max-width: 34rem; max-height: 92vh; max-height: 92dvh; background: #f1f5f9; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 30px 60px -20px rgba(2, 6, 23, .6);
}
.fx-modal-card.wide { max-width: 44rem; }
.fx-modal-header { background: var(--fx); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; }
.fx-modal-header h3 { font-size: 16px; font-weight: 800; min-width: 0; }
.fx-modal-close { width: 38px; height: 38px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.fx-modal-body { padding: 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 14px; font-size: 13px; }
.fx-modal-body > * { flex-shrink: 0; }
.fx-modal-body > .fx-card + .fx-card { margin-top: 0; }
.fx-modal-footer { padding: 12px 16px; border-top: 1px solid #e2e8f0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; flex: 0 0 auto; background: #fff; }
.fx-modal-overlay.is-confirm .fx-modal-card { max-width: 24rem; }
.fx-confirm-body { padding: 22px 20px 6px; text-align: center; }
.fx-confirm-body h3 { font-size: 17px; font-weight: 800; color: #0f172a; }
.fx-confirm-body p { margin-top: 6px; font-size: 12px; font-weight: 600; color: #64748b; line-height: 1.55; }
.fx-confirm-icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--fx-soft); color: var(--fx); }

.fx-kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.fx-kv:last-child { border-bottom: 0; }
.fx-kv .k { color: #64748b; font-weight: 700; flex: 0 0 auto; }
.fx-kv .v { color: #1e293b; font-weight: 800; text-align: right; min-width: 0; overflow-wrap: anywhere; }

.fx-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .fx-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fx-stat { padding: 11px 12px; border-radius: 14px; background: #f8fafc; border: 1px solid #eef2f6; }
.fx-stat .n { font-size: 20px; font-weight: 800; color: #1e293b; font-variant-numeric: tabular-nums; }
.fx-stat .l { margin-top: 2px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.fx-stat.good .n { color: #166534; }
.fx-stat.warn .n { color: #b45309; }
.fx-stat.bad .n { color: #be123c; }

.fx-row-btn { width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: #f9fafc; border: 1px solid #e2e8f0; transition: border-color .15s ease, transform .1s ease; }
.fx-row-btn:hover { border-color: #cbd5e1; }
.fx-row-btn:active { transform: scale(.992); }
.fx-row-btn + .fx-row-btn { margin-top: 8px; }
.fx-row-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--fx-soft); color: var(--fx); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.fx-row-main { min-width: 0; flex: 1; }
.fx-row-title { font-size: 13px; font-weight: 800; color: #1e293b; }
.fx-row-sub { margin-top: 2px; font-size: 11px; font-weight: 600; color: #64748b; }
.fx-row-arrow { color: #cbd5e1; font-size: 12px; flex: 0 0 auto; }

.fx-photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: 14px; background: #e2e8f0; }
.fx-photo-full { max-width: 100%; max-height: calc(100dvh - 190px); border-radius: 10px; object-fit: contain; touch-action: pinch-zoom; }
.fx-modal-overlay.is-photo .fx-modal-footer { background: #0f172a; border-top-color: #1e293b; }
.fx-modal-overlay.is-photo .fx-btn.ghost { background: #1e293b; color: #e2e8f0; }
.fx-modal-overlay.is-photo .fx-modal-body { align-items: center; justify-content: center; }

@media (max-width: 640px) {
  .fx-modal-overlay { padding: 0; align-items: stretch; }
  .fx-modal-card { max-width: none; max-height: none; height: 100dvh; border-radius: 0; }
  .fx-modal-overlay.is-confirm { padding: 16px; align-items: center; }
  .fx-modal-overlay.is-confirm .fx-modal-card { height: auto; max-height: 92vh; max-height: 92dvh; border-radius: 28px; }
  .fx-toolbar { display: none; }
}

.fx-btn.is-disabled, .fx-row-btn.is-disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
