* { box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: -apple-system, Segoe UI, Helvetica, Arial, sans-serif; margin: 0; background: #f6f7f9; color: #1c1e21; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1.5rem; background: #1c2733; color: #fff; }
.topbar .brand { color: #fff; text-decoration: none; font-weight: 600; }
.topbar nav { display: flex; align-items: center; gap: .75rem; }
.topbar .who { opacity: .8; font-size: .9rem; }
main { max-width: 900px; width: 100%; margin: 2rem auto; padding: 0 1.5rem; flex: 1; }
.sitefooter { text-align: center; padding: 1.25rem 1.5rem; color: #9199a6; font-size: .85rem; }
.sitefooter a { color: #6b7280; }
.sitefooter a:hover { color: #2563eb; }
.footer-sep { margin: 0 .5rem; }
h1 { font-size: 1.4rem; margin-bottom: .5rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.muted { color: #6b7280; }
a { color: #2563eb; }
.btn, button, input[type=submit] { background: #2563eb; color: #fff; border: none; padding: .5rem 1rem; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; font-size: .95rem; }
.btn:hover, button:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-small { padding: .25rem .6rem; font-size: .85rem; }
button.link { background: none; color: #2563eb; padding: 0; text-decoration: underline; }
form.inline { display: inline; }
form.inline-form { display: flex; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
label { display: block; margin: .75rem 0 .25rem; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date], select {
  padding: .5rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 1rem; width: 100%; max-width: 400px;
}
table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid #eee; }
table.list th { background: #f0f1f3; font-size: .85rem; text-transform: uppercase; color: #6b7280; }
tr.expired-row { background: #fff5f5; }
.status { padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; }
.status-open { background: #dcfce7; color: #166534; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-closed { background: #e5e7eb; color: #374151; }
.badge.warn { background: #fee2e2; color: #991b1b; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; }
.flash { padding: .6rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.ok { background: #dcfce7; color: #166534; }
.thread { margin: 1.5rem 0; }
.msg { background: #fff; border-radius: 8px; padding: .8rem 1rem; margin-bottom: .75rem; border-left: 3px solid #d1d5db; }
.msg-agent { border-left-color: #2563eb; }
.msg-user { border-left-color: #16a34a; }
.msg-meta { font-size: .85rem; margin-bottom: .4rem; }
.msg-body img { max-width: 100%; border-radius: 4px; }
.editor { background: #fff; min-height: 140px; margin-bottom: .5rem; }
