* { box-sizing: border-box; }

body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    margin: 0;
    background: #fafafa;
    color: #1a1a1a;
}

.site-header {
    background: #1f2d3d;
}

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
}

.site-nav .brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
}

.nav-links a {
    color: #d7dee6;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 600;
}

.nav-links a:hover { color: #fff; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-title {
    text-align: center;
    font-size: 2.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header-row .page-title { margin-bottom: 0; }

.legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

.legend-item { display: flex; align-items: center; gap: 0.5rem; }

.swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid #1f2d3d;
    border-radius: 3px;
}

.swatch-gray { background: #d3d3d3; }
.swatch-red { background: #ff0000; }
.swatch-green { background: #8dc63f; }

/* ---- Exam card grid (matches reference layout) ---- */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .exam-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .exam-grid { grid-template-columns: 1fr; }
}

.exam-card {
    border: 2px solid #1f2d3d;
    padding: 1.4rem 1.2rem;
    text-align: center;
    border-radius: 2px;
}

.exam-line {
    font-size: 1.05rem;
    margin: 0.55rem 0;
}

.exam-date-line, .exam-title-line { font-weight: 600; }

.exam-card-gray  { background: #d3d3d3; color: #1a1a1a; }
.exam-card-red   { background: #ff0000; color: #1a0000; }
.exam-card-green { background: #8dc63f; color: #14320a; }

.result-badge {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.25rem 0.75rem;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.result-pass    { background: #1e7e34; color: #fff; }
.result-fail    { background: #7a1212; color: #fff; }
.result-pending { background: rgba(0,0,0,0.15); color: #1a1a1a; }

.empty-state {
    text-align: center;
    color: #666;
    font-size: 1.05rem;
    margin-top: 2rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary { background: #1f6fdb; color: #fff; }
.btn-primary:hover { background: #175bb8; }
.btn-secondary { background: #e5e7eb; color: #1a1a1a; margin-left: 0.5rem; }
.btn-secondary:hover { background: #d1d5db; }
.btn-danger { background: #d92d20; color: #fff; }
.btn-danger:hover { background: #b42318; }

/* ---- Table (manage view) ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

.data-table th {
    background: #f3f4f6;
    font-weight: 700;
}

.actions a { margin-right: 0.8rem; font-weight: 600; text-decoration: none; color: #1f6fdb; }
.danger-link { color: #d92d20 !important; }

.status-pill {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: capitalize;
}
.status-past { background: #d3d3d3; color: #333; }
.status-imminent { background: #ff0000; color: #fff; }
.status-upcoming { background: #8dc63f; color: #14320a; }

/* ---- Forms ---- */
.entry-form {
    max-width: 520px;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid #cbd2d9;
    border-radius: 5px;
    font-size: 0.95rem;
}

.field-validation-error { color: #d92d20; font-size: 0.85rem; }
.validation-summary { color: #d92d20; margin-bottom: 1rem; }

.form-actions { margin-top: 1.2rem; }

.alert {
    padding: 0.8rem 1rem;
    border-radius: 5px;
    margin-bottom: 1.2rem;
}
.alert-success { background: #e6f4ea; color: #1e7e34; border: 1px solid #b7e2c1; }

.confirm-text { font-size: 1.05rem; margin-bottom: 1rem; }

.site-footer {
    text-align: center;
    color: #888;
    padding: 1.5rem;
    font-size: 0.85rem;
}
