/* Shared visual system. Loaded after the legacy stylesheets. */
:root {
  --blue: #1762bb;
  --bg: #f8fbff;
  --border: #e5eaf1;
  --text: #1c2b3e;
  --muted: #607087;
  --shadow: 0 2px 12px rgba(30, 64, 105, 0.035);
}
html {
  background: #f8fbff;
}
body,
main {
  background: #f8fbff;
  color: var(--text);
}
main {
  min-width: 0;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
:where(button, a, input, select):focus-visible {
  outline: 2px solid #1762bb;
  outline-offset: 2px;
}
.content {
  max-width: 1580px;
  margin: 0 auto;
  padding: 27px clamp(18px, 3vw, 42px) 45px;
}
.topbar {
  margin: 0;
  top: 0;
  height: 68px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  padding-inline: clamp(18px, 3vw, 42px);
}
.search {
  width: min(360px, 42vw);
  background: #fff;
  border-color: #dce4ed;
  color: #53657d;
  cursor: pointer;
}
.search:hover,
.table-search:hover {
  border-color: #a8bdd5;
}
.search:focus-visible,
.table-search:focus-within {
  border-color: #1762bb;
  box-shadow: 0 0 0 3px rgba(23, 98, 187, 0.1);
}
.search kbd {
  font-family: inherit;
  font-size: 13px;
}
.brand .brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  overflow: hidden;
  flex: none;
  background: transparent;
  box-shadow: none;
}
.brand .brand-mark img {
  position: absolute;
  width: 96px;
  height: 96px;
  max-width: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.sidebar { padding-top: 30px; }
.sidebar .brand {
  height: auto;
  min-height: 58px;
  align-items: center;
  padding-bottom: 14px;
}
.sidebar .workspace {
  background: #fff;
  border-color: #e5eaf1;
}
.sidebar .workspace-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  background: #edf5fd;
  color: #1762bb;
}
.sidebar .workspace-icon svg { width: 17px; height: 17px; }
.avatar,
.workspace > span {
  background: #eaf2fc;
  color: #1762bb;
}
.eyebrow,
.breadcrumb b {
  color: #1762bb;
}
.eyebrow span {
  background: #1762bb;
  box-shadow: 0 0 0 3px #eaf2fc;
}
.page-head h1,
.module-head h1 {
  color: #16283e;
  letter-spacing: -0.025em;
}
.page-head p,
.module-head p {
  color: #607087;
}
.page-head h1 span {
  background: transparent;
  box-shadow: none;
}
.kpi,
.panel,
.module-stat,
.data-panel,
.workflow-strip {
  background: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.kpi:hover,
.module-stat:hover {
  border-color: #cbdbee;
  box-shadow: 0 8px 22px rgba(24, 64, 112, 0.07);
}
.quick-btn,
.module-primary,
.primary-action,
.submit,
.pagination button.active {
  background: #1762bb;
  border-color: #1762bb;
  color: #fff;
  box-shadow: none;
}
.quick-btn:hover,
.module-primary:hover,
.primary-action:hover {
  background: #114e99;
  border-color: #114e99;
}
.module-primary {
  font-size: 13px;
  padding-inline: 16px;
  min-height: 40px;
}
.module-tab.active,
.panel-head a {
  color: #1762bb;
}
.module-tab.active:after,
.progress i,
.table-progress i,
.legend i.actual,
.funnel i {
  background: #1762bb;
}
.funnel i {
  background: linear-gradient(90deg, #1762bb, #5b98db);
}
.bars i:nth-child(8) {
  background: #1762bb;
}
.line-spark path {
  stroke: #1762bb;
}
.blue,
.violet,
.purple,
.cyan,
.amber,
.orange,
.stat-icon.blue,
.stat-icon.purple,
.stat-icon.green,
.stat-icon.orange,
.stat-icon.red,
.kpi-icon.blue,
.kpi-icon.violet,
.kpi-icon.cyan,
.kpi-icon.amber {
  background: #edf4fc;
  color: #1762bb;
}
.module-stat > svg {
  color: #b0bcc9;
}
.data-badge,
.stage-select {
  background: #fff !important;
  border: 1px solid #dce5ef;
  color: #465b73;
}
.data-badge.red,
.data-badge.urgent,
.stage-select.red {
  color: #a8434b;
  border-color: #edc8cc;
}
.data-badge.green,
.data-badge.safe,
.stage-select.green {
  color: #187352;
  border-color: #bee3d2;
}
.data-badge.orange,
.stage-select.orange {
  color: #956018;
  border-color: #ecd7ac;
}
.data-badge.blue,
.data-badge.purple,
.stage-select.blue,
.stage-select.purple {
  color: #1762bb;
  border-color: #cbdff4;
}
.permission-banner {
  background: #fff;
  border-color: var(--border);
  color: #586a7d;
}
.permission-banner > svg,
.permission-banner b {
  color: #1762bb;
}
.permission-banner span {
  border-color: var(--border);
  color: #586a7d;
}
.table-wrap thead th,
th {
  background: #fbfdff;
  color: #617188;
}
.table-wrap tbody tr:hover,
tbody tr:hover {
  background: #f7fbff;
}
.table-tools {
  gap: 9px;
  flex-wrap: wrap;
}
.table-search {
  width: min(300px, 100%);
  min-height: 38px;
  padding-inline: 11px;
}
.table-search input {
  font-size: 13px;
  min-width: 0;
}
.table-tools > button,
.stage-filter,
.table-filter-label {
  min-height: 38px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  color: #435570;
}
.table-tools > button:hover,
.secondary:hover,
.icon-btn:hover {
  color: #1762bb;
  background: #f1f7ff;
  border-color: #bed6ef;
}
.table-tools > button.search-trigger {
  background: #1762bb;
  color: #fff;
  border-color: #1762bb;
  font-weight: 700;
  padding-inline: 14px;
}
.table-tools > button.search-trigger:hover {
  background: #114e99;
  color: #fff;
}
.table-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  font-weight: 650;
}
.table-filter-label svg {
  width: 15px;
  height: 15px;
}
.table-filter-label select {
  border: 0;
  color: #263a52;
  background: transparent;
  font: inherit;
  max-width: 160px;
  min-width: 0;
}
.table-tools button b {
  background: #eaf2fc;
  color: #1762bb;
}
.pagination {
  color: #607087;
}
.pagination span {
  display: block;
  font-size: 13px;
}
.command {
  border-color: #dce4ed;
  max-height: min(560px, 78vh);
}
.command-results {
  overflow-y: auto;
  max-height: min(440px, 60vh);
  padding: 4px 8px 12px;
}
.command-results a {
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
  color: #263a52;
}
.command-results a:hover,
.command-results a:focus-visible {
  background: #f1f7ff;
}
.command-results a > svg:first-child {
  width: 18px;
  height: 18px;
  color: #1762bb;
}
.command-results a > svg:last-child {
  width: 15px;
  height: 15px;
  margin-left: auto;
  color: #8ba0b8;
}
.command-results b,
.command-results small {
  display: block;
}
.command-results b {
  font-size: 13px;
}
.command-results small {
  color: #6c7b90;
  font-size: 13px;
  margin-top: 3px;
}
.command-empty {
  display: block;
  padding: 18px 12px;
  color: #607087;
  font-size: 13px;
}
.overlay-clear {
  background: transparent;
  backdrop-filter: none;
}
.role-menu {
  border-color: var(--border);
}
.role-head span {
  color: #1762bb;
}
.active-account {
  background: #f5f9fe;
}
.stage-select:focus-visible {
  outline-color: #1762bb;
}
@media (max-width: 1100px) {
  .content {
    padding-inline: 20px;
  }
}
@media (max-width: 760px) {
  .sidebar.open {
    z-index: 45;
  }
  .topbar {
    margin: 0;
    top: 0;
    border-radius: 0;
    padding-inline: 14px;
  }
  .content {
    padding: 20px 14px 36px;
  }
  .module-head,
  .page-head {
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
  }
  .module-primary {
    width: auto;
    min-width: 40px;
    padding-inline: 14px;
    font-size: 13px;
  }
  .module-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .table-tools {
    align-items: stretch;
  }
  .table-search {
    width: 100%;
    flex: 1 1 100%;
  }
  .table-filter-label {
    flex: 1 1 140px;
    justify-content: space-between;
  }
  .table-filter-label select {
    max-width: 120px;
  }
  .table-tools > button:nth-of-type(2) {
    display: flex;
  }
  .permission-banner {
    flex-wrap: wrap;
  }
  .permission-banner span {
    margin-left: 25px;
  }
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .command {
    top: 72px;
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 90px);
  }
  .role-menu {
    width: min(310px, calc(100vw - 24px));
    right: 12px;
  }
}
@media (max-width: 430px) {
  .module-stats {
    grid-template-columns: 1fr 1fr;
  }
  .module-stat {
    gap: 9px;
    min-width: 0;
  }
  .module-stat strong {
    overflow-wrap: anywhere;
  }
  .search {
    width: 40px;
    flex: none;
    justify-content: center;
    padding: 0;
  }
  .search span,
  .search kbd {
    display: none;
  }
  .top-actions {
    gap: 4px;
  }
  .table-filter-label {
    flex-basis: 100%;
  }
  .table-filter-label select {
    max-width: none;
  }
}
.attendance-search-trigger {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid #1762bb;
  border-radius: 8px;
  background: #1762bb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.attendance-search-trigger svg {
  width: 15px;
  height: 15px;
}
.attendance-search-trigger:hover {
  background: #114e99;
}
@media (max-width: 760px) {
  .attendance-search-trigger {
    flex: 0 0 auto;
  }
}

/* Shared navigation and page hierarchy */
.sidebar nav a > span,
.sidebar nav .nav-parent > span {
  color: #34465a;
}
.sidebar nav a em {
  background: #eef2f6;
  color: #43546a;
}
body.sidebar-collapsed nav a:after { background: #263a52; box-shadow: 0 5px 15px rgba(38, 58, 82, .16); }
body.sidebar-collapsed nav a:before { border-right-color: #263a52; }
.sidebar .expand-btn { cursor: pointer; }
.content .eyebrow { display: none; }
.dashboard-page > .breadcrumb { margin-bottom: 8px; }
.dashboard-page > .page-head h1 { margin-top: 0; }
.module-stats .module-stat:nth-child(4n+1) .stat-icon { background: #e9f2fc; color: #275e9f; }
.module-stats .module-stat:nth-child(4n+2) .stat-icon { background: #e8f6ef; color: #248053; }
.module-stats .module-stat:nth-child(4n+3) .stat-icon { background: #fdf1e4; color: #a86923; }
.module-stats .module-stat:nth-child(4n+4) .stat-icon { background: #eef1f6; color: #52647b; }
.command-results a:nth-of-type(4n+2) > svg:first-child { color: #248053; }
.command-results a:nth-of-type(4n+3) > svg:first-child { color: #a86923; }
.command-results a:nth-of-type(4n+4) > svg:first-child { color: #52647b; }
.module-stats .module-stat > svg:last-child,
.module-view .table-search > svg,
.dashboard-page .search > svg { color: #697b90; }
.dashboard-page .kpi-grid .kpi:nth-child(4n+2) .kpi-icon { background: #e8f6ef; color: #248053; }
.dashboard-page .kpi-grid .kpi:nth-child(4n+3) .kpi-icon { background: #fdf1e4; color: #a86923; }
.dashboard-page .kpi-grid .kpi:nth-child(4n+4) .kpi-icon { background: #eef1f6; color: #52647b; }
.module-view .table-tools { position: relative; }
.module-view .data-panel:has(.filter-select),
.absence-filter-panel:has(.filter-select) { overflow: visible; }
.filter-select { position: relative; flex: 0 1 190px; min-width: 160px; }
.filter-select-trigger {
  width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 12px; border: 1px solid #d7e0e9; border-radius: 9px;
  background: #fff; color: #26394d; font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.filter-select-trigger span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.filter-select-trigger svg { width: 16px; height: 16px; flex: none; color: #64758a; }
.filter-select-popover {
  position: absolute; z-index: 100; top: calc(100% + 6px); left: 0;
  width: max(100%, 240px); max-width: min(340px, calc(100vw - 34px));
  padding: 8px; background: #fff; border: 1px solid #dbe3eb; border-radius: 11px;
  box-shadow: 0 14px 30px rgba(25, 44, 66, .16);
}
.filter-select-search { display: flex; align-items: center; gap: 8px; border: 1px solid #dbe3eb; border-radius: 8px; padding: 0 10px; background: #fff; }
.filter-select-search svg { width: 16px; height: 16px; flex: none; color: #697b90; }
.filter-select-search input { min-width: 0; width: 100%; height: 36px; border: 0; outline: 0; color: #24344a; background: transparent; font-size: 13px; }
.filter-select-options { max-height: 240px; overflow-y: auto; padding-top: 5px; }
.filter-select-options button { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 9px; border: 0; border-radius: 7px; background: #fff; color: #26394d; text-align: left; font-size: 13px; cursor: pointer; }
.filter-select-options button:hover, .filter-select-options button[aria-selected="true"] { background: #edf4fc; color: #194f8b; }
.filter-select-options button svg { width: 15px; height: 15px; flex: none; }
.filter-select-options p { padding: 10px; color: #64758a; font-size: 13px; }
.table-refresh-row { display: flex; justify-content: flex-end; padding: 8px 16px 0; }
.table-refresh { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #d7e0e9; border-radius: 8px; background: #fff; color: #52647b; cursor: pointer; }
.table-refresh:hover { background: #edf4fc; color: #1762bb; }
.table-refresh:disabled { opacity: .55; cursor: not-allowed; }
.table-refresh svg { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .module-view .table-tools > .filter-select { grid-column: 1 / -1; width: 100%; }
  .filter-select-popover { width: 100%; }
  .crud-actions:has(.back-button) { height: auto; min-height: 67px; flex-wrap: wrap; padding-block: 10px; }
  .crud-actions:has(.back-button) > span { width: 100%; }
}
.top-actions .topbar-icon {
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid #dce4ed;
  color: #687990;
  border-radius: 9px;
}
.top-actions .topbar-icon svg { width: 18px; height: 18px; }
.top-actions .topbar-icon:hover { background: #f1f6fb; color: #1762bb; }

/* Compact workflow steps and controls */
.workflow-step.current { color: #315b89; }
.workflow-step.current i {
  background: #eaf2fc;
  color: #1762bb;
  border: 1px solid #cbdff4;
  box-shadow: none;
}
.workflow-step.done { color: #20784e; }
.workflow-step.done i { background: #e4f6eb; color: #17804b; }
.workflow-line.done { background: #8fcca6; }
.view-toggle button.active { background: #eaf2fc; color: #1762bb; }
.stage-filter,
.table-filter-label select,
.absence-filter-grid select,
.attendance-table-entries select {
  cursor: pointer;
  min-height: 42px;
  padding-inline: 12px;
}
.table-filter-label {
  padding: 0;
  border: 0;
  background: transparent;
}
.table-filter-label select {
  max-width: none;
  width: 100%;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  background: #fff;
  color: #263a52;
  font-weight: 650;
}
.table-filter-label select:hover,
.stage-filter:hover,
.absence-filter-grid select:hover { border-color: #9cb8d4; }

/* Forms use the same centered content width and button colors */
.crud-page { max-width: 1120px; margin-inline: auto; }
.crud-top { flex-direction: column; align-items: flex-start; gap: 10px; }
.crud-top .back-button { order: -1; align-self: flex-start; }
.back-button { min-height: 38px; color: #31577d; font-size: 13px; }
.back-button:hover { background: #f2f7fc; border-color: #b9d1e9; }
.section-heading > span,
.context-line > span { background: #eaf2fc; color: #1762bb; }
.draft-note { background: #f6f9fc; color: #53657a; border-color: #dce4ed; }
.submit-crud,
.success-page button { background: #1762bb; }
.submit-crud:hover,
.success-page button:hover { background: #114e99; }

/* Search rows align each input and trigger as one unit */
.attendance-table-panel .attendance-table-toolbar {
  grid-template-columns: auto minmax(200px, 320px) minmax(180px, 1fr) auto;
  justify-content: initial;
  gap: 10px;
}
.attendance-table-panel .attendance-absence-toolbar,
.attendance-table-panel .absence-approval-toolbar {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.attendance-table-panel .attendance-table-search {
  min-width: 0;
  width: 100%;
  height: 42px;
  justify-self: stretch;
}
.attendance-table-panel .attendance-table-entries select,
.attendance-table-panel .attendance-table-date-range input { height: 42px; }
.attendance-table-panel .attendance-search-trigger {
  height: 42px;
  min-height: 42px;
  width: auto;
  padding-inline: 13px;
  white-space: nowrap;
}
.attendance-status-pill {
  height: 24px;
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
  border: 1px solid #dce5ef;
  background: #fff;
  color: #465b73;
}
.attendance-status-pill.normal { background: #fff; color: #187352; border-color: #bee3d2; }
.attendance-status-pill.late { background: #fff; color: #956018; border-color: #ecd7ac; }
.attendance-status-pill.half-day { background: #fff; color: #a8434b; border-color: #edc8cc; }
.attendance-status-pill.leave,
.attendance-status-pill.sick,
.attendance-status-pill.permit { background: #fff; color: #1762bb; border-color: #cbdff4; }
.attendance-status-pill.alpha,
.attendance-status-pill.absent { background: #fff; color: #617389; border-color: #dce5ef; }

/* Search dialog close is a light icon, with its only result visibly selected */
.command > div:first-child button {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #617389;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.command > div:first-child button:hover { color: #1762bb; background: #f2f7fc; }
.command-results a.command-result-selected { background: #eaf2fc; outline: 1px solid #cbdff4; }
.detail-drawer header > button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #617389;
}
.detail-drawer header > button svg { width: 18px; height: 18px; }
.detail-drawer header > button:hover { background: #f2f7fc; color: #1762bb; }
@media (max-width: 1040px) and (min-width: 761px) {
  .attendance-table-panel .attendance-table-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .attendance-table-toolbar .attendance-table-date-range { grid-column: 2 / -1; grid-row: 1; }
  .attendance-table-toolbar .attendance-table-search { grid-column: 1 / 3; }
  .attendance-table-panel .attendance-absence-toolbar,
  .attendance-table-panel .absence-approval-toolbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}
@media (max-width: 760px) {
  .sidebar .expand-btn { display: none !important; }
  .top-actions .topbar-icon { width: 32px; }
  .attendance-table-panel .attendance-table-toolbar,
  .attendance-table-panel .attendance-absence-toolbar,
  .attendance-table-panel .absence-approval-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .attendance-table-toolbar .attendance-table-entries,
  .attendance-table-toolbar .attendance-table-date-range { grid-column: 1 / -1; }
  .attendance-table-toolbar .attendance-table-search { grid-column: 1; }
  .attendance-table-toolbar .attendance-search-trigger { grid-column: 2; }
}
.workflow-step i {
  width: 25px;
  height: 25px;
  font-size: 13px;
  background: #eef2f6;
  border: 0;
  box-shadow: none;
}
.workflow-step.done i { background: #e4f6eb; color: #17804b; }
.workflow-step.current i { background: #1762bb; color: #fff; box-shadow: 0 0 0 4px #eaf2fc; }
.quick-btn,
.module-primary,
.submit-form,
.primary-action,
.apply-filter,
.access-denied button,
.pagination button.active { background: #1762bb; border-color: #1762bb; box-shadow: none; }
.quick-btn:hover,
.module-primary:hover,
.submit-form:hover,
.primary-action:hover,
.apply-filter:hover { background: #114e99; }
.attachment-add:hover,
.avatar-picker-add:hover { border-color: #1762bb; color: #1762bb; background: #f1f7ff; }
.avatar-picker-add,
.detail-subhead-action,
.detail-tab.active { color: #1762bb; }
.detail-tab.active { border-bottom-color: #1762bb; }

/* Date range control follows the Vendira two-month picker. */
.crm-range-picker { width: 100%; min-width: 0; }
.crm-date-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #dce4ed;
  border-radius: 9px;
  background: #fff;
  color: #263a52;
  font-size: 13px;
  font-weight: 650;
}
.crm-date-trigger:hover { border-color: #9cb8d4; background: #fff; }
.crm-date-trigger span { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-date-trigger svg { width: 16px; height: 16px; flex: none; color: #617389; }
.crm-range-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, .13);
}
.crm-range-dialog {
  width: min(680px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #dce4ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .14);
}
.crm-range-calendars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.crm-range-calendar { min-width: 0; }
.crm-range-month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.crm-range-month strong { color: #1c2b3e; font-size: 15px; font-weight: 750; }
.crm-range-month button {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: #263a52;
}
.crm-range-month button:hover { background: #f1f7ff; }
.crm-range-month svg { width: 17px; height: 17px; }
.crm-range-weekdays, .crm-range-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.crm-range-weekdays { margin-bottom: 6px; color: #617389; font-size: 13px; font-weight: 700; }
.crm-range-weekdays span { padding: 7px 0; }
.crm-range-days button {
  min-width: 0; min-height: 38px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: #263a52; font-size: 14px;
}
.crm-range-days button:hover { background: #f1f7ff; }
.crm-range-days button.muted { color: #a0adbd; }
.crm-range-days button.between { background: #eaf2fc; border-radius: 0; color: #1762bb; }
.crm-range-days button.selected,
.crm-range-days button.selected:hover { background: #1762bb; color: #fff; font-weight: 750; }
.crm-range-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.crm-range-presets button {
  min-height: 38px; border: 1px solid #dce4ed; border-radius: 8px;
  background: #fff; color: #263a52; font-size: 13px;
}
.crm-range-presets button:hover { border-color: #9cb8d4; background: #f1f7ff; }
@media (max-width: 760px) {
  .attendance-table-toolbar .crm-range-picker { grid-column: 1 / -1; }
  .crm-range-dialog { padding: 12px; }
  .crm-range-calendars { grid-template-columns: 1fr; }
  .crm-range-calendar:last-child { display: none; }
  .crm-range-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Inbox: keep the breadcrumb inside the content and let controls wrap cleanly. */
/* The shell breadcrumb sits above the page and duplicates its own breadcrumb. */
.app-shell > main > .breadcrumb { display: none !important; }
.inbox-view { min-width: 0; }
.inbox-view .breadcrumb { margin: 0 0 18px; }
.inbox-view .module-head { gap: 16px; }
.inbox-view .module-head > div { min-width: 0; }
.inbox-view .module-primary { flex: none; white-space: nowrap; }
.inbox-view .module-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inbox-view .module-stat { min-width: 0; }
.inbox-view .module-stat strong { overflow-wrap: anywhere; }
.inbox-view .data-panel { min-width: 0; }
.inbox-view .table-tools { display: flex; flex-wrap: wrap; align-items: stretch; }
.inbox-view .table-search { flex: 1 1 240px; width: auto; min-width: 0; }
.inbox-view .table-tools > .search-trigger { flex: none; min-height: 42px; }
.inbox-view .table-filter-label { flex: 1 1 185px; min-width: 0; }
.inbox-view .table-filter-label select { width: 100%; min-width: 0; }
.inbox-view .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 1100px) {
  .inbox-view .module-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .inbox-view .breadcrumb { display: flex; flex-wrap: wrap; }
  .inbox-view .module-head { align-items: flex-start; flex-wrap: wrap; }
  .inbox-view .module-primary { width: auto; min-height: 42px; padding-inline: 14px; font-size: 13px; }
  .inbox-view .module-tabs { overflow-x: auto; scrollbar-width: thin; }
  .inbox-view .module-tab { flex: none; }
  .inbox-view .table-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .inbox-view .table-tools > .attendance-table-entries { grid-column: 1 / -1; }
  .inbox-view .table-search { width: 100%; min-height: 42px; }
  .inbox-view .table-tools > .search-trigger { width: auto; }
  .inbox-view .table-filter-label { grid-column: 1 / -1; width: 100%; }
  .inbox-view .table-filter-label select { max-width: none; }
  .inbox-view .table-tools > button:not(.search-trigger) { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 480px) {
  .inbox-view .module-stats { grid-template-columns: minmax(0, 1fr); }
  .inbox-view .permission-banner > div { min-width: 0; overflow-wrap: anywhere; }
}

/* The collapsed sidebar shows child pages next to their parent icon. */
.collapsed-nav-popover {
  position: fixed;
  z-index: 75;
  display: flex;
  flex-direction: column;
  flex: none;
  width: min(236px, calc(100vw - 100px));
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #dce4ed;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(18, 37, 63, .16);
}
.collapsed-nav-popover strong {
  display: block;
  padding: 8px 10px;
  color: #52667c;
  font-size: 13px;
}
.collapsed-nav-popover a,
body.sidebar-collapsed .collapsed-nav-popover a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #34465a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: normal;
}
.collapsed-nav-popover a:hover,
.collapsed-nav-popover a.active {
  background: #eaf2fc;
  color: #1762bb;
}
.collapsed-nav-popover a::before,
.collapsed-nav-popover a::after { display: none !important; }

/* Consistent table controls and header profile */
.top-actions .profile {
  min-height: 42px; padding: 4px 9px; border: 1px solid #dce4ed;
  border-radius: 10px; background: #fff; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.top-actions .profile:hover, .top-actions .profile[aria-expanded="true"] {
  background: #f5f9fd; border-color: #a9c8e8; box-shadow: 0 2px 8px rgba(25,65,110,.07);
}
.table-tools > .table-refresh, .attendance-table-toolbar > .table-refresh,
.table-tools > .table-refresh-btn, .attendance-table-toolbar > .table-refresh-btn {
  margin-left: auto; flex: 0 0 36px; width: 36px; height: 36px; padding: 0;
}
@media (max-width: 760px) {
  .table-tools > .table-refresh, .attendance-table-toolbar > .table-refresh,
  .table-tools > .table-refresh-btn, .attendance-table-toolbar > .table-refresh-btn {
    margin-left: auto; justify-self: end; grid-column: -2 / -1;
  }
}
/* Keep the sidebar motion brief and smooth, while respecting reduced motion. */
@media (min-width: 761px) {
  .app-shell { transition: grid-template-columns .3s cubic-bezier(.22, 1, .36, 1); }
  .sidebar { transition: width .3s cubic-bezier(.22, 1, .36, 1), transform .3s cubic-bezier(.22, 1, .36, 1); }
}
@media (max-width: 760px) {
  .sidebar { transition: transform .3s cubic-bezier(.22, 1, .36, 1); will-change: transform; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell, .sidebar { transition-duration: .01ms !important; }
}

.module-view .module-head h1, .crud-page h1 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.25; }
.module-view .module-head p, .crud-page .crud-top p { font-size: 14px; line-height: 1.5; }
.module-view .data-panel th, .module-view .data-panel td, .crud-page .field label,
.module-view .module-tab, .module-view .table-tools, .module-view .detail-drawer { font-size: max(13px, 1em); }
@media (max-width: 760px) {
  .inbox-view .table-tools > button.table-refresh { grid-column: 2; grid-row: auto; width: 36px; justify-self: end; margin-left: auto; }
}

.dashboard-activity { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(290px, .9fr); gap: 16px; margin: 16px 0; }
.dashboard-activity .panel { min-width: 0; }
.dashboard-shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.dashboard-shortcut { min-width: 0; min-height: 49px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #dce5ee; border-radius: 10px; background: #fff; color: #263a52; font-size: 13px; font-weight: 700; text-decoration: none; }
.dashboard-shortcut:hover { border-color: #a8c8e7; background: #f4f9fe; }
.dashboard-shortcut svg:first-child { width: 18px; height: 18px; color: #4f657b; }
.dashboard-shortcut svg:last-child { width: 15px; height: 15px; margin-left: auto; color: #78889b; }
.dashboard-calendar-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 14px 0 10px; }
.dashboard-calendar-head strong { color: #24364b; text-transform: capitalize; font-size: 14px; }
.dashboard-calendar-head > div { display: flex; gap: 4px; }
.dashboard-calendar-head button { min-width: 30px; height: 30px; padding: 0 5px; border: 1px solid #dde5ec; border-radius: 7px; background: #fff; color: #52647a; cursor: pointer; font-size: 13px; }
.dashboard-calendar-head button:disabled { opacity: .5; cursor: default; }
.dashboard-calendar-head button svg { width: 16px; height: 16px; vertical-align: middle; }
.dashboard-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; text-align: center; }
.dashboard-calendar-grid b, .dashboard-calendar-grid span { display: grid; place-items: center; min-height: 31px; font-size: 13px; }
.dashboard-calendar-grid b { color: #687b90; font-weight: 650; }
.dashboard-calendar-grid span { color: #263a52; border-radius: 8px; }
.dashboard-calendar-grid .today { background: #1762bb; color: #fff; font-weight: 800; }
.dashboard-calendar-note { color: #607287; font-size: 13px; line-height: 1.45; margin: 12px 0 0; }
@media (max-width: 1000px) { .dashboard-activity { grid-template-columns: 1fr; } }
@media (max-width: 550px) { .dashboard-shortcut-grid { grid-template-columns: 1fr; } }

/* Compact reading scale; keep data tables comfortable without oversized labels. */
body { font-size: 14px; }
.module-view .module-head h1, .crud-page h1, .dashboard-page .page-head h1 { font-size: clamp(21px, 1.7vw, 24px); line-height: 1.3; }
.module-view .module-head p, .crud-page .crud-top p, .dashboard-page .page-head p { font-size: 13px; }
.module-view .data-panel table th, .module-view .data-panel table td,
.attendance-table-panel .attendance-team-table th, .attendance-table-panel .attendance-team-table td { font-size: 13px; line-height: 1.45; }
.module-view .data-panel table th, .attendance-table-panel .attendance-team-table th { font-weight: 700; letter-spacing: .01em; }
.dashboard-page .panel-head h3 { font-size: 16px; }
.dashboard-page .kpi h2 { font-size: 23px; }

/* Full-page loading state uses the existing Kiwari mark. */
.auth-loading { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 40%, #fff 0, #f4f8fd 55%, #ebf2fb 100%); }
.auth-loading-card { width: min(320px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; color: #263a52; }
.auth-loading-mark { width: 72px; height: 72px; background: url('/legacy/images/logo-gram.png') center / 420px no-repeat; filter: drop-shadow(0 8px 16px rgba(22,98,187,.14)); animation: kiwari-pulse 1.7s ease-in-out infinite; }
.auth-loading-line { width: 136px; height: 3px; overflow: hidden; border-radius: 999px; background: #dce9f6; margin: 9px 0 5px; }
.auth-loading-line span { display: block; width: 42%; height: 100%; border-radius: inherit; background: #2586d4; animation: kiwari-loading 1.4s ease-in-out infinite; }
.auth-loading-card strong { font-size: 14px; font-weight: 750; }
.auth-loading-card small { font-size: 13px; color: #72839a; }
@keyframes kiwari-loading { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@keyframes kiwari-pulse { 50% { transform: scale(1.045); opacity: .8; } }

/* Dashboard shortcuts and calendar */
.dashboard-activity { grid-template-columns: minmax(0, .95fr) minmax(340px, 1.05fr); align-items: stretch; }
.dashboard-shortcuts, .dashboard-calendar { position: relative; overflow: hidden; border: 1px solid #e1e9f2; border-radius: 14px; }
.dashboard-shortcuts { display: flex; flex-direction: column; }
.dashboard-shortcut-grid { flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: center; margin-top: 12px; }
.dashboard-shortcut { min-height: 108px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; padding: 13px; border-color: #e3ebf3; border-radius: 12px; background: #f9fbfe; transition: border-color .2s ease, background-color .2s ease, transform .2s ease; }
.dashboard-shortcut:hover { transform: translateY(-2px); background: #f0f7ff; }
.dashboard-shortcut-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 4px; border: 1px solid #d6e5f3; border-radius: 9px; background: #fff; color: #27649b; }
.dashboard-shortcut .dashboard-shortcut-icon svg { width: 18px; height: 18px; color: inherit; }
.dashboard-shortcut strong { font-size: 13px; line-height: 1.25; color: #22364c; }
.dashboard-shortcut small { font-size: 13px; color: #728298; line-height: 1.25; }
.dashboard-calendar::before { content: ''; position: absolute; inset: 40px 0 0; background: url('/legacy/images/logo-gram.png') center / 1050px no-repeat; opacity: .045; pointer-events: none; }
.dashboard-calendar > * { position: relative; z-index: 1; }
.dashboard-calendar-head { margin: 14px 0 12px; padding: 8px 10px; border: 1px solid #e4ecf5; border-radius: 10px; background: rgba(246,250,255,.83); }
.dashboard-calendar-head strong { font-size: 14px; }
.dashboard-calendar-grid { gap: 4px; }
.dashboard-calendar-grid b { min-height: 28px; color: #60758c; background: #f4f7fb; border-radius: 6px; }
.dashboard-calendar-grid span { min-height: 34px; border: 1px solid transparent; font-weight: 550; }
.dashboard-calendar-grid span:not(:empty):not(.today):hover { border-color: #d5e7f6; background: #f1f8fd; }
.dashboard-calendar-grid .weekend:not(.today) { color: #75879a; }
.dashboard-calendar-grid .today { box-shadow: 0 3px 10px rgba(23,98,187,.2); }
.dashboard-calendar-note { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid #edf1f6; }
.dashboard-today-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #1762bb; }
@media (max-width: 1100px) { .dashboard-activity { grid-template-columns: 1fr; } }
@media (max-width: 550px) { .dashboard-shortcut-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } .dashboard-shortcut { min-height: 105px; padding: 9px; } .dashboard-shortcut small { display: none; } }
@media (prefers-reduced-motion: reduce) { .auth-loading-mark, .auth-loading-line span { animation-duration: .01ms; } .dashboard-shortcut { transition-duration: .01ms; } }
