/* ======================================================
   TABLE.CSS — CORPORATE EXCEL STYLE TABLES (AURORA UI)
   Clean, premium, mobile-responsive table engine.
   Colors come from style.css variables.
====================================================== */

/* ----- BASE TABLE STYLE ----- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: var(--ks-bg-card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--ks-shadow-soft);
  margin-top: 10px;
}

/* ----- HEADER ----- */
table thead {
  background: linear-gradient(to right, #e5edff, #dbeafe);
  color: var(--ks-text-soft);
}

table thead th {
  padding: 8px 10px;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--ks-border-soft);
  border-right: 1px solid var(--ks-border-soft);
}

table thead th:last-child {
  border-right: none;
}

/* ----- BODY ----- */
table tbody tr {
  background: #ffffff;
}

table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--ks-border-soft);
  border-right: 1px solid var(--ks-border-soft);
  vertical-align: middle;
}

table tbody td:last-child {
  border-right: none;
}

table tbody tr:nth-child(even) {
  background: #f9fafb;
}

table tbody tr:last-child td {
  border-bottom: none;
}

/* ----- FOOTER ----- */
table tfoot td {
  padding: 8px 10px;
  background: #f1f5ff;
  font-weight: 600;
  border-top: 1px solid var(--ks-border-soft);
}

/* ----- BUTTONS INSIDE TABLE ----- */
table .small-btn {
  border-radius: var(--ks-radius-pill);
  padding: 4px 10px !important;
  font-size: 11px !important;
  white-space: nowrap;
}

/* ======================================================
   RESPONSIVE DESIGN — MOBILE CARD MODE (<600px)
====================================================== */

@media (max-width: 600px) {

  table {
    border-radius: 16px;
  }

  table thead {
    display: none;
  }

  table tbody,
  table tfoot {
    display: block;
  }

  table tbody tr {
    display: block;
    margin: 10px 0;
    border-radius: 14px;
    border: 1px solid var(--ks-border-soft);
    box-shadow: 0 6px 16px rgba(15,23,42,0.05);
    padding: 6px;
  }

  table tbody td {
    display: flex;
    justify-content: space-between;
    border: none !important;
    border-bottom: 1px dashed var(--ks-border-soft) !important;
    padding: 8px 6px;
  }

  table tbody td:last-child {
    border-bottom: none !important;
  }

  /* label for mobile rows */
  table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--ks-text-soft);
    margin-right: 10px;
  }

  /* footer also becomes card */
  table tfoot td {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-top: none;
  }
}
