@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* =================================================================
   HRLENS — UNIFIED DESIGN SYSTEM v4
   Premium enterprise SaaS · All portals
   ================================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Primitive tokens ─────────────────────────────────────────── */
:root {
  --font-text: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Gray scale — cool refined neutrals */
  --gray-0:   #ffffff;
  --gray-25:  #fcfcfd;
  --gray-50:  #f9fafb;
  --gray-100: #f2f4f7;
  --gray-200: #eaecf0;
  --gray-300: #d0d5dd;
  --gray-400: #98a2b3;
  --gray-500: #667085;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-800: #1d2939;
  --gray-900: #1a1a1a;
  --gray-950: #0c111d;

  /* Sidebar — slightly cooler than pure black, premium feel */
  --sidebar-bg: #ffffff;

  /* Status colors */
  --green:       #1a1a1a;
  --green-light: #f2f4f7;
  --green-mid:   #d0d5dd;
  --green-dark:  #1a1a1a;
  --amber:       #475467;
  --amber-light: #f9fafb;
  --amber-mid:   #eaecf0;
  --amber-dark:  #344054;
  --red:         #1a1a1a;
  --red-light:   #f2f4f7;
  --red-mid:     #d0d5dd;
  --red-dark:    #344054;
  --blue:        #1a1a1a;
  --blue-light:  #f2f4f7;
  --blue-mid:    #d0d5dd;

  /* Semantic tokens */
  --color-bg:             var(--gray-50);
  --color-surface:        var(--gray-0);
  --color-surface-raised: var(--gray-0);
  --color-surface-inset:  var(--gray-100);
  --color-border:         var(--gray-200);
  --color-border-strong:  var(--gray-300);
  --color-border-focus:   var(--gray-700);
  --color-text:           var(--gray-900);
  --color-text-secondary: var(--gray-600);
  --color-text-muted:     var(--gray-500);
  --color-text-dim:       var(--gray-400);
  --color-text-inverse:   var(--gray-0);
  --color-background-secondary: var(--gray-50);
  --color-background-tertiary:  var(--gray-100);
  --color-green:  #1a1a1a;
  --color-amber:  #475467;
  --color-red:    #475467;
  --color-blue:   #475467;
  --color-header-bg: var(--gray-900);
  --color-header-fg: var(--gray-0);

  /* Elevation */
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: none;

  /* Focus rings */
  --ring-focus: 0 0 0 3px rgba(16,24,40,.10);
  --ring-error: 0 0 0 3px rgba(198,40,40,.12);

  /* Radius */
  --radius-xs: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;

  /* Spacing (4px base) */
  --sp-1:  4px;  --sp-2:  8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-8: 32px;
  --sp-10: 40px; --sp-12: 48px;

  /* Layout */
  --sidebar-width:           216px;
  --sidebar-collapsed-width:  48px;
  --topbar-height:            48px;

  /* Transitions */
  --t-fast: 120ms ease;
  --t-base: 180ms ease;
  --t-slow: 260ms ease;
  --transition-fast: var(--t-fast);
  --transition-base: var(--t-base);

  /* Legacy aliases */
  --brand-green:      #1a1a1a;
  --brand-green-light:#f2f4f7;
  --brand-green-mid:  #d0d5dd;
  --brand-amber:      #475467;
  --brand-amber-light:#f9fafb;
  --brand-amber-mid:  #eaecf0;
  --brand-red:        #475467;
  --brand-red-light:  #f2f4f7;
  --brand-red-mid:    #d0d5dd;
  --brand-blue:       #475467;
  --brand-blue-light: #f2f4f7;
}

/* =================================================================
   BASE
   ================================================================= */

html, body {
  height: 100%;
  font-family: var(--font-text);
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* =================================================================
   SHELL
   ================================================================= */

.shell { display: flex; height: 100vh; overflow: hidden; }

/* =================================================================
   SIDEBAR
   ================================================================= */

.sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--t-base);
  overflow: hidden;
  position: relative;
  z-index: 10;
  border-right: 1px solid #e5e7eb;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar__brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid #e5e7eb;
  gap: var(--sp-3);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar__brand-icon {
  width: 27px; height: 27px;
  background: #1a1a1a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10.5px;
  flex-shrink: 0;
  letter-spacing: -.5px;
  border-radius: 0;
}

.sidebar__brand-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: opacity var(--t-fast);
}

.sidebar.collapsed .sidebar__brand-name { opacity: 0; pointer-events: none; }

.sidebar__badge {
  font-size: 9px;
  background: #1a1a1a;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 0;
  letter-spacing: .04em;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar__nav {
  flex: 1;
  padding: var(--sp-2) 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.sidebar__nav::-webkit-scrollbar { width: 3px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 0; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #6b7280;
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
  white-space: nowrap;
  transition: opacity var(--t-fast);
}

.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 7px 12px;
  color: #1a1a1a;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 400;
  transition: background var(--t-fast), color var(--t-fast);
  border-left: 2px solid transparent;
  text-decoration: none;
  position: relative;
  letter-spacing: .005em;
}

.nav-item:hover { background: #f6f7f9; color: #1a1a1a; }

.nav-item.active {
  background: #eef1f6;
  color: #0c447c;
  border-left-color: #185fa5;
  font-weight: 500;
}
.nav-item.active .nav-item__icon { opacity: 1; }
.nav-item.active .nav-item__icon svg { stroke: #185fa5; }

.nav-item__icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .85;
}

.nav-item__icon svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item__label {
  transition: opacity var(--t-fast);
  white-space: nowrap;
  flex: 1;
}

.sidebar.collapsed .nav-item__label { opacity: 0; width: 0; overflow: hidden; }

.nav-group__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 5px var(--sp-3);
  color: #1a1a1a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  border-left: 2px solid transparent;
  user-select: none;
  transition: background var(--t-fast), color var(--t-fast);
}

.nav-group__header:hover { background: #f9fafb; color: #1a1a1a; }

.nav-group__header.active {
  color: #1a1a1a;
  background: #f3f4f6;
  border-left-color: #9ca3af;
}

.nav-group__chevron {
  margin-left: auto;
  display: flex;
  align-items: center;
  transition: transform .22s ease;
  flex-shrink: 0;
  opacity: .5;
}

.nav-group__chevron svg {
  width: 11px; height: 11px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}

.nav-group.open .nav-group__chevron { transform: rotate(180deg); }

.nav-group__children {
  max-height: 0;
  overflow: hidden;
  transition: max-height .22s ease;
  background: #fafafa;
}

.nav-group.open .nav-group__children { max-height: 260px; }

.nav-item--child {
  padding-left: 34px;
  padding-right: 12px;
  font-size: 12.5px;
  color: #374151;
}

.nav-item--child:hover { color: #1a1a1a; }

.nav-item--child.active {
  border-left-color: #9ca3af;
  background: #f3f4f6;
  color: #1a1a1a;
}

.sidebar.collapsed .nav-group__chevron { display: none; }
.sidebar.collapsed .nav-group__children { max-height: 0 !important; }
.sidebar.collapsed .nav-group__header { padding-left: var(--sp-4); }

.sidebar__footer {
  border-top: 1px solid #e5e7eb;
  padding: var(--sp-1) 0;
  flex-shrink: 0;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  overflow: hidden;
}
.sidebar__user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #eef1f6;
  color: #0c447c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}
.sidebar__user-meta { min-width: 0; transition: opacity var(--t-fast); }
.sidebar__user-name {
  font-size: 12px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__user-role {
  font-size: 10px;
  color: #9ca3af;
  line-height: 1.2;
}
.sidebar.collapsed .sidebar__user-meta { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar__user { justify-content: center; padding: 8px 0; }

/* Notification badge on nav */
.sidebar.collapsed .nav-item__badge,
.sidebar.collapsed .sidebar__badge { opacity: 0; }

/* Collapsed mini-mode: hover tooltips reveal the full label */
.sidebar.collapsed .nav-item,
.sidebar.collapsed .nav-group__header { position: relative; }
.sidebar.collapsed [data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1a1a1a;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  padding: 4px 9px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}
/* Collapsed: a small dot signals a pending badge without the number */
.sidebar.collapsed .nav-item:has(.nav-item__badge)::before {
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 6px; height: 6px;
  background: #854f0b;
  border-radius: 50%;
}

.nav-item__badge {
  background: #faeeda;
  color: #854f0b;
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  font-family: var(--font-mono);
  margin-left: auto;
}

/* =================================================================
   TOPBAR
   ================================================================= */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  width: 0; /* forces flex to fill remaining space, not shrink to content */
}

.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-3);
  flex-shrink: 0;
  box-shadow: none;
}

.topbar__toggle {
  background: none; border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--color-text-muted);
  display: flex; align-items: center;
  border-radius: 0;
  transition: color var(--t-fast), background var(--t-fast);
  margin-right: var(--sp-1);
}

.topbar__toggle:hover { color: var(--color-text); background: var(--gray-100); }

.topbar__toggle svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round;
}

.topbar__breadcrumb {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 12.5px; color: var(--color-text-muted);
}

.crumb-sep { color: var(--gray-300); font-size: 13px; }
.crumb-current { color: var(--color-text-secondary); font-weight: 500; }

.topbar__spacer { flex: 1; }
.topbar__title { font-size: 13px; font-weight: 500; color: var(--color-text-muted); }

.topbar__user {
  display: flex; align-items: center; gap: var(--sp-3);
}

.topbar__user > span { font-size: 12.5px; color: var(--color-text-muted); }

.topbar__avatar {
  width: 31px; height: 31px;
  background: var(--gray-800);
  color: var(--gray-0);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
  border-radius: 0;
  letter-spacing: -.2px;
}

.topbar__logout {
  font-size: 12px; color: var(--color-text-secondary);
  padding: 5px var(--sp-3);
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: none; cursor: pointer;
  font-family: var(--font-text); font-weight: 400;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}

.topbar__logout:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--color-text);
}

.topbar__divider { width: 1px; height: 28px; background: var(--color-border); flex-shrink: 0; }
.topbar__info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar__name { font-size: 12px; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.topbar__role { font-size: 10px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.sidebar__view-switch { padding: 4px 0; border-top: 1px solid #e5e7eb; }

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-3);
  scroll-behavior: smooth;
  width: 100%;
  min-width: 0;
}

/* =================================================================
   PAGE HEADER
   ================================================================= */

.page-header {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-1);
  border-bottom: 1px solid var(--color-border);
}

.page-title {
  font-size: 15px; font-weight: 600;
  color: var(--color-text);
  letter-spacing: -.03em; line-height: 1.2;
}

.page-subtitle {
  font-size: 13px; color: var(--color-text-muted);
  margin-top: 5px; font-weight: 400;
}

/* =================================================================
   TYPOGRAPHY
   ================================================================= */

.text-display  { font-size: 28px; font-weight: 700; letter-spacing: -.04em; line-height: 1.15; }
.text-heading  { font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.text-subhead  { font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.text-body     { font-size: 13px; line-height: 1.55; }
.text-small    { font-size: 12px; line-height: 1.5; }
.text-label    { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.text-mono     { font-family: var(--font-mono); font-size: 12.5px; }

.text-primary   { color: var(--color-text); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-dim       { color: var(--color-text-dim); }
.text-success   { color: #1b8a2a; }
.text-warning   { color: #475467; }
.text-danger    { color: #c62828; }

/* =================================================================
   BUTTONS
   ================================================================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 4px; height: 26px; padding: 0 var(--sp-2);
  font-family: var(--font-text); font-size: 11px;
  font-weight: 500; letter-spacing: .01em;
  cursor: pointer; border: 1px solid transparent;
  border-radius: 0; outline: none;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast),
              transform .1s ease;
  text-decoration: none; -webkit-appearance: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }

.btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

.btn:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--gray-900); color: var(--gray-0); border-color: var(--gray-900); box-shadow: none; }
.btn-primary:hover { background: var(--gray-800); border-color: var(--gray-800); box-shadow: none; }
.btn-primary:active { background: var(--gray-950); }

.btn-secondary { background: var(--gray-0); color: var(--color-text); border-color: var(--gray-300); box-shadow: none; }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-ghost { background: transparent; color: var(--color-text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--color-text); }

.btn-danger { background: #c62828; color: var(--gray-0); border-color: #c62828; box-shadow: none; }
.btn-danger:hover { background: #b71c1c; border-color: #b71c1c; }

.btn-sm { height: 29px; padding: 0 var(--sp-3); font-size: 12px; }
.btn-lg { height: 41px; padding: 0 var(--sp-3); font-size: 14px; }
.btn-full { width: 100%; }

/* Modal button aliases */
.btn-modal {
  display: inline-flex; align-items: center; height: 36px; padding: 0 var(--sp-3);
  font-family: var(--font-text); font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; border-radius: 0;
}
.btn-primary-m  { background: var(--gray-900); color: #fff; border-color: var(--gray-900); }
.btn-primary-m:hover { background: var(--gray-800); }
.btn-primary-m:disabled { opacity: .4; cursor: not-allowed; }
.btn-secondary-m { background: var(--gray-0); color: var(--color-text); border-color: var(--gray-300); }
.btn-secondary-m:hover { background: var(--gray-50); }

/* =================================================================
   FORMS
   ================================================================= */

.form-group { margin-bottom: var(--sp-1); }

.form-label {
  display: block; font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .065em;
  color: var(--color-text-secondary); margin-bottom: 4px;
}

.form-label .req { color: #475467; margin-left: 2px; }

.form-input {
  width: 100%; height: 32px; padding: 4px 8px;
  border: 1px solid var(--gray-300); border-radius: 0;
  background: var(--gray-0);
  font-family: var(--font-text); font-size: 12px; color: var(--color-text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
}

.form-input::placeholder { color: var(--gray-400); }
.form-input:hover:not(:focus) { border-color: var(--gray-400); }
.form-input:focus { border-color: var(--gray-600); background: var(--gray-0); box-shadow: var(--ring-focus); }
.form-input.is-error { border-color: #475467 !important; background: #f9fafb !important; }
.form-input.is-error:focus { box-shadow: var(--ring-error); }
.form-input--sm { height: 26px; font-size: 10px; padding: 2px 4px; }

textarea.form-input { height: auto; padding: var(--sp-2) var(--sp-3); resize: vertical; line-height: 1.5; min-height: 82px; }

select.form-input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2398a2b3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; cursor: pointer;
}

input[type="date"].form-input, input[type="time"].form-input { cursor: pointer; }

.form-hint { font-size: 11.5px; color: var(--color-text-muted); margin-top: 5px; line-height: 1.55; }
.form-error { font-size: 12px; color: #475467; margin-top: 5px; display: flex; align-items: center; gap: var(--sp-1); }
.form-input--mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .02em; }

.form-row { display: flex; gap: var(--sp-1); margin-bottom: var(--sp-1); }
.form-row:last-child { margin-bottom: 0; }
.form-col { flex: 1; min-width: 0; }

/* ep-* aliases (employee portal profile edit) */
.ep-lbl {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .065em;
  color: var(--color-text-secondary); margin-bottom: 5px;
}

.ep-inp {
  width: 100%; height: 26px; padding: 0 var(--sp-2);
  border: 1px solid var(--gray-300); border-radius: 0;
  background: var(--gray-0);
  font-family: var(--font-text); font-size: 13px; color: var(--color-text);
  outline: none; -webkit-appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.ep-inp:hover:not(:focus) { border-color: var(--gray-400); }
.ep-inp:focus { border-color: var(--gray-600); box-shadow: var(--ring-focus); }
.ep-inp--err { border-color: #475467 !important; background: #f9fafb !important; }

textarea.ep-inp { height: auto; padding: var(--sp-2) var(--sp-3); resize: vertical; min-height: 82px; }

select.ep-inp {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2398a2b3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; cursor: pointer;
}

.ep-inp--mono { font-family: var(--font-mono); font-size: 12.5px; }

.ep-err { font-size: 11px; color: #475467; margin-top: 4px; padding: 3px 8px; background: #f2f4f7; border-radius: 0; }

.ep-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--color-border); }

.ep-save {
  height: 33px; padding: 0 var(--sp-4);
  background: var(--gray-900); color: #fff; border: none; border-radius: 0;
  font-family: var(--font-text); font-size: 12.5px; font-weight: 500; cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast);
}
.ep-save:hover { background: var(--gray-800); }

.ep-cancel {
  height: 33px; padding: 0 var(--sp-4);
  background: var(--gray-0); color: var(--color-text);
  border: 1px solid var(--gray-300); border-radius: 0;
  font-family: var(--font-text); font-size: 12.5px; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.ep-cancel:hover { background: var(--gray-50); border-color: var(--gray-400); }

/* =================================================================
   CARDS / SECTIONS
   ================================================================= */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
  margin-bottom: var(--sp-3);
  overflow: hidden;
}

.card__header {
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gray-25); min-height: 44px;
}

.card__title { font-size: 13px; font-weight: 600; color: var(--color-text); letter-spacing: -.01em; }
.card__body { padding: var(--sp-5); }

/* Info sections — dark header (brand identity) */
.info-section, .ep-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
  margin-bottom: var(--sp-4);
  overflow: hidden;
}

.info-section__header, .ep-header {
  background: var(--gray-900); color: var(--gray-0);
  padding: 10px var(--sp-5);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 38px;
}

.ep-header-title { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.ep-pencil {
  font-size: 13px; cursor: pointer;
  color: rgba(255,255,255,.45); padding: 2px var(--sp-2);
  transition: color var(--t-fast);
  background: none; border: none; border-radius: 0;
  line-height: 1; font-family: var(--font-text);
}
.ep-pencil:hover { color: rgba(255,255,255,.9); }

.info-section__body { padding: var(--sp-5); }
.ep-view { padding: 0; }

.ep-edit {
  padding: var(--sp-5) var(--sp-4); display: none;
  border-top: 2px solid rgba(255,255,255,.08);
  background: var(--gray-25);
}
.ep-edit.active { display: block; }

.form-section {
  border: 1px solid var(--color-border);
  border-radius: 0;
  margin-bottom: var(--sp-4);
  background: var(--color-surface);
  box-shadow: none;
  overflow: hidden;
}

.form-section__header {
  background: var(--gray-900); color: var(--gray-0);
  padding: 10px var(--sp-5);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  min-height: 38px; display: flex; align-items: center;
}

.form-section__body { padding: var(--sp-4) var(--sp-4); }

/* =================================================================
   TABS
   ================================================================= */

.tabs-bar {
  display: flex; align-items: flex-end;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: var(--sp-6); gap: 0;
  overflow-x: auto; scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }

.tab-link {
  display: flex; align-items: center; gap: 6px;
  padding: 5px var(--sp-3) 7px;
  font-size: 12.5px; font-weight: 500;
  color: var(--color-text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap; letter-spacing: .01em;
}
.tab-link:hover { color: var(--color-text-secondary); background: var(--gray-50); }
.tab-link.active { color: var(--color-text); border-bottom-color: var(--gray-900); font-weight: 600; }

.profile-tabs { display: flex; border-bottom: 2px solid var(--color-border); margin-bottom: var(--sp-3); }

.profile-tab {
  padding: 5px var(--sp-3) 7px;
  font-size: 13px; font-weight: 500;
  color: var(--color-text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color var(--t-fast), border-color var(--t-fast); letter-spacing: .01em;
}
.profile-tab:hover { color: var(--color-text-secondary); background: var(--gray-50); }
.profile-tab.active { color: var(--color-text); border-bottom-color: var(--gray-900); font-weight: 600; }

/* =================================================================
   DATA TABLES
   ================================================================= */

.data-table-wrap {
  overflow-x: auto;
  border-radius: 0;
  border: 1px solid var(--color-border);
  box-shadow: none;
}
.data-table-scroll { max-height: 336px; overflow-y: auto; }
.data-table-scroll-lg { max-height: 432px; overflow-y: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.data-table thead tr { background: var(--gray-900); }

.data-table thead th {
  color: rgba(255,255,255,.65);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px var(--sp-2); text-align: left;
  white-space: nowrap; border: none;
  position: sticky; top: 0; z-index: 1;
  background: var(--gray-900);
}

.data-table thead th:first-child { padding-left: var(--sp-3); }
.data-table thead th:last-child  { padding-right: var(--sp-3); }

.data-table tbody tr { border-bottom: 1px solid var(--gray-200); transition: background var(--t-fast); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: var(--gray-25); }
.data-table tbody tr:hover td { background: var(--gray-100) !important; }

.data-table td { padding: 3px var(--sp-2); vertical-align: middle; color: var(--color-text); line-height: 1.35; }
.data-table td:first-child { padding-left: var(--sp-3); }
.data-table td:last-child  { padding-right: var(--sp-3); }
.data-table td.mono { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-secondary); white-space: nowrap; }
.data-table td.muted  { color: var(--color-text-muted); }
.data-table td.right  { text-align: right; }
.data-table td.center { text-align: center; }
.data-table td.action { white-space: nowrap; }

/* Legacy dt table */
table.dt { width: 100%; border-collapse: collapse; }
table.dt td { padding: 10px var(--sp-5); border-bottom: 1px solid var(--color-border); font-size: 13px; vertical-align: top; line-height: 1.5; }
table.dt td:first-child { width: 180px; color: var(--color-text-muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
table.dt tr:last-child td { border-bottom: none; }

/* =================================================================
   STAT CARDS
   ================================================================= */

.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-1); margin-bottom: var(--sp-2); }

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: var(--sp-2);
  box-shadow: none;
  border-top: 3px solid var(--gray-800);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.stat-card:hover { box-shadow: none; transform: translateY(-1px); }

.stat-card--green { border-top-color: #1a1a1a; }
.stat-card--amber { border-top-color: #475467; }
.stat-card--red   { border-top-color: #475467; }
.stat-card--blue  { border-top-color: #475467; }

.stat-card__label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-muted); margin-bottom: var(--sp-2); }
.stat-card__value { font-size: 30px; font-weight: 700; color: var(--color-text); letter-spacing: -.05em; line-height: 1; margin-bottom: var(--sp-1); }
.stat-card__sub   { font-size: 12px; color: var(--color-text-muted); }
.stat-card__badge { display: inline-block; font-size: 10px; font-family: var(--font-mono); padding: 1px 6px; border-radius: 0; margin-top: var(--sp-1); }

/* =================================================================
   BADGES
   ================================================================= */

.badge-green, .badge-amber, .badge-red, .badge-blue, .badge-gray,
.status-badge, .status-active, .status-inactive, .status-invited, .status-pending {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 0;
  white-space: nowrap; line-height: 1.6;
  border: 1px solid transparent;
}

.badge-green, .status-active   { background: #e8f5e9; color: #1b8a2a; border-color: #1b8a2a40; }
.badge-amber, .status-invited,
.status-pending                 { background: #fff; color: #475467; border-color: #475467; }
.badge-red                      { background: #ffebee;   color: #c62828;   border-color: #c6282840; }
.badge-blue                     { background: #f2f4f7;  color: #1a1a1a;            border-color: #d0d5dd; }
.badge-gray, .status-inactive   { background: var(--gray-100); color: var(--color-text-secondary); border-color: var(--gray-200); }

/* =================================================================
   ALERTS / FLASH MESSAGES
   ================================================================= */

.flash, .alert {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0; border: 0.5px solid var(--gray-200);
  border-left: 3px solid transparent;
  font-size: 13px; font-weight: 500;
  margin-bottom: var(--sp-4); line-height: 1.5;
  animation: contentFadeIn .3s ease;
}

.flash-success, .alert-success { background: #e8f5e9; border-left-color: #1b8a2a; color: #1b8a2a; }
.flash-error,   .alert-error   { background: #ffebee; border-left-color: #c62828; color: #c62828; }
.flash-warning, .alert-warning { background: #f2f4f7; border-left-color: #475467; color: #344054; font-weight: 600; }
.flash-info,    .alert-info    { background: #f2f4f7; border-left-color: #475467; color: #344054; }

/* =================================================================
   EMPTY STATES
   ================================================================= */

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--sp-12) var(--sp-6); text-align: center; }

.empty-state__icon { width: 52px; height: 52px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 0; display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-4); }
.empty-state__icon svg { width: 22px; height: 22px; stroke: var(--gray-400); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty-state__title { font-size: 14px; font-weight: 600; color: var(--color-text); margin-bottom: var(--sp-2); letter-spacing: -.01em; }
.empty-state__sub   { font-size: 13px; color: var(--color-text-muted); max-width: 300px; line-height: 1.6; margin-bottom: var(--sp-3); }

/* =================================================================
   PROFILE BANNER (employee portal)
   ================================================================= */

.profile-banner {
  background: #ffffff; color: #111827;
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-4);
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid #e5e7eb;
}

.profile-banner__avatar {
  width: 52px; height: 52px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
  letter-spacing: -.5px; color: #1a1a1a;
  overflow: hidden;
}

.profile-banner__avatar img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
}

.profile-banner__name { font-size: 16px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; color: #111827; }
.profile-banner__meta { font-size: 12px; color: #6b7280; margin-top: 4px; line-height: 1.4; }

.profile-banner__status {
  margin-left: auto;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-size: 10px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 0;
}

.profile-banner__status.is-active {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* =================================================================
   CHECK-IN / CHECK-OUT (employee portal)
   ================================================================= */

.btn-checkin {
  background: var(--gray-900); color: #fff;
  border: 1px solid var(--gray-800);
  padding: 0 var(--sp-4); height: 34px;
  font-family: var(--font-text); font-size: 10px; font-weight: 600;
  cursor: pointer; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 0;
  transition: background var(--t-fast), box-shadow var(--t-fast);
  box-shadow: none;
}
.btn-checkin:hover { background: var(--gray-800); box-shadow: none; }
.btn-checkin svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.checkin-status {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 5px var(--sp-3);
  border: 1px solid var(--color-border); border-radius: 0;
  font-size: 12px; background: var(--gray-0); box-shadow: none;
}

.checkin-status__dot    { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.checkin-status__label  { font-weight: 600; }
.checkin-status__time   { color: var(--color-text-muted); font-family: var(--font-mono); font-size: 11px; }

/* =================================================================
   QUICK ACTION TILES
   ================================================================= */

.qa-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--sp-3); padding: var(--sp-5) var(--sp-4);
  background: var(--gray-0);
  border: 1px solid var(--color-border); border-radius: 0;
  cursor: pointer; text-decoration: none; color: var(--color-text);
  box-shadow: none;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.qa-btn:hover { border-color: var(--gray-400); box-shadow: none; transform: translateY(-1px); color: var(--color-text); }

.qa-btn svg { width: 22px; height: 22px; stroke: var(--color-text-secondary); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--t-fast); }
.qa-btn:hover svg { stroke: var(--color-text); }

.qa-btn span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-secondary); transition: color var(--t-fast); }
.qa-btn:hover span { color: var(--color-text); }

/* =================================================================
   MODALS / OVERLAYS
   ================================================================= */

.modal-overlay, .wfo-popup {
  position: fixed; inset: 0;
  background: rgba(16,24,40,.55);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.modal {
  background: var(--gray-0); width: 440px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none; overflow: hidden;
}

.modal__header {
  background: var(--gray-900); color: var(--gray-0);
  padding: 12px var(--sp-5);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}

.modal__body { padding: var(--sp-3); }
.modal__footer { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--color-border); display: flex; gap: var(--sp-2); justify-content: flex-end; background: var(--gray-25); }

.modal-option {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--color-border); border-radius: 0;
  cursor: pointer; margin-bottom: var(--sp-3);
  transition: border-color var(--t-base), background var(--t-fast), box-shadow var(--t-fast);
}
.modal-option:last-child { margin-bottom: 0; }
.modal-option:hover { border-color: var(--gray-400); background: var(--gray-25); }
.modal-option.selected { border-color: var(--gray-700); background: var(--gray-50); box-shadow: 0 0 0 3px rgba(16,24,40,.07); }

.modal-option__icon { width: 40px; height: 40px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.modal-option__icon svg { width: 19px; height: 19px; stroke: var(--color-text-secondary); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.modal-option__label { font-weight: 600; font-size: 13px; }
.modal-option__sub   { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

.wfo-popup__card {
  background: var(--gray-0); width: 340px; text-align: center;
  padding: var(--sp-10) var(--sp-8);
  border-top: 4px solid #1a1a1a;
  border-radius: 0; box-shadow: none;
}
.wfo-popup__icon { width: 64px; height: 64px; background: #f2f4f7; border: 1px solid #d0d5dd; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto var(--sp-4); }
.wfo-popup__title  { font-size: 17px; font-weight: 700; color: #1a1a1a; margin-bottom: var(--sp-2); letter-spacing: -.02em; }
.wfo-popup__office { font-size: 13px; color: var(--color-text-muted); margin-bottom: var(--sp-4); }
.wfo-popup__bar    { height: 3px; background: var(--gray-200); margin-top: var(--sp-5); overflow: hidden; border-radius: 0; }
.wfo-popup__fill   { height: 100%; background: #1a1a1a; width: 0; transition: none; }

/* =================================================================
   DOC ITEMS
   ================================================================= */

.doc-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--color-border); font-size: 13px; transition: background var(--t-fast); }
.doc-item:last-child { border-bottom: none; }
.doc-item:hover { background: var(--gray-25); }

/* =================================================================
   IP COMPONENTS
   ================================================================= */

.ip-chip { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 11.5px; padding: 2px 8px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 0; color: var(--color-text-secondary); white-space: nowrap; }
.ip-row { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.ip-row .form-input { width: 200px; flex-shrink: 0; }
.btn-ip-remove { background: none; border: 1px solid var(--color-border); border-radius: 0; padding: 5px 7px; cursor: pointer; color: var(--color-text-dim); display: flex; align-items: center; transition: border-color var(--t-fast), color var(--t-fast); }
.btn-ip-remove:hover { border-color: #475467; color: #475467; }
.ip-hint { font-size: 12px; color: var(--color-text-muted); margin-bottom: var(--sp-4); line-height: 1.65; padding: var(--sp-3) var(--sp-4); background: var(--gray-25); border: 1px solid var(--gray-200); border-radius: 0; }
.ip-hint code { font-family: var(--font-mono); font-size: 11.5px; background: var(--gray-200); padding: 1px 5px; border-radius: 0; }

/* =================================================================
   UTILITIES
   ================================================================= */

.mono-hint { font-family: var(--font-mono); font-size: 12px; background: var(--gray-100); padding: 2px 6px; border-radius: 0; color: var(--color-text-secondary); }

.val-negative { color: #475467; font-family: var(--font-mono); }
.val-negative::before { content: '('; }
.val-negative::after  { content: ')'; }

.req { color: #475467; margin-left: 2px; }
.org-row-selected td { background: var(--gray-100) !important; }

.btn-eye { background: none; border: 1px solid var(--color-border); border-radius: 0; padding: 5px 8px; cursor: pointer; color: var(--color-text-muted); display: flex; align-items: center; transition: border-color var(--t-fast), color var(--t-fast); }
.btn-eye:hover { border-color: var(--gray-500); color: var(--color-text); }

/* =================================================================
   PLACEHOLDER PAGE
   ================================================================= */

.placeholder-panel { border: 1px dashed var(--gray-300); border-radius: 0; background: var(--color-surface); padding: var(--sp-12) var(--sp-8); text-align: center; margin-top: var(--sp-2); }
.placeholder-panel__icon svg { width: 32px; height: 32px; stroke: var(--gray-300); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; margin-bottom: var(--sp-3); }
.placeholder-panel__title { font-size: 14px; font-weight: 500; color: var(--color-text-muted); margin-bottom: var(--sp-1); }
.placeholder-panel__sub { font-size: 12.5px; color: var(--color-text-dim); }

/* =================================================================
   SUPER ADMIN OVERRIDES
   ================================================================= */

:root { --sa-accent: #1a1a1a; }

.sa-shell .sidebar__brand-icon { background: var(--sa-accent); color: #fff; }
.sa-shell .nav-item.active,
.sa-shell .nav-item--child.active { border-left-color: rgba(255,255,255,.5); }
.sa-shell .topbar__avatar { background: var(--sa-accent); }

.sa-super-badge { font-size: 9.5px; font-weight: 700; background: var(--sa-accent); color: #fff; padding: 2px 8px; border-radius: 0; letter-spacing: .05em; text-transform: uppercase; }

/* =================================================================
   LOGIN PAGE
   ================================================================= */

.login-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: var(--gray-50);
  background-image: radial-gradient(var(--gray-200) 1px, transparent 1px);
  background-size: 28px 28px;
}

.login-card { background: var(--gray-0); border: 1px solid var(--color-border); border-radius: 0; width: 390px; box-shadow: none; overflow: hidden; }
.login-card__header { background: var(--gray-900); color: var(--gray-0); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid rgba(255,255,255,.06); }
.login-card__logo   { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.login-card__sub    { font-size: 11px; color: rgba(255,255,255,.38); margin-top: 3px; letter-spacing: .07em; text-transform: uppercase; }
.login-card__body   { padding: var(--sp-3); }

/* =================================================================
   PRINT
   ================================================================= */

@media print {
  .sidebar, .topbar { display: none !important; }
  .main { display: block !important; }
  .content { padding: 0 !important; overflow: visible !important; }
}

/* =================================================================
   DASHBOARD — Component classes
   ================================================================= */

/* Layout grids */
.dash-grid-2       { display: grid; grid-template-columns: 1fr 1fr;    gap: 16px; margin-bottom: 16px; }
.dash-grid-sidebar { display: grid; grid-template-columns: 1fr 320px;  gap: 16px; margin-bottom: 16px; }

/* Header link (light text in dark header) */
.dash-header-link {
  font-size: 10.5px;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  transition: color var(--t-fast);
}
.dash-header-link:hover { color: rgba(255,255,255,.8); }

/* Clear / empty state inside panel */
.dash-clear-state {
  padding: var(--sp-2);
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--gray-0);
}

/* Panel body (scrollable section inside info-section) */
.dash-panel-body { background: var(--gray-0); }

/* Pending groups */
.dash-pending-group {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--color-border);
}

.dash-pending-group:last-child { border-bottom: none; }

.dash-pending-group--amber { background: #f9fafb; }

.dash-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.dash-pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}

.dash-pending-name { font-weight: 500; }

.dash-pending-meta {
  font-size: 10.5px;
  color: var(--color-text-dim);
}

/* Activity feed */
.dash-activity-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: 5px var(--sp-3);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--t-fast);
}

.dash-activity-row:last-child { border-bottom: none; }
.dash-activity-row:hover { background: var(--gray-25); }

.dash-activity-icon {
  width: 28px; height: 28px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.dash-activity-body { flex: 1; min-width: 0; }

.dash-activity-ts {
  font-size: 10px;
  color: var(--color-text-dim);
  margin-top: 2px;
  font-family: var(--font-mono);
}

.dash-view-link {
  font-size: 10.5px;
  color: var(--color-text-dim);
  white-space: nowrap;
  padding-top: 2px;
  transition: color var(--t-fast);
}
.dash-view-link:hover { color: var(--color-text-secondary); }

/* Table footer (totals row) */
.dash-tfoot-row { background: var(--gray-900); color: var(--gray-0); }
.dash-tfoot-row td { color: var(--gray-0) !important; }

/* System diagnostics bar */
.dash-diag-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--sp-5);
  cursor: pointer;
  user-select: none;
  transition: opacity var(--t-fast);
}
.dash-diag-bar:hover { opacity: .92; }

.dash-diag-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.dash-diag-label {
  font-size: 10.5px;
  color: var(--color-text-muted);
}

.dash-diag-caret {
  font-size: 10.5px;
  color: var(--color-text-dim);
  transition: transform .2s;
  margin-left: var(--sp-1);
}

/* Button with notification count */
.btn-badge { position: relative; }

.btn-count {
  position: absolute;
  top: -7px;
  right: -7px;
  background: #475467;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: var(--font-mono);
}

/* =================================================================
   SVG SAFETY — Ensure all nav SVGs render as stroke icons
   Catches any inline SVGs missing fill="none" attribute
   ================================================================= */

.nav-item svg,
.nav-group__header svg,
.sidebar__footer .nav-item svg {
  fill: none !important;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 15px;
  height: 15px;
}

/* Topbar toggle and other shell SVGs */
.topbar__toggle svg {
  fill: none !important;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* =================================================================
   EMPLOYEE PORTAL — Component classes
   ================================================================= */

/* ── Attendance card block ───────────────────────────────────── */
.ep-att-status-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.ep-att-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ep-att-grid {
  display: grid;
  gap: var(--sp-2);
}

.ep-att-card {
  background: var(--gray-25);
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: 9px var(--sp-3);
}

.ep-att-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-dim);
  margin-bottom: 3px;
}

.ep-att-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

/* ── Leave balance chips ─────────────────────────────────────── */
.ep-leave-chips {
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ── Section review status badge in sec_pencil/sec_badge ────── */
.ep-section-badge {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 0;
}

/* =================================================================
   EMPLOYEE PORTAL — Component classes
   ================================================================= */

/* ── Dashboard header ──────────────────────────────────────── */
.ep-dash-header {
  background: var(--gray-900);
  color: var(--gray-0);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-3);
  border-radius: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.ep-dash-name {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,.95);
  letter-spacing: -.025em;
  line-height: 1.2;
}

.ep-dash-meta {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  margin-top: 4px;
  line-height: 1.5;
}

.ep-dash-date {
  font-size: 11px;
  color: rgba(255,255,255,.3);
  margin-top: 6px;
  font-family: var(--font-mono);
  letter-spacing: .03em;
}

.ep-dash-actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* ── Section layout helpers ──────────────────────────────────── */
.ep-section--flush { margin-bottom: 0; }

.ep-view--padded { padding: var(--sp-4); }

.ep-section-gap { margin-bottom: var(--sp-4); }

/* ── Entry blocks (experience / education) ───────────────────── */
.ep-entry-block {
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--gray-25);
}

.ep-entry-block:last-child { margin-bottom: 0; }

.ep-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
}

.ep-entry-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #475467;
  font-size: 12px;
  font-family: var(--font-text);
  padding: 2px 6px;
  border-radius: 0;
  transition: background var(--t-fast);
}
.ep-entry-remove:hover { background: #f2f4f7; }

/* ── Form grid layouts ───────────────────────────────────────── */
.ep-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.ep-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.ep-field-wrap { margin-bottom: var(--sp-3); }

/* ── Employee profile page grid layout ──────────────────────── */
/* Row wrapper — sections inside sit side-by-side */
.ep-profile-row {
  display: grid;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
  align-items: start;   /* sections don't stretch to match tallest */
}
/* Row templates */
.ep-profile-row--2-1 { grid-template-columns: 2fr 1fr; }
.ep-profile-row--1-2 { grid-template-columns: 1fr 2fr; }
.ep-profile-row--1-1 { grid-template-columns: 1fr 1fr; }
/* Sections inside a row have no bottom margin — the row handles gap */
.ep-profile-row > .ep-section { margin-bottom: 0; }
/* Two-column view table inside ep-section */
.ep-view-2col { display: grid; grid-template-columns: 1fr 1fr; }
.ep-view-2col .dt { width: 100%; }

/* ── File input wrapper ──────────────────────────────────────── */
.ep-file-wrap {
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: 6px var(--sp-3);
  background: var(--gray-25);
}

.ep-doc-existing {
  font-size: 10.5px;
  color: #1a1a1a;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Status badges inside ep-header ─────────────────────────── */
.ep-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 0;
  border: 1px solid transparent;
  white-space: nowrap;
}

.ep-status-badge--amber { background: #f9fafb; color: #344054; border-color: #eaecf0; }
.ep-status-badge--red   { background: #f2f4f7;   color: #344054;   border-color: #d0d5dd; }
.ep-status-badge--green { background: #f2f4f7; color: #1a1a1a; border-color: #d0d5dd; }

/* Mini status badge (dashboard change-request list) */
.ep-status-mini {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 0;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Tab badge (profile/documents tab notification) */
.ep-tab-badge {
  display: inline-flex;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 0;
  margin-left: 6px;
  border: 1px solid transparent;
}
.ep-tab-badge--red { background: #f2f4f7; color: #344054; border-color: #d0d5dd; }

/* ── Header inner alignment row ─────────────────────────────── */
.ep-header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── Lock note (read-only section hint) ──────────────────────── */
.ep-lock-note {
  font-size: 10px;
  color: rgba(255,255,255,.38);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Attendance (employee portal) ────────────────────────────── */
.ep-att-status-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--color-border);
}

.ep-att-type-label {
  font-size: 13px;
  font-weight: 600;
}

.ep-att-location {
  font-size: 12px;
  color: var(--color-text-dim);
}

.ep-att-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}

.ep-att-card {
  padding: var(--sp-4) var(--sp-5);
  border-right: 1px solid var(--color-border);
}

.ep-att-card:last-child { border-right: none; }

.ep-att-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-1);
}

.ep-att-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.ep-att-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Leave chips (balance display) ──────────────────────────── */
.ep-leave-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--color-border);
}

.ep-leave-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px var(--sp-2);
  border-radius: 0;
  font-size: 11px;
  border: 1px solid var(--color-border);
}

/* Leave table HR note row */
.ep-leave-hr-note {
  padding: 0 var(--sp-5) 6px !important;
  font-size: 10.5px !important;
  border-bottom: none !important;
}

/* ── Table show-more footer ──────────────────────────────────── */
.ep-table-footer {
  padding: var(--sp-2) var(--sp-4);
  background: var(--gray-25);
  border-top: 1px solid var(--color-border);
  text-align: center;
  border-radius: 0;
}

/* =================================================================
   REPORTS — Filter bar & chart containers
   ================================================================= */

.reports-filter-bar {
  background: var(--gray-0);
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  display: flex;
  gap: var(--sp-4);
  align-items: flex-end;
  flex-wrap: wrap;
  box-shadow: none;
}

/* ── Timesheet nature chip (used in reports table too) ── */
.ts-nature-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--gray-100);
  border: 1px solid var(--color-border);
  border-radius: 0;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* Chart canvas fills card body */
.card__body canvas {
  display: block;
  width: 100% !important;
  /* height is controlled by Chart.js via maintainAspectRatio:false — do NOT set height:100% */
}

/* =================================================================
   TOAST NOTIFICATIONS
   ================================================================= */
.toast-container {
  position: fixed; top: 60px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: 380px;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; font-size: 12px;
  background: var(--gray-0); border: 0.5px solid var(--gray-200);
  border-left: 3px solid transparent;
  animation: toastIn .3s ease;
  position: relative; overflow: hidden;
  box-shadow: none;
}
.toast.removing { animation: toastOut .25s ease forwards; }
.toast-success { border-left-color: #1b8a2a; }
.toast-error   { border-left-color: #c62828; }
.toast-warning { border-left-color: #98a2b3; }
.toast-info    { border-left-color: #475467; }
.toast__icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.toast__icon svg { width: 14px; height: 14px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toast-success .toast__icon svg { stroke: #1b8a2a; }
.toast-error   .toast__icon svg { stroke: #c62828; }
.toast-warning .toast__icon svg { stroke: #475467; }
.toast-info    .toast__icon svg { stroke: #475467; }
.toast__body { flex: 1; min-width: 0; }
.toast__msg { font-weight: 500; color: var(--color-text); line-height: 1.4; }
.toast__sub { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.toast__close {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--color-text-dim); cursor: pointer;
  opacity: .5; transition: opacity .15s;
}
.toast__close:hover { opacity: 1; }
.toast__progress {
  position: absolute; bottom: 0; left: 0; height: 2px;
  animation: toastShrink 4s linear forwards;
}
.toast-success .toast__progress { background: #1a1a1a; }
.toast-error   .toast__progress { background: #1a1a1a; }
.toast-warning .toast__progress { background: #475467; }
.toast-info    .toast__progress { background: #475467; }

@keyframes toastIn   { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut  { from { transform: translateX(0); opacity: 1; } to { transform: translateX(30px); opacity: 0; } }
@keyframes toastShrink { from { width: 100%; } to { width: 0; } }

/* =================================================================
   MODAL ANIMATION
   ================================================================= */
.modal-overlay {
  transition: background .2s ease;
}
.modal-box, [id$="Modal"] > div:first-child {
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* =================================================================
   CONTENT FADE-IN
   ================================================================= */
.content {
  animation: contentFadeIn .3s ease;
}
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =================================================================
   ENHANCED ROW HOVER
   ================================================================= */
.data-table tbody tr {
  transition: background var(--t-fast), padding-left .15s;
}

/* Employee list cards (expense page, etc.) */
[style*="margin-bottom:6px"][style*="display:flex"][style*="align-items:center"] {
  transition: border-color .15s;
}

/* =================================================================
   EMPTY STATE
   ================================================================= */
.empty-state {
  text-align: center;
  padding: 40px 24px;
}
.empty-state__icon {
  width: 52px; height: 52px;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.empty-state__icon svg {
  width: 24px; height: 24px;
  stroke: var(--color-text-dim);
  fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.empty-state__title {
  font-size: 14px; font-weight: 500;
  color: var(--color-text); margin-bottom: 6px;
}
.empty-state__desc {
  font-size: 12px; color: var(--color-text-muted);
  line-height: 1.6; max-width: 260px; margin: 0 auto 16px;
}

/* =================================================================
   STAT CARD POLISH
   ================================================================= */
.stat-card {
  transition: box-shadow var(--t-fast), transform .15s ease, border-color .15s;
}
.stat-card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-right: 4px; vertical-align: -2px;
}
.stat-card__icon svg {
  width: 13px; height: 13px; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* =================================================================
   STAGGERED PAGE LOAD ANIMATIONS
   ================================================================= */
.stagger { opacity: 0; transform: translateY(12px); }
.stagger.in { animation: staggerUp .4s ease forwards; }
.stagger-d1.in { animation-delay: .05s; }
.stagger-d2.in { animation-delay: .1s; }
.stagger-d3.in { animation-delay: .15s; }
.stagger-d4.in { animation-delay: .2s; }
.stagger-d5.in { animation-delay: .25s; }
.stagger-d6.in { animation-delay: .3s; }
.stagger-d7.in { animation-delay: .35s; }
.stagger-d8.in { animation-delay: .4s; }
.stagger-d9.in { animation-delay: .45s; }
.stagger-d10.in { animation-delay: .5s; }

@keyframes staggerUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Row slide variant */
.stagger-row { opacity: 0; transform: translateX(16px); }
.stagger-row.in { animation: staggerSlide .35s ease forwards; }

@keyframes staggerSlide {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Accent bar grow on stat cards */
.stat-card__bar {
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s ease;
}
.stat-card__bar.in { transform: scaleX(1); }

/* Enhanced row hover — slide right */
.data-table tbody tr:hover td { padding-left: 10px; }
.info-section .stagger-row:hover,
[class*="employee-row"]:hover {
  transform: translateX(2px);
  background: var(--gray-50);
  border-color: var(--gray-300);
}

/* Page header fade */
.page-header { animation: staggerUp .4s ease; }
.page-title  { animation: staggerUp .35s ease; }

/* Tabs bar entrance */
.tabs-bar { animation: staggerUp .3s .15s ease both; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS — 768px breakpoint
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: -180px; top: 0; bottom: 0; z-index: 100;
    transition: left .25s ease; box-shadow: none;
  }
  .sidebar.mobile-open {
    left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }
  .sidebar.collapsed { left: -48px; }
  .main { margin-left: 0 !important; width: 100% !important; }
  .topbar { padding: 4px 8px !important; }
  .topbar__breadcrumb { display: none; }
  .topbar__info { display: none; }
  .topbar__spacer { flex: 1; }
  .content { padding: var(--sp-2) !important; }
  .page-header { flex-direction: column; gap: 4px; align-items: flex-start !important; }
  .page-header .btn, .page-header a.btn { font-size: 10px !important; padding: 3px 8px !important; }
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }
  .tabs-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-link { white-space: nowrap; flex-shrink: 0; }
  .info-section__header { font-size: 11px !important; padding: 6px 10px !important; }
  .form-row, .form-grid { flex-direction: column !important; }
  .form-row > *, .form-grid > * { width: 100% !important; min-width: 0 !important; }

  /* Phase 3a — protective mobile hardening (additive, desktop unaffected) */
  /* Any wide data-table scrolls horizontally instead of overflowing the page. */
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  /* Guard against accidental horizontal page scroll from any stray wide element. */
  html, body { max-width: 100%; overflow-x: hidden; }
  /* Comfortable tap targets for primary actions on touch screens. */
  .btn, button.btn, a.btn { min-height: 36px; }
  /* Receipt/expense thumbnails and images never exceed the viewport. */
  .content img { max-width: 100%; height: auto; }
}
/* Mobile sidebar overlay backdrop */
.mobile-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 99;
}
@media (max-width: 768px) {
  .mobile-overlay.active { display: block; }
}

/* ─── Phase 3a: employee-page mobile refinements (scoped to .shell--emp only) ───
   Additive, inside the mobile breakpoint, prefixed with .shell--emp so they
   apply ONLY to employee pages and cannot affect admin pages or desktop. */
@media (max-width: 768px) {
  /* Stack inline two-column grids (1fr 1fr) so they don't squash on a phone. */
  .shell--emp .content [style*="grid-template-columns:1fr 1fr"],
  .shell--emp .content [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* NOTE: dense tables already scroll via the existing .data-table mobile rule
     (min-width + horizontal scroll). We deliberately do NOT add display:block
     here — it would conflict with that working pattern. */
  /* Comfortable tap target for the small icon/text action buttons in tables. */
  .shell--emp .content table.data-table button,
  .shell--emp .content table.data-table a {
    min-height: 30px;
  }
  /* Phase 3b: the check-in/out button is the primary employee action on a
     phone — give it a comfortable touch target (taller, larger text) than
     the dense 34px/10px desktop size. Topbar-only, employee-only, mobile-only. */
  .shell--emp .btn-checkin {
    height: 40px;
    font-size: 12px;
    padding: 0 16px;
  }
  .shell--emp .btn-checkin svg {
    width: 16px;
    height: 16px;
  }
}
