/* Employees: list, add and import, and the employee profile. */

/* ---------- list ---------- */
.emp-name { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.emp-name .avatar { width: 28px; height: 28px; font-size: 11px; flex: none; }
.emp-name .nm { font-weight: var(--fw-medium); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-name .ui-badge { flex: none; }
.emp-code { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.emp-muted { color: var(--text-muted); }
.emp-warn { color: var(--warning); }
.emp-err-t { color: var(--danger); }

/* ---------- dialogs ---------- */
.emp-form .row2 + .row2, .emp-form .row3 + .row3, .emp-form .row2 + .row3, .emp-form .row3 + .row2,
.emp-form .field + .row2, .emp-form .row2 + .field, .emp-form .field + .row3, .emp-form .row3 + .field, .emp-form .field + .field { margin-top: 14px; }
.emp-form .ui-field-pin label { display: flex; align-items: center; gap: 4px; }
.emp-gen { margin-left: auto; font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--primary); background: none; border: 0; padding: 0; cursor: pointer; }
.emp-gen:hover { text-decoration: underline; }
.emp-photo { display: flex; align-items: center; gap: 12px; }
.emp-photo .avatar { width: 48px; height: 48px; font-size: 16px; flex: none; }
.emp-photo img.avatar { object-fit: cover; }
.emp-photo .field { flex: 1; }
.emp-preview { margin-top: 14px; font-size: var(--fs-sm); color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 12px; }
.emp-preview[hidden] { display: none; }
.emp-note { margin-top: 12px; font-size: var(--fs-sm); color: var(--text-muted); }
.emp-pin { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.emp-pin .pin-v { font-family: var(--mono); font-size: 32px; font-weight: var(--fw-semibold); letter-spacing: 6px; color: var(--text); font-variant-numeric: tabular-nums; }
.emp-pin .pin-w { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---------- profile ---------- */
.emp-banner { margin-bottom: var(--s-4); }
.emp-banner + .emp-banner { margin-top: calc(-1 * var(--s-2)); }
.emp-ph-nav { display: inline-flex; gap: 4px; }
.emp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); align-items: start; }
.emp-grid .card-h { min-height: 48px; padding: 12px 20px; }
.emp-since { display: block; color: var(--text-muted); font-size: var(--fs-xs); margin-top: 2px; }
.emp-next { display: block; color: var(--info); font-size: var(--fs-xs); margin-top: 2px; }
.emp-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.emp-counts dt { color: var(--text-muted); font-size: var(--fs-sm); }
.emp-counts dd { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.emp-section + .emp-section { margin-top: var(--s-4); }
.emp-meta { color: var(--text-muted); font-size: var(--fs-sm); margin: -4px 0 var(--s-4); }
.emp-tbl-h { display: flex; align-items: center; gap: 8px; }

/* month strip */
.emp-cal { display: grid; grid-template-columns: repeat(var(--n, 31), minmax(0, 1fr)); gap: 3px; }
.emp-cal-c { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 44px; border-radius: 6px; border: 0;
  font: inherit; font-size: var(--fs-xs); line-height: 1; cursor: pointer; padding: 0; min-width: 0; font-variant-numeric: tabular-nums; }
.emp-cal-c .w { font-size: 10px; opacity: .75; }
.emp-cal-c .d { font-weight: var(--fw-semibold); }
.emp-cal-c.today { box-shadow: inset 0 0 0 2px var(--primary); }
.emp-cal-c.is-off { cursor: default; background: var(--surface-2); color: var(--text-faint); }
.emp-cal-c:not(.is-off):hover { filter: brightness(.96); }
.emp-cal-c:focus-visible { outline: none; box-shadow: var(--focus); }
.emp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: var(--fs-xs); color: var(--text-muted); }
.emp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.emp-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.emp-sum { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 14px; font-size: var(--fs-sm); color: var(--text-muted); }
.emp-sum b { color: var(--text); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* history and change lines */
.emp-chg { display: block; color: var(--text-muted); font-size: var(--fs-xs); margin-top: 2px; white-space: normal; }
.emp-wrap { white-space: normal; min-width: 220px; max-width: 520px; }
.emp-reason { white-space: normal; min-width: 160px; max-width: 360px; color: var(--text-2); }

/* ---------- import ---------- */
.emp-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 16px; border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md); background: var(--surface); text-align: center; cursor: pointer; color: var(--text-2); transition: border-color 120ms var(--ease), background 120ms var(--ease); }
.emp-drop:hover, .emp-drop.over { border-color: var(--primary); background: var(--primary-soft); }
.emp-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.emp-drop svg { width: 28px; height: 28px; color: var(--primary); }
.emp-drop .d1 { font-weight: var(--fw-medium); color: var(--text); }
.emp-drop .d1 u { color: var(--primary); text-decoration: none; }
.emp-drop .d2 { font-size: var(--fs-sm); color: var(--text-muted); }
.emp-res { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: var(--s-4) 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.emp-res.ok { background: var(--success-soft); border-color: transparent; }
.emp-res .r-t { font-weight: var(--fw-semibold); }
.emp-res .r-a { display: flex; gap: 8px; flex-wrap: wrap; }
.emp-cell-err { color: var(--danger); font-weight: var(--fw-medium); }
.emp-cols { margin-top: var(--s-4); }
.emp-cols td:first-child { font-weight: var(--fw-medium); white-space: nowrap; }

@media (max-width: 1023px) {
  .emp-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 719px) {
  .emp-cal { grid-template-columns: repeat(var(--n, 31), 30px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
  .emp-cal-c { height: 40px; }
  .emp-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emp-form .row2, .emp-form .row3 { grid-template-columns: minmax(0, 1fr); }
}
a.emp-cal-c, a.emp-cal-c:hover { text-decoration: none; }
.emp-tabs { margin-bottom: var(--s-4); }
.emp-var { display: block; margin-top: 2px; }
.emp-cal-c:not(.is-off) { box-shadow: inset 0 -3px 0 currentColor; }
.emp-cal-c.today { box-shadow: inset 0 0 0 2px var(--primary), inset 0 -3px 0 currentColor; }
.emp-legend i { background: currentColor !important; box-shadow: none !important; }
.emp-narrow { white-space: normal; min-width: 120px; max-width: 220px; }
