/* KSS Parent Dashboard Styles */
.kss-parent-dashboard {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  border: 1px solid #e0e0e0;
  padding: 20px;
  border-radius: 8px;
}
.kss-dashboard-notice {
  padding: 15px;
  background-color: #fff8e1;
  border-left: 4px solid #ffc107;
}
.kss-parent-dashboard h3 {
  margin-top: 0;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}
.kss-parent-dashboard h4 {
  margin-top: 30px;
  color: #333;
}
.kss-invoice-card {
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-bottom: 20px;
  overflow: hidden;
}
.kss-invoice-header {
  background-color: #f9f9f9;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
}
.kss-invoice-due {
  font-size: 0.9em;
  color: #e53935;
  font-weight: bold;
}
.kss-invoice-body {
  padding: 15px;
}
.kss-invoice-body ul {
  margin: 0;
  padding-left: 20px;
  list-style-type: disc;
}
.kss-invoice-body li {
  padding: 5px 0;
  color: #555;
}
.kss-invoice-footer {
  background-color: #f9f9f9;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #ddd;
}
.kss-invoice-total {
  font-size: 1.2em;
  font-weight: bold;
  color: #222;
}
.kss-payment-button form {
  margin: 0;
}
.kss-payment-button input[type="submit"] {
  background-color: #10b981;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
}
.kss-history-table {
  width: 100%;
  border-collapse: collapse;
}
.kss-history-table th,
.kss-history-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.kss-history-table th {
  background-color: #f5f5f5;
}
.kss-history-table .details-button {
  background-color: #eee;
  color: #333;
  border: 1px solid #ccc;
  padding: 5px 10px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.9em;
}

/* ============================================= */
/* Responsive Table for Invoice History          */
/* ============================================= */

/* 在螢幕寬度小於 768px 時觸發 */
@media screen and (max-width: 768px) {
  .kss-history-table {
    border: 0;
  }

  .kss-history-table thead {
    /* 隱藏傳統的表格標頭 */
    border: none;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }

  .kss-history-table tr {
    /* 將每一行變成一張卡片 */
    display: block;
    margin-bottom: 1.5em;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .kss-history-table td {
    /* 讓儲存格垂直排列 */
    display: block;
    text-align: right; /* 讓內容靠右，標題靠左，形成對齊 */
    padding: 10px;
    border-bottom: 1px dotted #ccc;
    font-size: 1em;
  }

  .kss-history-table td::before {
    /* 使用 data-label 的內容作為標題 */
    content: attr(data-label);
    float: left; /* 讓標題靠左 */
    font-weight: bold;
    text-transform: uppercase;
    margin-right: 20px;
  }

  .kss-history-table td:last-child {
    border-bottom: 0;
  }

  /* 針對操作按鈕，讓它置中或靠右比較好看 */
  .kss-history-table td[data-label="操作"] {
    text-align: center;
  }
  .kss-history-table td[data-label="操作"]::before {
    /* 按鈕這行不需要標題 */
    display: none;
  }
}

/* ============================================= */
/* Invoice Details Modal Table                   */
/* ============================================= */

.kss-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.kss-details-table th,
.kss-details-table td {
  padding: 10px;
  border: 1px solid #eee;
  text-align: left;
}

.kss-details-table th {
  background-color: #f9f9f9;
  font-weight: bold;
}

.kss-details-table tbody tr:nth-child(even) {
  background-color: #fcfcfc;
}

.kss-details-table td:nth-child(2),
.kss-details-table td:nth-child(3),
.kss-details-table td:nth-child(4) {
  text-align: right;
}

.kss-details-table tfoot {
  font-size: 1.1em;
  background-color: #f5f5f5;
}
