.approval-wrapper {
  display: flex;
  height: 100vh;
  background: #f5f6f8;
}

// ─── SIDEBAR ───────────────────────────────────────────────────────
.sidebar {
  width: 220px;
  min-width: 220px;
  background: #fff;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease, min-width 0.25s ease;

  .approval-wrapper.sidebar-collapsed & {
    width: 52px;
    min-width: 52px;
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px 10px 16px;
  flex-shrink: 0;
  min-height: 44px;

  .approval-wrapper.sidebar-collapsed & {
    justify-content: center;
    padding: 14px 0 10px;
  }
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;

  &:hover {
    background: #f5f3ff;
    color: var(--border-focus);
  }

  mat-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
  }
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 8px;
  padding: 5px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  flex-shrink: 0;

  mat-icon {
    font-size: 15px;
    width: 15px;
    height: 15px;
    color: #aaa;
    flex-shrink: 0;
  }

  input {
    border: none;
    outline: none;
    font-size: 12px;
    background: transparent;
    width: 100%;
    color: #333;

    &::placeholder {
      color: #bbb;
    }
  }
}

.entity-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;

  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
  }

  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;

  li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px 9px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;

    &:hover {
      background: #f5f3ff;
    }

    &.active {
      background: #f5f3ff;
      border-left-color: var(--border-focus);
      color: var(--border-focus);
      font-weight: 600;
    }

    .approval-wrapper.sidebar-collapsed & {
      justify-content: center;
      padding: 10px 0;
    }
  }
}

.menu-checkbox {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--border-focus);
  flex-shrink: 0;
}

.menu-icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.menu-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-count {
  font-size: 11px;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 1px 7px;
  color: #555;
  flex-shrink: 0;

  .active & {
    background: var(--category-bg-alpha);
    color: var(--border-focus);
  }
}

// ─── MAIN CONTENT ────────────────────────────────────────────────────
.main-content {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

// ─── ACTION BAR ────────────────────────────────────────────────────
.action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1e3a8a;
  padding: 10px 20px;
  color: #fff;
  flex-shrink: 0;

  .selected-count {
    font-size: 14px;
    font-weight: 500;
    margin-right: 8px;
  }

  .action-clear {
    margin-left: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.8;

    &:hover {
      opacity: 1;
    }
  }
}

.btn-approve {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;

  &:hover {
    background: #15803d;
  }
}

.bulk-btn-reject {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: #fff;
  border: 1.5px solid #fff;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;

  &:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

.btn-reject {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;

  &:hover {
    background: #b91c1c;
  }
}

.btn-resend {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f59e0b;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;

  &:hover {
    background: #d97706;
  }
}

// ─── TOP BAR — tabs + filter + search in one row
.top-bar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  flex-shrink: 0;
  gap: 10px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  max-height: 40px;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  cursor: pointer;
  color: #888;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
  font-size: 14px;

  mat-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
  }

  &:hover {
    color: #333;
  }

  &.active {
    border-bottom-color: var(--border-focus);
    color: #111;
    font-weight: 600;
  }
}

.tab-text {
  font-size: 14px;
  font-weight: 500;
}

// ─── RIGHT SIDE OF TOP BAR ─────────────────────────────────────────
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

// ─── FILTER DROPDOWN ───────────────────────────────────────────────
.filter-select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 140px; // your desired width
  border: 1px solid #ddd;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  height: 30px;

  .filter-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #666;
  }
}

.filter-select {
  flex: 1;
  font-size: 13px;
  color: #333;
}

::ng-deep .status-filter-panel {
  margin-left: -34px;
  margin-top: 12px;
}

// ─── SEARCH BOX ────────────────────────────────────────────────────
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ddd;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  width: 240px;
  height: 30px;

  mat-icon {
    font-size: 18px;
    color: #aaa;
    padding-top: 3px;
  }

  input {
    border: none;
    outline: none;
    font-size: 14px;
    width: 100%;
  }
}

// ─── SUMMARY CARDS ────────────────────────────────────────────
.card-container {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  flex-shrink: 0;
}

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eee;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 64px;

  &:hover {
    border-color: #c4b5fd;
    box-shadow: 0 2px 8px rgba(108, 76, 255, 0.08);
  }

  &.card-active {
    border-color: var(--border-focus);
    box-shadow: 0 2px 10px rgba(108, 76, 255, 0.12);
  }
}

.icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-Schedule {
  background-color: var(--category-text-alpha);
}

.icon-my-requests {
  background-color: var(--category-text-gamma);
}

.count {
  font-size: 18px;
  font-weight: 700;
}

.label {
  font-size: 12px;
  color: #777;
}

// ─── LOADING / EMPTY ───────────────────────────────────────────────
.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #aaa;
  gap: 8px;
  font-size: 14px;

  mat-icon {
    font-size: 36px;
    width: 36px;
    height: 36px;
  }
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

// ─── APPROVAL LIST ───────────────────────────────────────────────
.approval-list {
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
  gap: 5px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin-bottom: 100px;

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: #c7c7c7;
    border-radius: 4px;

    &:hover {
      background: #a0a0a0;
    }
  }

  scrollbar-width: thin;
  scrollbar-color: #c7c7c7 #f1f1f1;
}

.approval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  background: white;
  border-radius: 8px;
  border-left: 3px solid transparent;

  &:hover {
    background: #fafafa;
  }

  &.selected {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
  }
}

.item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--border-focus);
}

.item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.entity-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.entity-code {
  font-size: 13px;
  font-weight: 600;
  color: var(--border-focus);
}

.entity-title {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
}

.item-right {
  text-align: right;
  white-space: nowrap;
}

.amount {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.workflow-tag {
  font-size: 11px;
  background: #ede9fe;
  color: #6d28d9;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  display: block;
  text-align: right;
}

// ─── MODAL ───────────────────────────────────────────────────────
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;

  mat-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
  }

  h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
  }
}

.modal-sub {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}

.modal-textarea {
  width: 100%;
  height: 90px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  resize: none;
  outline: none;
  box-sizing: border-box;

  &:focus {
    border-color: var(--border-focus, #6c4cff);
  }
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.btn-cancel {
  padding: 8px 20px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #555;

  &:hover {
    background: #f5f5f5;
  }
}

// ─── LIGHTBOX ────────────────────────────────────────────────────
.LightBoxmodal {
  display: flex;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
}

.showDetail-LightBox-contents {
  display: flex;
  margin: auto;
  height: 90vh;
  width: 960px;
  overflow: auto;
  border-radius: calc(var(--size-radius-l) *1px);
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-subtle);
  text-align: start;
}

.lightbox-header {
  height: calc(var(--field-height-xl) *1px);
  padding-left: calc(var(--space-xl) *1px);
  padding-right: calc(var(--space-l) *1px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.close-icon {
  color: var(--button-secondary-text-disabled);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
}

.close-icon:hover {
  color: var(--field-helper-error);
}

.workflow-section {
  display: flex;
  align-items: center;
}

// ─── Select All / Deselect All ─────────────────────────────────────────────
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
  margin-bottom: 5px;
  padding: 10px 10px;
  padding-top: 0px;
  border-radius: 8px;

  span {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 700;
    padding-left: 3px;
  }
}

.select-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--border-focus);
}

// .list-toolbar {
//   display: flex;
//   align-items: center;
//   gap: 8px;
//   padding: 10px 10px;
//   width: 150px;

//   span {
//     font-size: 13px;
//     color: var(--text-secondary);
//   }
// }

// ─── Top Bar: Approval Header + Report Filter + Pagination ───────────────
.ApprovalHeader {
  margin: 0px 2px 0px 0px;
  padding: 5px 5px 5px 0px;
  background-color: White;
}

.FormHeadercontainer {
  display: grid;
  grid-template-columns: 25% auto;
  grid-template-areas: 'title action';
  border-radius: var(--size-radius-m);

  .gbformtitle {
    height: 52px;
    grid-area: title;

    display: flex;
    align-items: center;
    font-family: Poppins;
    font-size: 24px;
    font-weight: 600;
  }

  .gbformaction {
    grid-area: action;
    margin: 2px;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
}

.subformheader {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  margin-bottom: 0px;
  background-color: unset;
  margin-left: 12px;
}

.ApprovalBtns {
  width: max-content;
  margin-top: -4px;
  display: flex;
  align-items: center;
}

.pagination {
  position: relative;
  top: -3px;
  margin-right: 28px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagenumber {
  color: var(--action-primary-default);
  font-family: 'Inter';
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 18px;
  margin-right: 16px;
}

.pagebutton {
  width: 32px;
  height: 32px;
  border-radius: var(--size-radius-s);
  background: var(--button-secondary-bg-default);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  outline: none;
  font-size: 16px;

  &:hover {
    background: var(--button-secondary-bg-hover);
  }

  &.active {
    background: var(--button-secondary-bg-active);
  }
}

.pagebutton img {
  opacity: 0.5;
}

.pagebutton:hover img,
.pagebutton.active img {
  opacity: 1;
}

#prevprevbutton {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  outline-style: none;
  justify-content: center;
  align-items: center;
  position: relative;
  display: inline-flex;
}

#prevbutton {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  outline-style: none;
  justify-content: center;
  align-items: center;
  position: relative;
  display: inline-flex;
}

#nextnextbutton {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  outline-style: none;
  justify-content: center;
  align-items: center;
  position: relative;
  display: inline-flex;
}

#nextbutton {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  outline-style: none;
  justify-content: center;
  align-items: center;
  position: relative;
  display: inline-flex;
}

// filter details button
.filter-details {
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: 10px;
  margin-bottom: 8px;
}

::ng-deep .filter-details .filterbutton:hover {
  box-shadow: none;
}

::ng-deep .filter-details .filterbutton {
  box-shadow: none !important;
  margin-right: 0px;
  margin-left: auto;
  background-color: inherit !important;
  border: none !important;
}