.settings-card,
.card,
#budget-summary,
#actuals-summary {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 14px rgba(40, 90, 180, 0.06);
  padding: 32px 0 24px 0; /* Only top/bottom padding for card alignment */
  margin-bottom: 36px;
  width: 100%;
  overflow: visible;
}

/* Card inner content for "air" around content */
.card-content {
  padding: 0 32px;
}
@media (max-width: 900px) {
  .card-content {
    padding: 0 12px;
  }
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  margin-bottom: 0;
}

/* Table Styles */
#budget-table,
#actuals-table,
#dues-table {
  width: 100%;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: none;
  border-collapse: separate;
  border-spacing: 0;
  /* table-layout: fixed; */ /* REMOVE for natural column sizing */
  margin-bottom: 0;
}

/* --- PLAYER DUES TABLE COLUMNS: FLEXIBLE WIDTHS --- */
#dues-table th,
#dues-table td {
  min-width: 90px;
  white-space: nowrap;
}
#dues-table th:nth-child(5),
#dues-table td:nth-child(5)  /* Description */
{
  min-width: 160px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#budget-table th,
#budget-table td,
#actuals-table th,
#actuals-table td,
#dues-table th,
#dues-table td {
  border: none;
  padding: 12px 14px;
  text-align: left;
  font-size: 1rem;
}
#dues-table td:last-child {
  vertical-align: middle;
}
#budget-table th,
#actuals-table th,
#dues-table th {
  background: #f3f5fa;
  font-weight: 600;
  color: #2463eb;
  font-size: 1.04rem;
  text-transform: uppercase;
  border-bottom: 2px solid #e5eaf2;
}
#budget-table tr,
#actuals-table tr,
#dues-table tr {
  border-bottom: 1px solid #e6e7ef;
}
#budget-table tr:last-child,
#actuals-table tr:last-child,
#dues-table tr:last-child {
  border-bottom: none;
}
#budget-table tr:nth-child(even),
#actuals-table tr:nth-child(even),
#dues-table tr:nth-child(even) {
  background: #f7fbfe;
}
/* Delete buttons */
#budget-table button,
#actuals-table button,
#dues-table button {
  background: #f87171;
  color: #fff;
  border: none;
  padding: 7px 19px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s;
  font-weight: 500;
}
#budget-table button:hover,
#actuals-table button:hover,
#dues-table button:hover {
  background: #dc2626;
}

/* BLUE Send Reminder button */
#dues-table .reminder-btn {
  background: #2463eb !important;
  color: #fff !important;
  border: none;
  padding: 7px 19px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.01em;
}
#dues-table .reminder-btn:hover {
  background: #22d3ee !important;
  color: #1e293b !important;
}

@media (max-width: 700px) {
  #budget-table th,
  #budget-table td,
  #actuals-table th,
  #actuals-table td,
  #dues-table th,
  #dues-table td {
    padding: 9px 6px;
    font-size: 0.94rem;
  }
}

/* PRIMARY BUTTON (Add Entry, Save Name, etc.) */
.primary-btn,
#add-budget-entry,
#add-actual-entry,
#team-name-form button {
  background: #2463eb;
  color: #fff;
  border: none;
  padding: 0 38px;
  height: 48px;
  font-size: 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.18s, color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 12px 0 rgba(36,99,235,0.08);
  margin: 0 0 26px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.primary-btn:hover,
#add-budget-entry:hover,
#add-actual-entry:hover,
#team-name-form button:hover {
  background: #22d3ee;
  color: #1e293b;
}

.danger-btn {
  background: #f87171;
  color: #fff;
  border: none;
  padding: 12px 26px;
  font-size: 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.18s;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}
.danger-btn:hover {
  background: #dc2626;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(36, 99, 235, 0.11);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.20s;
}
.modal.active {
  display: flex;
}
.modal-content {
  background: #fff;
  padding: 34px 38px 26px 38px;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(36,99,235,0.10);
  min-width: 320px;
  max-width: 96vw;
  animation: modalBounce 0.20s;
  position: relative;
}
.modal-content h3 {
  margin-top: 0;
  margin-bottom: 19px;
  color: #2463eb;
  text-transform: uppercase;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-content input,
.modal-content select {
  padding: 8px 12px;
  font-size: 1rem;
  border: 1.5px solid #2463eb;
  border-radius: 8px;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.13s;
}
.modal-content input:focus,
.modal-content select:focus {
  border-color: #22d3ee;
}
.modal-content button[type="submit"] {
  margin-top: 10px;
  background: #2463eb;
  color: #fff;
  border: none;
  padding: 11px 28px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.18s;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.modal-content button[type="submit"]:hover {
  background: #22d3ee;
  color: #1e293b;
}
.close-modal {
  position: absolute;
  right: 28px;
  top: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #2463eb;
  cursor: pointer;
  font-weight: 500;
}

/* Utilities */
.action-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}
#dues-table .action-cell button {
  width: 100%;
}
#dues-table td:nth-child(1) {
  text-align: center;
  vertical-align: middle;
}

#team-name-form {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-top: 10px;
}

#team-name-form label {
  display: flex;
  align-items: center;
  font-size: 1rem;
  margin-right: 2px;
  white-space: nowrap;
}

#team-name-input {
  font-size: 1rem;
  border: 1.5px solid #2463eb;
  border-radius: 10px;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.15s;
  height: 48px;
  padding: 0 16px;
  box-sizing: border-box;
  line-height: 1.4;
  margin: 0;
  flex: 1 1 240px;
  min-width: 0;
}

#team-name-input:focus {
  border-color: #22d3ee;
}

#team-name-form button {
  background: #2463eb;
  color: #fff;
  border: none;
  height: 48px;
  font-size: 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.18s, color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 12px 0 rgba(36,99,235,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 34px;
  margin: 0;
  line-height: 1.4;
}

#team-name-form button:hover {
  background: #22d3ee;
  color: #1e293b;
}

/* ---- DASHBOARD CARDS ---- */
.dashboard-cards-row {
  display: flex;
  gap: 28px;
  margin-bottom: 34px;
  flex-wrap: wrap;
  align-items: flex-start; /* Ensures all cards in row are aligned at the top */
}
.dashboard-cards-bottom {
  align-items: flex-start !important; /* Make sure bottom row is top-aligned */
}

.dashboard-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 14px rgba(40, 90, 180, 0.08);
  padding: 32px 28px 24px 28px;
  min-width: 220px;
  min-height: 112px;
  height: auto;
  overflow: visible;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start; /* ensures content starts at the top */
  margin-bottom: 0;
}
.dashboard-card.large {
  min-width: 380px;
  flex: 2 1 0;
}
.card-label {
  font-size: 1.11rem;
  font-weight: 700;
  color: #213a50;
  margin-bottom: 11px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.card-main {
  margin-bottom: 2px;
}
.card-value {
  font-size: 1.38rem;  /* Smaller for summary cards */
  font-weight: 800;
  color: #101828;
}
.card-value.positive {
  color: #16a34a;
}
.card-value.negative {
  color: #dc2626;
}
.card-sub {
  color: #718096;
  font-size: 0.98rem;  /* Smaller for summary cards */
  font-weight: 400;
  margin-top: 7px;
}

#overdue-dues-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: separate;
  border-spacing: 0;
}
#overdue-dues-table th,
#overdue-dues-table td {
  padding: 12px 10px;
  font-size: 1.02rem;
  text-align: left;
}
#overdue-dues-table th {
  color: #213a50;
  background: #f3f5fa;
  font-weight: 700;
  border-bottom: 2px solid #e5eaf2;
}
#overdue-dues-table td:last-child {
  text-align: right;
}
.dues-badge {
  background: #f87171;
  color: #fff;
  border-radius: 16px;
  font-size: 1.02rem;
  padding: 4px 22px;
  font-weight: 600;
  display: inline-block;
}

@media (max-width: 900px) {
  .dashboard-cards-row {
    flex-direction: column;
    gap: 18px;
  }
  .dashboard-card,
  .dashboard-card.large {
    min-width: unset;
    width: 100%;
  }
}

#expensePieChart {
  margin-top: 18px;
  display: block;
}

.dashboard-cards-row {
  align-items: stretch;
}
.dashboard-card.large {
  min-height: 310px; /* adjust as needed for balance */
}

.dashboard-empty-msg {
  margin-top: 32px;
  color: #888;
  text-align: center;
  font-size: 1.06rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.reports-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 30px;
  letter-spacing: 0.01em;
}
.reports-cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: flex-start;
}
.report-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 14px rgba(40, 90, 180, 0.06);
  padding: 30px 30px 24px 30px;
  min-width: 325px;
  max-width: 400px;
  flex: 1 1 330px;
  display: flex;
  flex-direction: column;
  margin-bottom: 32px;
}
.report-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.report-desc {
  color: #6b7280;
  font-size: 1rem;
  margin-bottom: 22px;
}
.report-actions {
  display: flex;
  gap: 16px;
}
.report-btn {
  background: #fff;
  color: #111;
  border: 1.5px solid #e5e7eb;
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-btn:hover,
.report-btn:focus {
  background: #2463eb;
  color: #fff;
  border-color: #2463eb;
}
.export-icon {
  font-size: 1.22em;
  margin-right: 4px;
}
@media (max-width: 1100px) {
  .reports-cards-row {
    flex-direction: column;
    gap: 16px;
  }
  .report-card {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }
}
.report-modal-content {
  max-width: 820px;
  width: 100%;
}

#report-dues-status-table th,
#report-dues-status-table td {
  padding: 12px 12px;
  vertical-align: middle;
  text-align: left;
}

#report-dues-status-table th {
  font-size: 1.07rem;
  font-weight: 700;
  border-bottom: 2px solid #ececec;
}

#report-dues-status-table td {
  font-size: 1.04rem;
  border-bottom: 1px solid #f3f3f3;
}

#report-dues-status-table td:nth-child(3) { /* Amount */
  text-align: right;
}

#report-dues-status-table td:nth-child(5),
#report-dues-status-table th:nth-child(5) { /* Status */
  text-align: center;
  min-width: 120px;
}

/* Optionally, make the badge bigger and center vertically */
.status-badge {
  display: inline-block;
  min-width: 72px;
  padding: 7px 16px;
  border-radius: 22px;
  font-size: 1.01rem;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
  margin: 0;
}

.status-badge.overdue {
  background: #f87171;
  color: #fff;
}

.status-badge.unpaid {
  background: #fbbf24;
  color: #864d00;
}

.status-badge.paid {
  background: #4ade80;
  color: #03543f;
}

.export-modal-content {
  padding: 28px 36px 24px 36px;
  border-radius: 14px;
  min-width: 280px;
  background: #fff;
  box-shadow: 0 2px 22px 2px rgba(0,0,0,0.07);
  text-align: center;
}
.export-choice-btn {
  padding: 11px 0;
  font-size: 1.06rem;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-weight: 600;
  color: #2463eb;
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}
.export-choice-btn:hover,
.export-choice-btn:focus {
  background: #2463eb;
  color: #fff;
  border-color: #2463eb;
}
.export-choice-btn.cancel-btn {
  color: #dc2626;
  border-color: #fdeded;
  margin-top: 3px;
}
.export-choice-btn.cancel-btn:hover,
.export-choice-btn.cancel-btn:focus {
  background: #fdeded;
  color: #dc2626;
}

/* ====== UNIVERSAL TABLE HEADER AND SECTION ROWS ====== */
th,
.table-section-row {
  text-transform: uppercase;
  font-weight: 700;
  background: #f3f5fa;
  color: #2463eb;
  font-size: 1.04rem;
  border-bottom: 2px solid #e5eaf2;
}
.table-section-row {
  background: #f7fbfe !important; /* Lighter for section rows */
  color: #2463eb !important;
}

/* ====== MOBILE RESPONSIVE LAYOUT FOR CARDS & TABLES ====== */
@media (max-width: 900px) {
  .dashboard-cards-row,
  .reports-cards-row {
    flex-direction: column;
    gap: 18px;
  }
  .dashboard-card,
  .dashboard-card.large,
  .report-card {
    min-width: unset;
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
  }
}

/* Make tables scroll horizontally on small screens */
.table-responsive {
  overflow-x: auto;
  width: 100%;
}

@media (max-width: 700px) {
  #budget-table th,
  #budget-table td,
  #actuals-table th,
  #actuals-table td,
  #dues-table th,
  #dues-table td,
  #overdue-dues-table th,
  #overdue-dues-table td {
    padding: 9px 6px;
    font-size: 0.94rem;
    white-space: nowrap;
  }
  .dashboard-card,
  .report-card {
    padding: 18px 9px;
  }
  .settings-card,
  #budget-summary,
  #actuals-summary {
    padding: 18px 9px;
  }
}

@media (max-width: 500px) {
  .modal-content,
  .report-modal-content,
  .export-modal-content {
    min-width: 98vw !important;
    max-width: 98vw !important;
    padding: 12px 6px !important;
    border-radius: 10px !important;
  }
}

@media (max-width: 600px) {
  #actuals-table th,
  #actuals-table td,
  #budget-table th,
  #budget-table td,
  #dues-table th,
  #dues-table td {
    font-size: 0.90rem;
    padding: 7px 3px;
    min-width: 90px;
    white-space: nowrap;
  }
  .table-responsive {
    max-width: 100%;
  }
  .primary-btn {
    width: 100%;
    min-width: 0;
    padding: 0;
    font-size: 1rem;
  }
}
