/* Color palette lives in one place (CSS custom properties) so the accent
 * color can be changed without hunting through every rule below.
 * --accent is i-net's actual brand orange (#FF6600, pulled directly from
 * their site's CSS — not an approximation). Everything else stays a
 * restrained near-monochrome (Apple.com-style: color used sparingly as an
 * accent on buttons/links/highlights, not as large flat fills) so the
 * orange still reads as "the brand color" instead of getting diluted. */
:root {
    --accent: #ff6600;
    --accent-dark: #cc5200;
    --accent-light: #fff1e6;
    --ink: #1d1d1f;
    --ink-soft: #6e6e73;
    --page-bg: #fbfbfd;
    --card-bg: #fff;
    --border: #e5e5e5;
    --sb-w: 240px;
}

* { box-sizing: border-box; }
/* Always reserve the scrollbar's width, so the centered nav doesn't jump
   sideways between short pages and long ones (like the ticket lists). */
html { scrollbar-gutter: stable; }
body {
    font-family: "Barlow", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    background: var(--page-bg);
    color: var(--ink);
}
.link-btn {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
}
.nav-inner a.brand {
    font-family: "Barlow Condensed", "Barlow", sans-serif;
    font-weight: 700;
    color: #fff;
    font-size: 18px;
    letter-spacing: 0.3px;
}
.nav-inner a:hover, .nav-inner .link-btn:hover { color: #fff; }
.nav-spacer { flex: 1; }
.nav-user { color: rgba(255,255,255,0.7); font-size: 13px; }
.link-btn {
    background: none; border: none; cursor: pointer; padding: 0; font: inherit;
}
.inline-form { display: inline; }

main {
    max-width: 1100px;
    margin: 28px auto 60px;
    padding: 0 16px;
}
h1 {
    font-family: "Barlow Condensed", "Barlow", sans-serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 0.2px;
    margin-bottom: 16px;
    color: var(--ink);
}
.page-head { display: flex; justify-content: space-between; align-items: center; }
.secondary-btn { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.secondary-btn:hover { background: var(--accent-light); }
.export-link {
    display: inline-block;
    padding: 7px 9px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-right: 8px;
}

.login-box {
    max-width: 340px;
    margin: 90px auto;
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border-top: 4px solid var(--accent);
}
.login-box h1 { text-align: center; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); }

label { font-size: 13px; color: var(--ink-soft); }
input, select, button {
    font: inherit;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.12s, box-shadow 0.12s, background 0.12s, color 0.12s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
button {
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
button:hover { background: var(--accent-dark); }
.checkbox-label { display: flex; align-items: center; gap: 6px; }
.checkbox-label input { width: auto; }

.filter-toggle-wrap { display: flex; flex-direction: column; gap: 4px; }
/* Scoped to .filter-toggle-wrap (two classes) so this reliably beats the
 * generic ".filter-bar label { flex-direction: column }" rule below, which
 * otherwise also matches this <label> and was stretching/left-aligning the
 * pill's text instead of centering it. */
.filter-toggle-wrap .toggle-pill {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.filter-toggle-wrap .toggle-pill input { display: none; }
.filter-toggle-wrap .toggle-pill:hover { background: var(--accent-light); border-color: var(--accent); }
.filter-toggle-wrap .toggle-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.period-picker { position: relative; }
.period-trigger {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--border);
    font-weight: 600;
    padding: 0 14px;
    height: 36px;
}
.period-trigger:hover { background: var(--accent-light); border-color: var(--accent); }
.period-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.16);
    padding: 14px;
    display: flex;
    gap: 16px;
}
.period-popup[hidden] { display: none; }
.period-popup.popup-above {
    top: auto;
    bottom: calc(100% + 6px);
}
.popup-presets {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
    border-right: 1px solid var(--border);
    padding-right: 14px;
}
.popup-preset-link {
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}
.popup-preset-link:hover { background: var(--accent-light); }
.popup-preset-link.active { background: var(--accent); color: #fff; font-weight: 600; }

.range-calendar {
    background: #fff;
    padding: 0;
    width: 240px;
}
.rc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
}
.rc-header button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 16px;
    padding: 2px 8px;
    cursor: pointer;
}
.rc-header button:hover { background: var(--accent-light); border-radius: 4px; }
.rc-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.rc-weekday { font-size: 10px; color: #a1a1a6; text-align: center; padding: 2px 0; }
.rc-day {
    font-size: 12px;
    text-align: center;
    padding: 5px 0;
    border-radius: 4px;
    cursor: pointer;
    color: var(--ink);
}
.rc-day:hover { background: var(--accent-light); }
.rc-empty { cursor: default; }
.rc-empty:hover { background: none; }
.rc-in-range { background: var(--accent-light); }
.rc-endpoint { background: var(--accent) !important; color: #fff; font-weight: 700; }

.period-note { font-size: 13px; color: var(--ink-soft); margin: -8px 0 14px; }
.ticket-stats { font-size: 13px; color: var(--ink-soft); margin: 0 0 8px; }
.warn-link { color: #b3261e; font-weight: 600; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    position: relative;
    background: var(--card-bg);
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.filter-bar label { display: flex; flex-direction: column; gap: 4px; }
.filter-bar label select { height: 36px; }
.filter-bar .period-picker { display: flex; flex-direction: column; gap: 4px; }
.filter-bar .period-picker-label { font-size: 13px; color: var(--ink-soft); }

.report-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.report-table th, .report-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    overflow-wrap: break-word;
}
.report-table thead th {
    background: var(--accent);
    color: #fff;
    font-family: "Barlow Condensed", "Barlow", sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.2px;
}
.report-table thead th.sortable-th {
    cursor: pointer;
    user-select: none;
}
.report-table thead th.sortable-th:hover { background: var(--accent-dark); }
.report-table thead th.sort-asc::after { content: " \25B2"; font-size: 10px; }
.report-table thead th.sort-desc::after { content: " \25BC"; font-size: 10px; }
.report-table thead th[data-sort-rank]::before {
    content: attr(data-sort-rank);
    display: inline-block;
    min-width: 13px;
    height: 13px;
    line-height: 13px;
    font-size: 9px;
    text-align: center;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    margin-right: 4px;
}
.report-table tbody tr { transition: background 0.1s; }
.report-table tbody tr:nth-child(even) { background: #f7f7f9; }
.report-table tbody tr:hover { background: var(--accent-light); }
/* Whole-row tint for a ticket whose units were touched by a human (item 8
 * cell coloring wasn't enough to notice at a glance) — set on <td> rather
 * than <tr> so it reliably paints over the zebra-striping/even-row rule
 * above regardless of rule order. */
.report-table tbody tr.row-override td { background: #ecfeff; }
.report-table tbody tr.row-manual td { background: #f5f3ff; }
.report-table tbody tr.row-override:hover td,
.report-table tbody tr.row-manual:hover td { background: var(--accent-light); }
.report-table tbody tr.row-cancelled td { background: #fee2e2; color: #7f1d1d; }
.report-table tbody tr.row-cancelled:hover td { background: #fecaca; }
.status-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
/* A class that sets display (like .status-badge) would otherwise override the hidden attribute. */
[hidden] { display: none !important; }
.status-cancelled { background: #fecaca; color: #991b1b; }
.status-other { background: #ede9fe; color: #5b21b6; }
.status-done { color: #6b7280; font-size: 12px; }
.status-inactive { background: #e5e7eb; color: #4b5563; margin-left: 6px; }
.row-unpriced .status-badge { margin-left: 6px; }
.report-table tbody tr.row-inactive td { color: #9ca3af; }
.report-table tbody tr.row-unpriced td { background: #fff7ed; }
.flash-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.admin-types-table .units-edit-input { width: 6em; }
.report-table tfoot td { font-weight: 700; background: var(--accent-light); }
.averages-row td { font-weight: 400; font-style: italic; color: var(--ink-soft); background: #f7f7f9; }
.total-cell { font-weight: 700; }
.empty { color: #a1a1a6; text-align: center; padding: 24px; }
.error { color: #b3261e; font-size: 13px; }
.badge-warn {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #fff3cd;
    color: #8a6d00;
    font-size: 11px;
}
.delete-btn {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f3c6c1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.delete-btn:hover { background: #b3261e; color: #fff; border-color: #b3261e; }

.ticket-breakdown { margin-top: 18px; }
.ticket-breakdown summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-dark);
    padding: 8px 0;
}
.ticket-breakdown .report-table { margin-top: 10px; }
.full-list-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 9px 16px;
}

.ticket-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.ticket-tab {
    padding: 9px 18px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.ticket-tab:hover:not(.active) { background: var(--accent-light); color: var(--ink); }
.ticket-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    margin-left: 4px;
}

.nav-sync-btn {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}
.nav-sync-btn:hover { background: var(--accent); border-color: var(--accent); }
.nav-sync-btn { display: inline-flex; align-items: center; gap: 7px; }
.nav-sync-btn .sync-spinner {
    display: none;
    width: 12px; height: 12px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sync-spin 0.7s linear infinite;
}
.nav-sync-btn.is-loading { background: var(--accent); border-color: var(--accent); cursor: progress; opacity: 1; }
.nav-sync-btn.is-loading .sync-spinner { display: inline-block; }
@keyframes sync-spin { to { transform: rotate(360deg); } }

.sync-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px;
    overflow: hidden; z-index: 1000;
    background: rgba(255,102,0,0.15);
}
.sync-progress::before {
    content: ""; position: absolute; top: 0; bottom: 0; width: 35%;
    background: var(--accent);
    border-radius: 3px;
    animation: sync-bar 1.1s ease-in-out infinite;
}
@keyframes sync-bar { from { left: -35%; } to { left: 100%; } }
body.is-syncing main { opacity: 0.55; pointer-events: none; transition: opacity 0.2s; }
@media (prefers-reduced-motion: reduce) {
    .nav-sync-btn .sync-spinner, .sync-progress::before { animation-duration: 2.5s; }
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 22px;
    margin-top: 24px;
}
.menu-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    /* A fixed height (not aspect-ratio) — aspect-ratio is only a sizing
     * hint, so a card whose description happened to wrap onto a 3rd line
     * grew taller than the others and broke the uniform-square look. */
    height: 230px;
    padding: 22px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    text-decoration: none;
    color: var(--ink);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.menu-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0,0,0,0.16);
    border-color: var(--card-accent, var(--accent));
}
.menu-icon-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    background: var(--card-accent-light, var(--accent-light));
    box-shadow: inset 0 0 0 2px var(--card-accent, var(--accent));
}
.menu-label {
    font-family: "Barlow Condensed", "Barlow", sans-serif;
    font-weight: 700;
    font-size: 21px;
    color: var(--ink);
}
.menu-desc {
    font-size: 12.5px;
    color: var(--ink-soft);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.units-edit-form { display: inline-flex; align-items: center; gap: 4px; flex-wrap: nowrap; }

/* table-layout:fixed (see .report-table) splits columns evenly by default,
 * which isn't enough room for this row's category-select + units-input +
 * save-button form — it was overflowing into the delete column next to it.
 * Give the form column real space and shrink the short date columns. */
.extra-entries-table th:nth-child(1), .extra-entries-table td:nth-child(1),
.extra-entries-table th:nth-child(2), .extra-entries-table td:nth-child(2) { width: 11%; }
.extra-entries-table th:nth-child(3), .extra-entries-table td:nth-child(3) { width: 18%; }
.extra-entries-table th:nth-child(4), .extra-entries-table td:nth-child(4) { width: 50%; }
.extra-entries-table th:nth-child(5), .extra-entries-table td:nth-child(5) { width: 10%; }
.units-edit-input { width: 4.5em; padding: 3px 5px; font-size: 13px; }
.units-edit-save {
    color: var(--accent-dark);
    font-size: 16px;
    font-weight: 700;
    padding: 0 4px;
}
.units-edit-save:hover { color: var(--ink); }

/* Distinguishing where a unit value came from (item 8): plain auto-computed
 * weight is unstyled; the other three sources get their own color so a
 * reader can tell at a glance without hovering. */
.units-override { color: #0e7490; font-weight: 600; }       /* human-corrected on /tickets */
.units-manual { color: #7c3aed; font-weight: 600; }          /* "Այլ" ticket-level total */
.units-extra { color: #16a34a; font-weight: 600; }           /* /extra entries */
.units-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--ink-soft);
    margin: 0 0 12px;
}
.units-legend span { display: inline-flex; align-items: center; gap: 5px; }
.units-legend .swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.delay-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}
.delay-ok { background: #dcfce7; color: #166534; }
.delay-warn { background: #fff3cd; color: #8a6d00; }
.delay-severe { background: #fee2e2; color: #991b1b; }

.notes-preview {
    max-width: 260px;
    color: var(--ink-soft);
    font-size: 13px;
    white-space: normal;
}
.sla-cell { white-space: nowrap; }
.sla-cell select { height: 32px; padding: 0 26px 0 8px; font-size: 13px; background-position: right 8px center; }
.report-table tbody tr.row-late td { background: #fff1e6; }
.report-table tbody tr.row-late:hover td { background: #ffe4cc; }
.save-status { font-size: 12px; white-space: nowrap; min-width: 9em; }
.save-pending { color: #6b7280; }
.save-ok { color: #047857; }
.save-error { color: #b3261e; font-weight: 600; }
.report-table tbody tr.row-planned td { background: #eef2ff; }
.report-table tbody tr.row-planned:hover td { background: #e0e7ff; }
.delay-planned { background: #e0e7ff; color: #3730a3; }
.report-table tbody tr.row-stale td { background: #fee2e2; }
.report-table tbody tr.row-stale:hover td { background: #fecaca; }

/* Multi-select filter dropdowns (_multiselect.html + multiselect.js),
   styled to match the period picker next to them. */
.ms { position: relative; display: flex; flex-direction: column; gap: 4px; }
.ms-label { font-size: 13px; color: var(--ink-soft); }
.ms-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 10px 0 12px;
    background: #fff; color: var(--ink); border: 1px solid var(--border);
    font-weight: 600; text-align: left; cursor: pointer;
}
.ms-trigger:hover { background: var(--accent-light); border-color: var(--accent); color: var(--ink); }
.ms-trigger[aria-expanded="true"] { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.ms.has-value .ms-trigger { border-color: var(--accent); }
.ms-text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ms-text.is-all { color: var(--ink-soft); font-weight: 500; }
.ms-count {
    flex: none; background: var(--accent); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 18px; padding: 0 7px; border-radius: 9px;
}
.ms-chevron { flex: none; width: 12px; height: 12px; color: var(--ink-soft); transition: transform 0.15s; }
.ms-trigger[aria-expanded="true"] .ms-chevron { transform: rotate(180deg); color: var(--accent); }

.ms-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
    width: max-content; min-width: 100%; max-width: 320px;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.16); overflow: hidden;
    animation: ms-in 0.12s ease-out;
}
@keyframes ms-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ms-search { padding: 8px; border-bottom: 1px solid var(--border); }
.ms-search input { width: 100%; height: 32px; font-size: 13px; }
.ms-options { max-height: 280px; overflow-y: auto; padding: 4px; }
.filter-bar .ms-option {
    position: relative; flex-direction: row; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 6px; cursor: pointer;
    font-size: 14px; color: var(--ink); white-space: nowrap; user-select: none;
}
.ms-option:hover { background: var(--accent-light); }
.ms-option input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; padding: 0; }
.ms-box {
    flex: none; width: 16px; height: 16px; border-radius: 4px;
    border: 1.5px solid #c7c7cc; background: #fff;
    display: grid; place-items: center; transition: background 0.12s, border-color 0.12s;
}
.ms-option input:checked + .ms-box { background: var(--accent); border-color: var(--accent); }
.ms-option input:checked + .ms-box::after {
    content: ""; width: 4px; height: 8px; margin-top: -2px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.ms-option input:focus-visible + .ms-box { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.ms-option input:checked ~ .ms-option-text { font-weight: 600; }
.ms-empty { padding: 10px; font-size: 13px; color: var(--ink-soft); }
.ms-radio {
    flex: none; width: 16px; height: 16px; border-radius: 50%;
    border: 1.5px solid #c7c7cc; background: #fff;
    display: grid; place-items: center; transition: border-color 0.12s;
}
.ms-option input:checked + .ms-radio { border-color: var(--accent); }
.ms-option input:checked + .ms-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ms-option input:focus-visible + .ms-radio { box-shadow: 0 0 0 3px var(--accent-light); }

/* Plain <select>s in forms (not filters) get the same button look. */
select {
    appearance: none; -webkit-appearance: none;
    height: 36px; padding: 0 30px 0 12px; background-color: #fff; color: var(--ink); font-weight: 600;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
    cursor: pointer;
}
select:hover { border-color: var(--accent); }

/* Text/number fields in filter bars line up with the dropdown buttons. */
.filter-bar input[type=text], .filter-bar input[type=number], .filter-bar input[type=date],
.filter-bar input[type=password] { height: 36px; background: #fff; }
.filter-bar input[type=text]:hover, .filter-bar input[type=number]:hover { border-color: var(--accent); }
.select-compact { height: 30px; padding: 0 26px 0 8px; font-size: 13px; background-position: right 8px center; }

/* "×" that clears one filter: sits over the right end of its control. */
.ms-control, .input-clear-wrap { position: relative; display: inline-flex; }
/* Fixed widths: picking a value must not resize the control (long names
   are cut with "…"; the full text is in the button's tooltip). */
.ms .ms-control { width: 210px; }
.period-picker .ms-control { width: 250px; }
.ms-control .ms-trigger, .ms-control .period-trigger { width: 100%; padding-right: 32px; }
.period-trigger { width: 250px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ms.has-value .ms-chevron { visibility: hidden; }
.ms-reset {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%;
    background: transparent; color: var(--ink-soft);
    font-size: 18px; line-height: 22px; text-align: center; cursor: pointer;
}
.ms-reset:hover { background: var(--accent-light); color: var(--accent); }
.ms-reset:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-light); color: var(--accent); }
.input-clear-wrap input { padding-right: 30px; }
.period-picker .ms-control .period-trigger { padding-right: 36px; }
.login-help { margin-top: 18px; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.toggle-group { display: flex; gap: 6px; }

/* =====================================================================
   iNet HR additions (design-guide/DESIGN.md): left collapsible sidebar,
   page structure, and mapping of the app's existing class names onto
   the design system so every page shares one look.
   ===================================================================== */

/* ---- layout: left collapsible sidebar (§3) ---- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; flex: none;
    width: var(--sb-w); background: var(--ink); color: #fff;
    display: flex; flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,.12);
    transition: width .2s ease; overflow: hidden; z-index: 40;
}
html.sb-resizing .sidebar { transition: none; }
html.sb-collapsed .sidebar { width: 64px; }
.sb-resize {
    position: absolute; top: 0; right: 0; width: 6px; height: 100%; cursor: col-resize; z-index: 41;
}
.sb-resize:hover, html.sb-resizing .sb-resize { background: rgba(255,102,0,.4); }
html.sb-collapsed .sb-resize { display: none; }
.sb-head { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 12px; flex: none; }
.sb-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none;
            font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 18px; white-space: nowrap; }
.sb-brand .sb-icon { color: var(--accent); }
.sb-toggle { width: 28px; height: 28px; padding: 0; border-radius: 6px; background: rgba(255,255,255,.08); color: #fff; font-size: 14px; }
.sb-toggle:hover { background: var(--accent); }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0; }
.sb-item {
    position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
    height: 42px; padding: 0 20px; background: none; border: none; border-radius: 0;
    color: rgba(255,255,255,.85); text-decoration: none; font-size: 14px; font-weight: 500;
    white-space: nowrap; cursor: pointer; font-family: inherit;
}
.sb-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.sb-item.active { color: #fff; background: rgba(255,255,255,.08); box-shadow: inset 3px 0 0 var(--accent); }
.sb-icon { flex: none; width: 24px; text-align: center; font-size: 17px; }
.sb-label { overflow: hidden; text-overflow: ellipsis; }
.sb-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
            background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.sb-sep { height: 1px; background: rgba(255,255,255,.08); margin: 6px 16px; }
.sb-foot { border-top: 1px solid rgba(255,255,255,.1); padding: 8px 0; flex: none; }
.sb-foot form { margin: 0; }
.sb-user { display: block; padding: 6px 20px; color: rgba(255,255,255,.6); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.sb-collapsed .sb-label, html.sb-collapsed .sb-user { display: none; }
html.sb-collapsed .sb-head { justify-content: center; }
html.sb-collapsed .sb-brand { display: none; }
html.sb-collapsed .sb-item { justify-content: center; padding: 0; }
html.sb-collapsed .sb-badge { position: absolute; top: 5px; right: 10px; margin: 0; }
.content { flex: 1; min-width: 0; }
.mobile-bar { display: none; }
@media (max-width: 900px) {
    .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s ease; width: 240px; }
    .sidebar.open { transform: none; }
    html.sb-collapsed .sidebar { width: 240px; }
    html.sb-collapsed .sb-label, html.sb-collapsed .sb-user, html.sb-collapsed .sb-brand { display: revert; }
    html.sb-collapsed .sb-item { justify-content: flex-start; padding: 0 20px; }
    html.sb-collapsed .sb-badge { position: static; margin-left: auto; }
    .sb-toggle { display: none; }
    .sb-resize { display: none; }
    .sb-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
    .mobile-bar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; background: var(--ink); color: #fff;
                  font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 18px; }
    .sb-open { background: none; color: #fff; font-size: 20px; padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } * { animation-duration: .01ms !important; } }

/* ---- base text ---- */
body { font-size: 14px; line-height: 1.45; }
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
h2 { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 18px; margin: 20px 0 10px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
input, textarea { background: #fff; color: var(--ink); }
input:hover, textarea:hover { border-color: #cfcfd4; }
textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; width: 100%; }
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: auto; }
input:not([type=checkbox]):not([type=radio]):not([type=file]) { height: 36px; }

/* ---- page structure (§5) ---- */
.page-head { gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.summary-line { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; }
.summary-line strong { color: var(--ink); }

/* ---- buttons (§4): .btn = primary; .btn.secondary; .btn.danger; .btn.small ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
       background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 6px; font-weight: 600;
       font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; font-family: inherit;
       transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.btn.secondary { background: #fff; color: var(--accent); border-color: var(--accent); }
.btn.secondary:hover { background: var(--accent-light); color: var(--accent-dark); }
.btn.danger { background: #fdecea; color: #b3261e; border-color: #f3c6c1; }
.btn.danger:hover { background: #b3261e; color: #fff; border-color: #b3261e; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.link { background: none; border: none; color: var(--accent-dark); padding: 0; height: auto; }

/* ---- cards / panels ---- */
.panel, .pf-card, .card { background: var(--card-bg); border: none; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
                           padding: 16px 18px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.card { margin: 0; }
.card .num { font-family: "Barlow Condensed", "Barlow", sans-serif; font-size: 28px; font-weight: 700; color: var(--ink); }
.card .lbl { font-size: 13px; color: var(--ink-soft); }
a.card { color: var(--ink); text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.16); transform: translateY(-2px); }

/* ---- tabs (§4): .tabs a / .topmenu a → ticket-tab look ---- */
.tabs, .topmenu { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border: none; }
.tabs a, .topmenu a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; background: #fff;
                      border: 1px solid var(--border); color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 14px; margin: 0; }
.tabs a:hover:not(.on), .topmenu a:hover:not(.on) { background: var(--accent-light); color: var(--ink); text-decoration: none; }
.tabs a.on, .topmenu a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.topmenu a.primary { margin-left: auto; order: 99; background: var(--accent); color: #fff; border-color: var(--accent); }
.topmenu a.primary:hover { background: var(--accent-dark); }
.topmenu .count { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px;
                  background: #e5e7eb; color: #4b5563; font-size: 11px; font-weight: 700; text-align: center; }
.topmenu a.on .count { background: rgba(255,255,255,.28); color: #fff; }

/* ---- filter bar: legacy .filters rows get the same card look ---- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--card-bg); padding: 14px 16px;
           border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 18px; }
.filter-bar .grow { flex: 1; min-width: 220px; }
.filter-bar .grow input { width: 100%; }

/* ---- tables: every data table gets the report-table look ---- */
table { border-collapse: collapse; width: 100%; }
main table:not(.plain):not(.grid):not(.kv) { background: var(--card-bg); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
main table:not(.plain):not(.grid) th, main table:not(.plain):not(.grid) td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border);
    font-size: 14px; overflow-wrap: anywhere; vertical-align: top; }
main table:not(.plain):not(.grid) tr:first-child th, main table:not(.plain):not(.grid) thead th {
    background: var(--accent); color: #fff; font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .2px; }
main table:not(.plain):not(.grid) tbody tr:nth-child(even) { background: #f7f7f9; }
main table:not(.plain):not(.grid) tbody tr:hover { background: var(--accent-light); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.plain { background: none; }
table.plain th, table.plain td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: 14px; }
table.plain th { color: var(--ink-soft); font-weight: 600; font-size: 13px; }
td.actions { text-align: right; white-space: nowrap; }
.empty-state { color: #a1a1a6; text-align: center; padding: 24px; }

/* ---- badges (§2 semantic colours) ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap;
         background: #e5e7eb; color: #4b5563; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warning { background: #fff3cd; color: #8a6d00; }
.badge.error { background: #fee2e2; color: #991b1b; }
.badge.info { background: #e0e7ff; color: #3730a3; }
.badge.manual { background: #ede9fe; color: #5b21b6; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-soft); margin: 0 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---- messages ---- */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 6px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.messages li.error { background: #fdecea; color: #b3261e; border-color: #f3c6c1; }
.messages li.warning { background: #fff3cd; color: #8a6d00; border-color: #f5e3a3; }
.messages li.info { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.errorlist { color: #b3261e; font-size: 13px; }

/* ---- small shared bits ---- */
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label { display: flex; flex-direction: column; gap: 4px; }
.stack input, .stack select, .stack textarea { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #f2f2f5; border-radius: 12px; padding: 2px 10px; margin: 2px; font-size: 13px; color: var(--ink); }
a.chip:hover { background: var(--accent-light); text-decoration: none; }
.chip button { border: 0; background: none; color: var(--ink-soft); padding: 0 4px; height: auto; }
.chip form { display: inline; }
.progress { background: #eceef1; border-radius: 6px; height: 8px; overflow: hidden; margin-bottom: 2px; }
.progress div { background: var(--accent); height: 100%; }
.checklist { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
.checklist ul, #dept-box ul { list-style: none; padding: 0; margin: 0; }
.checklist label, #dept-box label { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.group { border-left: 3px solid var(--accent); }
.bell-count { background: #dc2626; }

/* dropdown menus (⋯) */
details.menu { display: inline-block; position: relative; }
details.menu summary { list-style: none; cursor: pointer; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--card-bg); border: 1px solid var(--border);
             border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.16); min-width: 240px; overflow: hidden; padding: 4px; }
.menu-body form { display: block; margin: 0; }
.menu-body a, .menu-body button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 6px; background: none;
                                   color: var(--ink); font-weight: 500; font-size: 14px; border: 0; height: auto; white-space: nowrap; }
.menu-body a:hover, .menu-body button:hover { background: var(--accent-light); color: var(--ink); text-decoration: none; }

/* ---- attendance grid ---- */
.grid-wrap { overflow-x: auto; background: var(--card-bg); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
table.grid { width: auto; font-size: 12px; }
table.grid th, table.grid td { padding: 4px 5px; text-align: center; border: 1px solid #eee; min-width: 28px; }
table.grid tr:first-child th { background: var(--accent); color: #fff; font-family: "Barlow Condensed", "Barlow", sans-serif; }
table.grid th.hol { background: var(--accent-dark); }
table.grid td.name { text-align: left; white-space: nowrap; position: sticky; left: 0; background: #fff; min-width: 190px; }
table.grid td.off { background: #f4f4f6; color: #a1a1a6; }
table.grid td.cell { cursor: pointer; }
table.grid td.cell:hover { background: var(--accent-light); outline: 1px solid var(--accent); }
.cell-panel { position: fixed; right: 20px; bottom: 20px; width: 360px; max-height: 70vh; overflow: auto; background: #fff;
    border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: 14px; z-index: 10; }
.cell-panel:empty { display: none; }

/* ---- unified employee profile ---- */
.pf-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.pf-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-light); color: var(--accent-dark);
             box-shadow: inset 0 0 0 2px var(--accent); display: flex; align-items: center; justify-content: center;
             font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 24px; overflow: hidden; flex-shrink: 0; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-title { flex: 1; min-width: 240px; }
.pf-title h1 { margin: 0 0 4px; }
.pf-sub { color: var(--ink-soft); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.pf-actions { display: flex; gap: 8px; align-items: center; }
.pf-asof { margin: 8px 0 12px; font-size: 13px; color: var(--ink-soft); }
.pf-asof input { height: 30px !important; font-size: 13px; }
.pf-notice { background: #fff3cd; color: #6b5400; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; line-height: 1.6; font-size: 13px; }
.pf-nav { position: relative; z-index: 4; background: var(--page-bg); display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 0; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.pf-nav a { padding: 5px 12px; border-radius: 16px; font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.pf-nav a:hover { background: var(--accent-light); color: var(--ink); }
.pf-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.7fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-card { scroll-margin-top: 60px; }
.pf-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pf-card-h h2 { margin: 0; }
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 14px; margin: 0; line-height: 1.5; }
dl.kv.two { grid-template-columns: minmax(150px, max-content) 1fr; }
dl.kv dt { color: var(--ink-soft); font-size: 13px; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.np { color: #a1a1a6; font-style: italic; font-size: 13px; }
.bal { margin-bottom: 8px; }
.bal-main { font-family: "Barlow Condensed", "Barlow", sans-serif; font-size: 30px; font-weight: 700; line-height: 1.15; }
.bal-main span { font-family: "Barlow", sans-serif; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.bal-main.neg { color: #b3261e; }
.bal-lbl { font-size: 13px; color: var(--ink-soft); }
.pf-inline-note { background: #fff3cd; border-radius: 6px; padding: 6px 10px; margin: 6px 0; font-size: 13px; }
details.pf-more { margin-top: 10px; }
details.pf-more > summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; font-size: 13px; padding: 4px 0; }
details.pf-more[open] > summary { margin-bottom: 8px; }
ol.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
ol.timeline li { position: relative; padding: 4px 0 10px 16px; line-height: 1.5; }
ol.timeline li::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: #c7c7cc; }
ol.timeline li.tl-hire::before { background: #16a34a; } ol.timeline li.tl-end::before { background: #dc2626; }
ol.timeline li.tl-pay::before { background: var(--accent); } ol.timeline li.tl-role::before { background: #3730a3; }
.tl-date { display: inline-block; min-width: 90px; color: var(--ink-soft); font-size: 13px; }
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 60; display: flex; justify-content: flex-end; }
.drawer-panel { width: min(480px, 100%); height: 100%; background: #fff; padding: 22px; overflow: auto; position: relative; box-shadow: -8px 0 24px rgba(0,0,0,.15); }
.drawer-close { position: absolute; top: 14px; right: 14px; background: none; color: var(--ink-soft); font-size: 18px; padding: 4px 8px; }
.drawer-close:hover { background: var(--accent-light); color: var(--accent); }
.drawer-actions { display: flex; gap: 8px; margin-top: 6px; }
.rp-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.rp-chip { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 6px;
           cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); background: #fff; }
.rp-chip:hover { background: var(--accent-light); border-color: var(--accent); }
.rp-chip input { display: none; }
.rp-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.rp-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.rp-group { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.cmp { color: var(--ink-soft); font-size: 12px; }

/* ---- login / public pages ---- */
.login-box h1 { margin-top: 0; }
.login-box input { width: 100%; }
.login-box button { height: 36px; }

@media print { .sidebar, .mobile-bar, .pf-nav, .pf-actions, .rp-filter, .drawer, .sb-overlay { display: none !important; } .app { display: block; } }

/* ---- employee profile (compact, tabbed) ---- */
.ep { --ep-gap: 12px; }
.ep-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--card-bg); border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 12px 16px; margin-bottom: 10px; }
.ep-avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--accent-light); color: var(--accent-dark);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; overflow: hidden; }
.ep-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ep-id { flex: 1; min-width: 260px; }
.ep-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ep-name h1 { margin: 0; font-size: 24px; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; }
.ep-meta { display: flex; flex-wrap: wrap; gap: 2px 0; margin-top: 3px; font-size: 13px; color: var(--ink-soft); }
.ep-meta > span:not(:last-child)::after { content: "·"; margin: 0 7px; color: #c7c7cc; }
.ep-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ep-asof { margin: 0; font-size: 12px; color: var(--ink-soft); }
.ep-asof input { height: 30px !important; font-size: 13px; padding: 0 6px; margin-left: 4px; }
.ep-menu { min-width: 250px; }
.ep-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.ep-menu a.danger { color: #b3261e; }
.ep-menu a.danger:hover { background: #fee2e2; color: #991b1b; }
.ep-notice { margin-bottom: 10px; padding: 8px 14px; }

/* user 2026-10-04: the employee page's bars stay in their place (no longer stuck to the top while scrolling — on phones
   they followed the page up and down and covered ~140px of the screen) */
.ep-tabs { position: relative; z-index: 5; display: flex; gap: 2px; overflow-x: auto; background: var(--page-bg);
    border-bottom: 1px solid var(--border); margin-bottom: 12px; scrollbar-width: none; }
.ep-tabs a { flex: none; padding: 9px 14px; font-weight: 600; font-size: 14px; color: var(--ink-soft); text-decoration: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ep-tabs a:hover { color: var(--ink); text-decoration: none; }
.ep-tabs a.on { color: var(--accent-dark); border-bottom-color: var(--accent); }
.ep-tabs .count { font-size: 11px; background: #efeff4; color: var(--ink-soft); border-radius: 8px; padding: 0 6px; margin-left: 2px; }

.ep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: var(--ep-gap); }
.ep-kpi { background: var(--card-bg); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05); padding: 8px 12px; min-width: 0; }
.ep-kpi-l { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-kpi-v { font-family: "Barlow Condensed", "Barlow", sans-serif; font-size: 22px; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.ep-kpi-v small { font-family: "Barlow", sans-serif; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.ep-kpi-v a { color: inherit; text-decoration: none; }
.ep-kpi-v.neg { color: #b3261e; } .ep-kpi-v.warn { color: #b45309; }
.ep-kpi-s { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ep-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ep-gap); align-items: start; }
.ep-stack { display: flex; flex-direction: column; gap: var(--ep-gap); min-width: 0; }
.ep-cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ep-gap); align-items: start; margin-bottom: var(--ep-gap); }
.ep-cols-pay { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2.4fr); gap: var(--ep-gap); align-items: start; }
.ep-hist { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--ep-gap); align-items: start; }
@media (max-width: 1200px) { .ep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ep-grid > .ep-stack { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ep-cols3 { grid-template-columns: 1fr 1fr; } .ep-cols3 > [style*="span 2"] { grid-column: 1 / -1 !important; } .ep-cols-pay, .ep-hist { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .ep-grid, .ep-cols3, .ep-grid > .ep-stack { grid-template-columns: 1fr; } .ep-head { padding: 10px 12px; } .ep-name h1 { font-size: 20px; } .ep-actions { width: 100%; } }

.ep-card { background: var(--card-bg); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05); padding: 10px 14px 12px; min-width: 0; scroll-margin-top: 50px; }
.ep-card h3, .ep-card h2 { font-size: 15px; margin: 0 0 6px; }
.ep-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.ep-card-h h2, .ep-card-h h3 { margin: 0; font-size: 15px; }
.ep-card-h > a, .ep-edit { font-size: 12px; font-weight: 600; color: var(--accent-dark); }
.ep-h3 { font-size: 15px; margin: 14px 0 6px; }
.ep-foot { font-size: 12px; color: var(--ink-soft); margin: 6px 0 0; }
.ep dl.ep-kv { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 3px 12px; margin: 0; font-size: 13.5px; line-height: 1.45; }
.ep dl.ep-kv dt { color: var(--ink-soft); font-size: 12.5px; }
.ep dl.ep-kv dd { margin: 0; overflow-wrap: anywhere; }
.ep dl.ep-kv .ep-sep { border-top: 1px dashed var(--border); padding-top: 4px; margin-top: 3px; }
.ep .np { font-size: 12.5px; }
.ep .num { text-align: right; font-variant-numeric: tabular-nums; }
.ep dl.ep-kv dd.num { text-align: left; }
.ep details.pf-more { margin-top: 8px; }

.ep-rp { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; font-size: 13px; }
.ep-rp .rp-chip { height: 30px; padding: 0 11px; font-size: 13px; }
.ep-rp input[type=date] { height: 30px; font-size: 13px; }
.ep-rp-lbl { color: var(--ink-soft); margin-right: 2px; }
.ep-rp-cmp { display: inline-flex; gap: 4px; align-items: center; color: var(--ink-soft); margin-left: 6px; }
.ep-rp-range { color: var(--ink-soft); margin-left: auto; }

main .ep table.report-table.ep-dense { table-layout: auto; overflow: visible; border-radius: 8px; box-shadow: none; border: 1px solid var(--border); }
main .ep .ep-card table.report-table.ep-dense { border: none; }
main .ep table.report-table.ep-dense th, main .ep table.report-table.ep-dense td { padding: 5px 9px; font-size: 13px; line-height: 1.35; vertical-align: top; }
main .ep table.report-table.ep-dense thead th { background: #f3f3f6; color: var(--ink-soft); font-family: "Barlow", sans-serif; font-size: 12px; font-weight: 700;
    position: sticky; top: 0; z-index: 1; white-space: nowrap; }
main .ep table.report-table.ep-dense thead th.sortable-th:hover { background: #e8e8ee; color: var(--ink); }
main .ep table.report-table.ep-dense tfoot th { font-size: 12.5px; padding: 6px 9px; background: #fafafa; text-align: left; }
main .ep table.report-table.ep-dense select, main .ep table.report-table.ep-dense input { height: 28px; font-size: 13px; padding: 0 6px; }
main .ep table.report-table.ep-dense .btn.small { height: 28px; padding: 0 10px; }
main .ep table.report-table.ep-dense + .empty, .ep .empty { font-size: 13px; color: var(--ink-soft); margin: 6px 0; }
.ep-comp span { font-size: 12.5px; }
.ep-inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.ep-inline input, .ep-inline select { height: 30px; font-size: 13px; }

.ep-tl { list-style: none; margin: 0; padding: 0; }
.ep-tl li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px; padding: 4px 0 4px 12px; font-size: 13px; line-height: 1.4;
    border-bottom: 1px solid #f0f0f3; position: relative; overflow-wrap: anywhere; }
.ep-tl li:last-child { border-bottom: none; }
.ep-tl li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: #c7c7cc; }
.ep-tl li.tl-hire::before { background: #16a34a; } .ep-tl li.tl-end::before { background: #dc2626; }
.ep-tl li.tl-pay::before { background: var(--accent); } .ep-tl li.tl-role::before { background: #6366f1; }
.ep-tl-d { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.ev { display: inline-block; padding: 0 7px; border-radius: 8px; font-size: 12px; font-weight: 600; background: #efeff4; color: #48484a; white-space: nowrap; }
.ev-absence { background: #fee2e2; color: #991b1b; }
.ev-excused_absence, .ev-sick_absence { background: #fff3cd; color: #8a6d00; }
.ev-vacation { background: #dcfce7; color: #166534; }
.ev-lateness, .ev-dayoff_or_lateness { background: #ffedd5; color: #9a3412; }
.ev-dayoff { background: #e0e7ff; color: #3730a3; }
@media print { .ep-tabs, .ep-actions { display: none !important; } .ep-panel[hidden] { display: block !important; } }
main .ep table.report-table.ep-dense td:first-child { white-space: nowrap; }
main .ep table.report-table.ep-dense th.num, main .ep table.report-table.ep-dense td.num { text-align: right; }
main .ep table.report-table.ep-dense thead th { white-space: normal; }
main .ep table.report-table.ep-dense input[type=date] { width: 132px; }
main .ep table.report-table.ep-dense select { width: auto; max-width: 150px; }
.ep-comp span { display: block; }
.ep-comp span { white-space: nowrap; }
main .ep table.report-table.ep-dense thead th { overflow-wrap: normal; word-break: normal; }
.ep-card { overflow-x: auto; }
/* user 2026-10-04 («drag it up and down — it still moves»): a sideways scroller is also scrollable up and down by
   the CSS rules, so 1px of extra height let its content slide under a finger; they scroll sideways only now (menus
   inside them open with position: fixed — static/js/hr_controls.js) */
.ep-tabs, .ep-card, .grid-wrap, .tbl-scroll, .users-list, .board { overflow-y: hidden; }
.ep-hist { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
@media (max-width: 1100px) { .ep-hist { grid-template-columns: 1fr; } }
#documents.ep-card { overflow: visible; }
main .ep .ep-card table.report-table.ep-dense thead th { position: static; }
main .ep table.report-table.ep-dense input[type=date] { width: 122px; }
main .ep table.report-table.ep-dense select { max-width: 110px; }

/* ---- profile: merged info card with in-place editing ---- */
.ep-grid > .ep-info { grid-column: span 2; }
.ep-info-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 22px; }
.ep-sub { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 2px 0 4px; }
@media (max-width: 720px) { .ep-grid > .ep-info { grid-column: auto; } .ep-info-cols { grid-template-columns: 1fr; } }
.ep-info dl.ep-kv { align-items: center; gap: 1px 10px; }
.ep-info dl.ep-kv dt { padding: 4px 0; }
.ie { position: relative; display: flex; align-items: center; }
main .ep .ie :is(input,select,textarea).ie-f { width: 100%; height: 28px; min-height: 28px; padding: 3px 24px 3px 6px; margin: 0 0 0 -7px;
    border: 1px solid transparent; border-radius: 5px; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink);
    box-shadow: none; transition: border-color .12s, background .12s; }
main .ep .ie select.ie-f { appearance: none; -webkit-appearance: none; cursor: pointer; background-image: none; }
main .ep .ie textarea.ie-f { resize: none; overflow: hidden; line-height: 1.4; height: auto; }
.ie input::placeholder, .ie textarea::placeholder { color: #a1a1a6; font-style: italic; font-size: 12.5px; }
.ie input[type=date]:invalid, .ie input[type=date][value=""] { color: #a1a1a6; }
main .ep .ie:hover :is(input,select,textarea).ie-f { background: #f5f5f7; }
main .ep .ie :is(input,select,textarea).ie-f:focus { background: #fff; border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(255,102,0,.12); }
main .ep .ie:hover select.ie-f { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e6e73' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center; }
.ie-st { position: absolute; right: 6px; font-size: 12px; font-weight: 700; pointer-events: none; }
.ie.saving .ie-st::after { content: "…"; color: var(--ink-soft); }
.ie.saved .ie-st::after { content: "✓"; color: #16a34a; }
main .ep .ie.err :is(input,select,textarea).ie-f { border-color: #dc2626; background: #fff5f5; }
.ie.err .ie-st::after { content: "!"; color: #dc2626; }
.ie-msg { font-size: 12px; line-height: 1.35; margin: 2px 0 2px; }
.ie-msg.err { color: #b3261e; } .ie-msg.ok { color: var(--ink-soft); }
.ie-hint { font-size: 12px; color: var(--ink-soft); }
main .ep .ie :is(input,select,textarea).ie-f { height: 26px; min-height: 26px; }
.ep-info dl.ep-kv dt { padding: 3px 0; }
main .ep .ie.ie-empty input[type=date].ie-f:not(:focus) { color: #a1a1a6; }

/* ---- site-wide controls: Armenian date picker + dropdown (static/js/hr_controls.js) ---- */
.hc-hidden { display: none !important; }
button.hc-sel {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; min-width: 120px; max-width: 100%;
    padding: 0 10px 0 12px; background: #fff; color: var(--ink); border: 1px solid var(--border); border-radius: 6px;
    font-weight: 600; font-size: 14px; text-align: left; cursor: pointer; box-shadow: none;
}
label > button.hc-sel, .stack button.hc-sel, form p button.hc-sel { width: 100%; }
button.hc-sel:hover { background: var(--accent-light); border-color: var(--accent); color: var(--ink); }
button.hc-sel:focus-visible, button.hc-sel[aria-expanded="true"] { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
button.hc-sel:disabled { background: #f5f5f7; color: var(--ink-soft); cursor: default; }
button.hc-sel.hc-bad { border-color: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
.hc-sel-t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hc-sel-t.is-empty { color: var(--ink-soft); font-weight: 500; }
button.hc-sel svg { flex: none; width: 12px; height: 12px; color: var(--ink-soft); transition: transform .15s; }
button.hc-sel[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--accent); }

.hc-date { position: relative; display: inline-flex; align-items: center; width: 170px; max-width: 100%; }
label > .hc-date, .stack .hc-date { width: 100%; }
.hc-date input.hc-date-text { width: 100%; padding-right: 34px; }
.hc-date input.hc-date-text.hc-bad { border-color: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
.hc-date button.hc-date-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; padding: 0;
    display: grid; place-items: center; background: transparent; color: var(--ink-soft); border-radius: 5px; }
.hc-date button.hc-date-btn:hover, .hc-date.open button.hc-date-btn { background: var(--accent-light); color: var(--accent); }
.hc-date button.hc-date-btn svg { width: 15px; height: 15px; }

.hc-pop { position: fixed; z-index: 1000; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,.16); animation: ms-in .12s ease-out; font-size: 14px; }
.hc-list { max-width: 360px; overflow: hidden; }
.hc-opts { max-height: 280px; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; }
.hc-opts > * { flex: none; }  /* long lists scroll; without this the options shrink and their text overlaps */
.hc-pop button.hc-opt { display: block; width: 100%; padding: 7px 10px 7px 28px; border-radius: 6px; background: none; color: var(--ink);
    font-weight: 500; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.hc-pop button.hc-opt:hover, .hc-pop button.hc-opt:focus { background: var(--accent-light); outline: none; color: var(--ink); }
.hc-pop button.hc-opt.on { font-weight: 700; }
.hc-pop button.hc-opt.on::before { content: ""; position: absolute; left: 11px; top: 50%; width: 4px; height: 8px; margin-top: -6px;
    border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.hc-pop button.hc-opt.is-empty { color: var(--ink-soft); }
.hc-cal { width: 272px; padding: 10px; }
.hc-cal-h { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.hc-cal-h button { width: 28px; height: 28px; padding: 0; background: none; color: var(--ink); font-size: 18px; line-height: 1; border-radius: 6px; }
.hc-cal-h button:hover { background: var(--accent-light); color: var(--accent); }
.hc-cal-h select { height: 28px; padding: 0 22px 0 8px; font-size: 13px; background-position: right 6px center; border: 1px solid transparent; }
.hc-cal-h select:hover { border-color: var(--border); }
.hc-cal-h .hc-m { flex: 1; }
.hc-cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.hc-cal-g .rc-day { height: 32px; padding: 0; border: none; background: none; color: var(--ink); font-weight: 500; font-size: 13px; border-radius: 6px; cursor: pointer; }
.hc-cal-g .rc-day:hover:not(:disabled):not(.rc-empty) { background: var(--accent-light); }
.hc-cal-g .rc-day:disabled { color: #c7c7cc; cursor: default; }
.hc-cal-g .rc-day.hc-today { box-shadow: inset 0 0 0 1px var(--accent); }
.hc-cal-g .rc-day.rc-endpoint { background: var(--accent); color: #fff; font-weight: 700; }
.hc-cal-f { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.hc-cal-f button { height: 28px; padding: 0 10px; background: none; color: var(--accent-dark); font-size: 13px; }
.hc-cal-f button:hover { background: var(--accent-light); color: var(--accent-dark); }

/* ---- profile info card: fields look like fields (editable), status mark outside ---- */
main .ep .ie { padding-right: 18px; }
main .ep .ie :is(input.ie-f, textarea.ie-f, button.hc-sel, input.hc-date-text) {
    width: 100%; height: 32px; min-height: 32px; margin: 0; padding: 0 10px; background: #fff; color: var(--ink);
    border: 1px solid var(--border); border-radius: 6px; font-size: 13.5px; font-weight: 500; box-shadow: none; }
main .ep .ie textarea.ie-f { height: auto; padding: 6px 10px; line-height: 1.4; }
main .ep .ie button.hc-sel { padding: 0 8px 0 10px; }
main .ep .ie .hc-date { width: 100%; }
main .ep .ie input.hc-date-text { padding-right: 34px; }
main .ep .ie :is(input.ie-f, textarea.ie-f, button.hc-sel, input.hc-date-text):hover { border-color: var(--accent); background: #fff; }
main .ep .ie :is(input.ie-f, textarea.ie-f, input.hc-date-text):focus, main .ep .ie button.hc-sel[aria-expanded="true"] {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); outline: none; }
main .ep .ie.err :is(input.ie-f, textarea.ie-f, button.hc-sel, input.hc-date-text) { border-color: #dc2626; background: #fff5f5; }
main .ep .ie .ie-st { right: 0; }
main .ep .ie.ie-empty input.hc-date-text::placeholder, main .ep .ie input.ie-f::placeholder { color: #a1a1a6; font-style: normal; }
.ep-info dl.ep-kv { gap: 4px 10px; }
.ep-avatar.can-edit { cursor: pointer; position: relative; }
.ep-avatar.can-edit::after { content: "✎"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45);
    color: #fff; font-size: 16px; opacity: 0; transition: opacity .15s; border-radius: 50%; }
.ep-avatar.can-edit:hover::after { opacity: 1; }
.ep-asof label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ep-asof .hc-date { width: 140px; }
.ep-asof .hc-date input.hc-date-text { height: 30px; font-size: 13px; }

/* ---- terminate: red action + drawer form ---- */
.btn.red, button.btn.red { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn.red:hover, button.btn.red:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.term-h { display: flex; gap: 12px; align-items: center; margin: 0 30px 14px 0; }
.term-h h2 { margin: 0; font-size: 20px; }
.term-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fee2e2; color: #b91c1c; font-weight: 800; font-size: 18px; }
.term-ic.ok { background: #dcfce7; color: #15803d; }
.term-sum { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 16px; padding: 10px 12px; background: #f7f7f9; border-radius: 8px; font-size: 13.5px; }
.term-sum dt { color: var(--ink-soft); } .term-sum dd { margin: 0; }
.term-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
button.term-chip { height: 26px; padding: 0 10px; border-radius: 13px; background: #f3f3f6; color: var(--ink); font-size: 12.5px; font-weight: 500; border: 1px solid transparent; }
button.term-chip:hover { background: var(--accent-light); border-color: var(--accent); color: var(--ink); }
.term-note { font-size: 12.5px; color: var(--ink-soft); background: #fff8eb; border-radius: 8px; padding: 8px 10px; margin: 4px 0 0; }
.term-box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.term-box h3 { margin: 0 0 6px; font-size: 15px; }
.term-box p { font-size: 13.5px; margin: 0 0 10px; }
.ep-docs { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.ep-docs .ep-card-h > span { font-size: 12px; font-weight: 600; }
.ep-card.ep-info { overflow: visible; }

/* ---- journal: colours instead of letters + popover next to the cell ---- */
.k-vac { --k: #bbf7d0; --kt: #166534; }
.k-abs { --k: #fca5a5; --kt: #7f1d1d; }
.k-exc { --k: #fde68a; --kt: #78350f; }
.k-late { --k: #fed7aa; --kt: #9a3412; }
.k-doff { --k: #c7d2fe; --kt: #312e81; }
.k-min { --k: #fde2c4; --kt: #7c2d12; }
.k-tol { --k: #e5e7eb; --kt: #4b5563; }
.k-ot { --k: #e9d5ff; --kt: #581c87; }
.k-none { --k: #f3f4f6; --kt: #6b7280; }
i.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--k, #fff); border: 1px solid rgba(0,0,0,.08); vertical-align: -1px; flex: none; }
table.grid td.cell[class*=" k-"] { background: var(--k); color: var(--kt); font-weight: 700; font-size: 11px; }
table.grid td.cell.off[class*=" k-"] { background: var(--k); }
table.grid td.cell.multi { box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
table.grid td.cell.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
table.grid tr:first-child th i.sw { border-color: rgba(255,255,255,.7); }
.att-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12.5px; margin: 0 0 10px; }
.att-legend span { display: inline-flex; gap: 6px; align-items: center; }

.cell-panel.hc-pop { right: auto; bottom: auto; width: 300px; max-height: 80vh; overflow: auto; padding: 12px; }
.cp-h { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.cp-h strong { font-size: 14px; }
button.cp-x { width: 26px; height: 26px; padding: 0; background: none; color: var(--ink-soft); border-radius: 6px; font-size: 13px; }
button.cp-x:hover { background: var(--accent-light); color: var(--accent); }
.cp-err { background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 6px 8px; font-size: 12.5px; margin-bottom: 8px; }
.cp-events { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.cp-ev { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cp-ev-t { flex: 1; min-width: 0; }
.cp-del { display: flex; gap: 4px; align-items: center; margin: 0; }
.cp-del input { width: 90px; height: 26px; font-size: 12px; padding: 0 6px; }
.cp-del button { width: 24px; height: 24px; padding: 0; background: none; color: #b91c1c; border-radius: 6px; font-size: 12px; }
.cp-del button:hover { background: #fee2e2; color: #991b1b; }
.cp-opts { display: flex; flex-direction: column; gap: 4px; }
.cp-opts form { margin: 0; }
button.cp-opt { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; background: #fff; color: var(--ink);
    border: 1px solid var(--border); border-radius: 6px; font-weight: 600; font-size: 13.5px; text-align: left; }
button.cp-opt:hover:not(:disabled) { background: var(--accent-light); border-color: var(--accent); color: var(--ink); }
button.cp-opt:disabled { opacity: .45; cursor: default; }
.cp-min { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: 6px; font-weight: 600; font-size: 13.5px; }
.cp-min:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.cp-min span:first-of-type { flex: 1; }
.cp-min input { width: 72px; height: 26px !important; padding: 0 6px; font-size: 13px; }
.cp-hint { font-size: 10.5px; color: var(--ink-soft); font-weight: 500; }
input.cp-note { width: 100%; height: 30px !important; font-size: 12.5px; margin-top: 4px; }
.term label.term-check { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; color: var(--ink); font-size: 13.5px; }
.term label.term-check input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; }

/* ---- structure: tree org chart (Director → departments → sub-departments) ---- */
.org-asof { margin: 0; } .org-asof label { display: flex; align-items: center; gap: 8px; }
.org-asof .hc-date { width: 150px; }
.org-zoom { display: inline-flex; gap: 4px; margin-right: 6px; }
.org-zoom .btn { width: 34px; padding: 0; justify-content: center; }
.org-wrap { overflow: auto; background: var(--card-bg); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 22px 12px 26px; }
.org-chart { width: max-content; min-width: 100%; }
.org-tree, .org-tree ul { display: flex; justify-content: center; margin: 0; padding: 0; list-style: none; }
.org-tree ul { padding-top: 22px; position: relative; }
.org-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 7px 0; list-style: none; }
.org-tree > li { padding-top: 0; }
.org-tree li::before, .org-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid #d4d6dc; }
.org-tree li::after { right: auto; left: 50%; border-left: 2px solid #d4d6dc; }
.org-tree li:only-child::before, .org-tree li:only-child::after { display: none; }
.org-tree li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-right: 2px solid #d4d6dc; border-radius: 0 8px 0 0; }
.org-tree li:first-child::after { border-radius: 8px 0 0 0; }
.org-tree > li::before, .org-tree > li::after { display: none; }
.org-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid #d4d6dc; }
.org-node { position: relative; width: 196px; padding: 10px 12px 12px; background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--accent);
    border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); text-align: left; cursor: pointer; transition: box-shadow .12s, border-color .12s, transform .12s; }
.org-node:hover, .org-node:focus-visible { box-shadow: 0 6px 18px rgba(0,0,0,.12); border-color: var(--accent); outline: none; transform: translateY(-1px); }
.org-node.inactive { opacity: .55; border-top-color: #c7c7cc; }
.org-root { cursor: default; background: var(--ink); color: #fff; border-color: var(--ink); text-align: center; width: 160px; }
.org-root:hover { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-color: var(--ink); }
.org-root .on-meta { color: rgba(255,255,255,.7); }
.on-name { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 16px; line-height: 1.2; }
.on-head { font-size: 12.5px; margin-top: 3px; color: var(--ink); }
.on-head::before { content: "👤 "; }
.on-head.vacant { color: #b45309; font-weight: 600; }
.on-pos { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.on-pos span { font-size: 11.5px; background: #f3f3f6; border-radius: 10px; padding: 1px 8px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.on-pos b { color: var(--ink); }
.on-pos i { font-style: normal; color: #b45309; font-weight: 700; margin-left: 1px; }
.on-meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 7px; }
.on-vac { color: #b45309; font-weight: 600; }
.org-node button.on-add { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); width: 22px; height: 22px; padding: 0; border-radius: 50%;
    background: #fff; color: var(--accent); border: 1px solid var(--accent); font-size: 15px; line-height: 20px; opacity: 0; transition: opacity .12s; z-index: 2; }
.org-node:hover button.on-add, .org-node:focus-within button.on-add { opacity: 1; }
.org-node button.on-add:hover { background: var(--accent); color: #fff; }
.org-inactive { display: flex; flex-wrap: wrap; gap: 6px; }
.org-add { width: 300px; padding: 12px; }
.org-add label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.org-add input { width: 100%; }
.org-add-parent { margin: 6px 0; }
.org-add-err { color: #b3261e; font-size: 12.5px; }

.drawer-panel.dp-panel { width: min(620px, 100%); }
.dp-h h2 { margin: 0 34px 2px 0; }
.dp-sec { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.dp-sec:first-of-type { border-top: none; }
.dp .ep-sub { margin-bottom: 8px; }
.dp-danger { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pt { display: flex; flex-direction: column; gap: 10px; position: relative; }
.pt.saving::after { content: "պահվում է…"; position: absolute; right: 0; top: -24px; font-size: 12px; color: var(--ink-soft); }
.pt.saved::after { content: "✓ պահված"; position: absolute; right: 0; top: -24px; font-size: 12px; color: #16a34a; }
.pt.err::after { content: "չհաջողվեց պահպանել"; position: absolute; right: 0; top: -24px; font-size: 12px; color: #b3261e; }
.pt-t { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pt-th { display: flex; align-items: center; background: #f7f7f9; border-bottom: 1px solid var(--border); }
.pt input { border: none; border-radius: 0; height: 30px !important; padding: 0 10px; font-size: 13px; background: transparent; box-shadow: none; }
.pt input:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--accent-light); }
.pt input.pt-title { flex: 1; font-weight: 700; }
.pt-r { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; border-bottom: 1px solid #f0f0f3; }
.pt-r input + input { border-left: 1px solid #f0f0f3; }
.pt button.pt-x { width: 30px; height: 30px; padding: 0; background: none; color: #a1a1a6; font-size: 12px; border-radius: 0; }
.pt button.pt-x:hover { background: #fee2e2; color: #b91c1c; }
.pt button.pt-addrow { width: 100%; height: 28px; padding: 0 10px; background: none; color: var(--accent-dark); font-size: 12.5px; text-align: left; border-radius: 0; }
.pt button.pt-addrow:hover { background: var(--accent-light); }
.pt .pt-add { align-self: flex-start; }

/* ---- profile tabs: personal / employment ---- */
.ep-cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ep-gap); align-items: start; }
@media (max-width: 1000px) { .ep-cols-2 { grid-template-columns: 1fr; } }
.ep-cols-2 > .ep-card.ep-info, .ep-stack > .ep-card.ep-info { overflow: visible; }
.ep-sub-rec { position: relative; padding: 8px 26px 8px 0; border-bottom: 1px dashed var(--border); }
.ep-sub-rec:last-of-type { border-bottom: none; }
button.ep-rec-del { position: absolute; top: 10px; right: 0; width: 22px; height: 22px; padding: 0; background: none; color: #a1a1a6; font-size: 12px; border-radius: 6px; }
button.ep-rec-del:hover { background: #fee2e2; color: #b91c1c; }
form.ep-rec-new { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
form.ep-rec-new input, form.ep-rec-new select { height: 32px; font-size: 13px; flex: 1 1 120px; min-width: 0; }
form.ep-rec-new button.hc-sel { height: 32px; flex: 1 1 130px; font-size: 13px; }
ul.ep-check { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
ul.ep-check li { display: flex; gap: 8px; align-items: baseline; }
ul.ep-check li span { width: 18px; height: 18px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
ul.ep-check li.ok span { background: #dcfce7; color: #15803d; }
ul.ep-check li.todo span { background: #fef3c7; color: #b45309; }
ul.ep-check em { color: var(--ink-soft); font-style: normal; font-size: 12px; }
.ep-bank { margin-bottom: var(--ep-gap); max-width: 640px; }

/* ---- structure catalogues: positions, grades, schedules ---- */
form.cat-new { max-width: 760px; margin: 0 0 12px; border-top: none; padding-top: 0; }
main .ep table.cat-table td { vertical-align: middle; }
main .ep table.cat-table .ie { padding-right: 16px; }
main .ep table.cat-table .ie :is(input.ie-f) { height: 30px; min-height: 30px; }
.cat-act { white-space: nowrap; }
form.cat-merge { display: inline-flex; gap: 4px; align-items: center; margin: 0 4px 0 0; }
form.cat-merge button.hc-sel { height: 28px; min-width: 0; width: 150px; font-size: 12.5px; padding: 0 6px 0 8px; }
.sched-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.sched-card .sched-week { font-size: 13.5px; margin: 2px 0; }
.drawer-panel.sched-panel { width: min(760px, 100%); }
.sched-title { margin: 0 34px 12px 0; }
.sched-top { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sched-top label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; }
.sched-weeks-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
button.sched-tab { height: 30px; padding: 0 12px; background: #f3f3f6; color: var(--ink); border-radius: 6px; font-size: 13px; }
button.sched-tab.on { background: var(--accent); color: #fff; }
table.sched-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sched-grid th { text-align: left; font-size: 12px; color: var(--ink-soft); padding: 4px; border-bottom: 1px solid var(--border); font-weight: 700; }
table.sched-grid td { padding: 3px 4px; border-bottom: 1px solid #f0f0f3; }
table.sched-grid tr.off td { color: #a1a1a6; }
table.sched-grid input:not([type=checkbox]) { width: 100%; height: 30px !important; padding: 0 6px; font-size: 13px; }
table.sched-grid input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
table.sched-grid td:nth-child(3), table.sched-grid td:nth-child(4) { width: 76px; }
table.sched-grid td:nth-child(5), table.sched-grid td:nth-child(6), table.sched-grid td:nth-child(7) { width: 70px; }
table.sched-grid tfoot td { font-weight: 700; border-bottom: none; padding-top: 8px; }
.sched-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.sched-err { color: #b3261e; font-size: 13px; min-height: 18px; margin: 6px 0; }
main .ep table.cat-pos { max-width: 1100px; }
main .ep table.cat-pos .c-name { width: 28%; } main .ep table.cat-pos .c-n { width: 100px; } main .ep table.cat-pos .c-act { width: 210px; }
main .ep table.cat-pos tr.cat-group td { background: #f7f7f9; font-weight: 700; font-size: 13px; padding-top: 8px; }
main .ep table.cat-pos .cat-act { text-align: right; }
.cat-merge-pop { padding: 12px; min-width: 300px; text-align: left; }
.cat-merge-pop form.cat-merge { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0; }
.cat-merge-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.cat-merge-pop form.cat-merge button.hc-sel { width: 100%; height: 34px; font-size: 13px; }
.menu-body.cat-merge-pop button.btn { display: inline-flex; justify-content: center; width: auto; background: var(--accent); color: #fff; padding: 0 14px; height: 32px; }
.menu-body.cat-merge-pop button.btn:hover { background: var(--accent-dark); color: #fff; }
.menu-body.cat-merge-pop button.hc-sel { display: inline-flex; background: #fff; padding: 0 8px 0 10px; border: 1px solid var(--border); }
.sched-for { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.sched-depts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 12px; padding: 10px 12px; background: #f7f7f9; border-radius: 8px; }
.sched-depts .ep-sub { width: 100%; margin: 0 0 2px; }
.sched-depts label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink); }
.sched-depts input { width: 16px; height: 16px; accent-color: var(--accent); }
main .ep table.cat-pos td.num .ie { max-width: 90px; margin-left: auto; }
main .ep table.cat-pos td.num input.ie-f { text-align: right; }
.org-node button.on-name { display: block; width: 100%; padding: 0; background: none; color: var(--ink); text-align: left; border-radius: 4px;
    font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 16px; line-height: 1.2; }
.org-node button.on-name:hover { color: var(--accent-dark); text-decoration: underline; background: none; }
.org-node .on-head { display: inline-block; font-size: 12.5px; margin-top: 3px; color: var(--ink); text-decoration: none; padding: 0; background: none; font-weight: 500; }
.org-node a.on-head:hover { color: var(--accent-dark); text-decoration: underline; }
.org-node button.on-head.vacant { color: #b45309; font-weight: 600; height: auto; }
.org-node button.on-head.vacant:hover { text-decoration: underline; background: none; }
.org-node .on-pos a { font-size: 11.5px; background: #f3f3f6; border-radius: 10px; padding: 1px 8px; white-space: nowrap; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; color: var(--ink); text-decoration: none; }
.org-node .on-pos a:hover { background: var(--accent-light); color: var(--accent-dark); }
.org-node .on-pos b { color: var(--ink); } .org-node .on-pos i { font-style: normal; color: #b45309; font-weight: 700; margin-left: 1px; }
.org-node .on-meta a { color: var(--ink-soft); text-decoration: none; } .org-node .on-meta a:hover { color: var(--accent-dark); text-decoration: underline; }
main .ep table.cat-dept { max-width: 1200px; }
main .ep table.cat-dept td { vertical-align: middle; }
.org-node .on-warn { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: #fef3c7; color: #b45309;
    font-size: 11px; font-weight: 800; display: grid; place-items: center; cursor: help; }
.org-warn div { margin-top: 2px; }
.org-node .on-warn ~ * { } .org-node:has(.on-warn) button.on-name { padding-right: 20px; }
main .ep table .c-drag { width: 28px; padding-left: 4px !important; padding-right: 0 !important; }
.drag { cursor: grab; color: #a1a1a6; font-size: 16px; user-select: none; padding: 0 4px; }
.drag:hover { color: var(--accent); }
tr.dragging td { background: var(--accent-light) !important; opacity: .75; }
main .ep table.cat-dept td.lvl { padding-left: calc(9px + var(--lvl, 0) * 22px) !important; position: relative; }
main .ep table.cat-dept td.lvl .lvl-mark { position: absolute; left: calc(var(--lvl, 0) * 22px - 8px); top: 50%; transform: translateY(-50%); color: #b0b0b6; }
main .ep table.cat-dept .c-act2 { width: 150px; } main .ep table.cat-dept td.cat-act { white-space: nowrap; text-align: right; }
main .ep table.cat-pos .c-act { width: 230px; }
.btn:disabled, button.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ---- tables: resizable columns, sort state ---- */
.report-table thead th { position: relative; }
main .ep table.report-table.ep-dense thead th { position: sticky; }
.col-resize { position: absolute; top: 0; right: -3px; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; }
.col-resize:hover, body.col-resizing .col-resize:hover { background: rgba(255,255,255,.35); }
main .ep table.ep-dense .col-resize:hover { background: rgba(0,0,0,.08); }
body.col-resizing { cursor: col-resize; user-select: none; }
.report-table[style*="fixed"] td, .report-table[style*="fixed"] th { overflow: hidden; text-overflow: ellipsis; }
.report-table[style*="fixed"] td .ie, .report-table[style*="fixed"] td button.hc-sel { max-width: 100%; }
tbody.is-sorted .drag { visibility: hidden; }
.sort-back { margin: 0 0 8px; }
/* departments: the name column has room for long / nested names */
main .ep table.cat-dept th:nth-child(2) { width: 30%; }
main .ep table.cat-dept td.lvl .ie { min-width: 180px; }
main .ep table.cat-dept td .ie :is(input.ie-f, button.hc-sel) { text-overflow: ellipsis; }
.tbl-scroll { overflow-x: auto; max-width: 100%; }
main .ep table.report-table.cat-dept { table-layout: fixed; width: 100%; max-width: none; }
main .ep table.cat-dept th.c-drag { width: 30px; }
main .ep table.cat-dept th:nth-child(2) { width: auto; }
main .ep table.cat-dept th:nth-child(3) { width: 21%; }
main .ep table.cat-dept th:nth-child(4) { width: 16%; }
main .ep table.cat-dept th:nth-child(5) { width: 16%; }
main .ep table.cat-dept th:nth-child(6) { width: 80px; }
main .ep table.cat-dept th:nth-child(7) { width: 150px; }
main .ep table.cat-dept td .ie, main .ep table.cat-dept td.lvl .ie { min-width: 0; width: 100%; }
main .ep table.cat-dept td button.hc-sel { width: 100%; min-width: 0; }
main .ep table.cat-dept th:nth-child(3) { width: 17%; }
main .ep table.cat-dept th:nth-child(4), main .ep table.cat-dept th:nth-child(5) { width: 13.5%; }
main .ep table.cat-dept th:nth-child(6) { width: 70px; }
main .ep table.cat-dept th:nth-child(7) { width: 142px; }
.org-node a.on-head.inherited { color: var(--ink-soft); }
.org-node a.on-head.inherited small { font-size: 10.5px; }
a.edit-link { color: inherit; text-decoration: none; border-bottom: 1px dashed #c7c7cc; }
a.edit-link:hover { color: var(--accent-dark); border-bottom-color: var(--accent); }

/* ---- undo: ↶ button (top left) + popup ---- */
.sb-head { gap: 6px; }
.sb-head .sb-brand { flex: 1; min-width: 0; }
button.sb-undo { width: 28px; height: 28px; padding: 0; border-radius: 6px; background: rgba(255,255,255,.08); color: #fff; font-size: 16px; line-height: 1; flex: none; }
button.sb-undo:hover:not(:disabled) { background: var(--accent); }
button.sb-undo:disabled { opacity: .35; cursor: default; }
button.sb-undo.mobile { margin-left: auto; }
html.sb-collapsed .sb-head { flex-direction: column; justify-content: center; height: auto; padding: 10px 0; gap: 8px; }
.modal { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.35); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { width: min(440px, 100%); background: #fff; border-radius: 14px; padding: 20px 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: ms-in .12s ease-out; }
.modal-card h2 { margin: 0 0 10px; font-size: 18px; }
.modal-body p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.modal-body .undo-what { font-weight: 700; font-size: 15px; background: #f7f7f9; border-radius: 8px; padding: 8px 10px; }
.modal-body .undo-when { color: var(--ink-soft); font-size: 12.5px; }
.modal-body .undo-no { color: #b3261e; } .modal-body .undo-ok { color: #15803d; font-weight: 700; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ---- employee page v2: overview summary + one "Data" tab with colored sections ---- */
.ep-tabs { align-items: center; }
.ep-tabs .ep-asof { margin-left: auto; padding-left: 12px; flex: none; }
.ep-contacts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: 13px; }
.ep-contacts a { color: var(--accent-dark); text-decoration: none; white-space: nowrap; }
.ep-contacts a:hover { text-decoration: underline; }
.ep-attn { text-decoration: none; }
a.ep-kpi { color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.ep-kpi:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); transform: translateY(-1px); text-decoration: none; }
.ep-kpi-v .np { font-size: 16px; color: #b45309; }
.ep-ov { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ep-gap); align-items: start; }
.ep-ov-wide { grid-column: 1 / -1; }
@media (max-width: 1100px) { .ep-ov { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .ep-ov { grid-template-columns: 1fr; } }
.ep-dates { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.ep-dates li { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 8px; padding: 5px 0 5px 10px; border-bottom: 1px solid #f0f0f3; border-left: 3px solid #c7c7cc; margin-bottom: 2px; }
.ep-dates li:last-child { border-bottom: none; }
.ep-dates li.warn { border-left-color: #f59e0b; } .ep-dates li.bday { border-left-color: #ec4899; }
.ep-dates li.anniv { border-left-color: #16a34a; } .ep-dates li.doc { border-left-color: #6366f1; }
.ep-dates em { font-style: normal; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.ep-date-d { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.ep-alerts { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.ep-alerts li { padding: 6px 10px; margin-bottom: 5px; background: #fffbeb; border-left: 3px solid #f59e0b; border-radius: 4px; line-height: 1.45; }
.ep-alerts li:last-child { margin-bottom: 0; }
.ep-ok { color: #15803d; font-weight: 600; font-size: 13.5px; margin: 4px 0; }
.ep-facts dd { font-weight: 500; }

.ep-secnav { position: relative; z-index: 4; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 6px 0 8px; background: var(--page-bg); }
.ep-secnav a { padding: 4px 12px; border-radius: 14px; background: var(--card-bg); box-shadow: 0 1px 2px rgba(0,0,0,.06); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.ep-secnav a:hover { background: var(--accent-light); color: var(--accent-dark); }
.ep-secnav .count { font-size: 11px; background: #efeff4; color: var(--ink-soft); border-radius: 8px; padding: 0 6px; }
.ep-secnav-note { margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.ep-sec { --sec: #64748b; --sec-bg: #f1f5f9; margin: 4px 0 18px; padding: 10px 12px 12px; border-radius: 10px; background: var(--sec-bg); border-top: 3px solid var(--sec); scroll-margin-top: 90px; }
.ep-sec.sec-personal { --sec: #0ea5e9; --sec-bg: #f0f9ff; }
.ep-sec.sec-work { --sec: #6366f1; --sec-bg: #f5f5ff; }
.ep-sec.sec-pay { --sec: #16a34a; --sec-bg: #f0fdf4; }
.ep-sec.sec-docs { --sec: #d97706; --sec-bg: #fffbeb; }
.ep-sec-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 17px; color: var(--sec); }
.ep-sec-h small { margin-left: auto; font-size: 12px; font-weight: 600; }
.ep-sub { font-size: 13px !important; font-weight: 700; color: var(--ink-soft); margin: 0 0 6px !important; }
.ep-sub-sep { margin-top: 12px !important; padding-top: 10px; border-top: 1px solid #ececf1; }
.ep-cols-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--ep-gap); align-items: start; }
@media (max-width: 1000px) { .ep-cols-2 { grid-template-columns: 1fr; } }
.ep-salary { font-family: "Barlow Condensed", "Barlow", sans-serif; font-size: 26px; font-weight: 700; }
.ep-salary small { font-family: "Barlow", sans-serif; font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.ep-salary .np { font-size: 16px; color: #b45309; }
.ep-tl-filter { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 10px; }
.ep-tl-filter button { height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--border); background: var(--card-bg); font-size: 12.5px; cursor: pointer; color: var(--ink-soft); }
.ep-tl-filter button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ep-tl li.tl-schedule::before { background: #0ea5e9; } .ep-tl li.tl-tax::before { background: #d97706; }
.ep-tl li[hidden] { display: none; }
a.ep-kpi, a.ep-kpi * { text-decoration: none !important; }
.ep-sec-h::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--sec); align-self: center; }

/* ---- settings → backups ---- */
.bk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.bk-head h2 { margin: 0 0 4px; }
.bk-head p { margin: 0; max-width: 720px; }
.bk-table { width: 100%; }
.bk-table th, .bk-table td { padding: 8px 14px; }
.bk-table th.num, .bk-table td.num { text-align: right; white-space: nowrap; }
.bk-status { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border-left: 4px solid; font-size: 14px; }
.bk-status.running { background: #eff6ff; border-color: #3b82f6; }
.bk-status.done { background: #f0fdf4; border-color: #16a34a; }
.bk-status.failed { background: #fef2f2; border-color: #dc2626; }
.bk-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid #93c5fd; border-top-color: #1d4ed8; border-radius: 50%; animation: bkspin .8s linear infinite; vertical-align: -1px; }
@keyframes bkspin { to { transform: rotate(360deg); } }
.bk-dialog { border: none; border-radius: 12px; padding: 20px 22px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.bk-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.bk-dialog h2 { margin: 0 0 6px; }
.bk-which { font-weight: 600; margin: 0 0 8px; }
.bk-warn { margin: 0 0 12px; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.bk-warn li { margin-bottom: 4px; }
.bk-check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; font-weight: 600; }
.bk-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ep-more { margin: 4px 0 2px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.ep-more a { color: var(--accent-dark); font-weight: 600; }
.ep-rp-out { display: inline-flex; gap: 6px; }
.ep-rp-out .btn.small { height: 30px; }
.ep-secnav a.on { background: var(--accent); color: #fff; }
.ep-secnav a.on .count { background: rgba(255,255,255,.25); color: #fff; }
.ep-secnav-all { border: 1px dashed var(--border); box-shadow: none !important; }
.ep-sec.ep-in { animation: epIn .18s ease-out; }
@keyframes epIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ep-sec[hidden] { display: none; }

/* ---- profile v3: overview in 2 columns, change log, buttons instead of text links ---- */
.ep-ov { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { .ep-ov { grid-template-columns: 1fr; } }
.ep .ep-facts { grid-template-columns: minmax(130px, max-content) minmax(0, 1fr); }
.ep .ep-facts dt { white-space: nowrap; }
.ep[data-cur]:not([data-cur="overview"]) .ep-meta,
.ep[data-cur]:not([data-cur="overview"]) .ep-contacts { display: none; }
.ep[data-cur]:not([data-cur="overview"]) .ep-head { padding-top: 10px; padding-bottom: 10px; }
.ep[data-cur]:not([data-cur="overview"]) .ep-avatar { width: 40px; height: 40px; }
.ep-chg { list-style: none; margin: 0; padding: 0; }
.ep-chg > li { padding: 7px 0 7px 12px; border-bottom: 1px solid #f0f0f3; border-left: 3px solid #c7c7cc; margin-bottom: 3px; font-size: 13px; }
.ep-chg > li:last-child { border-bottom: none; }
.ep-chg > li.chg-change { border-left-color: var(--accent); } .ep-chg > li.chg-add { border-left-color: #16a34a; } .ep-chg > li.chg-del { border-left-color: #dc2626; }
.ep-chg-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ep-chg-meta { margin-left: auto; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.ep-chg ul { margin: 3px 0 0; padding-left: 16px; color: var(--ink); }
.ep-chg ul li { margin: 1px 0; overflow-wrap: anywhere; }
.ep-card-h > a.btn, .ep-card-h > button.btn { font-size: 12px; }
.ep-alerts .btn.small { height: 26px; padding: 0 10px; margin-left: 4px; vertical-align: 1px; }
.ep-sec-actions { display: inline-flex; gap: 6px; align-items: center; }
.ep-sec-actions details.menu summary { list-style: none; }
.ep-sec-actions details.menu summary::-webkit-details-marker { display: none; }
.ep-doc { font-size: 13px; padding: 3px 0; }
.ep-more .btn.small { height: 28px; }

/* ---- profile v4: neutral "Data" sections (site style), bigger KPIs, brief in 2 columns, calendar ---- */
.ep-sec, .ep-sec.sec-personal, .ep-sec.sec-work, .ep-sec.sec-pay, .ep-sec.sec-docs {
  --sec: var(--ink); background: transparent; border-top: none; padding: 0; margin: 0 0 16px; }
.ep-sec-h { color: var(--ink); font-size: 16px; margin: 4px 0 10px; }
.ep-sec-h::before { display: none; }
.ep-kpi { padding: 12px 16px; }
.ep-kpi-l { font-size: 13px; }
.ep-kpi-v { font-size: 30px; line-height: 1.2; margin: 2px 0; }
.ep-kpi-v small { font-size: 14px; }
.ep-kpi-s { font-size: 12.5px; }
.ep-brief { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
@media (max-width: 800px) { .ep-brief { grid-template-columns: 1fr; } }
.ep-nav { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.ep-nav .btn.small { width: 32px; padding: 0; justify-content: center; font-size: 18px; line-height: 1; }
.ep-grp-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ep-grp-h .ep-sub { margin: 0 !important; }
.ep-grp-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ep-grp-h .btn.small { height: 26px; font-size: 12px; padding: 0 10px; }
.ep-dates li.missing { border-left-color: #f59e0b; color: var(--ink-soft); }
.ep-dates li em .btn.small { height: 24px; font-size: 12px; }

.tk-top { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--ep-gap); align-items: start; margin-bottom: var(--ep-gap); }
@media (max-width: 1000px) { .tk-top { grid-template-columns: 1fr; } }
.tk-side { display: flex; flex-direction: column; gap: 8px; }
.tk-year { display: grid; grid-template-columns: 1fr; gap: 3px; font-size: 13px; margin-top: 4px; }
.tk-cal-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tk-cal-h h2 { margin: 0 6px; font-size: 17px; min-width: 150px; text-align: center; }
.tk-cal-h .btn.small { min-width: 32px; justify-content: center; }
.tk-cal-h .tk-grid-link { margin-left: auto; }
table.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
table.cal th { font-size: 12px; font-weight: 600; color: var(--ink-soft); padding: 2px; text-align: center; }
table.cal td { height: 58px; border-radius: 8px; vertical-align: top; padding: 4px 6px; font-size: 12px; background: #fff; border: 1px solid var(--border); }
table.cal td.cal-empty { background: transparent; border: none; }
table.cal td.cell { cursor: pointer; font-weight: 700; text-align: right; }
table.cal td.cell::before { content: attr(data-n); float: left; font-weight: 600; font-size: 13px; color: var(--ink); }
table.cal td.cell.off { background: #f4f4f6; }
table.cal td.cell.off::before { color: #a1a1a6; }
table.cal td.cell[class*=" k-"] { background: var(--k); color: var(--kt); border-color: transparent; }
table.cal td.cell:hover { outline: 2px solid var(--accent); outline-offset: -1px; }
table.cal td.cell.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
table.cal td.cell.multi { box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.tk-totals { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.tk-totals span { display: inline-flex; align-items: center; gap: 5px; }
.tk-totals b { color: var(--ink); }
.tk-more { margin-top: 10px; }
.tk-more > summary { font-weight: 600; }
main .ep table.cal, main .ep table.cal thead, main .ep table.cal tr { background: transparent; box-shadow: none; border: none; }
main .ep table.cal th { background: transparent !important; color: var(--ink-soft) !important; border: none !important;
  font-family: "Barlow", sans-serif; font-size: 12px; font-weight: 600; text-transform: none; padding: 2px 4px; }
.ep-brief > dl { align-content: start; align-self: start; }

/* ---- profile header: name = employee switcher, avatar = photo upload ---- */
.ep-switch { position: relative; min-width: 0; }
.ep-switch-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; padding: 2px 6px; margin: -2px -6px;
  border-radius: 8px; cursor: pointer; color: inherit; font: inherit; max-width: 100%; }
.ep-switch-btn:hover { background: var(--accent-light); }
.ep-switch-caret { font-size: 14px; color: var(--ink-soft); }
.ep-switch-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 340px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 8px; }
.ep-switch-q { width: 100%; height: 34px; margin-bottom: 6px; }
.ep-switch-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.ep-switch-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 8px; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-size: 14px; }
.ep-switch-list a small { color: var(--ink-soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.ep-switch-list a:hover { background: var(--accent-light); }
.ep-switch-list a.on { background: var(--accent); color: #fff; } .ep-switch-list a.on small { color: rgba(255,255,255,.85); }
.ep-avatar.can-edit { cursor: pointer; position: relative; }
.ep-avatar.can-edit:hover::after { content: "📷"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35); border-radius: 50%; font-size: 18px; }
.ep-avatar.busy { opacity: .5; }
.ep-switch-btn { text-align: left; background: none !important; box-shadow: none !important; height: auto; min-height: 0; }
.ep-switch-btn:hover { background: var(--accent-light) !important; }
.ep-switch-btn h1 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
/* date picker: month / year are our own grids (our colours, not the blue system list) */
.hc-cal-h .hc-m, .hc-cal-h .hc-y { width: auto; height: 28px; padding: 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); background: none; }
.hc-cal-h .hc-m { flex: 1; text-align: left; }
.hc-cal-h .hc-m:hover, .hc-cal-h .hc-y:hover, .hc-cal-h .hc-m.on, .hc-cal-h .hc-y.on { background: var(--accent-light); color: var(--accent-dark); }
.hc-cal-t { flex: 1; text-align: center; font-weight: 700; font-size: 14px; }
.hc-cal-g.hc-cal-pick { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.hc-cal-g .rc-pick { height: 38px; padding: 0; border: none; background: none; color: var(--ink); font-weight: 600; font-size: 13px; border-radius: 6px; cursor: pointer; }
.hc-cal-g .rc-pick:hover:not(:disabled) { background: var(--accent-light); color: var(--accent-dark); }
.hc-cal-g .rc-pick.hc-today { box-shadow: inset 0 0 0 1px var(--accent); }
.hc-cal-g .rc-pick.on { background: var(--accent); color: #fff; }
.hc-cal-g .rc-pick:disabled { color: #c7c7cc; cursor: default; }
/* full name, fixed width = the longest name in the list */
.ep-switch-btn h1.ep-switch-name { display: grid; overflow: visible; text-overflow: clip; white-space: nowrap; }
.ep-switch-name > span { grid-area: 1 / 1; }
.ep-switch-name > .sizer { visibility: hidden; height: 0; overflow: hidden; }
@media (max-width: 720px) { .ep-switch-btn h1.ep-switch-name { white-space: normal; } }
/* the name reads as a dropdown: bordered box + chevron, orange on hover / open */
.ep-switch { display: flex; flex-direction: column; align-items: flex-start; }
.ep-switch-lbl { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 2px 2px; }
.ep-switch-btn { margin: 0 !important; padding: 5px 8px 5px 14px !important; gap: 12px !important; border: 1px solid var(--border) !important;
  border-radius: 10px !important; background: #fff !important; transition: border-color .15s, box-shadow .15s; }
.ep-switch-btn:hover { border-color: var(--accent) !important; background: #fff !important; }
.ep-switch.open .ep-switch-btn, .ep-switch-btn:focus-visible { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-light) !important; outline: none; }
.ep-switch-btn h1.ep-switch-name { font-size: 22px; }
.ep-switch-caret { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-light); color: var(--accent-dark); transition: transform .15s, background .15s; }
.ep-switch-caret svg { width: 13px; height: 13px; }
.ep-switch-btn:hover .ep-switch-caret { background: var(--accent); color: #fff; }
.ep-switch.open .ep-switch-caret { transform: rotate(180deg); background: var(--accent); color: #fff; }
.ep-name { align-items: flex-end; }
.ep-switch-lbl { text-transform: none; letter-spacing: 0; font-size: 12px; }
.ep-switch-pop { width: max(100%, 400px); }
.ep-switch-list a { white-space: nowrap; }
.ep-switch-list a small { flex: 0 1 auto; }

/* schedule editor: fixed hours vs weekly hours (D54) */
.sched-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.sched-kind label { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 10px 34px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; position: relative; }
.sched-kind label input { position: absolute; left: 12px; top: 13px; accent-color: var(--accent); }
.sched-kind label span { font-size: 12px; color: var(--ink-soft); }
.sched-kind label:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.sched-form.weekly .sched-grid th:nth-child(n+3):nth-child(-n+6), .sched-form.weekly .sched-grid td:nth-child(n+3):nth-child(-n+6),
.sched-form.weekly .sched-grid th:nth-child(8), .sched-form.weekly .sched-grid td:nth-child(8) { display: none; }
.sched-form.weekly .sched-grid tfoot td:first-child { text-align: left; }
.sched-form.weekly [data-copy-mon], .sched-form.weekly [data-add-week], .sched-form.weekly [data-del-week], .sched-form.weekly .sched-weeks-tabs { display: none !important; }

/* ---- work roster (D55) ---- */
.ro-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.ro-tabs a { padding: 6px 14px; border-radius: 16px; background: var(--card-bg); box-shadow: 0 1px 2px rgba(0,0,0,.06); font-weight: 600; font-size: 13px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.ro-tabs a:hover { background: var(--accent-light); color: var(--accent-dark); }
.ro-tabs a.on { background: var(--accent); color: #fff; }
.ro-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ro-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-soft); }
.ro-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ro-sw { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px; font-style: normal; font-size: 11px; font-weight: 700; border: 1px solid var(--border); background: #fff; }
.ro-sw.plan { background: var(--accent-light); border-color: var(--accent); }
.ro-sw.sched { background: #fff; border: 1px dashed var(--accent); }
.ro-sw.came { color: #15803d; } .ro-sw.missed { color: #dc2626; }
.ro-actions { display: flex; gap: 6px; }
.ro-past { margin-left: 8px; white-space: nowrap; }
table.ro-grid td.rc { min-width: 30px; height: 34px; text-align: center; font-weight: 800; font-size: 14px; position: relative; }
table.ro-grid td.rc.plan { background: var(--accent-light); box-shadow: inset 0 0 0 1px rgba(255,107,0,.35); }
table.ro-grid td.rc.plan.sched { background: #fff; box-shadow: inset 0 0 0 1px rgba(255,107,0,.45); background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255,107,0,.08) 5px 7px); }
table.ro-grid td.rc.hol { background: #f4f4f6; }
table.ro-grid td.rc.came { color: #15803d; }
table.ro-grid td.rc.missed { color: #dc2626; }
table.ro-grid td.rc.past:not(.plan) { color-scheme: light; }
table.ro-grid td.rc .sw { position: absolute; left: 3px; top: 3px; width: 8px; height: 8px; border-radius: 2px; }
table.ro-grid td.rc.edit { cursor: pointer; }
table.ro-grid td.rc.edit:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
table.ro-grid td.rc.busy { opacity: .45; }
table.ro-grid th.today { background: var(--accent) !important; color: #fff !important; }
table.ro-grid td.name { min-width: 180px; }
table.ro-grid td.rc { min-width: 0; width: 27px; padding: 0; font-size: 13px; }
table.ro-grid th { padding: 4px 1px; font-size: 11px; }
table.ro-grid td.name { min-width: 150px; max-width: 190px; }
table.ro-grid td.name a { white-space: nowrap; }
.sb-item .sb-label { white-space: normal; line-height: 1.2; }

/* journal = journal + roster (D55) */
.pr { font-weight: 800; font-size: 13px; } .pr.ok { color: #15803d; } .pr.no { color: #dc2626; }
.att-legend .pr { margin-right: 4px; }
i.sw.off-sw { background: #f4f4f6; }
.plan-b { font-size: 10.5px; font-weight: 700; color: var(--accent-dark); background: var(--accent-light); border-radius: 8px; padding: 0 6px; vertical-align: 1px; }
.cp-roster { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.cp-seg { display: flex; gap: 0; margin: 0; }
.cp-seg button { flex: 1; height: 30px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); background: #fff; color: var(--ink-soft); border-radius: 0; padding: 0 8px; }
.cp-seg button:first-of-type { border-radius: 8px 0 0 8px; } .cp-seg button:last-of-type { border-radius: 0 8px 8px 0; border-left: none; }
.cp-seg button:hover { background: var(--accent-light); color: var(--ink); }
.cp-seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cp-seg button.ok.on { background: #16a34a; border-color: #16a34a; } .cp-seg button.no.on { background: #dc2626; border-color: #dc2626; }
.filters .ro-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.cp-warn { background: #fffbeb; border-left: 3px solid #f59e0b; padding: 6px 10px; border-radius: 4px; font-size: 12.5px; margin-bottom: 8px; }
.tg-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.acc-result { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: #f0fdf4; border: 1px solid #bbf7d0; font-size: 13.5px; display: grid; gap: 4px; }
/* team vacation calendar */
table.vac-grid td { text-align: center; font-size: 12px; min-width: 70px; }
table.vac-grid td.vac { background: #dcfce7; color: #166534; }
table.vac-grid tfoot th { background: #f9fafb !important; color: var(--ink) !important; font-weight: 700; }
table.vac-grid tfoot th.warn { background: #fef3c7 !important; }
table.vac-grid th.today { background: var(--accent) !important; color: #fff !important; }
td.cell.holwork { box-shadow: inset 0 0 0 2px #f59e0b; }
i.sw.holwork-sw { background: #fff; box-shadow: inset 0 0 0 2px #f59e0b; }
.ep dl.ep-kv dt.dim, .ep dl.ep-kv dd.dim { opacity: .45; }
/* multi-day selection (journal / calendar) */
table.grid td.cell.sel, table.cal td.cell.sel { outline: 2px solid var(--accent); outline-offset: -2px; background-image: linear-gradient(rgba(255,107,0,.16), rgba(255,107,0,.16)); }
table.grid td.cell, table.cal td.cell { user-select: none; }
.cp-ok { color: #15803d; font-weight: 600; font-size: 13px; margin: 4px 0; }
.cp-clear { width: 100%; margin-top: 8px; }
.cell-panel.busy { opacity: .6; pointer-events: none; }
.cp-bulk-msg:empty { display: none; }
.cp-note-closed { background: #f1f5f9; border-left: 3px solid #64748b; padding: 5px 10px; border-radius: 4px; font-size: 12px; margin-bottom: 8px; }
.cp-hist { margin-top: 8px; font-size: 12.5px; border-top: 1px solid var(--border); padding-top: 6px; }
.cp-hist summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.cp-hist-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 4px 0; border-bottom: 1px dashed #eee; }
.cp-hist-row .del { color: #b3261e; font-weight: 600; } .cp-hist-row .add { color: #15803d; font-weight: 600; }
.cp-hist-row .btn.small { height: 24px; font-size: 11.5px; padding: 0 8px; }
/* two-factor sign-in */
.tf-panel { max-width: 560px; }
.tf-steps { padding-left: 20px; line-height: 1.6; }
.tf-qr svg { width: 200px; height: 200px; margin: 8px 0; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); }
.tf-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.tf-form input[name=code] { font-size: 22px; letter-spacing: 4px; width: 180px; text-align: center; font-family: monospace; }
.tf-trust { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.tf-codes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; font-size: 17px; }
.tf-codes span { padding: 8px; border: 1px dashed var(--border); border-radius: 6px; text-align: center; }
.tf-links { display: flex; gap: 8px; margin-top: 10px; }
.tf-links form { margin: 0; }
/* journal: department rows keep their name visible while the table scrolls sideways */
table.grid tr.dept-row td.dept-cell { background: #f9fafb; text-align: left; padding: 4px 0; }
table.grid .dept-sticky { position: sticky; left: 10px; display: inline-block; z-index: 1; }
.hc-month { width: 190px; }
.hc-month .hc-month-btn { width: 100%; display: inline-flex; align-items: center; gap: 8px; justify-content: space-between; }
.hc-month .hc-month-btn svg { width: 15px; height: 15px; color: var(--ink-soft); }
/* fixed column widths (user 2026-10-01): switching the month never resizes the grid */
table.grid.fixed-grid { table-layout: fixed; width: max-content; }
table.grid.fixed-grid col.c-name { width: 210px; }
table.grid.fixed-grid col.c-day { width: 34px; }
table.grid.fixed-grid col.c-tot { width: 46px; }
table.grid.fixed-grid col.c-month { width: 92px; }
table.grid.fixed-grid th, table.grid.fixed-grid td { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
table.grid.fixed-grid td.name { min-width: 0; max-width: 210px; }
table.grid.fixed-grid td.name a { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
table.grid.fixed-grid td.dept-cell { overflow: visible; }
/* likely mistakes (user 2026-10-01): an entry on a day off; month hours far from the norm */
td.cell.conflict { position: relative; }
td.cell.conflict::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 9px 9px 0;
  border-color: transparent #dc2626 transparent transparent; }
table.grid td.days-warn { background: #fef2f2; color: #b3261e; }
/* profile: entries behind a number (user 2026-10-01) */
.evp-kinds { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.evp-kinds a { padding: 4px 12px; border-radius: 14px; background: #f3f3f6; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; }
.evp-kinds a.on { background: var(--accent); color: #fff; }
.evp-period { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.evp-period .rp-chip { height: 28px; padding: 0 10px; font-size: 12.5px; }
.evp-total { background: #f9fafb; border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; font-size: 13.5px; }
.evp-table td, .evp-table th { padding: 5px 8px; font-size: 13px; }
a.ep-kpi[data-drawer], .tk-side [data-drawer] { cursor: pointer; }
.ep-kpi[data-drawer]:hover { outline: 1px solid var(--accent); }
.tk-year a, .cal-totals a, [data-drawer] .sw { color: inherit; text-decoration: none; }
.tk-year a:hover, .cal-totals a:hover { text-decoration: underline; }

/* ===== phones (user 2026-10-01: the app must be comfortable on a phone; iOS / Android apps later) ===== */
@media (max-width: 720px) {
  main { padding: 14px 12px 40px; }
  h1 { font-size: 22px; }
  /* data tables scroll sideways instead of squeezing columns to a letter wide */
  main table:not(.plain):not(.grid):not(.kv):not(.cal) { display: block; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; max-width: 100%; }
  main table:not(.plain):not(.grid):not(.kv):not(.cal) th { white-space: nowrap; overflow-wrap: normal; }
  main table:not(.plain):not(.grid):not(.kv):not(.cal) td { overflow-wrap: normal; min-width: 4.5em; padding: 8px 10px; }
  main table:not(.plain):not(.grid):not(.kv):not(.cal) td:first-child { min-width: 9em; }
  main table:not(.plain):not(.grid):not(.kv):not(.cal) th[style*="width"] { width: auto !important; }
  /* touch targets */
  .btn, button.btn, a.btn { min-height: 38px; }
  .btn.small, a.btn.small, button.btn.small { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
  input, select, textarea { font-size: 16px; }              /* iOS does not zoom into a 16px field */
  /* menus: two compact cards per row */
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .menu-card { padding: 14px 10px !important; min-height: 0 !important; }
  .menu-card .menu-icon-badge { width: 44px !important; height: 44px !important; font-size: 22px !important; }
  .menu-card .menu-label { font-size: 15px !important; }
  .menu-card .menu-desc { display: none; }
  /* journal: a narrower name column, actions wrap */
  table.grid.fixed-grid col.c-name { width: 118px; }
  table.grid.fixed-grid td.name { max-width: 118px; font-size: 11.5px; }
  table.grid.fixed-grid td.name a { max-width: 104px; }
  table.grid.fixed-grid td.name .plan-b { display: none; }
  table.grid.fixed-grid col.c-day { width: 32px; }
  .filters, .ro-actions, .filters .ro-actions { flex-wrap: wrap; margin-left: 0; }
  /* the day editor and side panels become a bottom sheet */
  .cell-panel { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: 100% !important;
    max-height: 78vh; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.18); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .drawer { align-items: flex-end; }
  .drawer-panel, .drawer-panel.dp-panel, .drawer-panel.sched-panel { width: 100%; height: auto; max-height: 92vh; border-radius: 14px 14px 0 0; padding: 18px 14px; }
  .ep-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .ep-kpis { grid-template-columns: 1fr 1fr !important; }
}

/* ===== installed app (PWA, user 2026-10-01) ===== */
.offline-page { display: grid; place-items: center; min-height: 100vh; background: var(--bg, #fafafb); }
.offline-box { text-align: center; max-width: 360px; padding: 24px; }
.offline-box img { border-radius: 16px; margin-bottom: 8px; }
/* notch / home indicator in the standalone window */
.mobile-bar { padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
.sidebar { padding-bottom: env(safe-area-inset-bottom); }
main { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
html.pwa-standalone body { overscroll-behavior-y: none; }

/* phones, round 2 (user 2026-10-01, iPhone app went wider than the screen on «Գլխավոր»):
   grid / flex children may shrink below their content, every table scrolls inside its own box, long buttons wrap,
   and nothing can ever widen the page itself */
@media (max-width: 720px) {
  main div, main section, main form, main aside, main article { min-width: 0; }
  main table:not(.grid):not(.cal) { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  main table.plain th, main table.plain td { white-space: nowrap; }
  .btn, a.btn, button.btn { white-space: normal; max-width: 100%; text-align: center; }
  main img, main video, main canvas, main pre { max-width: 100%; }
  main pre, main code { white-space: pre-wrap; overflow-wrap: anywhere; }
}
.content { min-width: 0; overflow-x: clip; }
html, body { max-width: 100%; }
table.pay-drawer { width: 100%; }
table.pay-drawer td, table.pay-drawer th { padding: 5px 6px; text-align: left; }
table.pay-drawer input { width: 100%; max-width: 160px; }
.ep-salary .ie input.ie-f { font-size: 26px; font-weight: 700; max-width: 220px; font-family: "Barlow Condensed", "Barlow", sans-serif; }
.ep-tl li.tl-edit .tl-items { display: block; font-size: 12.5px; color: var(--ink-soft, #555); }
.ep-tl li.tl-edit .tl-items span { display: block; }
.panel.warn-panel { border-left: 4px solid #f59e0b; background: #fffbeb; }
/* profile «Օրագիր»: summary tiles (user 2026-10-01: clearer and nicer) */
.tk-report { margin-top: 14px; }
.tk-report .ep-card-title { font-size: 17px; margin: 0 0 8px; }
.tk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 14px; }
.tk-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #fff;
  border: 1px solid var(--border, #ececf0); border-left: 4px solid var(--tc, #d4d4d8); text-decoration: none; color: var(--ink, #1d1d1f);
  transition: box-shadow .15s, transform .15s; }
a.tk-tile:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.tk-tile-l { font-size: 12.5px; color: var(--ink-soft, #6b7280); font-weight: 600; }
.tk-tile-v { font-family: "Barlow Condensed", "Barlow", sans-serif; font-size: 28px; font-weight: 700; line-height: 1.1; }
.tk-tile-v small { font-size: 15px; font-weight: 600; color: var(--ink-soft, #6b7280); }
.tk-tile-s { font-size: 12.5px; color: var(--ink-soft, #6b7280); }
.tk-tile-c { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.tk-tile.t-late { --tc: #f59e0b; } .tk-tile.t-abs { --tc: #ef4444; } .tk-tile.t-exc { --tc: #eab308; }
.tk-tile.t-vac { --tc: #22c55e; } .tk-tile.t-doff { --tc: #6366f1; } .tk-tile.t-time { --tc: #0ea5e9; } .tk-tile.t-warn { --tc: #f97316; background: #fff7ed; }
@media (max-width: 720px) { .tk-tiles { grid-template-columns: 1fr 1fr; } .tk-tile-v { font-size: 24px; } }
/* Structure → Departments (user 2026-10-01: nicer; the name opens the department's settings) */
.dept-list { background: var(--card-bg, #fff); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden; }
table.dept-pretty td, table.dept-pretty th { padding: 11px 14px; vertical-align: middle; }
table.dept-pretty tr.lvl-0 td { background: #fff; }
table.dept-pretty tr.lvl-0 .dept-link { font-size: 15.5px; font-weight: 700; }
table.dept-pretty .dept-link { color: var(--ink, #1d1d1f); text-decoration: none; font-weight: 600; border-bottom: 1px dashed transparent; }
table.dept-pretty .dept-link:hover { color: var(--accent, #ff6600); border-bottom-color: currentColor; }
table.dept-pretty .dept-name-cell { padding-left: calc(14px + var(--lvl, 0) * 22px); }
table.dept-pretty .lvl-mark { color: #c4c4cc; margin-right: 4px; }
table.dept-pretty .dept-head { font-weight: 500; }
.count-pill { display: inline-block; min-width: 32px; padding: 2px 10px; border-radius: 12px; background: var(--accent-light, #fff1e6);
  color: var(--accent-dark, #c2410c); font-weight: 700; text-align: center; text-decoration: none; }
.count-pill:hover { background: var(--accent, #ff6600); color: #fff; }
table.dept-pretty { table-layout: auto !important; width: 100% !important; }
table.dept-pretty th, table.dept-pretty td { width: auto !important; }
table.dept-pretty .c-drag { width: 34px !important; }
table.dept-pretty td.dept-name-cell { width: 38% !important; }
table.dept-pretty .chip { white-space: nowrap; }
table.dept-pretty .cat-act { width: 90px !important; text-align: right; }
table.dept-pretty .dept-head { white-space: nowrap; }
/* «Ավտոմատացում» (user 2026-10-01) */
.auto-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.auto-card { display: block; background: #fff; border: 1px solid var(--border, #ececf0); border-radius: 12px; padding: 14px; text-decoration: none; color: inherit; }
.auto-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); border-color: var(--accent, #ff6600); }
.auto-card.off { opacity: .6; }
.auto-card .ac-d { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.auto-help { margin-bottom: 14px; }
.auto-found { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.auto-actions { display: grid; gap: 10px; margin-bottom: 18px; }
.auto-act { background: #fff; border: 1px solid var(--border, #ececf0); border-left: 4px solid #f59e0b; border-radius: 10px; padding: 10px 14px; }
.auto-act.failed { border-left-color: #ef4444; background: #fef2f2; }
.auto-act .aa-d { margin: 6px 0; font-size: 13.5px; overflow-wrap: anywhere; }
.auto-act .aa-f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.auto-act .aa-f input { flex: 1; min-width: 180px; }
.auto-depts { border: 1px solid var(--border, #ececf0); border-radius: 10px; padding: 8px 12px; }
.auto-dept-list { max-height: 220px; overflow: auto; }
label.row { flex-direction: row !important; align-items: center; gap: 6px; }
/* absence entered ahead (user 2026-10-01): marked until the day comes */
td.cell.future { position: relative; }
td.cell.future::before { content: "⏳"; position: absolute; left: 1px; top: -1px; font-size: 8px; line-height: 1; }
.ep-h-link { color: inherit; text-decoration: none; }
.ep-h-link:hover { color: var(--accent, #ff6600); }
.ep-ov-wide .ep-brief { cursor: pointer; }
/* loading bar (user 2026-10-01, like TD KPI) */
.load-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; z-index: 3000; background: rgba(255,102,0,.15); }
.load-bar::before { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--accent, #ff6600); border-radius: 3px;
  animation: load-bar 1.1s ease-in-out infinite; }
@keyframes load-bar { from { left: -35%; } to { left: 100%; } }
/* no dimming / freezing (user 2026-10-01: it made the program feel slow) — only the thin bar */
@media (prefers-reduced-motion: reduce) { .load-bar::before { animation-duration: 3s; } }
.pull-tip { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 2500;
  background: var(--ink, #1d1d1f); color: #fff; padding: 6px 14px; border-radius: 16px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.sb-refresh { margin-left: auto; }
html.sb-collapsed .sb-refresh { display: none; }
/* the day / bulk editor always fits the screen (user 2026-10-01) */
.cell-panel.hc-pop { max-height: calc(100vh - 16px); }
.cp-bulk-msg .cp-warn { max-height: 140px; overflow: auto; }
.cp-opts .cp-opt { height: 32px; }
table.grid td.cell, table.cal td.cell { -webkit-touch-callout: none; -webkit-user-select: none; touch-action: manipulation; }
/* Settings → Users: the list full width, the form above it (user 2026-10-01: it covered the list's buttons) */
details.user-form { margin-bottom: 12px; }
details.user-form > summary { list-style: none; display: inline-flex; cursor: pointer; }
details.user-form > summary::-webkit-details-marker { display: none; }
details.user-form[open] > summary { margin-bottom: 12px; }
details.user-form form.stack { max-width: 520px; }
.users-list { overflow-x: auto; }
table.users-table { width: 100%; }
table.users-table td.actions { white-space: nowrap; text-align: right; }
.af-hint p { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 13.5px; }
.af-status { padding: 8px 12px; border-radius: 10px; font-size: 13.5px; }
.af-status.ok { background: #ecfdf5; } .af-status.bad { background: #fef2f2; }
.af-form fieldset { border: 1px solid var(--border, #ececf0); border-radius: 12px; padding: 10px 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.af-form legend { font-weight: 700; padding: 0 6px; font-size: 14px; }
.af-sub { display: block; font-size: 12px; color: var(--ink-soft, #6b7280); margin-top: 3px; font-weight: 400; }
label.row { display: flex !important; flex-direction: row !important; justify-content: flex-start !important; align-items: center; gap: 8px; text-align: left; }
label.row input[type=checkbox], label.row input[type=radio] { width: auto !important; flex: none; margin: 0; }
label.row > *:not(input) { flex: initial; }
/* undo / redo lists (user 2026-10-01) */
ol.undo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 55vh; overflow: auto; }
.undo-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--border, #ececf0); border-radius: 8px; padding: 8px 10px; color: var(--ink, #1d1d1f); font-weight: 500; }
.undo-item.in { background: var(--accent-light, #fff1e6); border-color: var(--accent, #ff6600); }
.undo-item.no { opacity: .5; }
.undo-item .ui-n { font-weight: 700; color: var(--ink-soft, #6b7280); }
.undo-item .ui-w { font-size: 12px; color: var(--ink-soft, #6b7280); white-space: nowrap; }
.mobile-bar .mb-title { color: #fff; text-decoration: none; }
/* Settings → Roles (user 2026-10-01) */
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.role-card { background: #fff; border: 1px solid var(--border, #ececf0); border-radius: 12px; display: flex; flex-direction: column; }
.role-card .rc-main { display: block; padding: 14px; color: inherit; text-decoration: none; flex: 1; }
.role-card .rc-main:hover { background: var(--accent-light, #fff1e6); border-radius: 12px 12px 0 0; }
.role-card .rc-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.role-card ul.rc-can { margin: 8px 0 4px 18px; padding: 0; font-size: 13px; }
.role-card .rc-act { padding: 0 14px 12px; display: flex; gap: 6px; }
.rf-s { color: #d97706; font-weight: 700; }
.rf-grp { border: 1px solid var(--border, #ececf0); border-radius: 12px; padding: 8px 14px 10px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.rf-grp legend { font-weight: 700; padding: 0 6px; }
.rf-all { background: none; border: 0; color: var(--accent, #ff6600); font-size: 12px; cursor: pointer; padding: 0 4px; }
.rf-row.sens span { color: #92400e; }
.af-hint-p { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
/* «Հաղորդագրություններ» (user 2026-10-01) */
.msg-grid { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .msg-grid { grid-template-columns: 1fr; } }
.msg-compose fieldset { border: 1px solid var(--border, #ececf0); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; margin: 0; }
.msg-compose legend { font-weight: 700; padding: 0 6px; }
.msg-sub { margin-left: 22px; max-height: 240px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.msg-people { display: flex; flex-direction: column; gap: 2px; }
.msg-read { max-width: 720px; }
/* Reports → Վահանակ (user 2026-10-01) */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dash-kpi { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--border, #ececf0); border-left: 4px solid var(--accent, #ff6600);
  border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; }
.dash-kpi:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.dash-kpi span { font-size: 12.5px; color: var(--ink-soft, #6b7280); font-weight: 600; }
.dash-kpi b { font-family: "Barlow Condensed", "Barlow", sans-serif; font-size: 30px; line-height: 1.1; }
.dash-kpi small { font-size: 12px; color: var(--ink-soft, #6b7280); }
.dash-kpi.k-red { border-left-color: #ef4444; } .dash-kpi.k-amber { border-left-color: #f59e0b; }
.dash-kpi.k-green { border-left-color: #22c55e; } .dash-kpi.k-brown { border-left-color: #b45309; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.dash-grid h3 { margin: 0 0 8px; font-size: 15px; }
.dash-row { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid #f3f3f6; font-size: 13.5px; }
.dash-row b { margin-left: auto; }
.bar { display: grid; grid-template-columns: 160px 1fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.bar .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .bt { background: #f3f3f6; border-radius: 6px; height: 12px; overflow: hidden; }
.bar .bt i { display: block; height: 100%; background: var(--accent, #ff6600); border-radius: 6px; }
.bar .bt.red i { background: #ef4444; } .bar .bt.amber i { background: #f59e0b; } .bar .bt.brown i { background: #b45309; }

/* dashboard bar charts (reports/charts.py bar_chart() + components/_bar_chart.html) */
.viz-wrap { margin-top: 2px; }
.viz-bar { display: block; width: 100%; height: auto; max-height: 160px; overflow: visible; }
.viz-base { stroke: var(--border, #e5e5e5); stroke-width: 1; }
.viz-mark { transition: opacity .12s; cursor: default; }
.viz-mark:hover { opacity: .75; }
.viz-x { font-size: 9px; fill: var(--ink-soft, #6e6e73); text-anchor: middle; dominant-baseline: hanging; }

/* reusable period quick-picker (dashboard + report filters): one segmented pill, not separate chips */
.period-picker { display: inline-flex; align-items: stretch; border: 1px solid var(--border, #e5e5e5); border-radius: 10px;
  overflow: hidden; background: #fff; }
.period-picker .chip { all: unset; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--ink-soft, #6e6e73);
  padding: 7px 13px; border-radius: 0; margin: 0; white-space: nowrap; transition: background .12s, color .12s; }
.period-picker .chip + .chip { border-left: 1px solid var(--border, #e5e5e5); }
.period-picker .chip:hover { background: #f7f7f8; color: var(--ink); }
.period-picker .chip.on { background: var(--accent, #ff6600); color: #fff; font-weight: 600; }

.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rep-card { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--border, #ececf0); border-top: 3px solid var(--c);
  border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; }
.rep-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.rep-card .ri { font-size: 20px; } .rep-card small { color: var(--ink-soft, #6b7280); font-size: 12.5px; }
.saved-list, .saved-q { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-x { background: none; border: 0; color: #9ca3af; cursor: pointer; padding: 0 2px; }
/* Payroll month page (user 2026-10-01: clearer) */
.pp-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
ol.pp-steps { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
ol.pp-steps li { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 18px; background: #f3f3f6; color: #9ca3af; font-size: 13px; font-weight: 600; }
ol.pp-steps li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e5e7eb; color: #6b7280; font-size: 11px; }
ol.pp-steps li.done { background: #ecfdf5; color: #15803d; } ol.pp-steps li.done span { background: #22c55e; color: #fff; }
ol.pp-steps li.now { background: var(--accent-light, #fff1e6); color: var(--accent-dark, #c2410c); } ol.pp-steps li.now span { background: var(--accent, #ff6600); color: #fff; }
.pp-next { margin: 8px 0 0; font-size: 14px; }
.pp-kpis { margin-top: 12px; }
.pp-filters { align-items: center; margin: 10px 0; }
.pp-filters .rp-chip { cursor: pointer; }
table.pp-table td.pp-name { white-space: nowrap; }
table.pp-table td.pp-pay a { font-weight: 700; }
table.pp-table tfoot th { background: #fafafa; color: var(--ink, #1d1d1f); }
table.pp-table td.pp-name { min-width: 230px; }
table.pp-table td.pp-name a { overflow: visible; }
.aa-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff;
  border: 1px solid var(--border, #ececf0); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.aa-h input[type=checkbox] { margin-right: 4px; }
.auto-card-wrap { position: relative; }
.auto-card-wrap .ac-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; }
.auto-card-wrap .auto-card { padding-right: 100px; height: 100%; }
/* sidebar: «Աշխատակիցներ» section with its submenu (user 2026-10-02) */
.sb-item.sb-parent { padding-right: 4px; }
.sb-parent .sb-plink { display: flex; align-items: center; gap: inherit; flex: 1; min-width: 0; color: inherit; text-decoration: none; height: 100%; }
.sb-chev { background: none; border: 0; color: rgba(255,255,255,.55); font-size: 13px; padding: 4px 8px; cursor: pointer; transition: transform .15s; }
.sb-group.open .sb-chev { transform: rotate(180deg); }
.sb-sub { display: none; }
.sb-group.open .sb-sub { display: block; }
.sb-sub .sb-item.sb-child { padding-left: 40px; height: 38px; font-size: 13.5px; }
html.sb-collapsed .sb-sub .sb-item.sb-child { padding-left: 0; }
html.sb-collapsed .sb-chev { display: none; }
html.sb-collapsed .sb-group .sb-sub { display: block; }
.menu-card { min-width: 0; }
.menu-card .menu-label { max-width: 100%; font-size: clamp(16px, 1.6vw, 22px); overflow-wrap: anywhere; text-align: center; }
.sb-group.open .sb-badge-group { display: none; }        /* the children show their own counts */
.menu-card .menu-label { font-size: clamp(15px, 1.3vw, 20px); overflow-wrap: normal; word-break: normal; }
.page-head.sub-head { justify-content: flex-start; gap: 12px; align-items: center; }
.page-head.sub-head h1 { margin: 0; }

/* «Թեկնածուներ» — the stage board (it had no style and showed as a plain list), 2026-10-02 */
.board { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; margin-top: 12px; align-items: flex-start; }
.board-col { flex: 0 0 210px; background: var(--surface-2, #f7f7f8); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 90px; }
.board-col.hired { border-color: #16a34a55; background: #16a34a0d; }
.board-col.rej { opacity: .75; }
.board-head { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center;
  padding: 2px 4px 6px; border-bottom: 2px solid var(--brand, #ff6600); }
.board-col.hired .board-head { border-color: #16a34a; }
.board-col.rej .board-head { border-color: #9ca3af; }
.board-head .muted { background: var(--surface, #fff); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.board-card { display: block; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; color: inherit; text-decoration: none; box-shadow: 0 1px 2px #0000000d; transition: box-shadow .15s, transform .15s; }
.board-card:hover { box-shadow: 0 4px 12px #0000001a; transform: translateY(-1px); text-decoration: none; }
.board-card strong { color: var(--text); }
.board-card .badge { margin-top: 4px; }
.hire-when { display: flex; gap: 6px; }
.hire-when input[type=date] { min-width: 150px; }
.hire-when input:not([type=date]) { width: 80px; }

/* «Պայմանագրեր» — the separate portal inside HR's window (2026-10-02) */
.ct-frame-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ct-frame-head h1 { margin: 0; }
.ct-frame { display: block; width: 100%; height: calc(100vh - 140px); min-height: 480px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; }
@media (max-width: 760px) { .ct-frame { height: calc(100vh - 120px); border-radius: 8px; } }
.menu-body button.danger-item { color: var(--danger, #b42318); }
.auto-dept-list label.inherited { color: var(--muted); }
.af-inherit { font-size: 12px; color: var(--muted); }
.af-pv { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.af-pv-row .chip { margin: 2px 3px 0 0; }
.af-pv-row.ok { color: #157347; } .af-pv-row.bad { color: #b42318; }

/* «Մուտքեր և իրավունքներ» (access model v2 preview, 2026-10-02) */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.acc-card { background: var(--card-bg); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 12px 14px; min-width: 0; }
.acc-card.changed { box-shadow: inset 3px 0 0 #f59e0b, 0 1px 3px rgba(0,0,0,.06); }
.acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.acc-kv th { width: 42%; white-space: normal; }
.acc-diff { margin-top: 8px; background: #fff8eb; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.acc-diff ul { margin: 4px 0 4px 18px; padding: 0; }
.acc-switch { border-left: 4px solid #f59e0b; }
.acc-switch.on { border-left-color: #16a34a; }

/* quick search, top right (2026-10-03): its own row above the page, so it never covers page buttons */
.gsearch { position: relative; z-index: 10; display: flex; justify-content: flex-end; max-width: 1100px;
  margin: 12px auto -14px; padding: 0 16px; }
.gsearch input { width: min(320px, 100%); height: 34px; border-radius: 999px; padding: 0 14px; background: #fff;
  border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.gs-pop { position: absolute; right: 16px; top: 40px; width: min(440px, 92vw); max-height: 70vh; overflow: auto; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: 6px; }
.gs-h { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; padding: 8px 8px 4px; }
.gs-it { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 14px; }
.gs-it:hover, .gs-it.on { background: var(--accent-light); text-decoration: none; }
.gs-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-s { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.gs-empty { padding: 10px; color: var(--ink-soft); font-size: 13px; }
@media (max-width: 900px) { .gsearch { margin: 10px auto -8px; } .gsearch input { width: 100%; } }
.users-tools .grow { flex: 1; min-width: 220px; }
.users-tools .grow input { width: 100%; }
.admin-toggle { flex-direction: row !important; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: #fafafb; cursor: pointer; }
.admin-toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.admin-toggle input { margin-top: 3px; width: 18px; height: 18px; }
.admin-toggle span { display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.admin-toggle small { color: var(--ink-soft); font-size: 12.5px; line-height: 1.35; }

/* role-based home tiles (2026-10-03) */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 6px 0 22px; }
.dash-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); color: var(--ink); text-decoration: none; border-left: 4px solid var(--border); }
.dash-tile b { font-family: "Barlow Condensed", "Barlow", sans-serif; font-size: 26px; line-height: 1.1; }
.dash-tile span { font-size: 13px; color: var(--ink-soft); }
.dash-tile:hover { box-shadow: 0 8px 20px rgba(0,0,0,.12); text-decoration: none; }
.dash-tile.act { border-left-color: var(--accent); }
.dash-tile.warn { border-left-color: #f59e0b; }
.dash-tile.ok { border-left-color: #16a34a; }

/* phones: form fields at 16px so iPhone does not zoom into the page when one is tapped — the "jumping fields"
   (user 2026-10-03) */
@media (max-width: 700px), (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
}

/* «← back» in the top-left corner of every page except home (user 2026-10-03) */
.page-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 12px; }
@media (max-width: 700px) { .page-back { margin-bottom: 10px; } }

/* phones: filter forms fold behind «Ֆիլտրեր ▾» (static/js/mobile_filters.js, user 2026-10-04) */
.filters-toggle { display: none; }
@media (max-width: 700px) {
  .filters-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; }
  .filters-toggle .badge { background: var(--accent); color: #fff; }
  form.filters-collapsed:not(.mf-has-search) { display: none !important; }
  form.filters-collapsed.mf-has-search > :not(:has([data-search])) { display: none !important; }
}

/* ===== AI «Օգնական» (user 2026-10-04) ===== */
.ai-fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 70; width: 52px; height: 52px;
  border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 24px; line-height: 1; padding: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.22); cursor: pointer; }
html.ai-open .ai-fab { display: none; }
.ai-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 80; background: var(--card-bg, #fff);
  box-shadow: -8px 0 24px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); }
.ai-head-b { display: inline-flex; gap: 6px; align-items: center; }
.ai-x { background: none; border: none; font-size: 18px; color: var(--ink-soft); padding: 4px 8px; cursor: pointer; }
.ai-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ai-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); }
.ai-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; font-size: 16px; }
.ai-form .btn { height: 44px; min-width: 44px; justify-content: center; }
.ai-q { align-self: flex-end; max-width: 85%; margin-left: auto; background: var(--accent-light, #fff1e8); border-radius: 12px 12px 2px 12px;
  padding: 8px 12px; white-space: normal; overflow-wrap: anywhere; }
.ai-a { max-width: 95%; background: #f3f3f6; border-radius: 12px 12px 12px 2px; padding: 8px 12px; margin-top: 6px; overflow-wrap: anywhere; }
.ai-a p { margin: 0 0 6px; } .ai-a p:last-child { margin-bottom: 0; } .ai-a ul { margin: 4px 0 6px; padding-left: 18px; }
.ai-err { background: #fee2e2; color: #991b1b; }
.ai-wait { color: var(--ink-soft); }
.ai-dots i { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: currentColor;
  animation: ai-blink 1.2s infinite; } .ai-dots i:nth-child(2) { animation-delay: .2s; } .ai-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ai-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-draft { margin-top: 8px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 8px 10px;
  background: #fff; font-size: 14px; }
.ai-draft-h { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.ai-draft-b { display: flex; gap: 8px; margin-top: 8px; }
.ai-draft-done { border-left-color: #16a34a; } .ai-draft-failed { border-left-color: #dc2626; } .ai-draft-cancelled { opacity: .7; border-left-color: #9ca3af; }
.ai-draft-r { margin-top: 6px; font-size: 13px; }
.ai-hello { background: #f7f7f9; border-radius: 12px; padding: 12px; font-size: 14px; } .ai-hello ul { margin: 6px 0; padding-left: 18px; }
.ai-note { background: #fff3cd; color: #6b5400; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
@media (max-width: 760px) {
  .ai-panel { top: auto; left: 0; width: 100%; height: 88vh; height: 88dvh; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.18); }
  .ai-fab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
}
.ai-quick { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px 12px 0; scrollbar-width: none; flex: none; }
.ai-quick::-webkit-scrollbar { display: none; }
.ai-chip { flex: none; white-space: nowrap; border: 1px solid var(--border); background: #fff; color: var(--ink); border-radius: 16px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ai-chip:hover { background: var(--accent-light, #fff1e8); border-color: var(--accent); }
.ai-quick-card .ai-a { max-width: 100%; }
