/**
 * Reusable list UI — filter bar + data table (Figma Beka Travel).
 * Apply .beka-filter-form and .beka-data-table* on any list page.
 */

.beka-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.beka-supplier-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 20px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 10px;
}

.beka-supplier-summary__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.beka-supplier-summary__name {
  font-size: 16px;
  line-height: 22px;
  color: #1d2a5c;
}

.beka-supplier-summary__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  background: #eef0f4;
  color: #4b5563;
}

.beka-supplier-summary__badge--active {
  background: #e8f7ee;
  color: #137333;
}

.beka-supplier-summary__badge--pending {
  background: #fff4e5;
  color: #b45309;
}

.beka-supplier-summary__badge--suspended {
  background: #fdecec;
  color: #b42318;
}

.beka-supplier-summary__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  flex: 1 1 auto;
}

.beka-supplier-summary__meta-item {
  margin: 0;
}

.beka-supplier-summary__meta-item dt {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: #6b7280;
  font-weight: normal;
}

.beka-supplier-summary__meta-item dd {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: #1d2a5c;
}

.beka-supplier-summary__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

/*.beka-filter-form__inner {*/
/*  display: grid;*/
/*  grid-template-columns: 1.2fr 1fr 1fr 1fr auto;*/
/*  gap: 8px;*/
/*  align-items: center;*/
/*  margin-top: 10px;*/
/*  padding: 8px;*/
/*  background: #fff;*/
/*  border-radius: 10px;*/
/*}*/

.beka-filter-form__inner > .form-item {
  margin: 0;
  min-width: 0;
}

.beka-filter-form__inner > .beka-filter-form__actions {
  margin: 0;
}


.beka-filter-form__field--search {
  color: #8c8c8c;
}

.beka-filter-form__field--select {
  position: relative;
}

.beka-filter-form__control {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  font-size: 14px;
  line-height: 22px;
  color: #1d2a5c;
  font-family: "Inter-Regular", sans-serif;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.beka-filter-form__field--search .beka-filter-form__control::placeholder {
  color: #8c8c8c;
}

.beka-filter-form__field--select .beka-filter-form__control {
  padding-right: 20px;
}

.beka-filter-form__chevron {
  flex-shrink: 0;
  color: #0652b0;
  font-size: 12px;
  pointer-events: none;
}

.beka-filter-form__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.beka-filter-form__reset {
  border: 0;
  background: transparent;
  padding: 0 8px;
  font-size: 14px;
  line-height: 20px;
  color: #e63a46;
  font-family: "Inter-Regular", sans-serif;
  text-decoration: none;
}

.beka-filter-form__reset:hover,
.beka-filter-form__reset:focus {
  color: #c92f3a;
  text-decoration: none;
}

/* —— Data table card —— */
.beka-data-table-card {
  margin-top: 8px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.beka-data-table-card__head {
  padding: 12px 16px;
  font-size: 24px;
  line-height: 32px;
  color: #1d2a5c;
  font-family: "Inter-SemiBold", sans-serif;
}

.beka-data-table-wrap {
  overflow-x: auto;
}

.beka-data-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  margin-bottom: 0px !important;
}

.beka-data-table thead th {
  padding: 12px 16px !important;
  background: #f5f6f8 !important;
  border-bottom: 0 !important;
  border-right: solid thin #dbdfe77d;;
  font-size: 12px;
  line-height: 18px !important;
  color: #5d5b73;
  text-transform: uppercase;
  white-space: nowrap;
  font-family: "Inter-SemiBold", sans-serif;
  vertical-align: middle !important;
}

.beka-data-table thead th:last-child {
  border-right: 0;
}

.beka-data-table thead th.is-right {
  text-align: right;
}

.beka-data-table thead th.is-center {
  text-align: center;
}

.beka-data-table thead th.is-actions,
.beka-data-table tbody td.is-actions {
  width: 100px;
  /*min-width: 100px;*/
  /*max-width: 100px;*/
}

.beka-data-table tbody td {
  padding: 10px 16px !important;
  border-top: 1px solid #eef0f4 !important;
  border-right: none !important;
  font-size: 14px !important;
  line-height: 18px !important;
  /*color: #1d2a5c !important;*/
  vertical-align: middle !important;
  font-family: "Inter-Regular", sans-serif !important;
}

.beka-data-table tbody td:last-child {
  border-right: 0;
}

.beka-data-table tbody td.is-right {
  text-align: right;
}

.beka-data-table tbody td.is-center {
  text-align: center;
}

.beka-data-table tbody tr.is-alt td {
  background: #fafbfc;
}

.beka-data-table__empty {
  padding: 24px 16px;
  text-align: center;
  color: #8c8c8c;
  font-size: 14px;
}

.beka-data-table__pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  font-size: 12px;
  line-height: 18px;
  color: #595959;
  font-family: "Inter-Regular", sans-serif;
}

.beka-data-table__pagination-summary {
  white-space: nowrap;
}

.beka-data-table__pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Hide bootstrap first/prev/next/last — Figma shows page numbers only */
.beka-data-table__pagination-controls .pager-first,
.beka-data-table__pagination-controls .pager-last,
.beka-data-table__pagination-controls .prev,
.beka-data-table__pagination-controls .next,
.beka-data-table__pagination-controls .pager-ellipsis {
  display: none !important;
}

.beka-data-table__pagination-controls .element-invisible {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  height: 1px;
  width: 1px;
  word-wrap: normal;
}

.beka-data-table__pagination-controls .text-center {
  text-align: inherit;
}

.beka-data-table__pagination .pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 0;
}

.beka-data-table__pagination .pagination > li {
  display: inline-flex;
  list-style: none;
}

.beka-data-table__pagination .pagination > li > a,
.beka-data-table__pagination .pagination > li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
  color: #595959;
  font-family: "Inter-Regular", sans-serif;
  text-decoration: none;
  float: none;
}

.beka-data-table__pagination .pagination > li.active > span,
.beka-data-table__pagination .pagination > li.active > a {
  background: #1d2a5c;
  border-color: #1d2a5c;
  color: #fff;
  font-family: "Inter-SemiBold", sans-serif;
}

.beka-data-table__pagination .pagination > li > a:hover,
.beka-data-table__pagination .pagination > li > a:focus {
  background: #f5f6f8;
  color: #1d2a5c;
  text-decoration: none;
}

.beka-data-table__pagination .pagination > li.active > a:hover,
.beka-data-table__pagination .pagination > li.active > a:focus {
  background: #1d2a5c;
  color: #fff;
}

/* Per-page control — Figma "12/Trang ▼" */
.pagination-mini__per-page {
  display: inline-flex;
}

.pagination-mini__per-page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
  color: #595959;
  font-family: "Inter-Regular", sans-serif;
  cursor: pointer;
}

.pagination-mini__per-page-select {
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1;
  color: #595959;
  font-family: "Inter-Regular", sans-serif;
  cursor: pointer;
  text-align: center;
}

.pagination-mini__per-page-select:focus {
  outline: none;
}

.pagination-mini__per-page-suffix {
  white-space: nowrap;
  pointer-events: none;
}

.pagination-mini__per-page-chevron {
  font-size: 10px;
  color: #595959;
  pointer-events: none;
}

/* Cell helpers (optional on any beka-data-table) */
.beka-data-table__code {
  font-family: "Inter-SemiBold", sans-serif;
  color: #1d2a5c;
}

.beka-data-table__amount--positive {
  color: #11a760;
  font-family: "Inter-SemiBold", sans-serif;
}

.beka-data-table__amount--negative {
  color: #e63a46;
  font-family: "Inter-SemiBold", sans-serif;
}

.beka-data-table__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #684E09;
  text-decoration: none;
  border-radius: 4px;
  background: var(--bg-2, #FFF1CC);
}

.beka-data-table__action:hover,
.beka-data-table__action:focus {
  background: #f5f6f8;
  text-decoration: none;
}

@media (max-width: 991px) {
  .beka-filter-form > .form-item,
  .beka-filter-form > div.form-wrapper {
    flex-basis: calc(50% - 8px);
    min-width: 140px;
  }
}

@media (max-width: 575px) {
  /* Drawer handles mobile; keep fallback sizing if --no-drawer */
  .beka-filter-form.beka-filter-form--no-drawer > .form-item,
  .beka-filter-form.beka-filter-form--no-drawer > div.form-wrapper {
    flex-basis: 100%;
  }

  .beka-data-table__pagination {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .beka-data-table__pagination-controls {
    width: 100%;
    justify-content: flex-start;
  }
}
/* —— Filter form layout (desktop inline / mobile drawer) —— */
.beka-filter-form {
  border-radius: 16px;
  background: #fff;
  box-sizing: border-box;
  position: relative;
}

.beka-filter-form > .form-item,
.beka-filter-form > .beka-filter-form__actions,
.beka-filter-form > div.form-wrapper {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 100%;
  margin: 0 !important;
  padding: 0;
  box-sizing: border-box;
}

.beka-filter-form > .beka-filter-form__actions {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.beka-filter-form input[type="text"],
.beka-filter-form input[type="search"],
.beka-filter-form select,
.beka-filter-form .form-control {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #e7ebf2;
  background: #f5f6f8;
  box-sizing: border-box;
}

.beka-filter-form .beka-filter-form__field {
  position: relative;
  display: block;
  width: 100%;
}

.beka-filter-form .beka-filter-form__field--select {
  position: relative;
}

.beka-filter-form input[type="text"] ~ i,
.beka-filter-form select ~ i,
.beka-filter-form .beka-filter-form__chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -6px;
  color: #1d2a5c;
  pointer-events: none;
}

/*.beka-filter-form .container-inline-date,*/
.beka-filter-form .container-inline-date  div,
.beka-filter-form .container-inline-date input {
  width: 100% !important;
  max-width: 100%;
}

.beka-filter-form button,
.beka-filter-form .beka-filter-form__submit,
.beka-filter-form input[type="submit"] {
  height: 40px;
  padding: 8px 20px;
  border-radius: 8px;
}

/* Drawer chrome — hidden on desktop */
.beka-filter-mobile-bar,
.beka-filter-drawer__backdrop,
.beka-filter-drawer__header {
  display: none;
}

body.beka-filter-drawer-open {
  overflow: hidden;
}

/* Datepicker / Tagify above drawer sheet */
body.beka-filter-drawer-open .ui-datepicker,
body.beka-filter-drawer-open .tagify__dropdown {
  z-index: 1100 !important;
}

@media (min-width: 1300px) {
  .beka-filter-form .beka-filter-form__container{
    display: flex;
    padding: 24px 16px;
    margin:0px -4px;
    align-items: flex-end;
    flex-wrap: wrap;
  }
  .beka-filter-form .beka-filter-form__container>div{
    width:calc(100% / 6);
    padding:0px 4px;
    margin:0px;
    margin-bottom: 8px !important;
  }
  .beka-filter-form .beka-filter-form__container>div.beka-filter-form__actions{
    width:max-content;
  }
  .beka-filter-form input[type=text]~i,
  .beka-filter-form select~i{
    position: absolute;
    right: 5px;
    top: calc(50% - 4px);
    color: #1D2A5C;
  }
}
@media (max-width: 767px) {
  .beka-filter-form__container{
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 10px;
  }
  .beka-filter-mobile-bar:not([hidden]) {
    display: block;
    margin: 12px 0;
  }

  .beka-filter-mobile-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #e7ebf2;
    border-radius: 10px;
    background: #fff;
    color: #1d2a5c;
    font-size: 15px;
    line-height: 22px;
    font-family: "Inter-SemiBold", sans-serif;
    text-align: left;
    cursor: pointer;
  }

  .beka-filter-mobile-bar__btn:hover,
  .beka-filter-mobile-bar__btn:focus {
    border-color: #c5cddb;
    outline: none;
  }

  .beka-filter-mobile-bar__btn > i {
    color: #0652b0;
  }

  .beka-filter-mobile-bar__label {
    flex: 1 1 auto;
  }

  .beka-filter-mobile-bar__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f8ba16;
    color: #1d2a5c;
    font-size: 12px;
    line-height: 1;
    font-family: "Inter-SemiBold", sans-serif;
  }

  .beka-filter-mobile-bar__badge[hidden] {
    display: none !important;
  }

  .beka-filter-drawer__backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.45);
  }

  form.beka-filter-form.beka-filter-form--drawer {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    margin: 0;
    max-height: min(88vh, 720px);
    padding: 0 0 12px;
    border-radius: 16px 16px 0 0;
    background: #fff;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px;
  }

  form.beka-filter-form.beka-filter-form--drawer.is-drawer-open {
    display: flex;
  }

  .beka-filter-drawer__header:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef0f4;
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
  }

  .beka-filter-drawer__title {
    margin: 0;
    font-size: 18px;
    line-height: 24px;
    color: #1d2a5c;
    font-family: "Inter-SemiBold", sans-serif;
  }

  .beka-filter-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: #f5f6f8;
    color: #1d2a5c;
    cursor: pointer;
  }

  form.beka-filter-form.beka-filter-form--drawer.is-drawer-open > .form-item,
  form.beka-filter-form.beka-filter-form--drawer.is-drawer-open > div.form-wrapper {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0 16px;
    margin-top: 12px !important;
  }

  form.beka-filter-form.beka-filter-form--drawer.is-drawer-open > .beka-filter-form__actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    margin: 0 !important;
    margin-top: auto !important;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #eef0f4;
    justify-content: stretch;
    gap: 12px;
  }

  form.beka-filter-form.beka-filter-form--drawer.is-drawer-open > .beka-filter-form__actions .beka-filter-form__submit,
  form.beka-filter-form.beka-filter-form--drawer.is-drawer-open > .beka-filter-form__actions input[type="submit"] {
    flex: 1 1 auto;
  }

  form.beka-filter-form.beka-filter-form--drawer.is-drawer-open > .beka-filter-form__actions .beka-filter-form__reset {
    flex: 0 0 auto;
    padding: 10px 8px;
  }

  form.beka-filter-form.beka-filter-form--no-drawer {
    display: flex !important;
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 16px !important;
  }

  form.beka-filter-form.beka-filter-form--no-drawer > .form-item,
  form.beka-filter-form.beka-filter-form--no-drawer > .beka-filter-form__actions,
  form.beka-filter-form.beka-filter-form--no-drawer > div.form-wrapper {
    flex: 1 1 100%;
    width: 100%;
  }
  .beka-filter-form .container-inline-date{
    margin-bottom: 15px;
  }
  .beka-filter-form .beka-filter-form__actions{
    margin-top: 15px;
  }
}

/* —— Mobile expand (opt-in: .beka-data-table--expand-sm) —— */
.beka-data-table__detail {
  display: none !important;
}

.beka-data-table__row--expandable {
  position: relative;
}

@media (max-width: 767px) {
  .beka-data-table-wrap:has(.beka-data-table--expand-sm),
  .beka-data-table-wrap--expand-sm {
    overflow-x: visible;
  }

  .beka-data-table--expand-sm,
  .beka-data-table--expand-sm thead,
  .beka-data-table--expand-sm tbody {
    display: block;
    width: 100%;
  }

  .beka-data-table--expand-sm thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__row--expandable {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    width: 100%;
    margin: 0;
    padding: 12px 36px 12px 16px;
    border-top: 1px solid #eef0f4;
    cursor: pointer;
    background: #fff;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__row--expandable.is-alt {
    background: #fafbfc;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__row--expandable.is-open {
    background: #f5f7fb;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__row--expandable > td {
    display: block;
    width: auto !important;
    max-width: none !important;
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__row--expandable > td.is-expand-body {
    display: none !important;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__row--expandable > td.is-primary:not(.is-actions) {
    flex: 1 1 auto;
    min-width: 0;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__row--expandable > td.is-actions {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__row--expandable::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid #8c8c8c;
    border-bottom: 2px solid #8c8c8c;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    pointer-events: none;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__row--expandable.is-open::after {
    margin-top: -2px;
    transform: rotate(225deg);
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__detail.is-open {
    display: block !important;
    width: 100%;
    padding: 0 16px 14px;
    border-top: 0;
    background: #f5f7fb;
  }

  .beka-data-table--expand-sm tbody tr.beka-data-table__detail.is-open > td {
    display: block;
    width: 100% !important;
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .beka-data-table__detail-list {
    margin: 0;
    padding: 12px;
    border: 1px solid #e7ebf2;
    border-radius: 10px;
    background: #fff;
  }

  .beka-data-table__detail-list > dt {
    margin: 0 0 4px;
    font-size: 11px;
    line-height: 16px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #8c8c8c;
    font-family: "Inter-SemiBold", sans-serif;
  }

  .beka-data-table__detail-list > dt:not(:first-child) {
    margin-top: 12px;
  }

  .beka-data-table__detail-list > dd {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: #1d2a5c;
  }
}

