:root {
    --bg: #f4f4f2;
    --surface: #ffffff;
    --dark: #0d0e0f;
    --yellow: #ffd000;
    --yellow-hover: #e6bb00;
    --text: #111214;
    --muted: #686b70;
    --border: #dcdcd8;
    --red: #dc2626;
    --green: #16a34a;
    --radius: 9px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.topbar {
    background: var(--dark);
    color: white;
    border-bottom: 3px solid var(--yellow);
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    background: var(--yellow);
    color: #111;
    font-weight: 900;
    border-radius: 5px;
}

.nav {
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin-left: auto;
}

.nav a {
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 0 14px;
    color: #bdbfc3;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    font-weight: 700;
    font-size: 0.9rem;
}

.nav a:hover,
.nav a.active {
    color: white;
}

.nav a.active {
    border-bottom-color: var(--yellow);
}

.userbar {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ddd;
}

.page {
    padding: 42px 0 72px;
}

.eyebrow {
    color: #927700;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.07em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

h2 {
    letter-spacing: -0.02em;
}

.muted {
    color: var(--muted);
}

.login-card {
    max-width: 620px;
    margin: 80px auto;
    padding: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.login-card p {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.65;
    margin: 20px 0 28px;
}

.button {
    appearance: none;
    border: 0;
    border-radius: 6px;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-primary {
    background: var(--yellow);
    color: #111;
}

.button-primary:hover {
    background: var(--yellow-hover);
}

.button-dark {
    background: #282a2d;
    color: white;
}

.button-danger {
    background: var(--red);
    color: white;
}

.full {
    width: 100%;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.split-heading {
    align-items: center;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px auto;
    gap: 10px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 11px;
    background: white;
    color: var(--text);
}

.input:focus {
    outline: 2px solid rgba(255, 208, 0, 0.35);
    border-color: #c9a600;
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.report-grid {
    display: grid;
    gap: 12px;
}

.report-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition:
        border-color 0.15s ease,
        transform 0.15s ease;
}

.report-card:hover {
    border-color: #aaa;
    transform: translateY(-1px);
}

.report-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.identity-row,
.person-banner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-large {
    width: 72px;
    height: 72px;
}

.person-banner {
    padding: 18px;
    border-bottom: 1px solid var(--border);
}

.report-card h2 {
    margin: 4px 0;
    font-size: 1.15rem;
}

.report-id {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
}

.report-summary {
    margin: 16px 0;
    line-height: 1.55;
}

.report-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 0.85rem;
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-open {
    background: #fff4bd;
    color: #735d00;
}

.status-claimed {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-resolved {
    background: #dcfce7;
    color: #166534;
}

.status-dismissed {
    background: #fee2e2;
    color: #991b1b;
}

.large-status {
    padding: 8px 12px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.stack {
    display: grid;
    gap: 18px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-heading {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: #f8f8f6;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1rem;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.detail-list > div:last-child {
    border-bottom: 0;
}

dt {
    color: var(--muted);
    font-weight: 700;
}

dd {
    margin: 0;
}

.prewrap {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.form-stack {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.compact-form {
    padding-bottom: 0;
}

.form-stack label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.notes {
    padding: 18px;
}

.note {
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.note:first-child {
    padding-top: 0;
}

.note:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.empty {
    padding: 42px;
    text-align: center;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.alert {
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 18px;
    font-weight: 700;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.mini-history {
    padding: 8px 18px;
}

.movement-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.movement-item:last-child {
    border-bottom: 0;
}

code {
    background: #eeeeeb;
    border-radius: 4px;
    padding: 2px 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 900px) {
    .topbar-inner {
        flex-wrap: wrap;
        padding: 10px 0;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .nav a {
        min-height: 42px;
    }
}

@media (max-width: 800px) {
    .toolbar,
    .detail-layout,
    .two-col {
        grid-template-columns: 1fr;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-list > div {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .userbar {
        margin-left: auto;
    }
}


.member-search-wrap {
    position: relative;
}

.member-search-results {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 360px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.member-search-result {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.member-search-result:last-child {
    border-bottom: 0;
}

.member-search-result:hover,
.member-search-result:focus {
    background: #f6f6f3;
    outline: none;
}

.member-search-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.member-search-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.member-search-text strong {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-search-text span {
    color: var(--muted);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-search-empty {
    padding: 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.selected-member {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8f8f6;
}

.selected-member[hidden] {
    display: none;
}

.selected-member-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.selected-member-copy strong,
.selected-member-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clear-member {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: #e7e7e3;
    color: #555;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.clear-member:hover {
    background: #dadad5;
    color: #111;
}

.field-help {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
}
