.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ═══════════════════════════════════════════════════════════════════════
   KSNZ Private Incident Log — theme
   (same dark theme as the public app / KSNZ.Timing.Web for a consistent
   look across the KSNZ app family)
   ═══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg:          #0d1117;
    --surface:     #161b22;
    --surface2:    #21262d;
    --border:      #30363d;
    --text:        #e6edf3;
    --text-dim:    #8b949e;
    --accent:      #58a6ff;
    --green:       #3fb950;
    --yellow:      #d29922;
    --red:         #f85149;
    --gold:        #ffd700;
    --purple:      #a371f7;
    --radius:      6px;
    --font-mono:   'Courier New', Courier, monospace;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
}

a { color: var(--accent); }

/* ── App shell ────────────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.top-bar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .6rem 1.2rem; display: flex; align-items: center;
    gap: 1.2rem; flex-wrap: wrap;
}

.brand {
    font-size: 1.1rem; font-weight: 700; color: var(--accent);
    letter-spacing: .05em; text-decoration: none;
}

.top-bar nav { display: flex; gap: .2rem; }
.top-bar nav a {
    color: var(--text-dim); text-decoration: none; padding: .4rem .8rem;
    border-radius: var(--radius); font-size: .85rem; transition: all .15s;
}
.top-bar nav a:hover, .top-bar nav a.active { background: var(--surface2); color: var(--text); }

.status-bar {
    margin-left: auto; display: flex; align-items: center; gap: .8rem;
    font-size: .8rem; color: var(--text-dim);
}

.dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-dim); flex-shrink: 0;
}
.dot.live { background: var(--green); box-shadow: 0 0 6px var(--green); }

.main-content { flex: 1; padding: 1.2rem; max-width: 1600px; width: 100%; margin: 0 auto; }

/* ── Page heading / event selector ───────────────────────────────── */
.page-heading { margin-bottom: 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-heading h2 { margin: 0 0 .3rem 0; }

.event-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.event-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem; color: var(--text);
}
.event-card-name { font-weight: 700; margin-bottom: .3rem; }
.event-card-dates { font-size: .8rem; margin-top: .3rem; margin-bottom: .7rem; }

.area-links { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.area-link {
    background: var(--surface2); border: 1px solid var(--border); color: var(--accent);
    text-decoration: none; font-size: .78rem; padding: .3rem .6rem; border-radius: var(--radius);
    transition: border-color .15s;
}
.area-link:hover { border-color: var(--accent); }

/* ── Cards / tables (shared) ─────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; margin-bottom: 1.2rem;
}
.card-header {
    padding: .7rem 1rem; border-bottom: 1px solid var(--border);
    font-size: .85rem; font-weight: 600; color: var(--text-dim);
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap;
}
.card-header span:first-child { color: var(--text); }

.timing-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.timing-table th {
    background: var(--surface); color: var(--text-dim);
    font-weight: 600; font-size: .75rem; text-transform: uppercase;
    letter-spacing: .06em; padding: .6rem .8rem;
    text-align: left; border-bottom: 1px solid var(--border);
}
.timing-table td {
    padding: .55rem .8rem; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.timing-table tr:hover td { background: var(--surface2); }
.timing-table tr.clickable { cursor: pointer; }
.timing-table tr.highlight td { background: #0d3d1f; font-weight: 600; }
.timing-table tr.highlight:hover td { background: #114f28; }
.timing-table tr.row-protest td { background: #4a1020; }
.timing-table tr.row-protest:hover td { background: #5c1428; }

.incident-table .notes { color: var(--text-dim); max-width: 20rem; }

.mono  { font-family: var(--font-mono); }
.dim   { color: var(--text-dim); }
.green { color: var(--green); }
.gold  { color: var(--gold); }
.truncate { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Incident state badges ───────────────────────────────────────── */
.state-badge {
    display: inline-block; border-radius: 3px; padding: .15rem .5rem;
    font-size: .75rem; border: 1px solid var(--border); background: var(--surface2);
    color: var(--text-dim); white-space: nowrap;
}
.state-badge.state-pending  { border-color: var(--yellow); color: var(--yellow); }
.state-badge.state-good     { border-color: var(--green);  color: var(--green); }
.state-badge.state-issued   { background: var(--green);  border-color: var(--green);  color: #04220f; font-weight: 600; }
.state-badge.state-processed{ background: var(--purple); border-color: var(--purple); color: #1a0d2e; font-weight: 600; }

/* ── State messages ───────────────────────────────────────────────── */
.empty-state { padding: 3rem; text-align: center; color: var(--text-dim); }
.empty-state.small { padding: 1.5rem; font-size: .85rem; }
.loading-spinner {
    display: inline-block; width: 1.2rem; height: 1.2rem;
    border: 2px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: spin .7s linear infinite;
    margin-right: .5rem; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ────────────────────────────────────────────────────────── */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 2rem; width: 100%; max-width: 360px;
}
.login-card h1 { font-size: 1.3rem; margin: 0 0 .3rem 0; }
.login-card p { margin: 0 0 1.4rem 0; }

/* ── Forms (shared: login + admin CRUD) ──────────────────────────── */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .8rem; color: var(--text-dim); margin-bottom: .3rem; }
.text-input, select.text-input, textarea.text-input {
    width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius); padding: .5rem .6rem; font-size: .9rem; outline: none;
    transition: border-color .15s;
}
.text-input:focus { border-color: var(--accent); }
textarea.text-input { resize: vertical; min-height: 4.5rem; }

.checkbox-row { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.checkbox-row label { font-size: .85rem; color: var(--text); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }

.error-banner {
    background: #3a0a0a; border: 1px solid var(--red); color: var(--red);
    border-radius: var(--radius); padding: .6rem .8rem; font-size: .85rem; margin-bottom: 1rem;
}
.success-banner {
    background: #1a3a1a; border: 1px solid var(--green); color: var(--green);
    border-radius: var(--radius); padding: .6rem .8rem; font-size: .85rem; margin-bottom: 1rem;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-link {
    font-size: .85rem; padding: .5rem 1rem; border-radius: var(--radius);
    border: 1px solid var(--border); cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #04111f; font-weight: 600; width: 100%; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); }

.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #3a0a0a; }

.btn-link { background: none; border: none; color: var(--accent); padding: 0; }
.btn-link:hover { text-decoration: underline; }

.btn-small { font-size: .75rem; padding: .3rem .6rem; }

.table-actions { display: flex; gap: .4rem; }

.admin-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.admin-tabs a {
    background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
    text-decoration: none; padding: .4rem 1rem; border-radius: var(--radius); font-size: .85rem;
}
.admin-tabs a:hover, .admin-tabs a.active { background: var(--accent); border-color: var(--accent); color: #04111f; font-weight: 600; }