/* Same palette as the WPSBC Enrollment app: the exact WPSBC logo colors,
   purple #34246B (header, hover) and teal #027378 (buttons, links, accents). */
:root {
    --wpsbc-purple: #34246B;
    --wpsbc-teal: #027378;
    --brand: var(--wpsbc-teal);
    --brand-dark: var(--wpsbc-teal);
    --brand-darker: var(--wpsbc-purple);
    --brand-tint: #e6f1f2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #1f2937;
    background: #f4f6f8;
}

.site-header {
    background: var(--wpsbc-purple);
    color: #fff;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    height: 36px;
    width: auto;
    display: block;
}

.login-page {
    display: flex;
    justify-content: center;
    padding-top: 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 32px;
}

.login-card h1 {
    text-align: center;
    margin: 0 0 4px;
    font-size: 1.6rem;
}

.login-card .btn-primary {
    width: 100%;
    margin-top: 6px;
}

.login-brand {
    display: flex;
    justify-content: center;
}

.login-brand img {
    height: 110px;
    width: auto;
}

.site-header nav a {
    color: #e6f4f4;
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.95rem;
}

.site-header nav a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

h1 {
    color: var(--brand-dark);
}

.subtitle, .empty {
    color: #555;
}

/* Tables match the Enrollment app: a white card with light row lines and a
   pale header, instead of a solid brand-colored bar. */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid #e2e8ee;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

.data-table th, .data-table td {
    border-bottom: 1px solid #e2e8ee;
    padding: 8px 10px;
    text-align: left;
    font-size: 0.92rem;
    vertical-align: middle;
}

.data-table thead th {
    background: #f8fafb;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Round the pale header to the table's corners (no overflow clipping, so
   wide tables are never cut off). */
.data-table thead tr:first-child > :first-child { border-top-left-radius: 10px; }
.data-table thead tr:first-child > :last-child { border-top-right-radius: 10px; }

.data-table tbody tr:hover { background: #fafcfc; }
.data-table tbody tr:last-child > * { border-bottom: 0; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
}

.status-not-started { background: #9ca3af; }
.status-submitted-to-it { background: #2563eb; }
.status-in-progress { background: #d97706; }
.status-complete { background: #16a34a; }

.progress {
    background: #e5e7eb;
    border-radius: 6px;
    height: 10px;
    width: 140px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.progress-large {
    width: 100%;
    height: 14px;
    margin-top: 10px;
}

.progress-bar {
    background: var(--brand);
    height: 100%;
}

.progress-label {
    font-size: 0.85rem;
    color: #555;
    margin-left: 8px;
}

.form-card {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-card label {
    display: flex;
    flex-direction: column;
    font-weight: bold;
    font-size: 0.9rem;
    gap: 6px;
}

.form-card input, .form-card select, .form-card textarea {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-weight: normal;
}

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.btn-primary {
    background: var(--brand-dark);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    align-self: flex-start;
}

.btn-primary:hover {
    background: var(--brand-darker);
}

.save-progress-btn {
    margin-top: 20px;
}

.link-btn {
    background: none;
    border: none;
    color: #b91c1c;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
    padding: 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--brand-dark);
    text-decoration: none;
}

.hire-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: #444;
    margin-bottom: 8px;
}

.hire-notes {
    background: #fff8e1;
    border: 1px solid #fde68a;
    padding: 8px 12px;
    border-radius: 4px;
    max-width: 700px;
}

.section-title {
    color: var(--brand-dark);
    margin-top: 28px;
    border-bottom: 2px solid var(--brand);
    padding-bottom: 4px;
}

.checklist-table .col-done {
    width: 50px;
    text-align: center;
}

.checklist-table .col-initials {
    width: 56px;
    text-align: center;
}

.checklist-table .col-initials input[type="text"] {
    width: 3.2em;
    text-align: center;
    text-transform: uppercase;
}

.checklist-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-dark);
}

.checklist-table input[type="text"], .checklist-table input[type="date"] {
    width: 100%;
    padding: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
}

.notes-input {
    display: block;
    width: 100%;
    min-width: 180px;
    padding: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.35;
    resize: none;
    overflow: hidden;
}

.checklist-table tr.task-done {
    background: #f0fdf4;
}

/* Not applicable: greyed out but still editable (e.g. a note on why). */
.checklist-table tr.task-na {
    background: #f3f4f6;
    color: #6b7280;
}

.checklist-table tr.task-na td:nth-child(3) {
    text-decoration: line-through;
}

.checklist-table input.chk-na {
    accent-color: #6b7280;
}

.notes-input {
    min-width: 180px;
}

.status-row {
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-row select {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
}

.role-edit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inline-form select {
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
}

.btn-small {
    background: var(--brand-dark);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-small:hover {
    background: var(--brand-darker);
}

.as-link {
    display: inline-block;
    text-decoration: none;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-dark);
}

.form-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 8px 12px;
    border-radius: 4px;
    max-width: 480px;
}

/* ---------- Messages after saving ---------- */
.flash {
    padding: 10px 14px;
    border-radius: 4px;
    margin: 0 0 14px;
    border: 1px solid;
}

.flash-success { background: #dcfce7; border-color: #86efac; color: #14532d; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.flash-warning { background: #fef3c7; border-color: #fcd34d; color: #78350f; }

/* ---------- Reports ---------- */
.report-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    background: #fff;
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 14px;
}

.report-filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: bold;
}

.report-filters select, .report-filters input {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: inherit;
    font-weight: normal;
}

.report-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-clear {
    color: var(--brand-dark);
    font-size: 0.85rem;
}

.report-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-secondary {
    background: #fff;
    color: var(--brand-dark);
    border: 1px solid var(--brand-dark);
    padding: 9px 16px;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--brand-tint);
}

.report-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.report-card {
    background: #fff;
    border-left: 4px solid var(--brand);
    border-radius: 6px;
    padding: 10px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    color: #444;
}

.report-card-num {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--brand-dark);
    margin-right: 4px;
}

.report-table td.num {
    white-space: nowrap;
    text-align: center;
}

.report-table td.cell-complete {
    background: #f0fdf4;
}

.open-list {
    font-size: 0.82rem;
    color: #444;
    min-width: 220px;
}

.open-list summary {
    cursor: pointer;
    color: #b45309;
    font-weight: bold;
}

.open-list ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.print-only {
    display: none;
}

.cell-complete-text {
    color: #15803d;
    font-weight: bold;
}

.muted {
    color: #6b7280;
}

.report-note {
    font-size: 0.8rem;
    margin-top: 8px;
}

.checklist-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.checklist-topbar .back-link {
    margin-bottom: 0;
}

@media print {
    .site-header, .no-print, .report-toolbar { display: none !important; }
    .print-only { display: inline; }
    body { background: #fff; }
    .container { max-width: none; padding: 0; }
    .data-table { box-shadow: none; }
    .data-table th, .data-table td { font-size: 9pt; padding: 4px 6px; }
    .data-table thead th { background: #e5e7eb !important; color: #000 !important; }
    .report-card { box-shadow: none; border: 1px solid #ccc; }
    a { color: #000; text-decoration: none; }
    tr { break-inside: avoid; }
}

.form-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #14532d;
    padding: 8px 12px;
    border-radius: 4px;
    max-width: 480px;
}

/* --- Dashboard: Open and Completed sections --------------------------- */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.dash-section { margin-top: 24px; }

.dash-section h2 {
    font-size: 1.1rem;
    color: #1f2937;
    margin: 0 0 10px;
}

.dash-section h2 .count {
    color: #6b7280;
    font-weight: normal;
}

.completed-hires > summary {
    cursor: pointer;
    list-style-position: inside;
    margin-bottom: 10px;
}

.completed-hires > summary h2 {
    display: inline;
    margin: 0;
}

.completed-hires > summary:hover h2 { color: var(--brand-darker); }

/* --- User management ---------------------------------------------------- */
.user-filters { margin: 12px 0 16px; }

.user-tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 1px 4px 1px 0;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
    white-space: nowrap;
}
.tag-active   { background: #dcfce7; color: #14532d; }
.tag-disabled { background: #e5e7eb; color: #374151; }
.tag-admin    { background: #ede9fe; color: var(--wpsbc-purple); }
.tag-pending  { background: #fef3c7; color: #78350f; }

.users-table tr.user-disabled td { color: #6b7280; }

.user-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    align-items: start;
    margin-top: 16px;
}
.user-edit-grid .form-card { max-width: none; }
.user-edit-grid h2 { font-size: 1.05rem; margin: 0; color: #1f2937; }
.user-edit-grid p.muted { margin: 0; font-size: 0.85rem; }
.user-actions { display: flex; flex-direction: column; gap: 20px; }
.danger-zone { border: 1px solid #fecaca; }