* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f5f7;
    color: #1d232a;
}
a { color: #175cd3; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
    background: #111827;
    color: white;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.brand { color: white; font-weight: 800; font-size: 20px; }
.tagline { color: #cbd5e1; margin-left: 10px; font-size: 13px; }
.topbar nav { display: flex; align-items: center; gap: 14px; }
.topbar nav a { color: white; }
.container { max-width: 1120px; margin: 0 auto; padding: 22px; }
.hero {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px; gap: 16px;
}
.hero h1 { margin: 0; font-size: 34px; }
.hero p { margin: 6px 0 0; color: #5b6472; }
.card, .entry-card {
    background: white;
    border: 1px solid #dde3ea;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.narrow { max-width: 440px; margin: 48px auto; }
.stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px;
}
.stats div { background: white; border: 1px solid #dde3ea; border-radius: 14px; padding: 16px; }
.stats strong { display: block; font-size: 26px; }
.stats span { color: #667085; }
.filters {
    display: grid;
    grid-template-columns: 1fr 150px 150px 130px auto auto;
    gap: 10px;
}
.entries { display: grid; gap: 12px; margin-top: 16px; }
.entry-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.entry-head h2 { margin: 0; font-size: 21px; }
.entry-card p { color: #424b57; white-space: pre-wrap; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; color: #667085; font-size: 13px; }
.pill {
    background: #eef4ff; color: #1849a9; border-radius: 999px;
    padding: 4px 10px; font-size: 12px; white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags a { background: #f2f4f7; border-radius: 999px; padding: 5px 9px; color: #344054; font-size: 13px; }
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input, select, textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #cfd6df;
    border-radius: 10px;
    font: inherit;
}
textarea { resize: vertical; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: #175cd3;
    color: white;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
button:hover, .button:hover { text-decoration: none; filter: brightness(.95); }
.button.secondary { background: #e4e7ec; color: #1d2939; }
.button.small { padding: 7px 10px; }
.danger { background: #c9184a; }
.link-danger {
    background: transparent;
    color: #c9184a;
    padding: 0;
    font-weight: 700;
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.checkrow { display: flex; align-items: end; padding-bottom: 10px; }
.checkrow input { width: auto; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.detail-head h1 { margin-top: 0; }
.notes {
    white-space: pre-wrap;
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    padding: 14px;
    font-family: inherit;
}
.attachments { padding-left: 20px; }
.attachments li { margin: 8px 0; display: flex; gap: 10px; align-items: center; }
.messages { margin-bottom: 14px; }
.message { padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; }
.message.success { background: #dcfae6; color: #05603a; }
.message.error { background: #fee4e2; color: #b42318; }
.muted { color: #667085; }

@media (max-width: 760px) {
    .topbar, .hero, .detail-head { flex-direction: column; align-items: stretch; }
    .topbar nav { flex-wrap: wrap; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .filters, .grid { grid-template-columns: 1fr; }
}
