/* ==========================================================================
   Admin · Access management · View Employee Details (approved 2026-11-27).
   Filter card, status chips, compact employee table (cards when narrow),
   row actions with confirmation. Shared parts: design-system.css.
   ========================================================================== */

.ev-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 10px; }
.ev-title { font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.ev-lead { margin-top: 6px; font-size: 15px; color: var(--tb-text-neutral); max-width: 640px; }
.ev-banner { margin-top: 20px; max-width: 900px; }

/* ---- Filters ---- */
.ev-filters { margin-top: 24px; padding: 20px 24px; }
.ev-filters__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: end; }
.ev-filters__end { display: flex; align-items: center; min-height: 46px; }
.ev-filters__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--tb-bg); }
.ev-filters__note { margin-right: auto; font-size: var(--tb-fs-meta); color: var(--tb-text-muted); }

/* ---- Empty / start states ---- */
.ev-state { margin-top: 20px; padding: 48px 24px; text-align: center; }
.ev-state__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--tb-ice); color: var(--tb-primary); }
.ev-state__icon .ic { width: 22px; height: 22px; }
.ev-state__title { margin-top: 14px; font-size: 17px; font-weight: 600; color: var(--tb-text-strong); }
.ev-state__text { max-width: 460px; margin: 6px auto 0; font-size: 14px; color: var(--tb-text-muted); }
.ev-state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }

/* ---- Toolbar: status chips + table tools ---- */
.ev-results { margin-top: 24px; }
.ev-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ev-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--tb-border-strong); border-radius: var(--tb-radius-pill); background: var(--tb-surface); font-size: 13.5px; font-weight: 500; color: var(--tb-text-neutral); }
.ev-chip span { color: var(--tb-text-muted); font-weight: 600; }
.ev-chip:hover { border-color: var(--tb-primary); color: var(--tb-primary); text-decoration: none; }
.ev-chip.is-on { background: var(--tb-primary); border-color: var(--tb-primary); color: var(--tb-on-strong); }
.ev-chip.is-on span { color: rgba(255, 255, 255, .78); }

.ev-tools { display: flex; align-items: center; gap: 6px; }
.ev-find { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--tb-border-strong); border-radius: var(--tb-radius-control); background: var(--tb-surface); color: var(--tb-text-muted); }
.ev-find:focus-within { border-color: var(--tb-royal); box-shadow: 0 0 0 3px rgba(23, 105, 210, .16); }
.ev-find .ic { width: 16px; height: 16px; }
.ev-find input { width: 200px; border: 0; outline: 0; background: none; font: 400 14px var(--tb-font); color: var(--tb-text-strong); }

.ev-icon-btn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 38px; height: 38px; padding: 0; border: 1px solid var(--tb-border-strong); border-radius: var(--tb-radius-control); background: var(--tb-surface); color: var(--tb-text-neutral); cursor: pointer; }
.ev-icon-btn:hover, .ev-icon-btn[aria-expanded="true"] { border-color: var(--tb-primary); color: var(--tb-primary); }
.ev-icon-btn:focus-visible { outline: 2px solid var(--tb-royal); outline-offset: 2px; }

/* Pop-up menus (column chooser, row actions): opened by site.js (.js-dropdown) */
.ev-pop-wrap { position: relative; display: inline-block; vertical-align: middle; }
.ev-pop.bo-nav__menu { top: calc(100% + 6px); left: auto; right: 0; z-index: 30; min-width: 210px; text-align: left; }
.ev-pop--cols { display: flex; flex-direction: column; padding: 10px 14px; }
.ev-pop--cols[hidden] { display: none; }
.ev-pop__cap { margin-bottom: 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tb-text-muted); }
.ev-pop__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font: 500 14px var(--tb-font); color: var(--tb-text); text-align: left; cursor: pointer; white-space: nowrap; }
.ev-pop__item:hover, .ev-pop__item:focus-visible { background: var(--tb-ice-2); color: var(--tb-primary); outline: none; }
.ev-pop__item .ic { color: var(--tb-text-muted); }
.ev-pop__item:hover .ic { color: var(--tb-primary); }

/* ---- Table ---- */
.ev-table-wrap { container-type: inline-size; container-name: evtable; }
.ev-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ev-table th { padding: 13px 12px; border-bottom: 1px solid var(--tb-border); font-size: 12px; font-weight: 600; color: var(--tb-text-muted); text-align: left; white-space: nowrap; }
.ev-table td { padding: 14px 12px; border-bottom: 1px solid var(--tb-bg); color: var(--tb-text-strong); vertical-align: middle; }
.ev-table th:first-child, .ev-table td:first-child { padding-left: 24px; }
.ev-table th:last-child, .ev-table td:last-child { padding-right: 16px; }
.ev-table tbody tr:hover td { background: var(--tb-ice-2); }
.ev-table .is-col-hidden { display: none; }

.ev-emp { min-width: 190px; }
.ev-emp__name { display: block; font-weight: 600; }
.ev-emp__mail { display: block; font-size: 13px; color: var(--tb-text-muted); overflow-wrap: anywhere; }
.is-inactive .ev-emp__name { color: var(--tb-text-neutral); }
.ev-none { color: var(--tb-text-muted); }
.ev-when { white-space: nowrap; }
.ev-when .num { display: block; }
.ev-by { display: block; font-size: 12.5px; color: var(--tb-text-muted); }

.ev-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--tb-radius-pill); background: var(--tb-surface-muted); color: var(--tb-text-neutral); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ev-tag span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ev-tag--active { background: var(--tb-success-soft); color: var(--tb-success); }

.ev-actions { text-align: right; white-space: nowrap; }
.ev-actions .ev-icon-btn { width: 36px; height: 36px; margin-left: 6px; border-color: transparent; }
.ev-actions .ev-icon-btn:hover, .ev-actions .ev-icon-btn[aria-expanded="true"] { border-color: var(--tb-border-strong); }
.ev-edit { min-height: 36px; padding: 0 12px; vertical-align: middle; }
.ev-edit.is-off { color: var(--tb-text-muted); background: var(--tb-surface-muted); border-color: var(--tb-border); cursor: not-allowed; }

.ev-nomatch { padding: 28px 24px; text-align: center; font-size: 14px; color: var(--tb-text-muted); }
.ev-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 12px 24px; font-size: 13px; color: var(--tb-text-muted); }
.ev-pager[hidden] { display: none; }
.ev-pager { display: inline-flex; align-items: center; gap: 8px; }
.ev-pager .ev-icon-btn { width: 34px; height: 34px; }
.js-prev .ic { transform: rotate(90deg); }
.js-next .ic { transform: rotate(-90deg); }
.ev-pager .ev-icon-btn:disabled { opacity: .45; cursor: default; border-color: var(--tb-border); color: var(--tb-text-muted); }

/* ---- Narrow page area ---- */
@container adcontent (max-width: 900px) {
    .ev-filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container adcontent (max-width: 520px) {
    .ev-filters { padding: 18px 16px; }
    .ev-filters__grid { grid-template-columns: minmax(0, 1fr); }
    .ev-filters__actions .btn { flex: 1; }
    .ev-filters__note { width: 100%; }
    .ev-tools { width: 100%; }
    .ev-find { flex: 1; }
    .ev-find input { width: 100%; }
}

/* Table → cards when the table can't fit */
@container evtable (max-width: 640px) {
    .ev-table thead { display: none; }
    .ev-table, .ev-table tbody { display: block; }
    .ev-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px 20px; border-bottom: 1px solid var(--tb-bg); }
    .ev-table td, .ev-table td:first-child, .ev-table td:last-child { display: block; padding: 0; border: 0; }
    .ev-table td.is-col-hidden { display: none; }
    .ev-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--tb-text-muted); }
    .ev-table td.ev-emp { grid-column: 1 / -1; min-width: 0; }
    .ev-table td.ev-emp::before { display: none; }
    .ev-table td.ev-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; text-align: left; }
    .ev-actions .ev-edit { flex: 0 0 auto; min-width: 88px; }
    .ev-actions .ev-icon-btn { margin-left: 0; border-color: var(--tb-border-strong); }
    .ev-foot { padding-left: 20px; }
}
@container evtable (max-width: 300px) {
    .ev-table tr { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .ev-title { font-size: 26px; }
    .ev-head .btn { width: 100%; }
}

/* ---- Always a table on desktop and tablet (2026-11-27, client: "table varala") ----
   When the columns don't fit, the table scrolls sideways inside its own box, as on the
   current site, with Employee pinned left and the row actions pinned right. Cards only on phones. */
.ev-scroll { overflow-x: auto; scrollbar-width: thin; }
.ev-scroll:focus-visible { outline: 2px solid var(--tb-royal); outline-offset: -2px; }
.ev-table td { background: var(--tb-surface); }
.ev-table th { background: var(--tb-surface); }
.ev-table td[data-col] { white-space: nowrap; }
.ev-table th:first-child, .ev-table td:first-child { position: sticky; left: 0; z-index: 1; }
.ev-table th:last-child, .ev-table td:last-child { position: sticky; right: 0; z-index: 1; }
.ev-scroll.is-scroll-left .ev-table th:first-child, .ev-scroll.is-scroll-left .ev-table td:first-child { box-shadow: 8px 0 8px -8px rgba(11, 31, 58, .18); }
.ev-scroll.is-scroll-right .ev-table th:last-child, .ev-scroll.is-scroll-right .ev-table td:last-child { box-shadow: -8px 0 8px -8px rgba(11, 31, 58, .18); }
.ev-emp { max-width: 280px; }
/* Row menus are placed in the window by employee-list.js, so the scrolling box can't clip them */
.ev-actions .ev-pop.bo-nav__menu { position: fixed; top: 0; left: 0; right: auto; }

@container evtable (max-width: 640px) {
    .ev-scroll { overflow: visible; }
    .ev-table th:first-child, .ev-table td:first-child, .ev-table th:last-child, .ev-table td:last-child { position: static; box-shadow: none; }
    .ev-table td[data-col] { white-space: normal; }
    .ev-emp { max-width: none; }
}

/* ---- Empty table (2026-11-27): before the first search and when nothing matches, the message
   sits inside the table under the column headers, so the table is always visible ---- */
.ev-table td.ev-empty { position: static; padding: 48px 24px; text-align: center; white-space: normal; box-shadow: none; }
.ev-table tbody tr.ev-empty-row:hover td { background: var(--tb-surface); }
.ev-empty .ev-state__title { margin-top: 14px; }
@container evtable (max-width: 640px) {
    .ev-table tr.ev-empty-row { display: block; padding: 0; }
    .ev-table td.ev-empty { display: block; padding: 36px 20px; }
}
