/* assets/css/attendance-payroll.css
 * 근태 현황(관리) 및 작업자 급여 화면 전용 스타일 (AGY-6)
 * 규격: docs/contracts/attendance-payroll-v1.md
 */

/* ── 공통 조회 전용 및 뱃지 스타일 ── */
.att-readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}

.att-fail-closed {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── 근태 현황: 월 선택 알약 바 ── */
.att-month-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.att-month-pill {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.att-month-pill:hover {
  background: var(--hover-bg, rgba(0, 0, 0, 0.04));
  border-color: #93c5fd;
}

.att-month-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

/* ── 근태 캘린더 컴포넌트 ── */
.att-calendar-wrap {
  margin-bottom: 16px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.att-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.att-cal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.att-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.att-cal-th {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0;
}

.att-cal-th.sun { color: #dc2626; }
.att-cal-th.sat { color: #2563eb; }

.att-cal-cell {
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.att-cal-cell:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.04);
}

.att-cal-cell.blank {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.att-cal-cell.today {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}

.att-cal-cell.selected {
  background: rgba(37, 99, 235, 0.08);
  border-color: #1d4ed8;
}

.att-cal-cell.weekend {
  background: rgba(0, 0, 0, 0.02);
}

.att-cal-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
}

.att-cal-pills {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.att-cal-tag {
  display: inline-block;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-cal-tag.att {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.att-cal-tag.ot {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}

.att-cal-tag.empty {
  color: var(--muted);
  font-size: 9px;
}

/* ── 근태 테이블 ── */
.att-table-view-card {
  margin-bottom: 16px;
}

/* ── 작업자 급여: 최근 확정월 바로보기 및 뷰 탭 ── */
.pr-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pr-recent-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #065f46;
  font-weight: 600;
  cursor: pointer;
}

.pr-recent-btn:hover {
  background: rgba(16, 185, 129, 0.2);
}

.pr-view-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.pr-view-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}

.pr-view-btn.active {
  background: #2563eb;
  color: #ffffff;
}

/* ── 작업자 급여: 컴팩트 총괄 테이블 ── */
.pr-compact-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg, #ffffff);
}

.pr-compact-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.pr-compact-tbl th {
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.pr-compact-tbl th:first-child,
.pr-compact-tbl th:nth-child(2),
.pr-compact-tbl th:nth-child(3),
.pr-compact-tbl th:nth-child(4),
.pr-compact-tbl th:nth-child(5) {
  text-align: left;
}

.pr-compact-tbl td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pr-compact-tbl td:first-child,
.pr-compact-tbl td:nth-child(2),
.pr-compact-tbl td:nth-child(3),
.pr-compact-tbl td:nth-child(4),
.pr-compact-tbl td:nth-child(5) {
  text-align: left;
}

.pr-compact-tbl tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.pr-compact-tbl tfoot tr td {
  background: var(--bg);
  font-weight: 700;
  border-top: 2px solid var(--border);
  border-bottom: none;
}

.pr-compact-tbl .emp-no {
  font-family: monospace;
  color: var(--muted);
  font-size: 11px;
}

.pr-compact-tbl .emp-name {
  font-weight: 600;
  color: var(--text);
}

.pr-compact-tbl .net-pay {
  font-weight: 700;
  color: #2563eb;
}

.pr-status-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.pr-status-confirmed {
  background: #d1fae5;
  color: #065f46;
}

.pr-status-unconfirmed {
  background: #fef3c7;
  color: #92400e;
}

.pr-status-unsaved {
  background: #f1f5f9;
  color: #64748b;
}

.pr-info-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 12px;
}

/* ── 급여 툴바: 귀속월 선택 및 액션 버튼 높이·수직 정렬 ── */
.payroll-toolbar-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#pr-month,
[data-control-id="Section_Payroll2"] input[type="month"] {
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  vertical-align: middle;
}

[data-control-id="Section_Payroll2"] .btn {
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
