/* ═══ TOASTS ═══════════════════════════════════════════════ */
.toast-stack {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.toast-item {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: .85rem 2.5rem .85rem 1rem;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.08);
    font-size: .9rem;
    position: relative;
    border-left: 4px solid #3b82f6;
    animation: toast-in .3s cubic-bezier(.4,0,.2,1);
}
.toast-item.toast-success { border-left-color: #10b981; }
.toast-item.toast-danger  { border-left-color: #ef4444; }
.toast-item.toast-warning { border-left-color: #f59e0b; }
.toast-item.fade-out { animation: toast-out .3s cubic-bezier(.4,0,.2,1) forwards; }
.toast-close {
    position: absolute;
    top: .5rem; right: .5rem;
    background: none; border: 0;
    color: #9ca3af; cursor: pointer;
    font-size: 1.1rem; line-height: 1;
    padding: .25rem .5rem;
}
.toast-close:hover { color: #374151; }

@keyframes toast-in  { from { opacity:0; transform: translateX(100%); } to { opacity:1; transform:none; } }
@keyframes toast-out { from { opacity:1; transform:none; } to { opacity:0; transform: translateX(100%); } }

[data-theme="dark"] .toast-item {
    background: #22252b;
    color: #e0e0e0;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
[data-theme="dark"] .toast-close { color: #6b7280; }
[data-theme="dark"] .toast-close:hover { color: #e0e0e0; }

/* ═══ LOADING SPINNER ═══════════════════════════════════════ */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: #fff;
    animation: spin .6s linear infinite;
}
.btn-outline-primary.btn-loading::after,
.btn-outline-secondary.btn-loading::after,
.btn-outline-success.btn-loading::after,
.btn-outline-danger.btn-loading::after,
.btn-outline-warning.btn-loading::after,
.btn-outline-info.btn-loading::after {
    color: #3b82f6;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ KOMPAKTMODUS ══════════════════════════════════════════ */
body.compact .table tbody td,
body.compact .table thead th {
    padding: .4rem .6rem !important;
    font-size: .85rem;
}
body.compact .card-body   { padding: .85rem; }
body.compact .card-header { padding: .6rem 1rem; font-size: .9rem; }
body.compact h2 { font-size: 1.4rem; margin-bottom: .75rem; }
body.compact .mb-3 { margin-bottom: .75rem !important; }
body.compact .btn-sm { padding: .2rem .5rem; font-size: .75rem; }

.compact-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all .2s ease;
    padding: 0;
    margin-left: .5rem;
    color: rgba(255,255,255,.9);
}
.compact-toggle:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Auf hellen Navbars (warning/info) dunkle Icons */
.navbar-light .compact-toggle,
.navbar-light .dark-mode-toggle,
.navbar.bg-warning .compact-toggle,
.navbar.bg-warning .dark-mode-toggle,
.navbar.bg-info .compact-toggle,
.navbar.bg-info .dark-mode-toggle {
    color: rgba(0,0,0,.75);
    border-color: rgba(0,0,0,.3);
}
.navbar-light .compact-toggle:hover,
.navbar-light .dark-mode-toggle:hover,
.navbar.bg-warning .compact-toggle:hover,
.navbar.bg-warning .dark-mode-toggle:hover,
.navbar.bg-info .compact-toggle:hover,
.navbar.bg-info .dark-mode-toggle:hover {
    background: rgba(0,0,0,.08);
    color: #000;
}

/* ═══ EMPTY STATE ══════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}
.empty-state .empty-icon {
    font-size: 3.5rem;
    color: #d1d5db;
    margin-bottom: .5rem;
    display: block;
    line-height: 1;
}
.empty-state .empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: .5rem 0;
}
.empty-state .empty-text {
    font-size: .9rem;
    margin-bottom: 1.25rem;
    color: #6b7280;
}
[data-theme="dark"] .empty-state .empty-title { color: #e5e7eb; }
[data-theme="dark"] .empty-state .empty-icon  { color: #4b5563; }

/* ═══ STATUS-BADGES ════════════════════════════════════════ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
}
.status-open     { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.status-paid     { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.status-overdue  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.status-pending  { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.status-draft    { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }
.status-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

[data-theme="dark"] .status-open    { background: #3a2f0a; color: #fcd34d; border-color: #78510a; }
[data-theme="dark"] .status-paid    { background: #0c2a1f; color: #6ee7b7; border-color: #107149; }
[data-theme="dark"] .status-overdue { background: #2d1212; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .status-pending { background: #0c1e3a; color: #93c5fd; border-color: #1e3a8a; }
[data-theme="dark"] .status-draft   { background: #2a2d35; color: #9ca3af; border-color: #4b5563; }

/* ═══ GLOBAL SEARCH MODAL ══════════════════════════════════ */
.search-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1900;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8vh;
    animation: fade-in .15s ease;
}
.search-modal-backdrop.show { display: flex; }
.search-modal {
    width: 100%;
    max-width: 640px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    overflow: hidden;
}
.search-modal-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1.05rem;
    outline: none;
}
.search-modal-results {
    max-height: 420px;
    overflow-y: auto;
    padding: .5rem 0;
}
.search-result-group {
    font-size: .7rem;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    letter-spacing: .05em;
    padding: .5rem 1rem .25rem;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 1rem;
    color: #111827;
    text-decoration: none;
    cursor: pointer;
    transition: background .1s ease;
}
.search-result-item:hover,
.search-result-item.active {
    background: #eff6ff;
    color: #1e40af;
}
.search-result-item i { font-size: 1rem; color: #6b7280; }
.search-result-item:hover i,
.search-result-item.active i { color: #3b82f6; }
.search-result-item .muted { font-size: .8rem; color: #9ca3af; margin-left: auto; }
.search-hint {
    padding: .6rem 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    color: #9ca3af;
    font-size: .75rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.search-hint kbd {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: .7rem;
    font-family: inherit;
}

[data-theme="dark"] .search-modal { background: #22252b; }
[data-theme="dark"] .search-modal-input { background: #22252b; color: #e0e0e0; border-bottom-color: #3a3d45; }
[data-theme="dark"] .search-result-item { color: #e0e0e0; }
[data-theme="dark"] .search-result-item:hover,
[data-theme="dark"] .search-result-item.active { background: #2d3a52; color: #93c5fd; }
[data-theme="dark"] .search-hint { background: #1a1d23; border-top-color: #3a3d45; color: #6b7280; }
[data-theme="dark"] .search-hint kbd { background: #2a2d35; border-color: #4b5563; color: #d1d5db; }

@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }

/* ═══ SEPA Girocode Widget ════════════════════════════════ */
.girocode-row {
    display: flex;
    justify-content: flex-end;
    padding: 24px 0 12px;
}
.girocode-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e5e4e0;
    border-radius: 12px;
    padding: 12px 16px 12px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 4px 12px rgba(0,0,0,.04);
    max-width: 320px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.girocode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.08);
}
.girocode-qr {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    background: #fff;
    padding: 4px;
    border: 1px solid #f0eee9;
    border-radius: 6px;
}
.girocode-qr svg, .girocode-qr img {
    width: 100%;
    height: 100%;
    display: block;
}
.girocode-info {
    min-width: 0;
}
.girocode-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #71717a;
    margin-bottom: 2px;
}
.girocode-name {
    font-size: 13px;
    font-weight: 600;
    color: #18181b;
    line-height: 1.2;
    margin-bottom: 2px;
}
.girocode-iban {
    font-size: 11px;
    font-family: 'JetBrains Mono', Consolas, monospace;
    color: #6b7280;
    word-break: break-all;
}
.girocode-hint {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
}

[data-theme="dark"] .girocode-card {
    background: #22252b;
    border-color: #3a3d45;
    box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.3);
}
[data-theme="dark"] .girocode-qr {
    background: #fff;
    border-color: #3a3d45;
}
[data-theme="dark"] .girocode-name { color: #e0e0e0; }
[data-theme="dark"] .girocode-iban,
[data-theme="dark"] .girocode-label,
[data-theme="dark"] .girocode-hint { color: #94a3b8; }

@media (max-width: 600px) {
    .girocode-row { justify-content: center; }
    .girocode-card { max-width: 100%; }
}
