/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Inter — self-hosted (app/assets/fonts), one variable file covering every weight.
   The UI font everywhere; numbers use its tabular figures (below) so digits align. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/inter-variable-1f021a24.woff2") format("woff2");
}

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--font-sans);
}

/* Editor amounts and the running balance align too (tabular figures), matching the
   .numeric read-view columns. */
[data-amount-field-target="display"],
[data-journal-entry-form-target="balance"] {
  font-variant-numeric: tabular-nums;
}

/* Reusable upload drop zone (files/_upload_field). Minimal by design — the polished
   drop-zone treatment is a later slice. */
.upload {
  border: 2px dashed #c7c7c7;
  border-radius: 8px;
  padding: 1rem;
}

.upload--dragover {
  border-color: #4a90d9;
  background: #f0f6fc;
}

.upload__list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.upload__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Numbers read right-aligned, with tabular figures so digits line up by place value
   down a column (the accounting convention). Reusable across any table's amount cell. */
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Journal entries (Slice 26) — minimal cues; the polished treatment is a later
   design pass. */
.je-field--error {
  outline: 2px solid #c0392b;
  outline-offset: 1px;
}

.je-balance--ok  { color: #1e7e34; font-weight: 600; }
.je-balance--off { color: #c0392b; font-weight: 600; }

.je-flag {
  display: inline-block;
  padding: 0 0.4rem;
  border: 1px solid #b8860b;
  border-radius: 4px;
  font-size: 0.85em;
  color: #8a6d00;
}

.form-errors {
  border: 1px solid #c0392b;
  background: #fdecea;
  border-radius: 6px;
  padding: 0.5rem 1rem;
}

/* Momsangivelse (Slice 28) — the VAT return laid out as the authorities show it.
   Minimal cues; the polished treatment is a later design pass. */
.moms-table {
  width: 100%;
  max-width: 40rem;
  border-collapse: collapse;
}

.moms-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.moms-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.moms-total {
  font-weight: 600;
}

.moms-help {
  color: #555;
}

.moms-en {
  color: #888;
}

/* The two VAT-return tabs (Momsangivelse | Listeangivelse). */
.moms-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  border-bottom: 1px solid #ddd;
}

.moms-tabs a {
  padding: 0.4rem 0.9rem;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  text-decoration: none;
}

.moms-tab--active {
  font-weight: 600;
  background: #f0f6fc;
  border-color: #4a90d9 !important;
}

/* A listeangivelse row missing its contact / country / VAT number. */
.moms-flagged {
  background: #fffbe6;
}

.moms-filing {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.moms-filing--submitted {
  border-color: #1e7e34;
}

.moms-filing--needs_resubmission {
  border-color: #b8860b;
  background: #fffbe6;
}

.moms-badge {
  display: inline-block;
  padding: 0 0.4rem;
  border: 1px solid #c7c7c7;
  border-radius: 4px;
  font-size: 0.85em;
}

.moms-badge--submitted {
  border-color: #1e7e34;
  color: #1e7e34;
}

.moms-badge--needs_resubmission {
  border-color: #b8860b;
  color: #8a6d00;
}

/* Native <dialog> modal (shared/_modal). */
.modal {
  border: 1px solid #c7c7c7;
  border-radius: 8px;
  padding: 1.25rem;
  max-width: 28rem;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

/* Financial statements (Reports). Sum/result rows are emphasised as subtotals,
   lined above and below; border-collapse merges adjacent subtotal lines into one. */
.report-tabs strong,
.report-tabs a {
  margin-right: 0.75rem;
}

.report-table {
  border-collapse: collapse;
}

.report-row--sum td,
.report-row--result td {
  font-weight: bold;
  border-top: 1px solid #c7c7c7;
  border-bottom: 1px solid #c7c7c7;
}

/* Top-level statement headers read a touch larger than nested subsections. */
.report-row--header td {
  font-size: 1.15em;
  padding-top: 0.4rem;
}
