/* ===== BASE ===== */
body {
  font-family: Arial, sans-serif;
  line-height: 1.55;
  background: #f5f5f5;
  color: #111827;
  font-size: 15px;
}

.container {
  max-width: 960px;
  margin: 30px auto;
  padding: 28px;
  background: #fff;
  border-radius: 12px;
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
}

.intro-text {
  color: #4b5563;
  max-width: 760px;
}

/* ===== SECTIONS ===== */
.section {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f5;
}

.overall-section {
  margin-bottom: 40px;
}

/* ===== SUMMARY CARDS ===== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 18px;
  margin: 22px 0;
}

.summary-card {
  background: #f9f9fb;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid #e5e5ea;
}

.summary-card label {
  font-size: 13px;
  color: #6b7280;
}

.summary-card strong {
  font-size: 22px;
  display: block;
  margin-top: 4px;
}

/* ===== TABLES (SCREEN) ===== */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: #f4f4f7;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  text-align: left;
}

/* ===== INPUTS ===== */
table input,
table select {
  min-width: 120px;
  padding: 6px 8px;
  font-size: 15px;
}

/* ===== PROGRESS ===== */
.progress-bar {
  height: 16px;
  background: #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: #28a745;
}

/* ===== CATEGORY STATUS ===== */
.cat-ok { color: #166534; }
.cat-warn { color: #b45309; font-weight: bold; }
.cat-danger { color: #991b1b; font-weight: bold; }

/* ===== INSIGHTS ===== */
#insights {
  margin-top: 18px;
  padding: 12px 16px;
  border-left: 4px solid #22c55e;
  background: #f0fdf4;
  color: #166534;
  border-radius: 6px;
}

.insight-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

/* ===================================================== */
/* ✅ BUTTONS — HOVER FILL STYLE (FINAL) */
/* ===================================================== */

button {
  appearance: none;
  border: 2px solid #2563eb;
  background: white;
  color: #2563eb;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 18px;
  border-radius: 10px;
  transition: background-color .2s ease,
              color .2s ease,
              transform .1s ease;
}

/* Hover = blue fill */
button:hover {
  background: #2563eb;
  color: white;
}

/* Active click */
button:active {
  transform: translateY(1px);
}

/* Export buttons layout */
.export-buttons {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid #e5e5ea;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

.site-footer a {
  color: #2563eb;
  text-decoration: none;
  margin: 0 6px;
}

.site-footer span {
  color: #9ca3af;
}

/* ===================================================== */
/* ✅ MOBILE (SCREEN ONLY) */
/* ===================================================== */
@media (max-width: 640px) {

  body { font-size: 16px; }

  .container {
    padding: 20px 16px;
    border-radius: 0;
  }

  h1 { font-size: 22px; }
  h2 { font-size: 17px; }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead { display: none; }

  tr {
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
  }

  td {
    border: none;
    padding: 6px 0;
  }

  td input,
  td select {
    width: 100%;
  }

  .export-buttons button,
  #addExpense {
    width: 100%;
  }
}

/* ===================================================== */
/* ✅ PRINT / PDF — CLEAN REPORT */
/* ===================================================== */
@media print {

  body {
    background: white !important;
    color: #000 !important;
    font-size: 12pt;
  }

  .no-print,
  .export-buttons,
  .site-footer,
  .progress-bar {
    display: none !important;
  }

  table {
    display: table !important;
    width: 100% !important;
  }

  thead {
    display: table-header-group !important;
  }

  tr {
    display: table-row !important;
    background: transparent !important;
  }

  th,
  td {
    display: table-cell !important;
    padding: 6px 8px !important;
    border-bottom: 1px solid #ccc !important;
    color: #000 !important;
    text-align: left !important;
  }

  input,
  select {
    background: transparent !important;
    color: #000 !important;
    border: none !important;
    padding: 0 !important;
    appearance: none !important;
  }

  #categoryProgress > div {
    page-break-inside: avoid;
    margin: 6px 0;
  }
}
``