/* Invoice template styles - matches factura-ejemplo.pdf */
.invoice-doc {
    width: 794px;
    min-height: 1123px;
    background: #ffffff;
    color: #1a1a2e;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 11px;
    line-height: 1.4;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.invoice-doc * { box-sizing: border-box; }

/* Header band */
.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 30px 40px 20px;
    position: relative;
}

.inv-header-left {
    flex: 1;
}

.inv-thank-you {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.35em;
    color: var(--inv-primary, #5b9bd5);
    line-height: 1.3;
    text-transform: uppercase;
}

.inv-thank-you-sub {
    font-size: 10px;
    letter-spacing: 0.25em;
    color: #888;
    margin-top: 4px;
}

.inv-header-right {
    text-align: right;
}

.inv-logo {
    max-width: 140px;
    max-height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
}

.inv-company-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--inv-primary, #5b9bd5);
    text-transform: uppercase;
}

.inv-company-contact {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    line-height: 1.6;
}

/* Title bar */
.inv-title-bar {
    background: var(--inv-primary, #5b9bd5);
    color: #fff;
    text-align: center;
    padding: 8px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* Client & meta row */
.inv-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    border-bottom: 2px solid var(--inv-primary, #5b9bd5);
}

.inv-client-block h4 {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.inv-client-block .client-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--inv-primary, #5b9bd5);
}

.inv-client-block .client-detail {
    font-size: 10px;
    color: #555;
    margin-top: 2px;
}

.inv-meta-block {
    text-align: right;
    font-size: 10px;
}

.inv-meta-block .meta-row {
    margin-bottom: 4px;
}

.inv-meta-block .meta-label {
    color: #888;
    display: inline-block;
    min-width: 80px;
}

.inv-meta-block .meta-value {
    font-weight: 700;
    color: var(--inv-primary, #5b9bd5);
}

/* Items table */
.inv-table-wrap { padding: 0 40px; }

.inv-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.inv-table thead th {
    background: var(--inv-primary, #5b9bd5);
    color: #fff;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
}

.inv-table thead th:nth-child(2),
.inv-table thead th:nth-child(3),
.inv-table thead th:nth-child(4) { text-align: center; }

.inv-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 10px;
    color: #333;
}

.inv-table tbody td:nth-child(2),
.inv-table tbody td:nth-child(3),
.inv-table tbody td:nth-child(4) { text-align: center; }

.inv-table tbody tr:nth-child(even) { background: #f8f9fb; }

/* Totals */
.inv-totals {
    display: flex;
    justify-content: flex-end;
    padding: 10px 40px 20px;
}

.inv-totals-table {
    width: 280px;
    border-collapse: collapse;
}

.inv-totals-table td {
    padding: 6px 12px;
    font-size: 11px;
}

.inv-totals-table .label {
    text-align: right;
    color: #666;
    font-weight: 600;
}

.inv-totals-table .value {
    text-align: right;
    font-weight: 700;
    color: #333;
    width: 100px;
}

.inv-totals-table .total-row td {
    background: var(--inv-primary, #5b9bd5);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 12px;
}

/* Footer section */
.inv-footer {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    border-top: 2px solid var(--inv-primary, #5b9bd5);
    margin-top: 10px;
}

.inv-signature-block {
    flex: 1;
}

.inv-signature-img {
    max-height: 50px;
    max-width: 150px;
    object-fit: contain;
    margin-bottom: 4px;
}

.inv-signature-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--inv-primary, #5b9bd5);
}

.inv-signature-title {
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.inv-terms-block {
    flex: 1.2;
    padding-left: 30px;
}

.inv-terms-block h4 {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--inv-primary, #5b9bd5);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.inv-terms-block p {
    font-size: 8.5px;
    color: #666;
    line-height: 1.5;
    white-space: pre-line;
}

.inv-bank-block {
    flex: 1;
    padding-left: 20px;
    border-left: 1px solid #e0e0e0;
}

.inv-bank-block h4 {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--inv-primary, #5b9bd5);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.inv-bank-block p {
    font-size: 9px;
    color: #555;
    margin-bottom: 3px;
}

.inv-bank-block .bank-label {
    color: #888;
    display: inline-block;
    min-width: 55px;
}

/* Decorative accent */
.inv-accent-bar {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    background: var(--inv-accent, #a78bfa);
}

.inv-print {
    position: absolute;
    left: -9999px;
    top: 0;
}

@media print {
    .invoice-doc {
        width: 100%;
        min-height: auto;
    }
}
