/* ── GENERELLT ─────────────────────────────────────────────────────────── */
.sfv-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: inherit;
}

.sfv-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 32px;
}

.sfv-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #1a202c;
}

/* ── MEDDELANDEN ───────────────────────────────────────────────────────── */
.sfv-message {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    font-weight: 500;
}

.sfv-message--success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

.sfv-message--error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #9b2c2c;
}

/* ── FORMULÄR ──────────────────────────────────────────────────────────── */
.sfv-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sfv-form__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sfv-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
}

.sfv-optional {
    font-weight: 400;
    color: #718096;
    font-size: 0.85rem;
}

.sfv-input {
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    color: #2d3748;
    background: #fff;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.sfv-input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.sfv-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.sfv-help {
    color: #718096;
    font-size: 0.9rem;
    margin: 0 0 16px 0;
}

.sfv-race-label {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #2c5282;
}

/* ── KNAPPAR ───────────────────────────────────────────────────────────── */
.sfv-btn {
    display: inline-block;
    padding: 11px 24px;
    background: #2b6cb0;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-start;
}

.sfv-btn:hover {
    background: #2c5282;
}

.sfv-btn--secondary {
    background: #edf2f7;
    color: #2d3748;
    border: 1px solid #cbd5e0;
}

.sfv-btn--secondary:hover {
    background: #e2e8f0;
}

/* ── FILTER ────────────────────────────────────────────────────────────── */
.sfv-filter-form {
    margin-bottom: 24px;
}

.sfv-filter-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.sfv-filter-row .sfv-form__row {
    flex: 1;
    min-width: 160px;
}

/* ── RESULTATTABELL ────────────────────────────────────────────────────── */
.sfv-table-wrap {
    overflow-x: auto;
}

.sfv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.sfv-table th {
    text-align: left;
    padding: 10px 14px;
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sfv-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
}

.sfv-table tbody tr:last-child td {
    border-bottom: none;
}

.sfv-table tbody tr:hover td {
    background: #f7fafc;
}

.sfv-place {
    font-weight: 700;
    color: #2b6cb0;
    width: 40px;
}

.sfv-time {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 600;
}

.sfv-race-name {
    color: #718096;
    font-size: 0.875rem;
}

.sfv-empty {
    color: #718096;
    font-style: italic;
    padding: 16px 0;
}

/* ── STATUSBADGAR ──────────────────────────────────────────────────────── */
.sfv-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.sfv-badge--success {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.sfv-badge--warning {
    background: #fffaf0;
    color: #7b341e;
    border: 1px solid #fbd38d;
}

.sfv-badge--info {
    background: #ebf8ff;
    color: #2c5282;
    border: 1px solid #bee3f8;
}

.sfv-badge--neutral {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

/* ── ADMIN ─────────────────────────────────────────────────────────────── */
.sfv-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.sfv-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.sfv-admin-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
}

.sfv-admin-card--full {
    grid-column: 1 / -1;
}

.sfv-admin-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.sfv-admin-message--success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

.sfv-admin-message--error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #9b2c2c;
}

.sfv-code {
    background: #edf2f7;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    margin-right: 8px;
}

.sfv-edit-form {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.sfv-login-wrap {
    max-width: 420px;
    margin: 60px auto;
}

.sfv-login-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 32px;
    margin-top: 20px;
}

/* ── DIVI-KOMPATIBILITET ───────────────────────────────────────────────── */
.et_pb_code .sfv-wrap {
    max-width: 100%;
}

.et_pb_code_inner .sfv-card {
    margin-bottom: 24px;
}

.sfv-wrap * {
    box-sizing: border-box;
}

/* ── MOBILANPASSNING ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .sfv-card {
        padding: 20px 16px;
    }

    .sfv-filter-row {
        flex-direction: column;
    }

    .sfv-filter-row .sfv-form__row {
        min-width: 100%;
    }

    .sfv-admin-grid {
        grid-template-columns: 1fr;
    }

    .sfv-btn {
        width: 100%;
        text-align: center;
    }

    .sfv-table {
        font-size: 0.78rem;
    }

    .sfv-table th,
    .sfv-table td {
        padding: 7px 5px;
    }

    .sfv-table th:nth-child(1),
    .sfv-table td:nth-child(1) {
        width: 28px;
        text-align: center;
    }

    .sfv-table th:nth-child(3),
    .sfv-table td:nth-child(3) {
        width: 52px;
    }

    .sfv-table th:nth-child(4),
    .sfv-table td:nth-child(4) {
        width: 42px;
    }

    .sfv-table th:nth-child(6),
    .sfv-table td:nth-child(6) {
        display: none;
    }

    .sfv-time {
        font-size: 0.82rem;
    }

    .sfv-place {
        font-size: 0.82rem;
    }
}
/* ============================================================
   TILLÄGG TILL style.css
   Klistra in dessa regler i slutet av din befintliga style.css
   ============================================================ */

/* --- Namnsökning --- */
.sfv-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 10px;
}

.sfv-search-input {
    flex: 1;
    max-width: 360px;
    padding: 9px 14px;
    border: 1px solid #c8d0da;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.2s;
}

.sfv-search-input:focus {
    outline: none;
    border-color: #3a7bd5;
    box-shadow: 0 0 0 3px rgba(58,123,213,0.12);
}

.sfv-search-count {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

/* --- Etikett för aktivt lopp --- */
.sfv-active-race-label {
    font-size: 14px;
    color: #555;
    margin: 6px 0 12px;
}

.sfv-active-race-label strong {
    color: #222;
}

/* --- "Inga sökresultat"-rad --- */
.sfv-no-search-results {
    text-align: center;
    color: #888;
    font-style: italic;
    margin: 20px 0;
}

/* Mobilanpassning */
@media (max-width: 480px) {
    .sfv-search-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
    .sfv-search-input {
        max-width: 100%;
        width: 100%;
    }
}