*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    background: #f4f5f7;
    color: #1a1a2e;
}

header {
    background: #1a1a2e;
    color: white;
    padding: 0 1.5rem;
}
.header-inner {
    max-width: 800px;
    margin: 0 auto;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.5px; }
nav a { color: #ccc; text-decoration: none; margin-left: 1.5rem; font-size: 0.9rem; }
nav a:hover { color: white; }

main {
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
h1 { font-size: 1.4rem; }
h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: #444; }

.date-nav { display: flex; align-items: center; gap: 1rem; }
.date-nav a { text-decoration: none; color: #1a1a2e; font-size: 1.2rem; padding: 0.2rem 0.4rem; }
.date-nav span { font-weight: 600; }

.card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.8rem; text-transform: uppercase; color: #888; padding: 0.4rem 0.5rem; border-bottom: 1px solid #eee; }
td { padding: 0.55rem 0.5rem; border-bottom: 1px solid #f0f0f0; }
tfoot td { font-size: 1rem; border-top: 2px solid #eee; border-bottom: none; padding-top: 0.75rem; }

.badge { font-size: 0.78rem; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.badge-ok  { background: #e6f4ea; color: #276738; }
.badge-warn{ background: #fff8e1; color: #9a6700; }
.badge-err { background: #fce8e6; color: #c62828; }

.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error   { background: #fce8e6; color: #c62828; }
.alert-success { background: #e6f4ea; color: #276738; }
.alert-warn    { background: #fff8e1; color: #9a6700; }

.instructions { margin-top: 1rem; font-size: 0.88rem; color: #555; }
.instructions ul { margin: 0.4rem 0 0 1.2rem; }
.instructions li { margin-bottom: 0.2rem; }

.form-row { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.9rem; }
.form-row label { min-width: 170px; font-size: 0.9rem; color: #555; }
.form-row input, .form-row select, .form-row textarea {
    flex: 1;
    padding: 0.45rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.95rem;
    font-family: inherit;
}
.form-row textarea { resize: vertical; }
.readonly { font-weight: 600; font-size: 1rem; }

.btn {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary   { background: #1a1a2e; color: white; }
.btn-primary:hover:not(:disabled) { background: #2d2d4e; }
.btn-secondary { background: #eee; color: #333; }

.submitted-view .row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}
.over-short td, .over-short span { color: #c62828; font-weight: 600; }
.over td, .over span { color: #276738; font-weight: 600; }

.match-status {
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.match-ok  { background: #e6f4ea; color: #276738; }
.match-err { background: #fce8e6; color: #c62828; }

/* Parse loading overlay */
.parse-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,0.55);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}
.parse-overlay.active { display: flex; }
.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
