/* --- Weekly Cash Flow Dashboard Styles --- */
.dashboard-body {
  background-color: #34302B !important; /* Deep Pewter */
  color: #ffffff !important;
}

.dashboard-wrapper {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #4a4540;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.dashboard-title-section {
  text-align: left;
  margin-bottom: 2rem;
}

.dashboard-title-section h1 {
  color: #ffffff !important;
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.dashboard-title-section .subtitle {
  color: #a1a1aa;
  font-size: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  max-width: 100%;
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 320px 1fr 260px;
  }
  
  .sticky-col {
    position: sticky;
    top: 2rem;
  }
}

.dashboard-card {
  background-color: #2b2724; /* Darker accent */
  border-radius: 0.75rem;
  border: 1px solid #4a4540;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dashboard-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 1px solid #4a4540;
  padding-bottom: 0.5rem;
  color: #ffffff;
}

/* Balance input wrapper */
.balance-input-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.balance-input-symbol {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #52525b;
  font-weight: 700;
  font-size: 1.25rem;
  pointer-events: none;
}

.large-balance-input {
  background-color: #fafafa !important;
  color: #18181b !important;
  border: 1px solid #d4d4d8 !important;
  height: 3.5rem !important;
  padding-left: 2rem !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  border-radius: 0.5rem !important;
  width: 100%;
}

.large-balance-input:focus {
  border-color: #D50A0A !important;
  box-shadow: 0 0 0 3px rgba(213, 10, 10, 0.4) !important;
  background-color: #ffffff !important;
}

/* Net balance block */
.net-balance-block {
  background-color: #23201e;
  border: 1px solid #4a4540;
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-align: center;
}

.net-balance-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
  margin-bottom: 0.5rem;
}

.net-balance-value {
  font-size: 2rem;
  font-weight: 800;
  word-break: break-all;
}

.net-balance-value.positive {
  color: #10b981; /* green */
}

.net-balance-value.negative {
  color: #ef4444; /* red */
}

.balance-breakdown {
  margin-top: 1rem;
  border-top: 1px dashed #4a4540;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.breakdown-row span:last-child {
  font-weight: 600;
}

.text-additions {
  color: #10b981;
}

.text-deductions {
  color: #f59e0b; /* orange */
}

/* Grid Table */
.table-container {
  overflow-x: auto;
  background-color: #2b2724;
  border-radius: 0.75rem;
  border: 1px solid #4a4540;
  padding: 1.25rem;
}

.cashflow-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed;
  min-width: 500px;
}

.cashflow-table th {
  padding: 0.75rem 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #a1a1aa;
  font-weight: 700;
  border-bottom: 1px solid #4a4540;
}

.cashflow-table td {
  padding: 0.5rem;
  border-bottom: 1px solid #3e3a35;
  vertical-align: middle;
}

/* Cash Flow Table Column Widths and Alignments */
.cashflow-table th:nth-child(1),
.cashflow-table td:nth-child(1) {
  width: 55%;
}

.cashflow-table th:nth-child(2),
.cashflow-table td:nth-child(2) {
  width: 20%;
  text-align: right;
}

.cashflow-table th:nth-child(3),
.cashflow-table td:nth-child(3) {
  width: 20%;
  text-align: right;
}

.cashflow-table th:nth-child(4),
.cashflow-table td:nth-child(4) {
  width: 5%;
  text-align: center;
}

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

.table-text-input {
  background-color: #23201e !important;
  color: #ffffff !important;
  border: 1px solid #4a4540 !important;
  padding: 0.5rem 0.75rem !important;
  font-size: 0.95rem !important;
  border-radius: 0.375rem !important;
  width: 100%;
  height: 2.25rem !important;
  transition: all 0.15s ease !important;
}

.table-text-input:focus {
  border-color: #D50A0A !important;
  background-color: #2b2724 !important;
  box-shadow: 0 0 0 2px rgba(213, 10, 10, 0.4) !important;
}

.table-amount-wrapper {
  position: relative;
}

.table-amount-symbol {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #52525b;
  font-size: 0.9rem;
  pointer-events: none;
  font-weight: 600;
}

.table-amount-input {
  background-color: #fafafa !important;
  color: #18181b !important;
  border: 1px solid #d4d4d8 !important;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  border-radius: 0.375rem !important;
  width: 100%;
  height: 2.25rem !important;
  text-align: right;
}

.table-amount-input:focus {
  border-color: #D50A0A !important;
  box-shadow: 0 0 0 2px rgba(213, 10, 10, 0.4) !important;
  background-color: #ffffff !important;
}

.delete-row-btn {
  background: transparent !important;
  border: none !important;
  color: #a1a1aa !important;
  font-size: 1.5rem !important;
  cursor: pointer;
  padding: 0.25rem 0.5rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.15s ease !important;
  width: 100%;
  height: 2.25rem;
}

.delete-row-btn:hover {
  color: #ef4444 !important;
}

/* Actions list */
.actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-card .btn {
  width: 100%;
  padding: 0.65rem 1rem !important;
  font-size: 0.9rem !important;
  border-radius: 0.375rem !important;
}

/* Custom Toast styling */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: #10b981;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-footer {
  text-align: center;
  padding: 2rem;
  color: #a1a1aa;
  font-size: 0.875rem;
  border-top: 1px solid #4a4540;
  margin-top: 4rem;
}

/* --- Mobile Responsive Table Cards --- */
@media (max-width: 600px) {
  .table-container {
    padding: 0.75rem !important;
  }

  .cashflow-table,
  .cashflow-table tbody,
  .cashflow-table tr,
  .cashflow-table td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }

  .cashflow-table thead {
    display: none !important;
  }

  .cashflow-table {
    min-width: 0 !important;
  }

  .cashflow-table tr {
    background-color: #23201e;
    border: 1px solid #4a4540;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .cashflow-table tr:last-child {
    margin-bottom: 0;
  }

  .cashflow-table td {
    padding: 0.5rem 0 !important;
    border-bottom: none !important;
  }

  /* Override desktop width/alignment columns */
  .cashflow-table td:nth-child(1),
  .cashflow-table td:nth-child(2),
  .cashflow-table td:nth-child(3),
  .cashflow-table td:nth-child(4) {
    width: 100% !important;
    text-align: left !important;
  }

  /* Mobile labels above inputs */
  .cashflow-table td:nth-child(1)::before {
    content: "Account / Flow Name";
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #a1a1aa;
    font-weight: 700;
    margin-bottom: 0.35rem;
  }

  .cashflow-table td:nth-child(2)::before {
    content: "Deductions (-)";
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #a1a1aa;
    font-weight: 700;
    margin-bottom: 0.35rem;
  }

  .cashflow-table td:nth-child(3)::before {
    content: "Additions (+)";
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #a1a1aa;
    font-weight: 700;
    margin-bottom: 0.35rem;
  }

  /* Inputs full horizontal width with proper padding */
  .table-text-input,
  .table-amount-wrapper {
    width: 100% !important;
  }

  .table-amount-input {
    text-align: left !important;
    padding-left: 1.5rem !important;
  }

  /* Align action button cleanly at the bottom right of each card */
  .cashflow-table td:nth-child(4) {
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 0.5rem;
    padding-top: 0.75rem !important;
    border-top: 1px dashed #3e3a35 !important;
  }

  .delete-row-btn {
    width: auto !important;
    height: 2.25rem !important;
    padding: 0 1rem !important;
    font-size: 0.9rem !important;
    background-color: #3e3a35 !important;
    border: 1px dashed #ef4444 !important;
    border-radius: 0.375rem !important;
    color: #ef4444 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem;
    transition: all 0.15s ease !important;
  }

  .delete-row-btn:hover,
  .delete-row-btn:active {
    background-color: #ef4444 !important;
    color: #ffffff !important;
  }

  .delete-row-btn::before {
    content: "Remove ";
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
  }
}
