body[data-path="/expenses"] .expense-mobile-list {
  grid-template-columns: 1fr !important;
  gap: 6px;
}

body[data-path="/expenses"] .expense-mobile-row {
  grid-template-columns: 42px minmax(0,1fr) auto;
  min-height: 60px;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 11px;
  box-shadow: 0 4px 14px rgba(18,50,86,.05);
}

body[data-path="/expenses"] .expense-date-tile {
  min-height: 44px;
  padding: 3px;
}

body[data-path="/expenses"] .expense-row-main {
  grid-template-columns: auto minmax(0,1fr);
  align-items: baseline;
  gap: 0 10px;
}

body[data-path="/expenses"] .expense-row-main > strong {
  font-size: .88rem;
  white-space: nowrap;
}

body[data-path="/expenses"] .expense-row-main > span {
  font-size: .75rem;
}

body[data-path="/expenses"] .expense-row-context {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

body[data-path="/expenses"] .expense-row-main > small {
  grid-column: 1 / -1;
  font-size: .66rem;
}

body[data-path="/expenses"] .expense-row-remark {
  min-width: 0;
  margin-top: 1px;
  color: #52677d;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body[data-path="/expenses"] .expense-row-remark b { color: #9a5a00; }

body[data-path="/expenses"] .expense-created-date {
  color: #536f8d;
  font-weight: 700;
}

body[data-path="/expenses"] .expense-row-end {
  align-items: center;
  flex-direction: row;
  gap: 9px;
}

body[data-path="/expenses"] .expense-row-end b {
  min-width: 88px;
  font-size: .92rem;
  text-align: right;
  white-space: nowrap;
}

/* Employee records keep desktop pagination/grid behavior, while phones use
   month sections and progressive disclosure for faster visual scanning. */
.personal-expense-month,
.personal-expense-month-records {
  display: contents;
}

.personal-expense-month-header,
.personal-expense-progress {
  display: none;
}

.personal-expense-swipe-action {
  display: none;
}

.personal-expense-row-surface {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.personal-expense-row-surface > .expense-mobile-row {
  width: 100%;
}

.personal-expense-actions-desktop {
  display: flex;
  align-items: center;
  width: 218px;
  gap: 6px;
}

.personal-expense-actions-desktop .btn,
.personal-expense-delete-form-desktop {
  height: 40px;
}

.personal-expense-actions-desktop .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  padding: .35rem .55rem;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.personal-expense-edit-desktop {
  flex: 1 1 132px;
}

.personal-expense-delete-form-desktop {
  flex: 0 0 80px;
}

.personal-expense-actions-desktop:not(.has-edit-action) .personal-expense-delete-form-desktop {
  flex: 1 1 auto;
}

@media (max-width: 575.98px) {
  .personal-expense-swipe {
    position: relative;
    overflow: hidden;
    border-radius: 11px;
    touch-action: pan-y;
  }

  .personal-expense-swipe-action {
    position: absolute;
    inset: 0 0 0 auto;
    display: flex;
    width: 188px;
    align-items: stretch;
    background: #fff;
  }

  .personal-expense-edit-mobile,
  .personal-expense-delete-form-mobile,
  .personal-expense-delete-form-mobile button {
    min-width: 0;
    min-height: 100%;
  }

  .personal-expense-edit-mobile {
    flex: 1 1 108px;
  }

  .personal-expense-delete-form-mobile {
    flex: 0 0 80px;
  }

  .personal-expense-swipe-action:not(.has-edit-action) .personal-expense-delete-form-mobile {
    flex: 1 1 auto;
  }

  .personal-expense-edit-mobile,
  .personal-expense-delete-form-mobile button {
    border: 0;
    color: #fff;
    font-size: .73rem;
    font-weight: 850;
    line-height: 1.1;
  }

  .personal-expense-edit-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1769df;
    text-align: center;
    text-decoration: none;
  }

  .personal-expense-delete-form-mobile button {
    width: 100%;
    background: #d93645;
  }

  .personal-expense-row-surface {
    position: relative;
    z-index: 1;
    display: block;
    gap: 0;
    background: var(--surface,#fff);
    transition: transform .2s ease;
    will-change: transform;
  }

  .personal-expense-swipe.is-swiping .personal-expense-row-surface {
    transition: none;
  }

  .personal-expense-swipe.is-revealed .personal-expense-row-surface {
    transform: translateX(-188px);
  }

  .personal-expense-actions-desktop {
    display: none;
  }
}

.expense-status-back-wrap {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
}

.expense-status-back {
  min-width: 150px;
  font-weight: 800;
}

.employee-expense-phone-back {
  display: none;
}

.direct-status-expense-view {
  display: grid;
  gap: 10px;
}

.direct-status-expense-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid #cfe0ed;
  border-left: 5px solid #1b73e8;
  border-radius: 12px;
  background: #fff;
}

.direct-status-expense-head span {
  display: grid;
  gap: 1px;
}

.direct-status-expense-head small {
  color: #688098;
  font-size: .68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.direct-status-expense-head strong {
  color: #092f58;
  font-size: 1rem;
}

.direct-status-expense-head.status-view-approved { border-left-color: #2fad78; background: #f3fbf7; }
.direct-status-expense-head.status-view-pending { border-left-color: #e6a321; background: #fffaf0; }
.direct-status-expense-head.status-view-rejected { border-left-color: #e45562; background: #fff5f6; }

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-list {
  display: grid;
  gap: 10px;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-group {
  overflow: hidden;
  padding: 0;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 13px;
  border-bottom: 1px solid #071f3c;
  background: linear-gradient(100deg,#061c35 0%,#0a3d76 100%);
  box-shadow: inset 4px 0 0 #2d8ff0;
  list-style: none;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle::-webkit-details-marker {
  display: none;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle span {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle strong,
body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle b {
  color: #fff;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle small {
  color: #d9ebff;
  font-size: .7rem;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle > i {
  display: none;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .employee-expense-record-filter {
  display: none;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-group .expense-mobile-list {
  gap: 0;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-group .expense-mobile-row {
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-group .expense-mobile-row:last-child {
  border-bottom: 0;
}

@media (max-width: 575.98px) {
  body[data-role="employee"][data-path="/expenses"] .employee-expense-phone-back {
    display: flex;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .direct-status-expense-view .expense-mobile-row {
    min-height: 72px;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .direct-status-expense-head {
    position: sticky;
    top: var(--mobile-header-height, 58px);
    z-index: 4;
    padding: 9px 11px;
    box-shadow: 0 6px 18px rgba(18,50,86,.08);
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .direct-status-expense-head strong {
    font-size: .92rem;
  }

  /* Employee accordion rows replace the duplicate global employee filter on phones. */
  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .expense-admin-filter {
    display: none !important;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-list {
    display: block;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-month,
  body[data-role="employee"][data-path="/expenses"] .personal-expense-month-records {
    display: block;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-month {
    margin-bottom: 10px;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 3px 7px;
    color: #0b315b;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-month-header strong {
    font-size: .88rem;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-month-header span {
    color: #647b94;
    font-size: .65rem;
    font-weight: 750;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-month-records {
    overflow: hidden;
    border: 1px solid #d5e2ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(18,50,86,.06);
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-month-records .expense-mobile-row {
    min-height: 72px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid #e1e9f1;
    border-radius: 0;
    box-shadow: none;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-month-records .expense-mobile-row:last-child {
    border-bottom: 0;
  }

  body[data-role="employee"][data-path="/expenses"] .expense-row-main > strong {
    color: #082f58;
    font-size: .9rem;
  }

  body[data-role="employee"][data-path="/expenses"] .expense-row-main > span {
    color: #385b7d;
    font-size: .69rem;
    font-weight: 650;
  }

  body[data-role="employee"][data-path="/expenses"] .expense-row-main > small {
    margin-top: 2px;
    color: #7b8fa3;
    line-height: 1.25;
  }

  body[data-role="employee"][data-path="/expenses"] .expense-row-end {
    margin-top: 2px;
  }

  body[data-role="employee"][data-path="/expenses"] .expense-row-end b {
    color: #092f58;
    font-size: 1rem;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-progress {
    display: block;
    width: 100%;
    margin: 3px 0 10px;
    background: #fff;
    font-weight: 800;
  }

  body[data-role="employee"][data-path="/expenses"] .expense-status-back-wrap {
    margin-top: 18px;
  }

  body[data-role="employee"][data-path="/expenses"] .expense-status-back {
    width: 100%;
    min-height: 48px;
    border-color: #8fa2b6;
    border-radius: 11px;
    background: rgba(255,255,255,.82);
    color: #526b84;
  }

  body[data-role="employee"][data-path="/expenses"] .personal-expense-progress[hidden],
  body[data-role="employee"][data-path="/expenses"] .personal-expense-month.is-empty-mobile,
  body[data-role="employee"][data-path="/expenses"] .expense-mobile-row.is-progressively-hidden {
    display: none !important;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto 28px;
    min-height: 56px;
    cursor: pointer;
    touch-action: manipulation;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle span {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle > i {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 9px;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-style: normal;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-toggle > i::before {
    content: '⌄';
    transform: translateY(-2px);
    transition: transform .16s ease;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-group[open] .report-employee-expense-toggle {
    background: linear-gradient(100deg,#07545b 0%,#0b8584 100%);
    box-shadow: inset 4px 0 0 #4ce1d2;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .report-employee-expense-group[open] .report-employee-expense-toggle > i::before {
    transform: rotate(180deg) translateY(1px);
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .employee-expense-record-filter {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
    padding: 9px;
    border-bottom: 1px solid #d7e3ee;
    background: #f7fbff;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .employee-expense-record-filter label {
    min-width: 0;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .employee-expense-record-filter label > span {
    display: block;
    margin: 0 0 3px;
    color: #345572;
    font-size: .58rem;
    font-weight: 800;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .employee-expense-record-filter :is(.form-control,.form-select,.btn) {
    min-height: 38px;
    padding: 6px 8px;
    border-radius: 9px;
    font-size: .68rem;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .employee-expense-filter-actions {
    display: flex;
    align-self: end;
    gap: 6px;
    min-width: 0;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .employee-expense-filter-actions > .btn {
    align-self: end;
    flex: 1 1 0;
    min-width: 0;
    min-height: 34px;
    padding: 4px 6px;
    font-size: .62rem;
    font-weight: 800;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .employee-expense-record-filter > small {
    grid-column: 1 / -1;
    color: #607b94;
    font-size: .6rem;
    font-weight: 750;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .expense-mobile-row[hidden] {
    display: none !important;
  }

  body:is([data-role="admin"],[data-role="report"])[data-path="/expenses"] .employee-expense-filter-empty {
    padding: 18px 12px;
    color: #60778e;
    font-size: .75rem;
    font-weight: 750;
    text-align: center;
  }
  body[data-path="/expenses"] .expense-mobile-row {
    grid-template-columns: 40px minmax(0,1fr);
    gap: 5px 8px;
    padding: 7px 9px;
  }
  body[data-path="/expenses"] .expense-row-end {
    grid-column: 2;
    width: 100%;
    justify-content: space-between;
  }
  body[data-path="/expenses"] .expense-row-end b {
    min-width: 0;
  }
}
