/* ==== Seite: invoice-generator ==== */

body.page-invoice-generator .seo-section h3 {
    margin-top: 0;
}

body.page-invoice-generator .seo-section p {
    margin-bottom: 30px;
}

body.page-invoice-generator .info-icon {
    font-size: 24px;
}

body.page-invoice-generator .info-text {
    flex: 1;
    font-size: 14px;
    color: var(--c-accent);
    font-weight: 600;
}


body.page-invoice-generator .card-header {
    text-align: center;
    margin-bottom: 20px;
}

body.page-invoice-generator .card-header h1 {
    font-size: 2.2em;
    margin-bottom: 30px;
}

body.page-invoice-generator .card-header p {
    color: var(--c-muted);
    font-size: 1.05em;
    margin-bottom: 30px;
}

/* Hinweis-Banner */
body.page-invoice-generator .ig-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.08);
    color: var(--c-text);
    font-size: 0.9em;
}

body.page-invoice-generator .ig-notice i {
    color: #f59e0b;
}

body.page-invoice-generator .ig-notice-close {
    margin-left: auto;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

body.page-invoice-generator .ig-notice-close:hover {
    background: rgba(245, 158, 11, 0.3);
}

/* ==== Generator-Layout: Formular links, Vorschau rechts ==== */
body.page-invoice-generator .generator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 30px;
    align-items: start;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    body.page-invoice-generator .generator-layout {
        grid-template-columns: 1fr;
    }
}

body.page-invoice-generator .generator-layout > * {
    min-width: 0;
}

/* ==== Formular-Panel ==== */
body.page-invoice-generator .settings-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.page-invoice-generator .setting-item {
    border: 1px solid rgba(102, 126, 234, 0.18);
    border-radius: 12px;
    background: var(--c-surface);
}

body.page-invoice-generator .setting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--c-text);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

body.page-invoice-generator .setting-header-title i {
    color: var(--c-accent);
    margin-right: 8px;
    width: 18px;
}

body.page-invoice-generator .setting-chevron {
    transition: transform 0.2s;
    color: var(--c-muted);
}

body.page-invoice-generator .setting-header[aria-expanded="true"] .setting-chevron {
    transform: rotate(180deg);
}

body.page-invoice-generator .setting-body {
    display: none;
    padding: 12px 16px;
    flex-direction: column;
    gap: 10px;
}

body.page-invoice-generator .setting-header[aria-expanded="true"] + .setting-body {
    display: flex;
}

body.page-invoice-generator .input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.page-invoice-generator .mini-label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--c-muted);
}

body.page-invoice-generator .text-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    background-color: var(--c-surface);
    color: var(--c-text);
    font-size: 0.95em;
    font-family: inherit;
    box-sizing: border-box;
}

body.page-invoice-generator .text-input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Native Selects werden durch Custom-Dropdowns ersetzt (visuell versteckt,
   bleiben aber im DOM fuer Wert/Events/i18n erhalten). */
body.page-invoice-generator select.text-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 1px;
    width: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

body.page-invoice-generator select.text-input:focus + .ig-custom-select {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* ===== Custom-Dropdown ===== */
body.page-invoice-generator .ig-custom-select {
    position: relative;
    width: 100%;
}

body.page-invoice-generator .ig-custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(102, 126, 234, 0.35);
    background-color: var(--c-surface);
    color: var(--c-text);
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

body.page-invoice-generator .ig-custom-select-trigger:hover {
    border-color: #667eea;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.18);
}

body.page-invoice-generator .ig-custom-select-trigger .ig-custom-select-caret {
    color: #667eea;
    font-size: 0.8em;
    transition: transform 0.2s;
    flex-shrink: 0;
}

body.page-invoice-generator .ig-custom-select.open .ig-custom-select-trigger .ig-custom-select-caret {
    transform: rotate(180deg);
}

body.page-invoice-generator .ig-custom-select-trigger .ig-custom-select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.page-invoice-generator .ig-custom-select-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: 260px;
    overflow-y: auto;
    background: var(--c-surface);
    border: 1px solid rgba(102, 126, 234, 0.35);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 20, 50, 0.18);
    padding: 6px;
    display: none;
}

body.page-invoice-generator .ig-custom-select.open .ig-custom-select-list {
    display: block;
    animation: igDropdownIn 0.16s ease-out;
}

@keyframes igDropdownIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

body.page-invoice-generator .ig-custom-select-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    color: var(--c-text);
    font-size: 0.9em;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

body.page-invoice-generator .ig-custom-select-option:hover {
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
}

body.page-invoice-generator .ig-custom-select-option.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
}

body.page-invoice-generator .ig-custom-select-list::-webkit-scrollbar {
    width: 8px;
}

body.page-invoice-generator .ig-custom-select-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.35);
    border-radius: 8px;
}

body.dark-theme.page-invoice-generator .ig-custom-select-list {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.dark-theme.page-invoice-generator .ig-custom-select-option.selected {
    color: #fff;
}

body.page-invoice-generator .ig-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

body.page-invoice-generator .ig-taxinfo {
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.08);
    color: var(--c-text);
    font-size: 0.85em;
    line-height: 1.5;
}

/* Logo */
body.page-invoice-generator .ig-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.page-invoice-generator .ig-logo-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px dashed rgba(102, 126, 234, 0.5);
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.06);
    color: var(--c-accent);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

body.page-invoice-generator .ig-logo-upload:hover {
    background: rgba(102, 126, 234, 0.12);
}

body.page-invoice-generator .ig-logo-preview {
    position: relative;
    display: inline-block;
}

body.page-invoice-generator .ig-logo-preview img {
    max-height: 60px;
    max-width: 160px;
    border-radius: 6px;
    border: 1px solid var(--c-border);
    padding: 4px;
}

body.page-invoice-generator .ig-logo-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--c-danger);
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Positionen */
body.page-invoice-generator .ig-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.page-invoice-generator .ig-item-row {
    display: grid;
    grid-template-columns: 1fr 1fr 90px 30px;
    gap: 6px;
    align-items: center;
}

body.page-invoice-generator .ig-item-row .ig-item-desc {
    grid-column: 1 / -1;
}

body.page-invoice-generator .ig-item-row input {
    padding: 7px 8px;
}

body.page-invoice-generator .ig-item-remove {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--c-danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.page-invoice-generator .ig-item-remove i {
    line-height: 1;
    font-size: 14px;
}

body.page-invoice-generator .ig-add-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px dashed rgba(102, 126, 234, 0.5);
    border-radius: 10px;
    background: none;
    color: var(--c-accent);
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}

/* ==== Vorschau-Panel ==== */
body.page-invoice-generator .preview-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.page-invoice-generator .preview-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

body.page-invoice-generator .ig-tpl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 10px;
    background: var(--c-surface);
    color: var(--c-accent);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
}

body.page-invoice-generator .ig-tpl-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.2);
}

body.page-invoice-generator .ig-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

body.page-invoice-generator .ig-print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

/* ==== Rechnung (Vorschau + Druck) ==== */
body.page-invoice-generator .preview-panel {
    container-type: inline-size;
}

body.page-invoice-generator .ig-invoice {
    background: #fff;
    color: #1a1a2e;
    border-radius: 12px;
    padding: 36px 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

@container (max-width: 760px) {
    body.page-invoice-generator .ig-invoice {
        width: 760px;
        zoom: calc(100cqw / 760px);
    }
}

body.dark-theme.page-invoice-generator .ig-invoice {
    background: #fff;
    color: #1a1a2e;
}

body.page-invoice-generator .ig-inv-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}

body.page-invoice-generator .ig-inv-logo img {
    max-height: 70px;
    max-width: 200px;
}

body.page-invoice-generator .ig-inv-title-row {
    text-align: right;
}

body.page-invoice-generator .ig-inv-title-row h2 {
    font-size: 28px;
    letter-spacing: 1px;
    margin: 0 0 8px 0;
    color: #1a1a2e;
}

body.page-invoice-generator .ig-inv-meta {
    font-size: 13px;
    color: #555;
}

body.page-invoice-generator .ig-inv-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

body.page-invoice-generator .ig-inv-blocklabel {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #999;
    margin-bottom: 6px;
}

body.page-invoice-generator .ig-inv-block {
    font-size: 13px;
    white-space: pre-line;
}

body.page-invoice-generator .ig-inv-table-wrap {
    margin-bottom: 20px;
    overflow-x: auto;
}

body.page-invoice-generator .ig-inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

body.page-invoice-generator .ig-inv-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid #ccc;
    color: #444;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

body.page-invoice-generator .ig-inv-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

body.page-invoice-generator .ig-inv-table th.num,
body.page-invoice-generator .ig-inv-table td.num {
    text-align: right;
    white-space: nowrap;
}

body.page-invoice-generator .ig-inv-summary {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

body.page-invoice-generator .ig-inv-summary-inner {
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

body.page-invoice-generator .ig-sum-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

body.page-invoice-generator .ig-sum-row.grand {
    font-size: 16px;
    font-weight: 700;
    border-top: 2px solid #ccc;
    padding-top: 8px;
    margin-top: 4px;
}

body.page-invoice-generator .ig-inv-payment {
    margin-bottom: 12px;
}

body.page-invoice-generator .ig-inv-pay-block {
    font-size: 12px;
    color: #444;
    line-height: 1.6;
}

body.page-invoice-generator .ig-inv-notes {
    font-size: 12px;
    color: #666;
    white-space: pre-line;
}

body.page-invoice-generator .ig-inv-taxnote {
    margin-top: 16px;
    font-size: 11px;
    color: #888;
    white-space: pre-line;
}

/* ==== Print-Layout (A4) ==== */
@media print {
    body.page-invoice-generator {
        background: #fff;
    }
    body.page-invoice-generator header,
    body.page-invoice-generator footer,
    body.page-invoice-generator .ig-notice,
    body.page-invoice-generator .settings-panel,
    body.page-invoice-generator .preview-toolbar,
    body.page-invoice-generator .info-section,
    body.page-invoice-generator .seo-section,
    body.page-invoice-generator .back-to-top,
    body.page-invoice-generator .card-header,
    body.page-invoice-generator #related-container,
    body.page-invoice-generator .related-tools {
        display: none !important;
    }
    body.page-invoice-generator .container {
        max-width: 100%;
        padding: 0;
    }
    body.page-invoice-generator .main-card {
        padding: 0;
        margin: 0;
        box-shadow: none;
        background: #fff;
    }
    body.page-invoice-generator .generator-layout {
        display: block;
    }
    body.page-invoice-generator .preview-panel {
        display: block;
    }
    body.page-invoice-generator .ig-invoice {
        box-shadow: none;
        border-radius: 0;
        padding: 20px;
        width: 100%;
        zoom: 1;
    }
    @page {
        size: A4;
        margin: 15mm;
    }
}

/* ==== Responsive ==== */
@media (max-width: 600px) {
    body.page-invoice-generator .ig-grid-2 {
        grid-template-columns: 1fr;
    }
    body.page-invoice-generator .ig-inv-parties {
        grid-template-columns: 1fr;
    }
    body.page-invoice-generator .ig-item-row {
        grid-template-columns: 1fr 1fr 80px 30px;
    }
    body.page-invoice-generator .ig-invoice {
        padding: 20px 16px;
    }
}

@media (max-width: 340px) {
    body.page-invoice-generator .ig-item-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    body.page-invoice-generator .ig-item-row input {
        grid-column: auto;
    }
    body.page-invoice-generator .ig-item-row .ig-item-remove {
        grid-column: 1 / -1;
        width: 100%;
    }
    body.page-invoice-generator .ig-inv-table {
        font-size: 11px;
    }
}
