/* =====================================================================
 * ATLAS HR — employee self-service experience (top-bar layout).
 * Mirrors the existing employee portal: indigo/navy top bar, light ground,
 * card-heavy screens — recoloured to the ATLAS HR brand (navy + emerald).
 * All classes are namespaced `.emp-` so this never touches the admin shell.
 * ===================================================================== */

:root {
  --emp-navy: #2b2a6b;
  --emp-navy-2: #3b3a86;
  --emp-teal: #12b981;
  --emp-teal-d: #0e9e6e;
  --emp-ground: #eef2fb;
  --emp-card: #ffffff;
  --emp-ink: #2b2f42;
  --emp-muted: #8890a6;
  --emp-line: #eaedf5;
  --emp-cream: #fdf6ec;
}

/* ---- Clean shell: white left sidebar + slim white top bar (green accents) ---- */
.emp-shell { display: flex; min-height: 100vh; background: var(--emp-ground); color: var(--emp-ink); }

.emp-nav { width: 262px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--emp-line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; transition: width .2s ease; }
.emp-nav-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--emp-line); }
.emp-nav-head img { width: 34px; height: 34px; border-radius: 9px; }
.emp-nav-head .t { font-size: 1.2rem; font-weight: 800; letter-spacing: 0.04em; }
.emp-nav-head .t .g { color: var(--emp-teal-d); }
.emp-nav-head .t .n { color: var(--emp-navy); }
.emp-nav-close { margin-left: auto; display: none; background: none; border: none; cursor: pointer; color: var(--emp-muted); }
.emp-nav-list { flex: 1; overflow-y: auto; padding: 12px 10px; }
.emp-nav-group { margin-bottom: 12px; }
.emp-nav-title { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--emp-muted); font-weight: 700; padding: 6px 12px; }
.emp-nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--emp-ink); text-decoration: none; font-size: 0.875rem; font-weight: 500; margin: 1px 0; }
.emp-nav-item svg { width: 18px; height: 18px; color: var(--emp-muted); flex-shrink: 0; }
.emp-nav-item:hover { background: var(--emp-ground); }
.emp-nav-item.active { background: rgba(18,185,129,0.12); color: var(--emp-teal-d); font-weight: 600; box-shadow: inset 3px 0 0 var(--emp-teal); }
.emp-nav-item.active svg { color: var(--emp-teal-d); }
.emp-nav-user { border-top: 1px solid var(--emp-line); padding: 12px; display: flex; align-items: center; gap: 10px; }
.emp-nav-user .who { flex: 1; min-width: 0; }
.emp-nav-user .who .n { font-weight: 700; font-size: 0.85rem; color: var(--emp-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-nav-user .who .r { font-size: 0.7rem; color: var(--emp-muted); text-transform: capitalize; }
.emp-nav-user form { margin: 0; }
.emp-nav-signout { background: none; border: none; color: var(--emp-muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.emp-nav-signout:hover { color: #e05a5a; background: var(--emp-ground); }

.emp-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--emp-teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }

.emp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.emp-top { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--emp-line); height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 22px; }
.emp-ham { display: flex; background: none; border: 1.5px solid var(--emp-ink); cursor: pointer; color: var(--emp-ink); padding: 4px; border-radius: 8px; }
.emp-ham svg { width: 20px; height: 20px; }
/* Button shows ☰ while the menu is hidden / folded and ✕ while it is open (like the CRM). */
.emp-ham .ico-close { display: none; }
.emp-ham[aria-expanded="true"] .ico-menu { display: none; }
.emp-ham[aria-expanded="true"] .ico-close { display: block; }
.emp-ham:hover { background: var(--emp-ground); }
.emp-top-brand { display: none; align-items: center; gap: 8px; font-weight: 800; color: var(--emp-navy); letter-spacing: 0.04em; text-decoration: none; }
.emp-top-brand:hover { text-decoration: none; color: var(--emp-teal-d); }
.emp-top-title { font-weight: 700; color: var(--emp-navy); font-size: 1rem; line-height: 1.2; min-width: 0; }
.emp-top-sub { display: block; font-size: 0.72rem; font-weight: 400; color: var(--emp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.emp-user-name { font-size: 0.85rem; color: var(--emp-ink); }
.emp-overlay { display: none; position: fixed; inset: 0; background: rgba(20,25,60,0.4); z-index: 40; }

/* Collapsed icon rail (desktop) — toggled by the menu button, remembered in localStorage. */
@media (min-width: 901px) {
  html.nav-collapsed .emp-nav { width: 72px; }
  html.nav-collapsed .emp-nav-head { padding: 16px 0; justify-content: center; }
  html.nav-collapsed .emp-nav-head .t { display: none; }
  html.nav-collapsed .emp-nav-list { padding: 12px 8px; }
  html.nav-collapsed .emp-nav-group { margin-bottom: 6px; }
  html.nav-collapsed .emp-nav-title { font-size: 0; padding: 0; margin: 6px 10px 8px; border-top: 1px solid var(--emp-line); }
  html.nav-collapsed .emp-nav-group:first-child .emp-nav-title { border-top: 0; margin: 0 0 4px; }
  html.nav-collapsed .emp-nav-item { justify-content: center; padding: 11px 0; gap: 0; }
  html.nav-collapsed .emp-nav-item span { display: none; }
  html.nav-collapsed .emp-nav-item.active { box-shadow: none; background: var(--emp-teal); color: #fff; }
  html.nav-collapsed .emp-nav-item.active svg { color: #fff; }
  html.nav-collapsed .emp-nav-item { width: 44px; height: 44px; margin: 2px auto; padding: 0; }
  html.nav-collapsed .emp-nav-list { padding: 12px 0; }
  html.nav-collapsed .emp-nav-user { flex-direction: column; gap: 8px; padding: 12px 8px; }
  html.nav-collapsed .emp-nav-user .who { display: none; }
}

@media (max-width: 900px) {
  .emp-nav { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,0.25); }
  .emp-nav.open { transform: none; }
  .emp-nav-close { display: block; }
  .emp-ham { display: flex; }
  .emp-top-brand { display: flex; }
  .emp-top-title { display: none; }
  .emp-overlay.open { display: block; }
}

/* Main */
.emp-main { max-width: 1200px; margin: 0 auto; width: 100%; padding: 22px 22px 48px; }

/* Cards / layout */
.emp-card { background: var(--emp-card); border-radius: 16px; box-shadow: 0 8px 24px rgba(20,25,60,0.06); padding: 22px; }
.emp-card + .emp-card { margin-top: 18px; }
.emp-card-title { font-weight: 700; color: var(--emp-navy); font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.emp-grid { display: grid; gap: 18px; }
.emp-cols-2 { grid-template-columns: 1fr 1fr; }
.emp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.emp-sidebar-2 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 900px) { .emp-cols-2, .emp-cols-3, .emp-sidebar-2 { grid-template-columns: 1fr; } }

.emp-muted { color: var(--emp-muted); }
.emp-flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 0.9rem; }
.emp-flash.ok { background: rgba(18,185,129,0.12); color: var(--emp-teal-d); }
.emp-flash.err { background: rgba(239,68,68,0.10); color: #c0392b; }

/* Stat row (daily report / leave balance) */
.emp-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.emp-stat { flex: 1; min-width: 150px; display: flex; align-items: center; gap: 12px; }
.emp-stat-ico { width: 40px; height: 40px; border-radius: 12px; background: rgba(18,185,129,0.12); color: var(--emp-teal-d); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.emp-stat-ico svg { width: 20px; height: 20px; }
.emp-stat-val { font-size: 1.35rem; font-weight: 700; color: var(--emp-navy); line-height: 1.1; }
.emp-stat-lbl { font-size: 0.75rem; color: var(--emp-muted); }
.emp-balance { text-align: center; }
.emp-balance .v { font-size: 2rem; font-weight: 800; color: var(--emp-navy); }
.emp-balance .l { font-size: 0.85rem; color: var(--emp-muted); margin-top: 2px; }

/* Tables */
.emp-table { width: 100%; border-collapse: collapse; }
.emp-table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--emp-muted); padding: 12px 14px; background: #f7f9fd; }
.emp-table td { padding: 14px; border-top: 1px solid var(--emp-line); font-size: 0.88rem; }
.emp-table tr:first-child td { border-top: 0; }
.emp-in { color: var(--emp-teal-d); font-weight: 600; }
.emp-out { color: #e05a5a; font-weight: 600; }
.emp-loc { display: block; font-size: 0.72rem; color: var(--emp-muted); font-weight: 400; }
.emp-status-warn { color: #e0952a; font-weight: 600; }
.emp-status-ok { color: var(--emp-teal-d); font-weight: 600; }

/* A day the engine flagged: the whole row follows the link in its status cell. */
.emp-row-link { cursor: pointer; }
.emp-row-link:hover td { background: #f7f9fd; }
.emp-reg-link { text-decoration: none; }
.emp-reg-link:hover { text-decoration: underline; }
.emp-reg-arrow { margin-left: 5px; opacity: 0.55; font-weight: 400; }
.emp-row-link:hover .emp-reg-arrow { opacity: 1; }
.emp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Buttons */
.emp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px 18px; font-weight: 600; font-size: 0.9rem; cursor: pointer; border: 1px solid transparent; text-decoration: none; }
.emp-btn-primary { background: var(--emp-teal); color: #fff; }
.emp-btn-primary:hover { background: var(--emp-teal-d); }
.emp-btn-navy { background: var(--emp-navy); color: #fff; }
.emp-btn-outline { background: #fff; color: var(--emp-navy); border-color: var(--emp-line); }
.emp-btn-outline:hover { border-color: var(--emp-teal); color: var(--emp-teal-d); }
.emp-btn-block { width: 100%; }

/* Clock in/out card */
.emp-clockcard { text-align: center; }
.emp-clockcard .date { color: var(--emp-muted); font-size: 0.9rem; margin-bottom: 14px; }
.emp-clockcard .illus { font-size: 84px; line-height: 1; margin: 10px 0 18px; }
.emp-clockrow { display: flex; justify-content: space-around; border-top: 1px solid var(--emp-line); padding-top: 16px; margin-top: 6px; }
.emp-clockrow .t { font-size: 1.15rem; font-weight: 700; }
.emp-clockrow .l { font-size: 0.75rem; color: var(--emp-muted); }

/* HR documents */
.emp-docgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .emp-docgrid { grid-template-columns: 1fr; } }
.emp-doc { background: var(--emp-cream); border-radius: 12px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.emp-doc-name { font-weight: 600; color: var(--emp-ink); font-size: 0.9rem; }
.emp-doc-meta { font-size: 0.75rem; color: var(--emp-muted); margin-top: 2px; }
.emp-doc-upload { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; color: var(--emp-navy); font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.emp-doc-upload svg { width: 22px; height: 22px; color: var(--emp-teal); }
.emp-chip { font-size: 0.7rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.emp-chip-verify { background: rgba(224,149,42,0.14); color: #c67c14; }
.emp-chip-ok { background: rgba(18,185,129,0.14); color: var(--emp-teal-d); }
.emp-chip-missing { background: #eef1f7; color: var(--emp-muted); }

/* Timesheet grid */
.emp-ts { display: grid; grid-template-columns: 60px repeat(5, 1fr); border: 1px solid var(--emp-line); border-radius: 10px; overflow: hidden; }
.emp-ts-h { background: #f7f9fd; padding: 8px; font-size: 0.72rem; font-weight: 700; color: var(--emp-navy); text-align: center; border-bottom: 1px solid var(--emp-line); }
.emp-ts-h small { display: block; color: var(--emp-muted); font-weight: 500; }
.emp-ts-time { font-size: 0.7rem; color: var(--emp-muted); padding: 10px 6px; text-align: right; border-top: 1px solid var(--emp-line); }
.emp-ts-cell { border-top: 1px solid var(--emp-line); border-left: 1px solid var(--emp-line); min-height: 40px; position: relative; }
.emp-ts-cell.today { background: rgba(18,185,129,0.05); }
.emp-ts-add { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--emp-teal); font-size: 1.1rem; text-decoration: none; opacity: 0.6; }
.emp-ts-add:hover { opacity: 1; }
.emp-todo-item, .emp-upload-item { border: 1px solid var(--emp-line); border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; margin-top: 8px; display: flex; justify-content: space-between; gap: 8px; }

/* Team view */
.emp-team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .emp-team-grid { grid-template-columns: 1fr 1fr; } }
.emp-team-card { background: #f7f9fd; border-radius: 14px; padding: 18px; text-align: center; position: relative; }
.emp-team-av { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 10px; background: var(--emp-navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; }
.emp-team-name { font-weight: 700; color: var(--emp-navy); font-size: 0.9rem; }
.emp-team-role { font-size: 0.75rem; color: var(--emp-muted); }
.emp-team-dot { position: absolute; top: 16px; right: 16px; width: 10px; height: 10px; border-radius: 50%; }
.emp-dot-on { background: var(--emp-teal); }
.emp-dot-off { background: #cbd2e0; }

/* Home launcher tile grid */
.emp-home-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
@media (max-width: 1000px) { .emp-home-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .emp-home-grid { grid-template-columns: repeat(2, 1fr); } }
.emp-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--emp-ink); padding: 8px; }
.emp-tile-ico { width: 88px; height: 88px; border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(20,25,60,0.06); display: flex; align-items: center; justify-content: center; color: var(--emp-teal-d); transition: transform .15s ease, box-shadow .15s ease; }
.emp-tile-ico svg { width: 38px; height: 38px; stroke-width: 1.75; }
.emp-tile:hover .emp-tile-ico { color: var(--emp-navy); }
.emp-tile:hover .emp-tile-ico { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(20,25,60,0.12); }
.emp-tile-lbl { font-size: 0.82rem; font-weight: 600; color: var(--emp-navy); text-align: center; }

/* Manager approval tabs + card */
.emp-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.emp-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 10px; border: 1px solid var(--emp-line); background: #fff; color: var(--emp-navy); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.emp-tab.active { border-color: var(--emp-teal); color: var(--emp-teal-d); box-shadow: 0 4px 12px rgba(18,185,129,0.12); }
.emp-appr-card { border: 1px solid var(--emp-line); border-radius: 14px; padding: 18px; }
.emp-appr-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.emp-appr-dates { display: flex; gap: 22px; }
.emp-appr-date .l { font-size: 0.7rem; color: var(--emp-muted); }
.emp-appr-date .v { font-weight: 600; color: var(--emp-navy); }
.emp-appr-meta { background: #f7f9fd; border-radius: 10px; padding: 12px 16px; display: flex; justify-content: space-between; margin: 12px 0; font-weight: 600; color: var(--emp-navy); }
.emp-reason { text-align: center; margin: 10px 0; }
.emp-reason .q { color: var(--emp-navy); font-weight: 700; }

/* Small form controls reused on emp screens */
.emp-input { width: 100%; padding: 10px 12px; border: 1px solid var(--emp-line); border-radius: 10px; font-size: 0.9rem; font-family: inherit; }
.emp-field-label { display: block; font-size: 0.78rem; color: var(--emp-muted); margin-bottom: 4px; font-weight: 600; }

/* ---- Compact density (employee shell) ---- */
.emp-nav { width: 232px; }
.emp-nav-head { padding: 10px 14px; }
.emp-nav-head img { width: 28px; height: 28px; }
.emp-nav-head .t { font-size: 1.02rem; }
.emp-nav-list { padding: 6px 8px; }
.emp-nav-group { margin-bottom: 6px; }
.emp-nav-title { padding: 6px 10px 2px; font-size: 0.6rem; }
.emp-nav-item { padding: 5px 10px; font-size: 0.8rem; gap: 9px; border-radius: 8px; }
.emp-nav-item svg { width: 15px; height: 15px; }
.emp-nav-user { padding: 8px; }
.emp-avatar { width: 30px; height: 30px; font-size: 0.7rem; }
.emp-top { height: 48px; padding: 0 14px; }
.emp-top-title { font-size: 0.95rem; }
.emp-user-name { font-size: 0.78rem; }
.emp-main { max-width: none; padding: 12px 16px 28px; }
.emp-card { padding: 12px 14px; border-radius: 12px; box-shadow: 0 1px 2px rgba(20,25,60,0.06), 0 0 0 1px rgba(20,25,60,0.04); }
.emp-card + .emp-card { margin-top: 10px; }
.emp-card-title { font-size: 0.92rem; }
.emp-grid { gap: 10px; }
.emp-table th { padding: 6px 10px; font-size: 0.64rem; }
.emp-table td { padding: 6px 10px; font-size: 0.8rem; }
.emp-btn { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.emp-stat-val { font-size: 1.15rem; }
.emp-stat-ico { width: 32px; height: 32px; border-radius: 9px; }
.emp-tile-ico { width: 68px; height: 68px; border-radius: 12px; }
.emp-tile-ico svg { width: 28px; height: 28px; }
.emp-tile-lbl { font-size: 0.76rem; }
.emp-home-grid { gap: 10px; grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1000px) { .emp-home-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .emp-home-grid { grid-template-columns: repeat(3, 1fr); } }
.emp-input { padding: 6px 10px; font-size: 0.8rem; border-radius: 8px; }
.emp-field-label { font-size: 0.68rem; margin-bottom: 3px; }
.emp-team-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
.emp-team-card { padding: 12px; }
.emp-team-av { width: 44px; height: 44px; font-size: 0.9rem; }
.emp-tabs { gap: 6px; margin-bottom: 10px; }
.emp-tab { padding: 6px 14px; font-size: 0.8rem; }
@media (min-width: 901px) { html.nav-collapsed .emp-nav { width: 60px; } }

/* ---- Left menu: no hover underline; section headings as green labels ---- */
.emp-nav-item:hover, .emp-nav-item:focus { text-decoration: none; }
.emp-nav-group { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--emp-line); }
.emp-nav-group:last-child { border-bottom: 0; }
.emp-nav-title {
  display: inline-block; margin: 4px 0 4px 2px; padding: 3px 9px; border-radius: 6px;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--emp-teal-d); background: rgba(18,185,129,0.10);
}
@media (min-width: 901px) {
  html.nav-collapsed .emp-nav-group { border-bottom: 0; padding-bottom: 0; margin-bottom: 6px; }
  html.nav-collapsed .emp-nav-title { display: block; background: none; border-radius: 0; padding: 0; font-size: 0; margin: 6px 10px 8px; border-top: 1px solid var(--emp-line); }
  html.nav-collapsed .emp-nav-group:first-child .emp-nav-title { border-top: 0; margin: 0 0 4px; }
}
