.inv-create-form,
.inv-field {
    display: grid;
    gap: 0.5rem;
}

.inv-field span {
    font-weight: 600;
    font-size: 0.92rem;
}

.inv-field input,
.inv-field textarea,
.inv-field select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.86);
    color: inherit;
    font: inherit;
    padding: 0.75rem 0.9rem;
}

.admin-invoices-page.dark-mode .inv-field input,
.admin-invoices-page.dark-mode .inv-field textarea,
.admin-invoices-page.dark-mode .inv-field select {
    background: rgba(15, 23, 42, 0.84);
    border-color: rgba(148, 163, 184, 0.18);
}

.inv-lookup-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.inv-lookup-wrap input {
    flex: 1;
    min-width: 0;
}

.brreg-btn-compat {
    flex-shrink: 0;
    width: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.06);
    color: #1d4ed8;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.14s ease;
}

.brreg-btn-compat:hover {
    background: rgba(37, 99, 235, 0.12);
}

.admin-invoices-page.dark-mode .brreg-btn-compat {
    background: rgba(30, 64, 175, 0.14);
    border-color: rgba(96, 165, 250, 0.22);
    color: #93c5fd;
}

.inv-customer-info {
    font-size: 0.9rem;
    color: var(--muted-text, #475569);
    min-height: 1.2em;
}

.inv-customer-info.is-found {
    color: #166534;
}

.admin-invoices-page.dark-mode .inv-customer-info.is-found {
    color: #86efac;
}

.inv-lines {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.inv-line-row {
    display: grid;
    grid-template-columns: 1fr 64px 58px 106px 64px 60px 36px;
    gap: 0.4rem;
    align-items: center;
}

.inv-line-unit {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.86);
    color: inherit;
    font: inherit;
    font-size: 0.88rem;
    padding: 0.55rem 0.4rem;
    width: 100%;
}

.admin-invoices-page.dark-mode .inv-line-unit {
    background: rgba(15, 23, 42, 0.84);
    border-color: rgba(148, 163, 184, 0.18);
}

.inv-product-picker {
    margin-top: 0.5rem;
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 14px;
    background: rgba(255,255,255,0.96);
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-invoices-page.dark-mode .inv-product-picker {
    background: rgba(15,23,42,0.95);
    border-color: rgba(148,163,184,0.16);
}

.inv-product-pick-btn {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid rgba(148,163,184,0.1);
    transition: background 0.12s;
}

.inv-product-pick-btn:last-child { border-bottom: none; }
.inv-product-pick-btn:hover { background: rgba(37,99,235,0.06); }

.inv-pick-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
}

.inv-pick-meta {
    font-size: 0.78rem;
    color: var(--muted-text, #64748b);
}

.inv-line-row input {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.86);
    color: inherit;
    font: inherit;
    font-size: 0.88rem;
    padding: 0.55rem 0.7rem;
}

.admin-invoices-page.dark-mode .inv-line-row input {
    background: rgba(15, 23, 42, 0.84);
    border-color: rgba(148, 163, 184, 0.18);
}

.inv-line-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.14s;
}

.inv-line-remove:hover {
    background: rgba(185, 28, 28, 0.08);
    color: #b91c1c;
}

.inv-add-line-btn {
    font-size: 0.85rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
}

.inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.inv-table th,
.inv-table td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.inv-table th {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-text, #475569);
}

.inv-td-num {
    text-align: right;
}

.inv-td-label {
    text-align: right;
    color: var(--muted-text, #475569);
    font-size: 0.88rem;
}

.inv-tfoot-total td {
    font-weight: 700;
    border-top: 2px solid rgba(37, 99, 235, 0.2);
    padding-top: 0.75rem;
}

.inv-order-link {
    margin-top: 0.5rem;
    font-size: 0.88rem;
    color: var(--muted-text, #475569);
}

.inv-order-link a {
    color: #1d4ed8;
    text-decoration: underline;
}

.admin-invoices-page.dark-mode .inv-order-link a {
    color: #93c5fd;
}

/* Detail badge for company tag in orders */
.detail-badge-company {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.admin-orders-page.dark-mode .detail-badge-company {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.detail-invoice-btn {
    font-size: 0.88rem;
}
