/* === BASE TABLE STYLES === */
table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 1rem;
  font-family: 'Roboto', sans-serif;
  background-color: #fff;
  color: #000;
  position: relative;
  z-index: 1;
}

caption {
  caption-side: top;
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: left;
}

/* === COLUMN STYLES === */
colgroup col:first-child {
  background-color: #f0f0f0;
}

/* === HEADER, BODY, FOOT STYLING === */
thead th,
tbody td,
tfoot td {
  border: 1px solid #333;
  padding: 10px;
  text-align: left;
}

thead th {
  background-color: #f7f7f7;
  font-weight: bold;
}

tbody tr:nth-child(even) {
  background-color: #f0f0f0;
}

tbody td:hover {
  background-color: #e0e0e0;
  z-index: 2;
  position: relative;
}

tfoot td {
  background-color: #fafafa;
  font-style: italic;
  text-align: center;
  padding: 1rem;
  border-top: 2px solid #333;
}

/* === RESPONSIVE: TABLET < 992px === */
@media (max-width: 991px) {
  table {
    font-size: 0.9rem;
  }
}

/* === RESPONSIVE: MOBILE < 768px === */
@media (max-width: 767px) {
  table, thead, tbody, tfoot, th, td, tr {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    margin-bottom: 1.5rem;
    border: 1px solid #ccc;
    padding: 0.5rem;
    background: #fff;
    position: relative;
  }

  tbody td {
    padding: 10px 10px 10px 50%;
    text-align: right;
    position: relative;
    border: none;
    border-bottom: 1px solid #eee;
    background-color: #fff;
  }

  tbody td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: 45%;
    padding-left: 10px;
    font-weight: bold;
    text-align: left;
    white-space: nowrap;
  }

  tfoot td {
    display: block;
    width: 100%;
    border-top: 2px solid #333;
  }
}

