/**
 * HRIS Enterprise Design System
 * Overrides Ant Design + existing decorative CSS with a calm, production HR look.
 * Preserves all React SPA functionality; visual layer only.
 */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  /* Brand — Indigo modern palette (2026-10-13). */
  --hris-primary: #4f46e5;
  --hris-primary-hover: #4338ca;
  --hris-primary-active: #3730a3;
  --hris-primary-soft: #eef2ff;
  --hris-accent: #7c3aed;

  /* Surfaces */
  --hris-bg: #f8fafc;
  --hris-surface: #ffffff;
  --hris-surface-2: #f8fafc;
  --hris-border: #e2e8f0;
  --hris-border-strong: #cbd5e1;

  /* Text */
  --hris-text: #0f172a;
  --hris-text-secondary: #475569;
  --hris-text-muted: #64748b;
  --hris-text-inverse: #ffffff;

  /* Sidebar */
  --hris-sidebar: #1e1b4b;
  --hris-sider: #1e1b4b;
  --hris-sider-hover: rgba(255, 255, 255, 0.06);
  --hris-sider-active: rgba(124, 58, 237, 0.28);
  --hris-sidebar-text: rgba(255, 255, 255, 0.78);
  --hris-sidebar-active: rgba(124, 58, 237, 0.28);

  /* Status — paired with text labels in the SPA; color is not the only cue. */
  --hris-success: #15803d;
  --hris-success-bg: #f0fdf4;
  --hris-warning: #b45309;
  --hris-warning-bg: #fffbeb;
  --hris-danger: #b91c1c;
  --hris-danger-bg: #fef2f2;
  --hris-info: #1d4ed8;
  --hris-info-bg: #eff6ff;

  /* Shape / elevation */
  --hris-radius-sm: 6px;
  --hris-radius: 8px;
  --hris-radius-lg: 10px;
  --hris-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --hris-font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Spacing (4px scale) */
  --hris-space-1: 4px;
  --hris-space-2: 8px;
  --hris-space-3: 12px;
  --hris-space-4: 16px;
  --hris-space-5: 20px;
  --hris-space-6: 24px;
  --hris-space-8: 32px;
  --hris-header-h: 56px;
  --hris-sidebar-w: 240px;
}

/* ——— Base ——— */
html, body, #root {
  font-family: var(--hris-font) !important;
  color: var(--hris-text);
  background: var(--hris-bg) !important;
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 0 !important;
  background: var(--hris-bg) !important;
  color: var(--hris-text) !important;
}

/* Kill decorative template effects from index-DewF9w6C.css */
.ant-card:hover,
.custom-card:hover,
.shadow-custom:hover,
.custom-list .ant-list-item:hover {
  transform: none !important;
  box-shadow: var(--hris-shadow) !important;
}

.ant-btn-primary,
.ant-btn-primary:hover,
.ant-btn-primary:focus,
.custom-modal .ant-modal-header,
.text-gradient {
  background: var(--hris-primary) !important;
  background-image: none !important;
  border-color: var(--hris-primary) !important;
  box-shadow: none !important;
  transform: none !important;
  -webkit-text-fill-color: unset !important;
  color: var(--hris-text-inverse) !important;
}

.ant-btn-primary:hover,
.ant-btn-primary:focus {
  background: var(--hris-primary-hover) !important;
  border-color: var(--hris-primary-hover) !important;
}

/* ——— Layout shell ——— */
.ant-layout {
  background: var(--hris-bg) !important;
  min-height: 100vh;
}

.ant-layout-sider,
.custom-sidebar {
  background: var(--hris-sider) !important;
  background-image: none !important;
  box-shadow: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.ant-layout-sider .ant-layout-sider-children {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Collapse control is pinned to the bottom of the sider. Keep the
   scrolling menu above it so the last items do not draw through it. */
.ant-layout-sider .ant-layout-sider-children > .ant-menu {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin-bottom: 72px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.ant-layout-sider .ant-layout-sider-children > div[style*="bottom"] {
  background: var(--hris-sider) !important;
  z-index: 3;
}

.ant-menu-dark,
.ant-menu-dark .ant-menu-sub {
  background: transparent !important;
}

.ant-menu-dark .ant-menu-item {
  margin: 2px 8px !important;
  width: calc(100% - 16px) !important;
  border-radius: var(--hris-radius) !important;
  height: 40px !important;
  line-height: 40px !important;
  color: rgba(255, 255, 255, 0.72) !important;
}

.ant-menu-dark .ant-menu-item:hover {
  background: var(--hris-sider-hover) !important;
  color: #fff !important;
}

.ant-menu-dark .ant-menu-item-selected {
  background: var(--hris-sider-active) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--hris-accent);
}

.ant-layout-header,
.custom-header {
  background: var(--hris-surface) !important;
  border-bottom: 1px solid var(--hris-border) !important;
  box-shadow: none !important;
  padding: 0 20px !important;
  height: 56px !important;
  line-height: 56px !important;
}

.ant-layout-content {
  padding: 20px 24px 32px !important;
  background: var(--hris-bg) !important;
}

/* ——— Typography ——— */
.ant-typography,
h1, h2, h3, h4, h5 {
  font-family: var(--hris-font) !important;
  color: var(--hris-text);
}

.ant-typography h1,
h1.ant-typography { font-size: 22px !important; font-weight: 600 !important; letter-spacing: -0.01em; }
.ant-typography h2,
h2.ant-typography,
h3.ant-typography,
h4.ant-typography { font-weight: 600 !important; }

/* ——— Cards / surfaces ——— */
.ant-card,
.custom-card,
.custom-table {
  background: var(--hris-surface) !important;
  border: 1px solid var(--hris-border) !important;
  border-radius: var(--hris-radius-lg) !important;
  box-shadow: none !important;
}

.ant-card-head {
  border-bottom: 1px solid var(--hris-border) !important;
  min-height: 48px !important;
  padding: 0 16px !important;
}

.ant-card-head-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--hris-text) !important;
  padding: 12px 0 !important;
}

.ant-card-body {
  padding: 16px !important;
}

/* Metric / statistic cards — compact, not flashy */
.ant-statistic-title {
  color: var(--hris-text-secondary) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ant-statistic-content {
  color: var(--hris-text) !important;
  font-size: 24px !important;
  font-weight: 600 !important;
}

/* ——— Buttons ——— */
.ant-btn {
  font-family: var(--hris-font) !important;
  border-radius: var(--hris-radius) !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  height: 36px;
  padding: 0 14px;
}

.ant-btn-lg { height: 40px; }

.ant-btn-default {
  border-color: var(--hris-border-strong) !important;
  color: var(--hris-text) !important;
  background: var(--hris-surface) !important;
}

.ant-btn-default:hover {
  border-color: var(--hris-primary) !important;
  color: var(--hris-primary) !important;
}

.ant-btn-dangerous {
  background: var(--hris-danger) !important;
  border-color: var(--hris-danger) !important;
}

/* ——— Forms ——— */
.ant-form-item-label > label {
  color: var(--hris-text) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
}

.ant-input,
.ant-input-affix-wrapper,
.ant-select-selector,
.ant-picker,
.ant-input-number,
.ant-input-password {
  border-radius: var(--hris-radius) !important;
  border-color: var(--hris-border-strong) !important;
  font-family: var(--hris-font) !important;
}

.ant-input:hover,
.ant-input-affix-wrapper:hover,
.ant-select:not(.ant-select-disabled):hover .ant-select-selector,
.ant-picker:hover {
  border-color: var(--hris-accent) !important;
}

.ant-input:focus,
.ant-input-affix-wrapper-focused,
.ant-select-focused .ant-select-selector,
.ant-picker-focused {
  border-color: var(--hris-primary) !important;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.16) !important;
}

/* ——— Tables ——— */
.ant-table,
.ant-table-wrapper {
  font-size: 13px !important;
  font-family: var(--hris-font) !important;
}

.ant-table-thead > tr > th {
  background: var(--hris-surface-2) !important;
  color: var(--hris-text-secondary) !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-bottom: 1px solid var(--hris-border) !important;
  padding: 10px 12px !important;
}

.ant-table-tbody > tr > td {
  border-bottom: 1px solid var(--hris-border) !important;
  padding: 10px 12px !important;
  color: var(--hris-text) !important;
}

.ant-table-tbody > tr:hover > td {
  background: var(--hris-primary-soft) !important;
}

.ant-table-container,
.ant-table {
  border-radius: var(--hris-radius-lg) !important;
  overflow: visible !important;
}

/* rc-table inserts a measurement row for scroll.x / fixed columns.
   position:relative on those cells (plus our header padding) leaves a
   blank band above the first data row on every scrolling table. */
.ant-table-measure-row {
  height: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
}
.ant-table-tbody > tr.ant-table-measure-row > th,
.ant-table-tbody > tr.ant-table-measure-row > td,
.ant-table-thead > tr.ant-table-measure-row > th,
.ant-table-thead > tr.ant-table-measure-row > td,
th.ant-table-measure-cell,
td.ant-table-measure-cell {
  position: static !important;
  padding: 0 !important;
  border: 0 !important;
  height: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
}
.ant-table-measure-cell-content {
  height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  visibility: hidden !important;
}

/* Fixed columns sit above scrolling cells so row text does not paint through them. */
.ant-table-cell-fix-left,
.ant-table-cell-fix-right {
  z-index: 2;
  background: var(--hris-surface) !important;
}
.ant-table-thead > tr > th.ant-table-cell-fix-left,
.ant-table-thead > tr > th.ant-table-cell-fix-right {
  z-index: 3;
  background: var(--hris-surface-2) !important;
}

/* ——— Tags / badges ——— */
.ant-tag {
  border-radius: var(--hris-radius-sm) !important;
  border: 1px solid transparent !important;
  font-weight: 500 !important;
  font-size: 12px !important;
  line-height: 20px;
  padding: 0 8px;
}

.ant-tag-success,
.ant-tag-green { background: var(--hris-success-bg) !important; color: var(--hris-success) !important; }
.ant-tag-warning,
.ant-tag-gold,
.ant-tag-orange { background: var(--hris-warning-bg) !important; color: var(--hris-warning) !important; }
.ant-tag-error,
.ant-tag-red { background: var(--hris-danger-bg) !important; color: var(--hris-danger) !important; }
.ant-tag-processing,
.ant-tag-blue { background: var(--hris-info-bg) !important; color: var(--hris-info) !important; }

/* ——— Modals / drawers ——— */
.ant-modal-content {
  border-radius: var(--hris-radius-lg) !important;
  box-shadow: 0 12px 32px rgba(28, 36, 48, 0.16) !important;
}

.ant-modal-header {
  background: var(--hris-surface) !important;
  border-bottom: 1px solid var(--hris-border) !important;
  padding: 16px 20px !important;
}

.ant-modal-title {
  font-weight: 600 !important;
  font-size: 16px !important;
  color: var(--hris-text) !important;
}

.ant-modal-close,
.custom-modal .ant-modal-close,
.custom-modal .ant-modal-title {
  color: var(--hris-text-secondary) !important;
}

.custom-modal .ant-modal-header {
  background: var(--hris-surface) !important;
}

.ant-modal-body { padding: 16px 20px !important; }
.ant-modal-footer {
  border-top: 1px solid var(--hris-border) !important;
  padding: 12px 20px !important;
}

.ant-drawer-header {
  border-bottom: 1px solid var(--hris-border) !important;
}

/* ——— Tabs ——— */
.ant-tabs-tab {
  font-weight: 500 !important;
  color: var(--hris-text-secondary) !important;
  padding: 10px 4px !important;
}

.ant-tabs-tab-active .ant-tabs-tab-btn {
  color: var(--hris-primary) !important;
  font-weight: 600 !important;
}

.ant-tabs-ink-bar {
  background: var(--hris-primary) !important;
}

/* ——— Pagination ——— */
.ant-pagination-item-active {
  border-color: var(--hris-primary) !important;
  background: var(--hris-primary) !important;
}

.ant-pagination-item-active a {
  color: #fff !important;
}

/* ——— Avatar ——— */
.ant-avatar {
  border: 1px solid var(--hris-border) !important;
  box-shadow: none !important;
}

.ant-layout-sider .ant-avatar {
  border: 2px solid rgba(255, 255, 255, 0.25) !important;
}

/* ——— Empty / muted helpers ——— */
.ant-empty-description {
  color: var(--hris-text-muted) !important;
}

/* ——— Scrollbar ——— */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #c5ced8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #a8b3c0; }

/* ——— Print ——— */
@media print {
  .ant-layout-sider, .ant-layout-header { display: none !important; }
  .ant-layout-content { padding: 0 !important; }
}

/* Mobile content breathing room */
@media (max-width: 768px) {
  .ant-layout-content {
    padding: 12px 12px 24px !important;
  }
  .ant-card-body { padding: 12px !important; }
  .ant-statistic-content { font-size: 20px !important; }
}

/* ——— Focus, motion, density (enterprise overlay) ——— */
:focus-visible {
  outline: 2px solid var(--hris-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.ant-layout-header {
  height: var(--hris-header-h) !important;
  line-height: var(--hris-header-h) !important;
}

.ant-menu-dark .ant-menu-submenu-title {
  margin: 2px 8px !important;
  width: calc(100% - 16px) !important;
  border-radius: var(--hris-radius) !important;
  color: rgba(255, 255, 255, 0.72) !important;
}

.ant-menu-dark .ant-menu-submenu-title:hover,
.ant-menu-dark .ant-menu-submenu-open > .ant-menu-submenu-title {
  background: var(--hris-sider-hover) !important;
  color: #fff !important;
}

.ant-form-item {
  margin-bottom: 16px;
}

.ant-form-item-explain-error,
.ant-form-item-explain-error .ant-form-item-explain-error {
  color: var(--hris-danger) !important;
  font-size: 12px !important;
}

.ant-form-item-required::before {
  color: var(--hris-danger) !important;
}

.ant-input-status-error,
.ant-input-affix-wrapper-status-error,
.ant-select-status-error .ant-select-selector,
.ant-picker-status-error {
  border-color: var(--hris-danger) !important;
}

.ant-alert {
  border-radius: var(--hris-radius) !important;
  font-size: 13px;
}

.ant-alert-success {
  background: var(--hris-success-bg) !important;
  border-color: #bbf7d0 !important;
}

.ant-alert-warning {
  background: var(--hris-warning-bg) !important;
  border-color: #fde68a !important;
}

.ant-alert-error {
  background: var(--hris-danger-bg) !important;
  border-color: #fecaca !important;
}

.ant-alert-info {
  background: var(--hris-info-bg) !important;
  border-color: #bfdbfe !important;
}

.ant-checkbox-checked .ant-checkbox-inner,
.ant-radio-checked .ant-radio-inner {
  background-color: var(--hris-primary) !important;
  border-color: var(--hris-primary) !important;
}

.ant-switch.ant-switch-checked {
  background: var(--hris-primary) !important;
}

.ant-dropdown-menu,
.ant-select-dropdown,
.ant-picker-dropdown .ant-picker-panel-container {
  border-radius: var(--hris-radius) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
}

.ant-table-wrapper {
  max-width: 100%;
}

.ant-pagination-item,
.ant-pagination-prev,
.ant-pagination-next {
  min-width: 32px;
  height: 32px;
  line-height: 30px;
}

.ant-empty {
  padding: 24px 8px;
}

/* Login: neutral enterprise surface. The form, fields, and API stay in the bundle. */
body.hris-route-login,
body.hris-route-login #root,
body.hris-route-login #root * {
  background-image: none !important;
}

body.hris-route-login,
body.hris-route-login #root {
  background-color: var(--hris-bg) !important;
}

body.hris-route-login .ant-card {
  width: min(420px, calc(100vw - 32px));
  margin: 10vh auto 24px;
  border: 1px solid var(--hris-border) !important;
  box-shadow: var(--hris-shadow) !important;
}

body.hris-route-login .ant-card,
body.hris-route-login .ant-card-head,
body.hris-route-login .ant-typography,
body.hris-route-login h1,
body.hris-route-login h2,
body.hris-route-login h3 {
  color: var(--hris-text) !important;
  background-image: none !important;
  -webkit-text-fill-color: unset !important;
}

@media (max-width: 768px) {
  .ant-modal {
    max-width: calc(100vw - 16px) !important;
    margin: 8px auto !important;
    top: 8px;
  }
  .ant-modal-body {
    max-height: calc(100vh - 180px);
    overflow: auto;
  }
  .ant-drawer-content-wrapper {
    max-width: 100vw !important;
  }
  .ant-btn {
    min-height: 36px;
  }
  .ant-table {
    font-size: 13px !important;
  }
}

/* ——— Phase 2: tables, forms, dialogs, narrow viewports ——— */
.ant-btn-link,
.ant-btn-background-ghost {
  background: transparent !important;
  box-shadow: none !important;
}

.ant-btn-link {
  border-color: transparent !important;
  color: var(--hris-primary) !important;
  height: auto;
  padding-inline: 4px;
}

.ant-btn-link.ant-btn-dangerous,
.ant-btn-background-ghost.ant-btn-dangerous {
  background: transparent !important;
  color: var(--hris-danger) !important;
  border-color: transparent !important;
}

.ant-btn-background-ghost.ant-btn-primary {
  color: var(--hris-primary) !important;
  border-color: var(--hris-primary) !important;
}

.ant-input:not(textarea),
.ant-input-affix-wrapper,
.ant-select-single:not(.ant-select-customize-input) .ant-select-selector,
.ant-picker,
.ant-input-number {
  min-height: 32px;
}

.ant-form textarea.ant-input {
  min-height: 72px;
}

.ant-form .ant-form-item-label > label {
  height: auto;
}

.ant-input:focus-visible,
.ant-input-affix-wrapper:focus-within,
.ant-select-focused .ant-select-selector,
.ant-picker-focused {
  outline: none;
}

.ant-table-wrapper .ant-table-container {
  border: 1px solid var(--hris-border);
  border-radius: var(--hris-radius);
}

.ant-table-tbody > tr > td {
  vertical-align: middle;
}

.ant-table-tbody .ant-btn + .ant-btn {
  margin-inline-start: 4px;
}

.ant-table .ant-btn-sm {
  height: 28px;
  padding-inline: 8px;
}

.ant-pagination {
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
}

.ant-notification-notice,
.ant-message-notice-content {
  border-radius: var(--hris-radius) !important;
  font-family: var(--hris-font);
}

.ant-notification-notice {
  border: 1px solid var(--hris-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.ant-tabs-nav {
  margin-bottom: 12px;
}

.ant-tabs-nav-wrap {
  overflow: auto;
}

.ant-descriptions-bordered .ant-descriptions-item-label {
  background: var(--hris-surface-2) !important;
  color: var(--hris-text-secondary) !important;
  font-size: 12px;
  font-weight: 600;
}

.ant-layout-content .ant-page-header {
  padding: 0 0 12px;
  background: transparent;
}

.ant-layout-content .ant-page-header-heading-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ant-select-dropdown,
.ant-dropdown,
.ant-picker-dropdown,
.ant-cascader-dropdown {
  max-width: calc(100vw - 16px);
}

.ant-modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ant-modal-footer .ant-btn {
  margin-inline-start: 0 !important;
}

.ant-drawer-body,
.ant-modal-body {
  overflow-wrap: anywhere;
}

@media (max-width: 1440px) {
  .ant-layout-content {
    padding: 16px 20px 28px !important;
  }
}

@media (max-width: 1280px) {
  .ant-layout-content {
    padding: 16px 16px 24px !important;
  }
}

@media (max-width: 1024px) {
  .ant-layout-header {
    padding-inline: 12px !important;
  }
  .ant-card-head-title {
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .ant-layout,
  .ant-layout-content {
    min-width: 0;
    max-width: 100%;
  }
  .ant-table-wrapper {
    overflow-x: auto;
  }
  .ant-form-item-label,
  .ant-form-item-control {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 430px) {
  .ant-modal {
    max-width: calc(100vw - 12px) !important;
    margin: 0 auto !important;
    top: 8px;
    padding-bottom: 8px;
  }
  .ant-modal-header,
  .ant-modal-footer {
    padding-inline: 12px !important;
  }
  .ant-modal-body {
    padding: 12px !important;
    max-height: calc(100dvh - 148px);
  }
  .ant-drawer-content-wrapper {
    width: 100vw !important;
  }
  .ant-pagination-options {
    display: none;
  }
}

@media (max-width: 360px) {
  .ant-layout-content {
    padding: 8px 8px 20px !important;
  }
  .ant-btn {
    padding-inline: 10px;
  }
  .ant-card-head {
    padding-inline: 12px !important;
  }
}

/* ——— 2026-10-13 audit fixes ——— */

/* Search/affix inputs: the outer wrapper owns the border. Without this the
   inner <input> also got a border, which rendered as a box inside a box. */
html body .ant-input-affix-wrapper > input.ant-input,
html body .ant-input-affix-wrapper > textarea.ant-input {
  height: auto !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
.ant-input-search .ant-input-group-addon .ant-btn {
  border-color: var(--hris-border-strong) !important;
}

/* Tables with a fixed (sticky) action column switch to table-layout:fixed,
   which squeezed every column to the same width and split words mid-way
   ("Developmen t", "SUPERVI"). Size columns by content and scroll instead. */
.ant-table-wrapper .ant-table table {
  table-layout: auto !important;
}
.ant-table-wrapper .ant-table-content,
.ant-table-wrapper .ant-table-body {
  overflow-x: auto !important;
}
.ant-table-tbody > tr > td {
  word-break: normal !important;
  overflow-wrap: normal !important;
}
.ant-table-tbody > tr > td a,
.ant-table-tbody > tr > td .ant-typography {
  white-space: nowrap;
}

/* Pages whose header lives inside the card get the same visual weight as
   pages with a top-level title. */
.ant-layout-content > div > .ant-card:first-child > .ant-card-head .ant-card-head-title {
  font-size: 18px !important;
  font-weight: 600 !important;
}

/* Sidebar: active item uses the brand primary with a left accent bar. */
.ant-layout-sider .ant-menu-dark .ant-menu-item-selected,
.ant-layout-sider .ant-menu .ant-menu-item-selected {
  background: rgba(99, 102, 241, 0.22) !important;
  color: #ffffff !important;
  box-shadow: inset 3px 0 0 #818cf8;
}
.ant-layout-sider .ant-menu-item:not(.ant-menu-item-selected):hover {
  background: rgba(255, 255, 255, 0.06) !important;
}
.ant-layout-sider .ant-menu-item .ant-menu-item-icon {
  opacity: 0.9;
}

/* Phones: keep the content full-width and tables scrollable, not squashed. */
@media (max-width: 600px) {
  .ant-table-wrapper .ant-table table {
    min-width: 560px !important;
  }
  .ant-card-head {
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 10px !important;
  }
  .ant-card-head-wrapper {
    flex-wrap: wrap;
    gap: 8px;
  }
  .ant-card-extra {
    margin-inline-start: 0 !important;
  }
  .ant-input-search {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* The SPA bundle hard-codes AntD's default palette in inline styles
   (dashboard stats, header avatar, icons). Map them onto the brand palette. */
[style*="color: rgb(24, 144, 255)"],
[style*="color: rgb(22, 119, 255)"],
[style*="color: #1890ff"],
[style*="color:#1890ff"],
[style*="color: #1677ff"],
[style*="color:#1677ff"] {
  color: var(--hris-primary) !important;
}
[style*="color: rgb(82, 196, 26)"],
[style*="color: #52c41a"],
[style*="color:#52c41a"] {
  color: #16a34a !important;
}
[style*="color: rgb(250, 173, 20)"],
[style*="color: #faad14"],
[style*="color:#faad14"] {
  color: #d97706 !important;
}
[style*="color: rgb(255, 77, 79)"],
[style*="color: #ff4d4f"],
[style*="color:#ff4d4f"] {
  color: #dc2626 !important;
}
/* Background variants come last so a matched background also gets white text. */
[style*="background-color: rgb(24, 144, 255)"],
[style*="background: rgb(24, 144, 255)"],
[style*="background-color: rgb(22, 119, 255)"],
[style*="background: #1890ff"],
[style*="background:#1890ff"],
[style*="background-color: #1890ff"] {
  background-color: var(--hris-primary) !important;
  color: #ffffff !important;
}

/* Dashboard stat cards: icon on a soft tinted tile, tighter spacing. */
.ant-card .ant-statistic-content {
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}
.ant-card-body > div > .anticon[style*="font-size: 24px"],
.ant-card-body > div > div > .anticon[style*="font-size: 24px"] {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: var(--hris-primary-soft);
  font-size: 20px !important;
}

@media (max-width: 600px) {
  /* Sticky columns overlap content on narrow screens; let the table scroll. */
  /* AntD emits position:sticky !important on .ant-table-wrapper .ant-table-cell-fix-*. */
  html body .ant-table-wrapper .ant-table-cell.ant-table-cell-fix-left,
  html body .ant-table-wrapper .ant-table-cell.ant-table-cell-fix-right {
    position: static !important;
    box-shadow: none !important;
  }
  .ant-table-cell-fix-right-first::after,
  .ant-table-cell-fix-left-last::after {
    display: none !important;
  }
  .ant-row > .ant-col {
    margin-bottom: 0;
  }
  .ant-layout-content .ant-row {
    row-gap: 12px !important;
  }
}
