:root {
  --yasui-bottom-safe: env(safe-area-inset-bottom, 0px);
  --yasui-green: #22c55e;
  --yasui-green-2: #16a34a;
}

.desc .tag {
  background: var(--yasui-green) !important;
  color: #fff !important;
  border-color: var(--yasui-green) !important;
}

.yasui-bottom-bar {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(12px + var(--yasui-bottom-safe));
  z-index: 9999;
  height: 68px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(17, 24, 39, .94), rgba(10, 10, 12, .94));
  box-shadow: 0 18px 45px rgba(2, 6, 23, .34), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

body.yasui-route-landing .yasui-bottom-bar {
  background: linear-gradient(180deg, rgba(15, 23, 42, .82), rgba(2, 6, 23, .82));
}

.yasui-nav-item,
.yasui-quick-menu button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.yasui-nav-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 16px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  padding: 4px 2px;
}

.yasui-nav-text {
  white-space: nowrap;
}

.yasui-ico {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: currentColor;
  background: rgba(255,255,255,.055);
}

.yasui-ico svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.yasui-nav-item.is-active,
.yasui-nav-item:hover {
  color: #ecfdf5;
  background: linear-gradient(135deg, rgba(34,197,94,.22), rgba(16,185,129,.10));
}

.yasui-nav-item.is-active .yasui-ico,
.yasui-nav-item:hover .yasui-ico {
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 8px 20px rgba(34,197,94,.28), inset 0 1px 0 rgba(255,255,255,.22);
}

.yasui-quick-menu {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(92px + var(--yasui-bottom-safe));
  z-index: 10000;
  display: none;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(2,6,23,.96));
  box-shadow: 0 22px 60px rgba(2, 6, 23, .42), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

body.yasui-quick-open .yasui-quick-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.yasui-quick-menu button {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  text-align: left;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  background: rgba(255,255,255,.055);
}

.yasui-quick-menu button:hover,
.yasui-quick-menu button:active {
  background: rgba(34,197,94,.16);
}

.yasui-quick-ico {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(34,197,94,.14);
  color: #86efac;
  font-weight: 900;
}

.yasui-balance-card {
  cursor: pointer;
}

@media (min-width: 769px) {
  .yasui-bottom-bar {
    max-width: 480px;
    left: 50%;
    right: auto;
    width: calc(100% - 24px);
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) {
  body.yasui-route-order-info .yasui-bottom-bar {
    left: auto;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + var(--yasui-bottom-safe));
    width: 72px;
    height: 72px;
    grid-template-columns: 1fr;
    padding: 8px;
    border-radius: 999px;
  }

  body.yasui-route-order-info .yasui-nav-item:not(.yasui-quick-toggle) {
    display: none !important;
  }

  body.yasui-route-order-info .yasui-quick-toggle .yasui-nav-text {
    display: none;
  }

  body.yasui-route-order-info .yasui-quick-toggle .yasui-ico {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
  }

  body.yasui-route-order-info .yasui-quick-menu {
    bottom: calc(96px + var(--yasui-bottom-safe));
  }

  body.yasui-route-order-info .ant-layout-content {
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.yasui-route-order-info .yasui-pay-action {
    scroll-margin-bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.yasui-route-order-info .ant-layout-content::after {
    content: '';
    display: block;
    height: calc(110px + env(safe-area-inset-bottom, 0px));
  }

  body.yasui-route-order {
    overflow-x: hidden !important;
  }

  body.yasui-route-order .yasui-order-table,
  body.yasui-route-order .yasui-order-table .ant-spin-nested-loading,
  body.yasui-route-order .yasui-order-table .ant-spin-container,
  body.yasui-route-order .yasui-order-table .ant-table,
  body.yasui-route-order .yasui-order-table .ant-table-container,
  body.yasui-route-order .yasui-order-table .ant-table-content,
  body.yasui-route-order .yasui-order-table .ant-table-body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: visible !important;
  }

  body.yasui-route-order .yasui-order-table .ant-table table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  body.yasui-route-order .yasui-order-table colgroup,
  body.yasui-route-order .yasui-order-table .ant-table-thead {
    display: none !important;
  }

  body.yasui-route-order .yasui-order-table .ant-table-tbody {
    display: grid !important;
    gap: 12px !important;
    width: 100% !important;
  }

  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr {
    display: block !important;
    width: 100% !important;
    padding: 14px !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08) !important;
  }

  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td {
    display: grid !important;
    grid-template-columns: 92px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 0 !important;
    border: 0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:empty {
    display: none !important;
  }

  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td::before {
    content: attr(data-label);
    color: #64748b;
    font-weight: 800;
    font-size: 12px;
  }

  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:nth-child(1)::before { content: 'Mã đơn hàng'; }
  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:nth-child(2)::before { content: 'Chu kỳ'; }
  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:nth-child(3)::before { content: 'Số tiền'; }
  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:nth-child(4)::before { content: 'Trạng thái'; }
  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:nth-child(5)::before { content: 'Thời gian tạo'; }
  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:nth-child(6)::before { content: 'Thao tác'; }

  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:first-child {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
  }

  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding-top: 12px !important;
  }

  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:last-child::before {
    flex: 0 0 92px;
  }

  body.yasui-route-order .yasui-order-table .ant-table-tbody > tr > td:last-child .ant-btn {
    margin: 0 !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
  }
}

/* Yasui ticket mobile: convert support request table to readable cards only */
@media (max-width: 768px) {
  body.yasui-route-ticket {
    overflow-x: hidden !important;
  }

  body.yasui-route-ticket .yasui-ticket-table,
  body.yasui-route-ticket .yasui-ticket-table .ant-spin-nested-loading,
  body.yasui-route-ticket .yasui-ticket-table .ant-spin-container,
  body.yasui-route-ticket .yasui-ticket-table .ant-table,
  body.yasui-route-ticket .yasui-ticket-table .ant-table-container,
  body.yasui-route-ticket .yasui-ticket-table .ant-table-content,
  body.yasui-route-ticket .yasui-ticket-table .ant-table-body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: visible !important;
  }

  body.yasui-route-ticket .yasui-ticket-table .ant-table table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  body.yasui-route-ticket .yasui-ticket-table colgroup,
  body.yasui-route-ticket .yasui-ticket-table .ant-table-thead {
    display: none !important;
  }

  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody {
    display: grid !important;
    gap: 12px !important;
    width: 100% !important;
  }

  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr {
    display: block !important;
    width: 100% !important;
    padding: 14px !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08) !important;
  }

  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td {
    display: grid !important;
    grid-template-columns: 86px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 0 !important;
    border: 0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td:empty {
    display: none !important;
  }

  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td::before {
    content: attr(data-label);
    color: #64748b;
    font-weight: 800;
    font-size: 12px;
  }

  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td:nth-child(1)::before { content: 'Chủ đề'; }
  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td:nth-child(2)::before { content: 'Nội dung'; }
  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td:nth-child(3)::before { content: 'Trạng thái'; }
  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td:nth-child(4)::before { content: 'Thời gian'; }
  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td:nth-child(5)::before { content: 'Thao tác'; }

  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding-top: 12px !important;
  }

  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td:last-child::before {
    flex: 0 0 86px;
  }

  body.yasui-route-ticket .yasui-ticket-table .ant-table-tbody > tr > td:last-child .ant-btn {
    margin: 0 !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
  }
}
