* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #17202a;
}
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 20px;
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    min-height: calc(100vh - 92px);
}
.sidebar, .content { padding: 16px; }
.panel {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}
.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.badge {
    background: #edf2f7;
    color: #334e68;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}
.grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #243b53;
}
input, select, textarea, button { font: inherit; }
input, select, textarea {
    width: 100%;
    border: 1px solid #bcccdc;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}
textarea { resize: vertical; }
button, .link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: #1565d8;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
button.secondary, .link-btn.secondary {
    background: #e6eef8;
    color: #102a43;
}
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}
.alert.error { background: #fde8e8; color: #9b1c1c; }
.alert.success { background: #e6fffa; color: #0f766e; }
.hidden { display: none !important; }
.cases-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.case-card {
    padding: 12px;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
}
.case-card.active {
    border-color: #1565d8;
    box-shadow: 0 0 0 2px rgba(21,101,216,0.1);
}
.case-card h3 { margin: 0 0 8px; font-size: 16px; }
.case-meta {
    font-size: 13px;
    color: #486581;
    display: grid;
    gap: 4px;
}
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.summary-item {
    background: #f8fbff;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    padding: 12px;
}
.summary-item small {
    display: block;
    color: #627d98;
    margin-bottom: 4px;
}
.timeline-list { display: grid; gap: 12px; }
.timeline-item {
    border-left: 4px solid #1565d8;
    padding: 10px 12px;
    background: #f8fbff;
    border-radius: 8px;
}
.timeline-item .meta {
    font-size: 12px;
    color: #627d98;
    margin-bottom: 6px;
}
.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
}
.login-card, .dialog-card {
    width: min(100%, 520px);
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(16,24,40,0.08);
}
.login-form { display: grid; gap: 12px; }
.muted { color: #627d98; }
dialog {
    border: 0;
    padding: 0;
    background: transparent;
}
dialog::backdrop { background: rgba(15, 23, 42, 0.5); }
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}
@media (max-width: 960px) {
    .layout { grid-template-columns: 1fr; }
    .grid-form, .summary-grid { grid-template-columns: 1fr; }
}
