:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: #f7f8fb;
  color: #1f2937;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #dbe2ea;
  background: #ffffff;
}

header a {
  color: inherit;
  text-decoration: none;
  margin-left: 0.8rem;
}

main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.flash {
  background: #e6f4ea;
  color: #14532d;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 0.7rem;
  margin-bottom: 1rem;
}

.warning {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 0.7rem;
  margin-bottom: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.month-filter {
  display: flex;
  gap: 0.5rem;
}

.money {
  font-size: 1.8rem;
  font-weight: 700;
}

.bars {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bars li {
  display: grid;
  grid-template-columns: 130px 1fr 120px;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
}

.bar-track {
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
}

.bar-fill {
  background: #4338ca;
  height: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 0.5rem;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.8rem;
  text-transform: capitalize;
}

.status-confirmed {
  background: #dcfce7;
  color: #166534;
}

.status-review {
  background: #fef9c3;
  color: #854d0e;
}

.button-link,
button {
  display: inline-block;
  border: 1px solid #4338ca;
  color: #fff;
  background: #4338ca;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

input,
select {
  width: 100%;
  padding: 0.45rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.upload-form {
  display: grid;
  gap: 0.8rem;
}

.dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
  background: #f8fafc;
}

.dropzone input {
  margin-top: 0.7rem;
}



/* ============================================================
   Extraction progress indicator (htmx) — append to style.css
   ============================================================ */

/* Disabled state while htmx is in flight (hx-disabled-elt) */
.upload-form button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Permanent hint under the button */
.upload-hint {
  font-size: 0.85rem;
  opacity: 0.65;
  margin: 10px 0 0;
}

/* Progress panel: hidden until htmx adds .htmx-request to it */
.extract-status {
  display: none;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #4f46e5;
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.12);
}
.extract-status.htmx-request {
  display: flex;
}
.extract-status p {
  margin: 0;
  line-height: 1.45;
}
.extract-status span {
  opacity: 0.7;
  font-size: 0.85rem;
}

/* Simple CSS-only spinner */
.spinner {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #8b7ff0;
  border-radius: 50%;
  animation: kkb-spin 0.9s linear infinite;
}
@keyframes kkb-spin {
  to {
    transform: rotate(360deg);
  }
}