body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: #f6f7fb;
    color: #222;
}

header {
    background: #1f3a93;
    color: #fff;
    padding: 1.5rem 2rem;
}

header h1 {
    margin: 0;
    font-size: 1.75rem;
}

header a {
    color: #fff;
    text-decoration: none;
}

main {
    padding: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-grid {
    display: grid;
    gap: 1rem;
}

label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="url"],
input[type="number"],
input[type="text"] {
    margin-top: 0.35rem;
    padding: 0.6rem;
    border: 1px solid #ccd3e0;
    border-radius: 6px;
    font-size: 1rem;
}

.button,
button {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border-radius: 6px;
    border: none;
    background: #4d6de3;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.button:hover,
button:hover {
    background: #2f4ec9;
}

button.primary {
    background: #1f3a93;
}

.button.danger,
button.danger {
    background: #c0392b;
}

.button.danger:hover,
button.danger:hover {
    background: #962d22;
}

.button-row,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.table-controls label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 140px;
}

.table-controls select,
.table-controls input[type="search"] {
    margin-top: 0.35rem;
    padding: 0.5rem;
    border: 1px solid #ccd3e0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.table-controls .grow {
    flex: 1 1 220px;
}

.table-controls .reset-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-left: auto;
}

.table-controls .reset-form label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
    font-size: 0.85rem;
}

.table-wrapper {
    overflow-x: auto;
}

.table-scroll {
    max-height: 500px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    position: sticky;
    top: 0;
    background: #eef1fb;
}

td,
th {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e6f2;
    text-align: left;
}

th[data-sort-key] {
    cursor: pointer;
    user-select: none;
}

.sorted-asc::after {
    content: "▲";
    margin-left: 0.3rem;
    font-size: 0.7rem;
}

.sorted-desc::after {
    content: "▼";
    margin-left: 0.3rem;
    font-size: 0.7rem;
}

.mono {
    font-family: 'Fira Code', 'Courier New', monospace;
}

.log-area {
    background: #111;
    color: #d6f4ff;
    padding: 1rem;
    border-radius: 6px;
    height: 320px;
    overflow-y: auto;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-list li {
    margin-bottom: 0.4rem;
}

.flash-messages {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    background: #eaf2ff;
    color: #1f3a93;
}

.flash.error {
    background: #fdecea;
    color: #c0392b;
}

.flash.warning {
    background: #fff4e5;
    color: #b06b00;
}

.flash.success {
    background: #e8f8f2;
    color: #1e824c;
}

footer {
    text-align: center;
    font-size: 0.8rem;
    color: #54617a;
    padding: 1rem;
}

.summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #eef1ff;
    color: #1f3a93;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge.warning {
    background: #fff1d6;
    color: #c27a00;
}

.reason-panel {
    margin-bottom: 0.75rem;
    background: #f8f9ff;
    border-radius: 6px;
    padding: 0.75rem 1rem;
}

.reason-panel summary {
    font-weight: 600;
    cursor: pointer;
}

.reason-panel ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.run-summary-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e6f2;
}

.run-summary-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.4rem 0.75rem;
    margin: 0;
}

.run-summary-grid dt {
    font-weight: 700;
    color: #2f3c56;
}

.run-summary-grid dd {
    margin: 0;
    color: #1f2937;
}

.muted-text {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0.25rem 0 0.75rem;
}
