/* Employees app (js/employees.js) */
.emp-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; align-items: start; }
.emp-deps { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 6px var(--space-2) 10px;
  position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow: auto; }
.emp-check { display: flex; gap: 6px; align-items: center; }
.emp-main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
/* the department select replaces the panel on narrow screens only (L8) */
.emp-dep-select { display: none; }
.emp-dep-select select, .emp-dep-select .ss { width: 100%; }
.emp-kanban { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.emp-card, .dep-card { display: flex; gap: var(--space-3); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-3); transition: box-shadow var(--motion-fast), border-color var(--motion-fast); min-width: 0; }
/* the employee card is a link to the form: keep the card look, not link colours */
a.emp-card { color: var(--color-text); text-decoration: none; cursor: pointer; }
a.emp-card:hover { box-shadow: var(--shadow-dropdown); border-color: var(--color-border-strong); color: var(--color-text); text-decoration: none; }
a.emp-card:focus-visible { outline: none; border-color: var(--color-focus); box-shadow: var(--focus-ring); }
.emp-card-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.emp-name { font-weight: var(--weight-semibold); font-size: var(--text-md); overflow-wrap: anywhere; }
.emp-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.emp-tags .chip, .emp-reports .chip { font-size: var(--text-xs); }
.emp-avatar { border-radius: var(--radius-lg); object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.emp-avatar.initials { background: var(--color-primary-subtle); color: var(--color-primary-text); font-weight: 700; }
.emp-pager { display: flex; gap: var(--space-2); align-items: center; justify-content: flex-end; margin-top: var(--space-3); }
.seg { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); overflow: hidden; }
.seg button { border: none; border-radius: 0; background: var(--color-surface); }
.seg button.on { background: var(--color-primary-subtle); color: var(--color-primary-text); }
.emp-head { display: flex; gap: var(--space-5); align-items: flex-start; margin-bottom: var(--space-2); }
.emp-head-main { flex: 1; min-width: 0; }
.emp-head-grid { margin-top: 10px; }
.emp-title input { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
.emp-name-ar { width: min(360px, 100%); }
/* the photo is a button: no button chrome, a small pencil badge instead */
button.emp-photo { cursor: pointer; border-radius: var(--radius-lg); position: relative; padding: 0; border: 0; background: transparent; flex: none; }
button.emp-photo:hover { background: transparent; border: 0; }
button.emp-photo:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.emp-photo::after { content: '✎'; position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--color-surface);
  border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center; font-size: var(--text-xs); color: var(--color-text-muted); }
.emp-form .tabs { margin-top: var(--space-4); overflow-x: auto; }
.tab-pane { padding-top: 14px; }
.tab-pane h4, .form-grid h4.full { grid-column: 1 / -1; margin: 14px 0 2px; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); }
.emp-reports { margin-top: var(--space-3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.emp-reports .dms-group { width: 100%; padding-inline-start: 0; }
.dep-card { flex-direction: column; gap: 6px; }
.dep-card .dep-title { font-weight: var(--weight-semibold); font-size: var(--text-md); display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.dep-card .dep-title button.link { font-weight: inherit; font-size: inherit; text-align: start; padding: 0; min-height: 0; }
/* the Arabic name sits under the English one, not across the card */
.dep-card > [lang=ar] { align-self: flex-start; }
.dep-card button { align-self: flex-start; margin-top: 6px; }
.dep-card .dep-title button { margin-top: 0; }
.dep-card.archived { opacity: .6; }
/* org chart: nested lists drawn as a tree */
.org-wrap { overflow-x: auto; }
.org, .org ul { list-style: none; margin: 0; padding-inline-start: 26px; position: relative; }
.org { padding-inline-start: 0; }
.org li { position: relative; padding: 6px 0; }
.org ul li::before { content: ''; position: absolute; inset-inline-start: -16px; top: 0; bottom: 0; border-inline-start: 1.5px solid var(--color-border-strong); }
.org ul li:last-child::before { bottom: calc(100% - 30px); }
.org ul li::after { content: ''; position: absolute; inset-inline-start: -16px; top: 30px; width: 14px; border-top: 1.5px solid var(--color-border-strong); }
.org-node { display: inline-flex; gap: 10px; align-items: center; padding: 6px var(--space-3) 6px 6px; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); color: var(--color-text); }
.org-node:hover { border-color: var(--color-primary); color: var(--color-text); }
@media (max-width: 900px) {
  .emp-layout { grid-template-columns: minmax(0, 1fr); }
  .emp-deps { display: none; }
  .emp-dep-select { display: block; max-width: 360px; }
}
@media (max-width: 800px) {
  .emp-head { flex-direction: column-reverse; }
}
@media (max-width: 480px) {
  .emp-kanban { grid-template-columns: minmax(0, 1fr); }
  .emp-pager { justify-content: center; }
}
