:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: #1f2937;
  background: #f3f4f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.625rem 1.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 48rem;
  margin: 0 auto;
}

.site-nav form {
  margin: 0;
  display: flex;
  align-items: center;
}

.site-nav .button {
  margin-top: 0;
}

.nav-site {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.nav-link {
  color: #2563eb;
  font-weight: 600;
  line-height: 1.25rem;
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
}

.nav-user {
  margin-left: auto;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.site-nav .flash {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  white-space: nowrap;
}

.page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.page-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  width: min(100%, 32rem);
  padding: 2rem;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

h1 {
  margin-top: 0;
  font-size: 1.75rem;
}

p {
  color: #4b5563;
}

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: #2563eb;
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background: #1d4ed8;
}

.button-secondary {
  background: #6b7280;
}

.button-secondary:hover {
  background: #4b5563;
}

.user-info {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.5rem 1rem;
  margin: 1.5rem 0;
}

.user-info dt {
  font-weight: 600;
  color: #374151;
}

.role-list {
  margin: 0;
  padding-left: 1.25rem;
}

.role-list li {
  margin: 0.125rem 0;
}

.user-info dd {
  margin: 0;
  color: #111827;
}

.flash-messages-floating {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: grid;
  gap: 0.5rem;
  max-width: 24rem;
}

.flash {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #dbeafe;
  color: #1e3a8a;
}

.flash-alert {
  background: #fee2e2;
  color: #991b1b;
}

.flash-notice {
  background: #dcfce7;
  color: #166534;
}

.card-wide {
  width: min(100%, 40rem);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card-header h1 {
  margin: 0;
}

.card-header .button {
  margin-top: 0;
  flex-shrink: 0;
}

.case-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
}

.case-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.case-list li:last-child {
  border-bottom: none;
}

.case-list li:hover {
  background: #f9fafb;
}

.case-id {
  flex-shrink: 0;
  color: #6b7280;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.case-id-detail {
  margin: -0.5rem 0 1.25rem;
  color: #6b7280;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.case-list a {
  color: #1f2937;
  font-weight: 500;
  text-decoration: none;
}

.case-list a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.empty-state {
  color: #6b7280;
  margin: 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label,
.field-label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 600;
  color: #374151;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font: inherit;
  color: #111827;
  background: #ffffff;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: 2px solid #93c5fd;
  border-color: #2563eb;
}

.field-value {
  margin: 0;
  color: #4b5563;
}

.form-errors {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #fee2e2;
  color: #991b1b;
}

.form-errors ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.actions .button {
  margin-top: 0;
}

.button-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.button-danger {
  background: #dc2626;
}

.button-danger:hover {
  background: #b91c1c;
}
