:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #172033; background: #f3f5f9; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { border: 0; border-radius: .55rem; background: #2056d7; color: white; padding: .65rem 1rem; cursor: pointer; }
button:hover { background: #1747ba; }
button:disabled { cursor: not-allowed; opacity: .5; }
.button { display: inline-block; border-radius: .55rem; padding: .65rem 1rem; text-decoration: none; }
.secondary { background: #e8edf7; color: #27344c; }
.secondary:hover { background: #dae2f0; }
.danger { background: #b42318; }
.danger:hover { background: #912018; }
.eyebrow { margin: 0 0 .3rem; color: #526584; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: #68758a; line-height: 1.5; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at top, #dde7fb, #f6f7fa 55%); }
.login-card { width: min(100%, 26rem); padding: 2rem; border: 1px solid #dfe4ed; border-radius: 1rem; background: white; box-shadow: 0 18px 50px #25365b1c; }
.login-card h1 { margin: 0; font-size: 1.8rem; }
.login-card form { display: grid; gap: .65rem; margin-top: 1.5rem; }
label { font-weight: 650; }
input { width: 100%; border: 1px solid #c9d1df; border-radius: .55rem; padding: .72rem .8rem; background: white; }
input:focus { outline: 3px solid #bcd0ff; border-color: #356ee5; }
.flash { border-radius: .5rem; padding: .75rem; }
.flash.error { background: #ffe8e8; color: #8b1c1c; }
.flash.success { background: #e5f7eb; color: #176233; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem max(1rem, calc((100vw - 1200px)/2)); background: #111b2f; color: white; }
.topbar h1 { margin: 0; font-size: 1.4rem; }
.topbar .eyebrow { color: #aab9d5; }
.topbar form { display: flex; align-items: center; gap: .8rem; }
.topbar-actions { display: flex; align-items: center; gap: .7rem; }
.username { color: #c9d3e5; }
.content { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; }
.toolbar { display: grid; grid-template-columns: auto minmax(12rem, 30rem) 1fr; align-items: center; gap: .8rem; margin-bottom: 1rem; }
#report-count { justify-self: end; color: #66738a; }
.table-card { overflow-x: auto; border: 1px solid #dfe4ed; border-radius: .8rem; background: white; box-shadow: 0 8px 30px #26395f0d; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem .9rem; border-bottom: 1px solid #e7eaf0; text-align: left; white-space: nowrap; }
th { color: #56637a; background: #f8f9fb; font-size: .8rem; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafbfe; }
.format { display: inline-block; min-width: 3.3rem; border-radius: 999px; padding: .25rem .5rem; background: #e8efff; color: #244fba; font-size: .75rem; font-weight: 750; text-align: center; }
.empty td { padding: 3rem; text-align: center; color: #788398; }
dialog { width: min(96vw, 1200px); height: min(92vh, 900px); padding: 0; border: 0; border-radius: .8rem; box-shadow: 0 25px 80px #0005; }
dialog::backdrop { background: #0b1224b8; }
dialog header { height: 3.8rem; display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; border-bottom: 1px solid #dfe4ed; }
dialog h2 { overflow: hidden; margin: 0; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
dialog iframe { display: block; width: 100%; height: calc(100% - 3.8rem); border: 0; background: white; }
.admin-content { display: grid; gap: 1rem; }
.admin-card { border: 1px solid #dfe4ed; border-radius: .8rem; padding: 1.2rem; background: white; box-shadow: 0 8px 30px #26395f0d; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-size: 1.25rem; }
.section-heading .muted { max-width: 34rem; margin: 0; }
.create-user-form { display: grid; grid-template-columns: repeat(3, minmax(10rem, 1fr)); align-items: end; gap: .9rem; }
.create-user-form label:not(.checkbox-label), .inline-panel label { display: grid; gap: .4rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; min-height: 2.7rem; }
.checkbox-label input { width: auto; }
.user-table { overflow: visible; box-shadow: none; }
.user-table td { vertical-align: top; }
.self-mark, .role, .status { display: inline-block; border-radius: 999px; padding: .2rem .48rem; font-size: .72rem; font-weight: 700; }
.self-mark { background: #edf0f5; color: #56637a; }
.role { background: #edf0f5; color: #56637a; }
.role.admin { background: #eee9ff; color: #5b39a8; }
.status.enabled { background: #e5f7eb; color: #176233; }
.status.disabled { background: #ffe8e8; color: #8b1c1c; }
.user-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem; min-width: 31rem; }
.user-actions form { margin: 0; }
details { position: relative; }
summary { display: inline-block; border-radius: .55rem; padding: .65rem 1rem; background: #e8edf7; color: #27344c; cursor: pointer; }
summary:hover { background: #dae2f0; }
.inline-panel { position: absolute; z-index: 5; top: calc(100% + .5rem); right: 0; width: 19rem; display: grid; gap: .7rem; padding: 1rem; border: 1px solid #d7deea; border-radius: .7rem; background: white; box-shadow: 0 14px 40px #17203330; }
.inline-panel p { margin: 0; white-space: normal; color: #68758a; line-height: 1.45; }
.danger-zone summary { background: #ffe8e8; color: #8b1c1c; }
@media (max-width: 700px) {
  .topbar { align-items: flex-start; }
  .username { display: none; }
  .toolbar { grid-template-columns: 1fr; }
  #report-count { justify-self: start; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .section-heading { display: block; }
  .section-heading .muted { margin-top: .5rem; }
  .create-user-form { grid-template-columns: 1fr; }
  .user-table { overflow-x: auto; }
  .inline-panel { right: auto; left: 0; }
}
