﻿/* ==================== Layout ==================== */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #1f2937;
}

.as-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.as-header {
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.as-header-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.as-header-info {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    gap: 12px;
    align-items: center;
}

.as-main {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ==================== Step-Flow ==================== */
.as-flow {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: white;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.as-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    position: relative;
}

.as-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    background: #e5e7eb;
    color: #6b7280;
    flex-shrink: 0;
}

.as-step.active .as-step-number {
    background: #2a5298;
    color: white;
}

.as-step.done .as-step-number {
    background: #10b981;
    color: white;
}

.as-step.error .as-step-number {
    background: #dc2626;
    color: white;
}

.as-step-label {
    color: #6b7280;
    font-weight: 500;
}

.as-step.active .as-step-label,
.as-step.done .as-step-label {
    color: #1f2937;
}

/* ==================== Card-Grid ==================== */
.as-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.as-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.15s;
}

    .as-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

.as-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.as-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2a5298;
    font-size: 16px;
    font-weight: 700;
}

.as-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.as-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.as-card-row-label {
    color: #6b7280;
}

.as-card-row-value {
    color: #1f2937;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.as-card-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
}

    .as-card-status.ok {
        background: #d1fae5;
        color: #065f46;
    }

    .as-card-status.pending {
        background: #fef3c7;
        color: #92400e;
    }

    .as-card-status.error {
        background: #fee2e2;
        color: #991b1b;
    }

.as-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

    .as-status-dot.ok {
        background: #10b981;
    }

    .as-status-dot.pending {
        background: #f59e0b;
        animation: pulse 1.5s infinite;
    }

    .as-status-dot.error {
        background: #dc2626;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ==================== Summary-Banner ==================== */
.as-summary {
    background: white;
    padding: 20px 24px;
    border-radius: 10px;
    border-left: 4px solid #10b981;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

    .as-summary.error {
        border-left-color: #dc2626;
    }

.as-summary-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.as-summary-hint {
    font-size: 13px;
    color: #6b7280;
}

.as-summary-actions {
    display: flex;
    gap: 8px;
}

/* ==================== Buttons ==================== */
.btn-primary, .btn-secondary {
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.1s;
}

.btn-primary {
    background: #2a5298;
    color: white;
}

    .btn-primary:hover:not(:disabled) {
        background: #1e3c72;
    }

    .btn-primary:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

    .btn-secondary:hover:not(:disabled) {
        background: #d1d5db;
    }

/* ==================== Dialogs ==================== */
.dialog-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

    .dialog-backdrop.show {
        display: flex;
    }

.dialog {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 460px;
    max-width: 92vw;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.dialog-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.dialog-hint {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.dialog-warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.dialog-body {
    margin-bottom: 20px;
}

.dialog-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.dialog-select, .dialog-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background: white;
}

.dialog-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

    .dialog-checkbox input {
        width: 16px;
        height: 16px;
    }

.dialog-error {
    color: #dc2626;
    font-size: 13px;
    margin: 6px 0 0 0;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ==================== Fehler-Log ==================== */
.as-errorlog {
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    color: #991b1b;
    white-space: pre-wrap;
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
}

/* ==================== Full-Screen-Error ==================== */
.as-noconnect {
    max-width: 520px;
    margin: 80px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
}

.as-noconnect-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.as-noconnect-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.as-noconnect-hint {
    color: #6b7280;
    font-size: 14px;
}
