:root {
    --bg: #fafaf8;
    --fg: #1a1a1a;
    --muted: #888;
    --border: #ddd;
    --accent: #2c5f2d;
    --card-bg: #fff;
    --radius: 4px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
}

header {
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1rem;
}

.breadcrumb { font-size: 0.9rem; }
.breadcrumb a { color: #fff; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 0.3rem; opacity: 0.6; }

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

footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { text-decoration: underline; color: var(--accent); }
.footer-links .sep { margin: 0 0.4rem; opacity: 0.5; }

h1 { margin-bottom: 0.25rem; }
h2 { margin-top: 1.25rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--muted); margin-bottom: 1rem; }

/* Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th, .data-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: #f0f0ee;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.data-table tbody tr:hover { background: #f5f5f0; }
.data-table a { color: var(--accent); text-decoration: none; font-weight: 500; }
.data-table a:hover { text-decoration: underline; }

/* Info table (person detail) */
.info-table td { padding: 0.25rem 0.75rem 0.25rem 0; vertical-align: top; }
.info-table td:first-child { font-weight: 600; white-space: nowrap; color: var(--muted); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: #1e4a1f; color: #fff; }
.btn-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Badge */
.badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge.pending { background: #eee; color: var(--muted); }

/* Inputs */
.text-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--fg);
}
.text-input:focus { outline: none; border-color: var(--accent); }

.search-wrap {
    display: flex;
    gap: 0.5rem;
}
.search-wrap .text-input { flex: 1; }

/* Connect form */
.connect-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}
.person-picker { flex: 1; min-width: 250px; }
.person-picker label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}
.person-picker input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
}
.person-picker input:focus { outline: none; border-color: var(--accent); }

/* Autocomplete */
.autocomplete-wrap { position: relative; }
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}
.search-results:not(:empty) { display: block; }
.search-result {
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
}
.search-result:hover { background: #f5f5f0; }
.search-empty {
    padding: 0.5rem 0.75rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Report text */
.report-text {
    font-family: "SFMono-Regular", "Cascadia Code", "Fira Code", Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

/* Responsive */
@media (max-width: 768px) {
    main { padding: 0.5rem; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 0.35rem 0.5rem; }
    .connect-form { flex-direction: column; }
    .person-picker { min-width: auto; }
    .report-text { font-size: 0.72rem; }
    h1 { font-size: 1.3rem; }
    h2 { font-size: 1.1rem; }
}
