*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #111827 0, #020617 55%, #000 100%);
  font-family: "Rubik", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #e5e7eb;
}

/* Overall layout */
.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 6px;
}

.shell {
  max-width: 430px;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  background: #020617;
  border: 1px solid #facc15;
}

/* Header */
.shell-header {
  background: linear-gradient(135deg, #1f2937, #0f172a);
  color: #e5e7eb;
}

.title-row {
  text-align: center;
  padding: 10px 8px 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(15, 23, 42, 0.7);
  font-family: 'Courier New', Courier, monospace;
}

.date-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 8px;
  font-size: 0.88rem;
  background: #111827;
  margin-top: 2px;
}

.date-row label {
  color: #9ca3af;
  font-weight: 300;
}

.shell-main {
  padding: 8px 8px 6px;
}

/* Inputs */
.dropdown {
  appearance: none;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.94rem;
  font-weight: 400;
  border: none;
}

.dark-input {
  background: #020617;
  color: #e5e7eb;
  border-radius: 8px;
  border: 1px solid #374151;
  padding: 7px 9px;
  font-size: 0.94rem;
  font-weight: 400;
}

.dark-input:focus,
.dropdown.dark-input:focus {
  outline: 1.5px solid #38bdf8;
}

.date-row .dropdown {
  background: #f9fafb;
  color: #111827;
}

/* Card */
.block-card {
  background: #020617;
  border-radius: 12px;
  padding: 12px 8px 8px;
}

/* Form */
.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.form-row label {
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
  color: #e5e7eb;
}

.field-help {
  font-size: 0.82rem;
  font-weight: 300;
  color: #e5e7eb;
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px 0;
}

.rect-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.blue-btn {
  background: #38bdf8;
  color: #020617;
}

.grey-btn {
  background: #f9f8f5;
  color: #111827;
}

.green-btn {
  background: #a7f3d0;
  color: #064e3b;
  min-width: 170px;
}

/* Expense list */
.expense-list-title {
  margin: 12px 0 6px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Report-specific expense title styling */
.report-expense-title {
  color: #654321;
  font-weight: 500;
}

.expense-list {
  max-height: 140px;
  overflow-y: auto;
  padding: 6px 4px;
  background: #020617;
  border-radius: 8px;
  border: 1px solid #1f2937;
  margin-bottom: 12px;
}

.expense-empty {
  text-align: center;
  font-size: 0.9rem;
  color: #9ca3af;
  font-style: italic;
  font-weight: 300;
}

.expense-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  column-gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #111827;
  margin-bottom: 6px;
}

.expense-main {
  min-width: 0;
}

.expense-name {
  font-size: 0.92rem;
  font-weight: 400;
}

.expense-notes {
  font-size: 0.82rem;
  color: #93c5fd;
  font-weight: 300;
}

.expense-amount {
  font-size: 0.9rem;
  text-align: right;
  min-width: 72px;
  font-weight: 500;
}

.expense-delete-btn {
  background: none;
  border: none;
  color: #fecaca;
  font-size: 1rem;
  cursor: pointer;
}

/* Summary */
.summary-section {
  margin-top: 6px;
}

.flat-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

/* Report-specific flat row styling */
.report-flat-row {
  color: #654321;
  font-weight: 500;
}

.short-input {
  width: 50px;
  text-align: center;
  font-size: 0.88rem;
  padding: 4px 6px;
}

.summary-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.summary-box {
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 130px;
  text-align: center;
}

.summary-label {
  display: block;
  font-size: 0.73rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
}

.total-box {
  background: #fbbf24;
  color: #111827;
}

.perflat-box {
  background: #bae6fd;
  color: #0f172a;
}

.summary-value {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
  font-weight: 500;
}

/* Footer - subtle but visible */
.app-footer {
  margin-top: 6px;
  padding: 8px 0;
  text-align: center;
  font-size: 0.7rem;
  color: rgba(156, 163, 175, 0.35);
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* Report footer with subtle gray */
.report-footer {
  color: rgba(100, 100, 100, 0.4);
}

/* Report extras */
.dark-tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #374151;
  font-size: 0.88rem;
  color: #ffffff;
}

.chart-wrapper {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #f9fafb;
}

/* Scrollbar styling */
.expense-list::-webkit-scrollbar {
  width: 4px;
}

.expense-list::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

.expense-list {
  scrollbar-width: thin;
  scrollbar-color: #4b5563 transparent;
}

/* Remove spinner controls from number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .shell-main {
    padding: 8px 6px 6px;
  }

  .block-card {
    padding: 10px 8px 8px;
  }
}
