/* Sedifex expense page layout polish
   Loaded globally from index.html so it also fixes older inline JSX pages. */

.expenses-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  color: #0f172a;
}

.expenses-header {
  margin-bottom: 24px;
}

.expenses-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 4px;
}

.expenses-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}

.expenses-header p {
  max-width: 900px;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

.expense-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.expense-summary-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.expense-summary-card strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #1e1b4b;
}

.expense-summary-card span {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 14px;
}

.expense-rule-card {
  background: #eef2ff;
  border-left: 5px solid #4f46e5;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.expense-rule-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: #312e81;
}

.expense-rule-card p {
  margin: 0;
  color: #334155;
  line-height: 1.6;
}

.expense-form-card,
.expense-history-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.07);
  margin-bottom: 24px;
}

.expense-form-card h3,
.expense-history-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
}

.expense-help-text {
  color: #64748b;
  margin: 0 0 20px;
  line-height: 1.5;
}

.expense-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.expense-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.expense-field label {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.expense-field input,
.expense-field select,
.expense-field textarea,
.expense-filter-row input,
.expense-filter-row select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 15px;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.expense-field textarea {
  min-height: 110px;
  resize: vertical;
}

.expense-field input:focus,
.expense-field select:focus,
.expense-field textarea:focus,
.expense-filter-row input:focus,
.expense-filter-row select:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.expense-field-wide {
  grid-column: span 2;
}

.expense-field-full {
  grid-column: 1 / -1;
}

.expense-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.expense-primary-button {
  border: none;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  font-weight: 800;
  padding: 13px 22px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.25);
}

.expense-primary-button:hover {
  transform: translateY(-1px);
}

.expense-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 260px;
  gap: 14px;
  margin: 18px 0;
}

.expense-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}

.expense-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

.expense-table th {
  background: #f8fafc;
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  padding: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.expense-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}

.expense-empty-state {
  padding: 24px;
  color: #64748b;
  text-align: center;
}

/* Safety net for the current inline/unstyled expenses screen shown in the screenshot. */
.dashboard-page input,
.dashboard-page select,
.dashboard-page textarea,
main input,
main select,
main textarea {
  box-sizing: border-box;
  max-width: 100%;
}

.dashboard-page label,
main label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 10px 0;
  font-weight: 700;
  color: #0f172a;
}

.dashboard-page label > input,
.dashboard-page label > select,
.dashboard-page label > textarea,
main label > input,
main label > select,
main label > textarea {
  margin-left: 8px;
}

@media (max-width: 900px) {
  .expense-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expense-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expense-field-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .expenses-page {
    padding: 16px;
  }

  .expense-summary-grid,
  .expense-form-grid,
  .expense-filter-row {
    grid-template-columns: 1fr;
  }

  .expense-form-card,
  .expense-history-card {
    padding: 18px;
    border-radius: 18px;
  }

  .expenses-header h1 {
    font-size: 24px;
  }

  .dashboard-page label,
  main label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    margin-right: 0;
  }

  .dashboard-page label > input,
  .dashboard-page label > select,
  .dashboard-page label > textarea,
  main label > input,
  main label > select,
  main label > textarea {
    margin-left: 0;
  }
}
