.history-page {
  max-width: 1240px;
  margin: 120px auto 70px;
  padding: 0 24px;
  flex: 1;
}

.history-wrapper {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(43, 18, 6, 0.14);
  overflow: hidden;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.history-title {
  display: inline-flex;
  background: #ffbd2b;
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
  margin: 0;
}

.history-card {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #2b1206;
}

.history-table th {
  background: #fff8f3;
  color: #7c2d12;
  text-align: left;
  padding: 15px 16px;
  font-weight: 900;
  border-bottom: 1px solid #f4e3d8;
  white-space: nowrap;
}

.history-table td {
  padding: 16px;
  border-bottom: 1px solid #f7eee7;
  font-weight: 750;
  vertical-align: middle;
}

.history-table tbody tr:hover {
  background: #fff8f3;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 300px;
  white-space: nowrap;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: 190px;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 90px;
  text-align: center;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
  width: 250px;
  white-space: nowrap;
}

.history-table th:nth-child(5),
.history-table td:nth-child(5) {
  width: 130px;
  text-align: right;
}

.history-table th:nth-child(6),
.history-table td:nth-child(6) {
  width: 150px;
  padding-right: 34px;
  white-space: nowrap;
}

.history-table a {
  color: #2b1206;
  font-weight: 900;
  white-space: nowrap;
}

.role-chip {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .history-page {
    margin-top: 92px;
    padding: 0 14px;
  }

  .history-wrapper {
    padding: 14px;
  }

  .history-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .history-table {
    min-width: 980px;
  }
}

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--gray-800);
  min-height: 100vh;

  background:
    radial-gradient(circle at 15% 20%, rgba(255,107,53,.18), transparent 35%),
    radial-gradient(circle at 85% 25%, rgba(255,209,102,.15), transparent 40%),
    radial-gradient(circle at 75% 80%, rgba(217,72,15,.10), transparent 45%),
    linear-gradient(
      135deg,
      #f99c4a 0%,
      #ffa046 25%,
      #ffa54b 50%,
      #fea14b 75%,
      #ff983e 100%
    );

  background-attachment: fixed;
}

html,
body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
}

.history-page {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.modern-footer {
  margin-top: auto;
}

.role-chip{
  display:flex;
  align-items:center;
  gap:6px;

  background:none;
  border:none;
  padding:0;

  color:#2b1206;
  font-size:1rem;
  font-weight:700;
  border-radius:0;
}

.role-chip .mono{
  font-family:'Montserrat', sans-serif;
  font-weight:800;
  color:#2b1206;
}

/* MOBILE HISTORY TABLE FIX */
@media (max-width: 760px) {
  .history-card {
    overflow: hidden !important;
    width: 100% !important;
  }

  .history-table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed !important;
  }

  /* Hide Customer, Items, Total, PUM on mobile */
  .history-table th:nth-child(2),
  .history-table td:nth-child(2),
  .history-table th:nth-child(3),
  .history-table td:nth-child(3),
  .history-table th:nth-child(5),
  .history-table td:nth-child(5),
  .history-table th:nth-child(6),
  .history-table td:nth-child(6) {
    display: none !important;
  }

  /* Order ID */
  .history-table th:nth-child(1),
  .history-table td:nth-child(1) {
    width: 58% !important;
    padding: 14px 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  .history-table td:nth-child(1) a {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Created At */
  .history-table th:nth-child(4),
  .history-table td:nth-child(4) {
    display: table-cell !important;
    width: 42% !important;
    padding: 14px 10px !important;
    white-space: normal !important;
    text-align: left !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
  }

  .history-table th:nth-child(4)::before {
    content: "Created At";
  }

  .history-table th:nth-child(4) {
    font-size: 0 !important;
  }

  .history-table th:nth-child(4)::before {
    font-size: 14px !important;
    font-weight: 900 !important;
  }

  .history-table th {
    font-size: 14px !important;
  }

  .history-table td {
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .history-table th:nth-child(1),
  .history-table td:nth-child(1) {
    width: 60% !important;
  }

  .history-table th:nth-child(4),
  .history-table td:nth-child(4) {
    width: 40% !important;
    font-size: 12px !important;
  }
}

@media (max-width: 760px) {
  .history-card {
    overflow: hidden !important;
  }

  .history-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  .history-table th:nth-child(3),
  .history-table td:nth-child(3),
  .history-table th:nth-child(4),
  .history-table td:nth-child(4),
  .history-table th:nth-child(5),
  .history-table td:nth-child(5),
  .history-table th:nth-child(6),
  .history-table td:nth-child(6),
  .history-table th:nth-child(7),
  .history-table td:nth-child(7) {
    display: none !important;
  }

  .history-table th:nth-child(1),
  .history-table td:nth-child(1) {
    width: 58% !important;
    padding: 14px 10px !important;
  }

  .history-table th:nth-child(2),
  .history-table td:nth-child(2) {
    display: table-cell !important;
    width: 42% !important;
    padding: 14px 10px !important;
    text-align: left !important;
  }

  .history-table td:nth-child(1) a {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .history-table th,
  .history-table td {
    font-size: 14px !important;
  }
}

/* DESKTOP: hide Created At, keep data aligned */
@media (min-width: 761px) {
  .history-table {
    width: 100% !important;
    min-width: 1180px !important;
    table-layout: fixed !important;
  }

  .history-table th:nth-child(2),
  .history-table td:nth-child(2) {
    display: none !important;
  }

  .history-table th:nth-child(1),
  .history-table td:nth-child(1) {
    width: 300px !important;
  }

  .history-table th:nth-child(3),
  .history-table td:nth-child(3) {
    width: 180px !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  .history-table th:nth-child(4),
  .history-table td:nth-child(4) {
    width: 130px !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  .history-table th:nth-child(5),
  .history-table td:nth-child(5) {
    width: 230px !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  .history-table th:nth-child(6),
  .history-table td:nth-child(6) {
    width: 130px !important;
    text-align: right !important;
    white-space: nowrap !important;
  }

  .history-table th:nth-child(7),
  .history-table td:nth-child(7) {
    width: 120px !important;
    text-align: left !important;
    white-space: nowrap !important;
  }
}

/* MOBILE: only Order ID + Created At */
@media (max-width: 760px) {
  .history-card {
    overflow: hidden !important;
  }

  .history-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  .history-table th:nth-child(n+3),
  .history-table td:nth-child(n+3) {
    display: none !important;
  }

  .history-table th:nth-child(1),
  .history-table td:nth-child(1) {
    width: 60% !important;
    padding: 14px 10px !important;
  }

  .history-table th:nth-child(2),
  .history-table td:nth-child(2) {
    display: table-cell !important;
    width: 40% !important;
    padding: 14px 10px !important;
    white-space: normal !important;
    text-align: left !important;
  }

  .history-table td:nth-child(1) a {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

html,
body {
  overflow-x: hidden !important;
}

.history-card {
  overflow-x: hidden !important;
  width: 100% !important;
}

.history-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

/* DESKTOP */
@media (min-width: 761px) {
  .history-table th:nth-child(2),
  .history-table td:nth-child(2) {
    display: none !important;
  }

  .history-table th,
  .history-table td {
    padding: 15px 12px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .history-table th:nth-child(1),
  .history-table td:nth-child(1) {
    width: 28% !important;
  }

  .history-table th:nth-child(3),
  .history-table td:nth-child(3) {
    width: 17% !important;
  }

  .history-table th:nth-child(4),
  .history-table td:nth-child(4) {
    width: 9% !important;
    text-align: left !important;
  }

  .history-table th:nth-child(5),
  .history-table td:nth-child(5) {
    width: 24% !important;
  }

  .history-table th:nth-child(6),
  .history-table td:nth-child(6) {
    width: 11% !important;
    text-align: right !important;
  }

  .history-table th:nth-child(7),
  .history-table td:nth-child(7) {
    width: 11% !important;
  }

  .history-table a {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 760px) {
  .history-table th:nth-child(n+3),
  .history-table td:nth-child(n+3) {
    display: none !important;
  }

  .history-table th:nth-child(1),
  .history-table td:nth-child(1) {
    width: 60% !important;
    padding: 14px 10px !important;
  }

  .history-table th:nth-child(2),
  .history-table td:nth-child(2) {
    display: table-cell !important;
    width: 40% !important;
    padding: 14px 10px !important;
    white-space: normal !important;
    text-align: left !important;
  }

  .history-table td:nth-child(1) a {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}