/* Personal Expenses (FIN_FOR_06) — only what styles.css doesn't already cover. */

.exp-add { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.exp-upload {
  flex: 1 1 240px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  font-size: 16px; font-weight: 700;
  padding: 16px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.exp-upload svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.exp-upload:active { transform: scale(.98); }
/* visually hidden but still reachable by its label (and focusable for keyboard users) */
.exp-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.exp-upload:has(+ .exp-file:focus-visible), .exp-attach:has(.exp-file:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }

.exp-empty { font-size: 14px; color: var(--grey); text-align: center; padding: 12px 0; }

.exp-line { padding-top: 12px; }
.exp-line .field { min-width: 0; }
.exp-line input[type=date] { min-width: 0; -webkit-appearance: none; appearance: none; min-height: 44px; }
.exp-line-head { display: flex; align-items: center; gap: 12px; margin: 0 70px 12px 0; min-height: 40px; }
.exp-line-title { color: var(--blue-dark); }
.exp-status { font-size: 12px; color: var(--grey); line-height: 1.4; }
.exp-line.is-reading .exp-status { color: var(--teal-dark); }
.exp-line.is-reading .exp-status::before {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid var(--teal); border-right-color: transparent; border-radius: 50%;
  animation: exp-spin .8s linear infinite;
}
@keyframes exp-spin { to { transform: rotate(360deg); } }
.exp-line.is-error { border-color: #E0A800; }
.exp-line.is-error .exp-status { color: #6b5500; font-weight: 600; }

.exp-thumb {
  flex: none; width: 56px; height: 56px; padding: 0;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--white); cursor: zoom-in;
  font-family: inherit; font-weight: 700; font-size: 12px; color: var(--blue-dark);
}
.exp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* fields the receipt reader wasn't sure about */
.field.exp-check input, .field.exp-check select { border-color: #E0A800; background: #FFF8E6; }
.field.exp-check label::after { content: ' — please check'; font-weight: 400; font-size: 12px; color: #6b5500; }
/* fields that failed validation */
.field.exp-bad input, .field.exp-bad select { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192, 57, 43, .12); }
.field.exp-bad canvas { border-color: var(--red); }

.exp-line-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.exp-line-foot .btn-add { font-size: 13px; padding: 7px 12px; margin: 0; position: relative; }
.exp-line-foot [hidden] { display: none; }

.exp-sum { width: 100%; border-collapse: collapse; font-size: 14px; }
.exp-sum th, .exp-sum td { padding: 8px 4px; border-bottom: 1px solid var(--border); text-align: left; font-weight: 400; }
.exp-sum td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.exp-sum tfoot th, .exp-sum tfoot td { font-weight: 700; color: var(--blue-dark); border-bottom: none; font-size: 15px; }

#expErrors ul { margin: 6px 0 0 18px; }
#expSubmit[disabled] { opacity: .7; cursor: progress; transform: none; }
.exp-discard {
  margin-top: 14px; background: none; border: none; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--red); cursor: pointer; padding: 6px 8px;
}
.exp-discard:hover { text-decoration: underline; }

.exp-viewer { border: none; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; margin: auto; }
.exp-viewer::backdrop { background: rgba(26, 31, 46, .82); }
.exp-viewer img { display: block; max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 8px; }
.exp-viewer-close {
  position: fixed; top: 12px; right: 12px; width: 44px; height: 44px;
  border: none; border-radius: 50%; background: var(--white); color: var(--text);
  font-size: 26px; line-height: 1; cursor: pointer; box-shadow: var(--shadow-lg);
}

@media (max-width: 640px) {
  .form-wrap { padding-left: 14px; padding-right: 14px; }
  #expSubmit { width: 100%; padding-left: 20px; padding-right: 20px; }
}
