/* ================================
   STEP 4: Audit Summary (from React)
   ================================ */

.audit-summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}

.as-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.as-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.as-errors-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}

.as-errors-toggle input {
    display: none;
}

.as-toggle-box {
    width: 20px;
    height: 20px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background .25s, border-color .25s;
}

.as-errors-toggle input:checked + .as-toggle-box {
    background: #7fad49;
    border-color: #7fad49;
}

.as-errors-toggle input:checked + .as-toggle-box:after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    position: absolute;
    top: 5px;
    left: 4px;
}

.as-toggle-label {
    color: #4b5563;
    font-weight: 500;
}

.as-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .as-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.as-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
/*    max-height: 420px;*/
    overflow: hidden;
}

.as-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 14px;
    color: #111827;
}

.as-steps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.as-steps-list::-webkit-scrollbar,
.as-logs-list::-webkit-scrollbar {
    width: 8px;
}
.as-steps-list::-webkit-scrollbar-track,
.as-logs-list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}
.as-steps-list::-webkit-scrollbar-thumb,
.as-logs-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.as-steps-list::-webkit-scrollbar-thumb:hover,
.as-logs-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.as-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #eceff1;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background .25s;
    animation: fadeIn .35s ease;
}

.as-step:hover {
    background: #f3f4f6;
}

.as-step-status {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    position: relative;
    background: #ffffff;
}

.as-status-in-progress {
    border-color: #f59e0b;
    background: #fef3c7;
}

.as-status-completed {
    background: #7fad49;
    border-color: #7fad49;
}

.as-status-completed:after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    position: absolute;
    top: 3px;
    left: 3px;
}

.as-status-error {
    background: #dc2626;
    border-color: #dc2626;
}

.as-status-error:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 2px;
    background: #fff;
    top: 8px;
    left: 4px;
    transform: rotate(45deg);
}
.as-status-error:before {
    content: '';
    position: absolute;
    width: 10px;
    height: 2px;
    background: #fff;
    top: 8px;
    left: 4px;
    transform: rotate(-45deg);
}

.as-step-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.as-step-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.as-step-time {
    font-size: 11px;
    color: #6b7280;
}

.as-logs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.as-log {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 13px;
    animation: fadeIn .35s ease;
}

.as-log:nth-child(even) {
    background: #f3f4f6;
}

.as-log-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.as-log-meta {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.as-log-success { color: #16a34a; }
.as-log-error { color: #dc2626; }
.as-log-info { color: #2563eb; }
.as-log-warning { color: #d97706; }

.as-empty {
    text-align: center;
    padding: 54px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.as-empty-icon {
    width: 64px;
    height: 64px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.as-empty-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.as-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.as-footer-right {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.as-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background .25s, color .25s, border-color .25s;
    border: 1px solid #d1d5db;
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary.as-btn:hover:not(:disabled) {
    background: #d1d5db;
}

.btn-secondary.as-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-outline.as-btn {
    background: #ffffff;
    border-color: #e5e7eb;
}

.btn-outline.as-btn:hover {
    background: #f3f4f6;
}

.btn-primary.as-btn {
    background: #7fad49;
    border-color: #7fad49;
    color: #ffffff;
}

.btn-primary.as-btn:hover:not(:disabled) {
    background: #6a943f;
    border-color: #6a943f;
}

.btn-primary.as-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.as-ico {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Reuse existing fadeIn keyframe if defined; fallback here */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}