/* Payroll module — tabs, KPI cards, register toolbar, leave search/dropdown/
   calc panel, letter type cards, pills. Reuses the shared gcc-* primitives
   (panel, table, btn, input, modal) from app.css; only module-specific
   pieces live here. */

.pr-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.pr-tab {
  border: none; background: none; padding: 9px 16px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; display: inline-flex; align-items: center; gap: 7px;
}
.pr-tab:hover { color: var(--text); }
.pr-tab.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }

/* KPI cards */
.pr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.pr-stat-card {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow); transition: all .2s ease;
}
.pr-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pr-stat-icon {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 1.25rem; color: #fff; flex-shrink: 0;
}
.pr-stat-icon.primary { background: #2563eb; }
.pr-stat-icon.success { background: #059669; }
.pr-stat-icon.danger { background: #dc2626; }
.pr-stat-icon.warning { background: #d97706; }
.pr-stat-icon.brand { background: var(--brand-600); }
.pr-stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.pr-stat-value { font-size: 19px; font-weight: 800; color: var(--text); }
.pr-stat-sub { font-size: 10.5px; color: var(--text-muted); }

/* Register toolbar + pager */
.pr-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pr-toolbar .gcc-input { height: 30px; font-size: 12px; padding: 2px 8px; }
.pr-period { min-width: 130px; }
.pr-loading { color: var(--brand-600); animation: pr-spin 1s linear infinite; }
@keyframes pr-spin { to { transform: rotate(360deg); } }
.pr-center { text-align: center; color: var(--text-muted); padding: 22px 10px !important; }
.pr-code { font-family: var(--mono, monospace); font-weight: 600; }
.pr-emp-name { font-weight: 600; }
.pr-emp-sub { font-size: 10.5px; color: var(--text-muted); }
.pr-ot { color: #d97706; font-weight: 600; }
.pr-gross { color: #2563eb; font-weight: 600; }
.pr-ded { color: #dc2626; }
.pr-net { color: #059669; font-weight: 700; }
.pr-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
}
.pr-badge.paid, .pr-badge.st-generated { background: #dcfce7; color: #166534; }
.pr-badge.approved, .pr-badge.st-sent { background: #dbeafe; color: #1e40af; }
.pr-badge.posted { background: #e0e7ff; color: #3730a3; }
.pr-badge.pending, .pr-badge.st-draft { background: #fef3c7; color: #92400e; }
.pr-badge.unpaid { background: #fee2e2; color: #991b1b; }
.pr-badge.st-archived { background: #e5e7eb; color: #374151; }
.pr-pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); }
.pr-pager-info { font-size: 11.5px; color: var(--text-muted); }
.pr-pager-page { font-size: 11.5px; font-weight: 600; margin: 0 8px; }

/* Employee search dropdown */
.pr-empsearch-wrap { position: relative; }
.pr-dropdown {
  display: none; position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 8px);
  box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto;
}
.pr-dropdown.active { display: block; }
.pr-dropdown-item { display: flex; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; }
.pr-dropdown-item:hover { background: var(--gray-50, #f8fafc); }
.pr-dropdown-code { font-family: var(--mono, monospace); font-weight: 700; min-width: 62px; color: var(--brand-600); }
.pr-dropdown-name { font-weight: 600; font-size: 12.5px; }
.pr-dropdown-meta { font-size: 11px; color: var(--text-muted); }
.pr-dropdown-empty { padding: 12px; text-align: center; color: var(--text-muted); font-size: 12px; }

/* Leave: employee card + calc panel */
.pr-emp-card {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius, 8px);
  padding: 12px 16px; font-size: 12.5px;
}
.pr-emp-card-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); font-weight: 700; }
.pr-calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pr-calc-cell {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius, 8px);
  padding: 10px 12px; text-align: center;
}
.pr-calc-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.pr-calc-value { font-size: 22px; font-weight: 800; color: var(--text); }
.pr-calc-success { color: #059669; font-size: 30px; }

/* Leave modal */
.pr-modal-types { display: flex; gap: 10px; }
.pr-type-btn {
  flex: 1; padding: 10px; border: 2px solid transparent; border-radius: var(--radius, 8px);
  background: var(--surface-2); font-weight: 700; font-size: 12.5px; cursor: pointer; opacity: .6;
}
.pr-type-btn.active { opacity: 1; }
#lvTypePaid.active { border-color: #155724; color: #155724; }
#lvTypeUnpaid.active { border-color: #721c24; color: #721c24; }
.pr-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.pr-field .gcc-input { font-weight: 500; color: var(--text); }
.pr-hint { font-size: 10.5px; color: var(--text-muted); font-weight: 400; }

/* Letters */
.pr-letter-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pr-letter-card {
  text-align: left; background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; cursor: pointer; transition: all .15s ease;
}
.pr-letter-card:hover { border-color: var(--brand-600); }
.pr-letter-card.active { border-color: var(--brand-600); background: color-mix(in srgb, var(--brand-600) 6%, var(--surface)); }
.pr-letter-card-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.pr-letter-card-title .bi { color: var(--brand-600); margin-right: 4px; }
.pr-letter-card-sub { font-size: 11.5px; color: var(--text-muted); }
.pr-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pr-form-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Medical pills */
.pr-pills { display: inline-flex; gap: 4px; background: var(--gray-100, #eef2f7); border-radius: 999px; padding: 3px; }
.pr-pill {
  border: none; background: none; padding: 5px 14px; border-radius: 999px; font-size: 11.5px;
  font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.pr-pill.active { background: var(--brand-600); color: #fff; }

.gcc-btn.sm { padding: 3px 8px; font-size: 11.5px; }
