/* WBC Fakturaer – My Account
 * Matcher Danfoods-temaet: mørk teal/grøn, orange accent, lyse grå kort.
 * Alt er scoped under .wbc-invoices så det ikke påvirker resten af temaet. */

.wbc-invoices {
    --wbc-ink: #1f2320;
    --wbc-muted: #6b726d;
    --wbc-green: #2c4a45;
    --wbc-green-dark: #213834;
    --wbc-orange: #e69b4d;
    --wbc-orange-dark: #d4863a;
    --wbc-bg: #f5f5f3;
    --wbc-line: #e6e6e2;
    --wbc-paid-bg: #e4f0e8;
    --wbc-paid-ink: #2f6b46;
    --wbc-due-bg: #fbeede;
    --wbc-due-ink: #b5601a;
    color: var(--wbc-ink);
}

.wbc-invoices * {
    box-sizing: border-box;
}

/* ---- Headings ---- */
.wbc-invoices__title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    color: var(--wbc-ink);
}

.wbc-invoices__back {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    font-weight: 600;
    text-decoration: none;
    color: var(--wbc-green);
    margin-bottom: 1.1rem;
}

.wbc-invoices__back:hover {
    color: var(--wbc-orange-dark);
}

/* ---- Empty state ---- */
.wbc-invoices__empty {
    background: var(--wbc-bg);
    border: 1px solid var(--wbc-line);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    color: var(--wbc-muted);
    margin: 0;
}

/* ---- List table ---- */
.wbc-invoices__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--wbc-line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.wbc-invoices__table thead th {
    background: var(--wbc-green);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    text-align: left;
    /* !important: temaets "table thead:first-child tr:first-child th { padding:10px 0 }"
     * (specificitet 0,2,4) overtrumfer ellers vores padding og klistrer kolonnerne sammen. */
    padding: .85rem 1rem !important;
}

.wbc-invoices__table tbody td {
    padding: .9rem 1rem;
    border-top: 1px solid var(--wbc-line);
    vertical-align: middle;
    font-size: .95rem;
}

.wbc-invoices__table tbody tr:first-child td {
    border-top: none;
}

.wbc-invoices__table tbody tr:hover td {
    background: var(--wbc-bg);
}

.wbc-invoices__num {
    font-weight: 700;
    color: var(--wbc-ink);
}

.wbc-invoices__amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wbc-invoices__actions {
    text-align: right;
    white-space: nowrap;
}

/* ---- Status badge ---- */
.wbc-badge {
    display: inline-block;
    padding: .25em .7em;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.4;
}

.wbc-badge--paid {
    background: var(--wbc-paid-bg);
    color: var(--wbc-paid-ink);
}

.wbc-badge--due {
    background: var(--wbc-due-bg);
    color: var(--wbc-due-ink);
}

/* ---- Buttons ---- */
.wbc-btn {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    padding: .5rem .9rem;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.wbc-btn + .wbc-btn {
    margin-left: .4rem;
}

.wbc-btn--ghost {
    background: #fff;
    border-color: var(--wbc-line);
    color: var(--wbc-green);
}

.wbc-btn--ghost:hover {
    border-color: var(--wbc-green);
    background: var(--wbc-bg);
}

.wbc-btn--primary {
    background: var(--wbc-orange);
    color: #fff;
}

.wbc-btn--primary:hover {
    background: var(--wbc-orange-dark);
    color: #fff;
}

.wbc-btn.is-disabled {
    opacity: .45;
    cursor: default;
    pointer-events: none;
}

/* ---- Pagination ---- */
.wbc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
}

.wbc-pagination__info {
    color: var(--wbc-muted);
    font-size: .9rem;
    font-weight: 600;
}

/* ---- Detail: header card ---- */
.wbc-detail__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: var(--wbc-bg);
    border: 1px solid var(--wbc-line);
    border-radius: 12px;
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.5rem;
}

.wbc-detail__header h2 {
    margin: 0 0 .3rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.wbc-detail__header-meta {
    margin: .35rem 0 0;
    color: var(--wbc-muted);
    font-size: .9rem;
}

.wbc-detail__header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* ---- Detail: sections ---- */
.wbc-section {
    margin-bottom: 1.75rem;
}

.wbc-section__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 .75rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--wbc-line);
}

/* ---- Address / meta cards ---- */
.wbc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.wbc-card {
    background: #fff;
    border: 1px solid var(--wbc-line);
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
}

.wbc-card h4 {
    margin: 0 0 .6rem;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--wbc-green);
}

.wbc-card address {
    font-style: normal;
    line-height: 1.55;
    font-size: .95rem;
}

/* ---- Definition grid (meta) ---- */
.wbc-dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .9rem 1.5rem;
    margin: 0;
}

.wbc-dl > div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.wbc-dl dt {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--wbc-muted);
    font-weight: 600;
}

.wbc-dl dd {
    margin: 0;
    font-size: .95rem;
    font-weight: 500;
}

/* ---- Lines table ---- */
.wbc-invoices .wbc-lines {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--wbc-line);
    border-radius: 10px;
    overflow: hidden;
}

/* Højere specificitet (.wbc-invoices foran) så temaets globale tabel-padding
 * ikke vinder og kolonner som ANTAL/ENHED flyder sammen. */
.wbc-invoices .wbc-lines thead th,
.wbc-invoices .wbc-lines tbody td {
    /* !important: se note ovenfor – temaets th-reset har specificitet 0,2,4. */
    padding: .75rem 1.1rem !important;
    border: none;
}

.wbc-invoices .wbc-lines thead th {
    background: var(--wbc-bg);
    color: var(--wbc-ink);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--wbc-line);
}

.wbc-invoices .wbc-lines tbody td {
    border-top: 1px solid var(--wbc-line);
    font-size: .92rem;
    vertical-align: top;
}

.wbc-invoices .wbc-lines tbody tr:first-child td {
    border-top: none;
}

.wbc-invoices .wbc-lines .wbc-num,
.wbc-invoices .wbc-lines .wbc-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Lidt ekstra luft mellem en venstrestillet og en højrestillet nabokolonne. */
.wbc-invoices .wbc-lines th.wbc-num,
.wbc-invoices .wbc-lines td.wbc-num,
.wbc-invoices .wbc-lines th.wbc-right,
.wbc-invoices .wbc-lines td.wbc-right {
    padding-left: 1.6rem !important;
}

/* ---- Totals ---- */
.wbc-totals {
    margin-top: 1.25rem;
    display: flex;
    justify-content: flex-end;
}

.wbc-totals__box {
    width: 100%;
    max-width: 340px;
    background: var(--wbc-bg);
    border: 1px solid var(--wbc-line);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
}

.wbc-totals__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
    font-size: .95rem;
}

.wbc-totals__row span:last-child {
    font-variant-numeric: tabular-nums;
}

.wbc-totals__row--grand {
    margin-top: .4rem;
    padding-top: .7rem;
    border-top: 2px solid var(--wbc-line);
    font-size: 1.1rem;
    font-weight: 700;
}

.wbc-totals__row--due {
    color: var(--wbc-due-ink);
    font-weight: 700;
}

/* ---- Responsive: stack the list table on small screens ---- */
@media (max-width: 600px) {
    .wbc-invoices__table thead {
        display: none;
    }

    .wbc-invoices__table,
    .wbc-invoices__table tbody,
    .wbc-invoices__table tr,
    .wbc-invoices__table td {
        display: block;
        width: 100%;
    }

    .wbc-invoices__table tr {
        border-top: 1px solid var(--wbc-line);
        padding: .5rem 0;
    }

    .wbc-invoices__table tbody tr:first-child {
        border-top: none;
    }

    .wbc-invoices__table tbody td {
        border: none;
        padding: .35rem 1rem;
        display: flex;
        justify-content: space-between;
        gap: 1rem;
    }

    .wbc-invoices__table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--wbc-muted);
    }

    .wbc-invoices__actions {
        text-align: left;
        justify-content: flex-start !important;
    }
}
