/* Purpose: Standard table styling for all billing pages in EHR-Africa
   This ensures consistent, properly aligned tables throughout the billing system */

/* Apply to all tables in billing pages by default */
.billing-table,
table.billing-standard {
  display: table !important;
  table-layout: fixed !important;
  width: 100% !important;
  border-collapse: collapse !important;
  background: white !important;
}

.billing-table thead,
table.billing-standard thead {
  display: table-header-group !important;
  background: linear-gradient(135deg, #4CAF50, #45a049) !important;
}

.billing-table tbody,
table.billing-standard tbody {
  display: table-row-group !important;
}

.billing-table tr,
table.billing-standard tr {
  display: table-row !important;
}

.billing-table th,
table.billing-standard th {
  display: table-cell !important;
  border: 1px solid #ddd !important;
  padding: 12px 10px !important;
  text-align: left !important;
  vertical-align: middle !important;
  color: white !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

.billing-table td,
table.billing-standard td {
  display: table-cell !important;
  border: 1px solid #ddd !important;
  padding: 12px 10px !important;
  text-align: left !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Alignment helpers */
.billing-table th.center,
.billing-table td.center,
table.billing-standard th.center,
table.billing-standard td.center {
  text-align: center !important;
}

.billing-table th.right,
.billing-table td.right,
table.billing-standard th.right,
table.billing-standard td.right {
  text-align: right !important;
}

.billing-table th.left,
.billing-table td.left,
table.billing-standard th.left,
table.billing-standard td.left {
  text-align: left !important;
}

/* Money columns should be right-aligned and bold */
.billing-table td.amount,
table.billing-standard td.amount {
  text-align: right !important;
  font-weight: 600 !important;
  color: #4CAF50 !important;
}

/* Action column should allow wrapping for buttons */
.billing-table td.actions,
table.billing-standard td.actions {
  white-space: normal !important;
  text-align: center !important;
}

/* Button styling in tables */
.billing-table button,
table.billing-standard button {
  font-size: 11px !important;
  padding: 6px 12px !important;
  margin: 2px !important;
  white-space: nowrap !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  display: inline-block !important;
  min-width: fit-content !important;
  width: auto !important;
}

/* Row hover effect */
.billing-table tbody tr:hover,
table.billing-standard tbody tr:hover {
  background: #f5f5f5 !important;
}

/* Alternating row colors */
.billing-table tbody tr:nth-child(even),
table.billing-standard tbody tr:nth-child(even) {
  background: #fafafa !important;
}

.billing-table tbody tr:nth-child(even):hover,
table.billing-standard tbody tr:nth-child(even):hover {
  background: #f5f5f5 !important;
}

/* Status badges */
.billing-table .status-badge,
table.billing-standard .status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-paid { background: #4CAF50; color: white; }
.status-pending { background: #FF9800; color: white; }
.status-overdue { background: #f44336; color: white; }
.status-partial { background: #2196F3; color: white; }
.status-cancelled { background: #9E9E9E; color: white; }

/* Link styling in tables */
.billing-table a,
table.billing-standard a {
  color: #2196F3;
  text-decoration: none;
  font-weight: 500;
}

.billing-table a:hover,
table.billing-standard a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .billing-table,
  table.billing-standard {
    font-size: 13px;
  }
  
  .billing-table th,
  .billing-table td,
  table.billing-standard th,
  table.billing-standard td {
    padding: 8px 5px !important;
  }
  
  .billing-table button,
  table.billing-standard button {
    font-size: 10px !important;
    padding: 4px 8px !important;
  }
}

