:root { --bg:#f5f6f8; --card:#fff; --text:#1c2430; --muted:#5b6675; --line:#d9dee5; --accent:#1d5fa8; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:16px/1.5 system-ui,sans-serif; }
header { display:flex; flex-wrap:wrap; gap:.5rem 1.5rem; align-items:center; padding:.75rem 1.25rem; background:var(--card); border-bottom:1px solid var(--line); }
.brand { font-weight:700; color:var(--text); text-decoration:none; }
nav { display:flex; flex-wrap:wrap; gap:1rem; flex:1; }
nav a[aria-current] { font-weight:600; color:var(--text); text-decoration:none; }
.me { display:flex; gap:1rem; align-items:center; }
main { max-width:1100px; margin:0 auto; padding:1.5rem 1.25rem; }
h1 { font-size:1.5rem; margin:0 0 1rem; overflow-wrap:anywhere; }
a { color:var(--accent); }
.row { display:flex; justify-content:space-between; gap:1rem; align-items:start; }
.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:1.25rem; margin:0 0 1rem; }
.narrow { max-width:400px; margin:3rem auto; }
.muted { color:var(--muted); font-size:.9rem; font-weight:400; }
label { display:block; font-weight:500; margin-bottom:1rem; }
label .muted { display:block; }
input:not([type=checkbox],[type=radio]), select, textarea { display:block; width:100%; margin-top:.25rem; padding:.5rem .6rem; font:inherit; color:inherit; background:var(--card); border:1px solid #8a94a3; border-radius:6px; }
textarea { resize:vertical; }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
fieldset { border:1px solid var(--line); border-radius:6px; margin:0 0 1rem; padding:.75rem 1rem; }
legend { font-weight:500; }
.check { font-weight:400; margin-bottom:.4rem; }
.check .muted { display:inline; }
button, .button { display:inline-block; padding:.5rem 1rem; font:inherit; font-weight:500; color:#fff; background:var(--accent); border:1px solid var(--accent); border-radius:6px; text-decoration:none; white-space:nowrap; cursor:pointer; }
button.secondary { background:none; color:var(--accent); }
button.plain { padding:0; border:0; background:none; color:var(--accent); text-decoration:underline; }
.filters { display:flex; flex-wrap:wrap; gap:.75rem; align-items:end; margin-bottom:1rem; }
.filters label { margin:0; flex:1 1 150px; }
.filters .check { flex:0 0 auto; padding-bottom:.5rem; }
.alert { background:#fdecea; color:#8c1d13; border-radius:6px; padding:.6rem .9rem; }
.table { overflow-x:auto; background:var(--card); border:1px solid var(--line); border-radius:8px; }
table { width:100%; border-collapse:collapse; }
th, td { padding:.6rem .75rem; text-align:left; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:.85rem; color:var(--muted); white-space:nowrap; }
tbody tr:last-child td { border-bottom:0; }
td:nth-child(2) { min-width:180px; overflow-wrap:anywhere; }
.tag { display:inline-block; padding:.05rem .5rem; border-radius:4px; font-size:.85rem; white-space:nowrap; background:#e8ebef; }
.bug, .rejected { background:#fdecea; color:#8c1d13; }
.feature { background:#e3eefa; color:#164a84; }
.active { background:#fdf1d6; color:#6f4a00; }
.done { background:#e0f3e6; color:#17592f; }
dl { display:grid; grid-template-columns:max-content 1fr; gap:.25rem 1rem; }
dt { color:var(--muted); } dd { margin:0; overflow-wrap:anywhere; }
.description { white-space:pre-wrap; overflow-wrap:anywhere; border-top:1px solid var(--line); padding-top:1rem; margin-bottom:0; }
h2 { font-size:1.15rem; margin:1.5rem 0 .75rem; }
button.danger, .button.danger { background:none; color:#a3241a; border-color:#a3241a; }
.actions { display:flex; flex-wrap:wrap; gap:.75rem; }
.filters .small { flex:0 0 80px; }
.filters.new { margin:0; padding-top:1rem; border-top:1px solid var(--line); }
.history { list-style:none; } .history li + li { margin-top:.5rem; }

/* Khu vực quản trị: menu bên trái */
.tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:1rem; }
.tiles .card { margin:0; color:inherit; text-decoration:none; }
.tiles .card:hover { border-color:var(--accent); }
.tiles strong { display:block; font-size:2rem; line-height:1.2; }
.admin header { background:#1c2938; border:0; color:#fff; }
.admin header a, .admin header button.plain { color:#d5dde8; }
.admin header .brand, .admin header a[aria-current] { color:#fff; }
.admin header :focus-visible { outline-color:#fff; }
.brand small { font-weight:400; }
@media (min-width:800px) {
  .admin { display:grid; grid-template-columns:210px minmax(0,1fr); min-height:100vh; }
  .admin header { flex-direction:column; flex-wrap:nowrap; align-items:stretch; gap:1.25rem; height:100vh; position:sticky; top:0; padding:1.25rem 1rem; overflow-y:auto; }
  .admin nav { flex-direction:column; flex-wrap:nowrap; gap:.25rem; }
  .admin nav a { padding:.45rem .7rem; border-radius:6px; text-decoration:none; }
  .admin nav a:hover { background:#2a3a4d; }
  .admin nav a[aria-current] { background:#33475e; }
  .admin .me { flex-direction:column; align-items:flex-start; gap:.4rem; }
  .admin main { width:100%; }
}
@media (max-width:799px) {
  header { justify-content:space-between; }
  nav { order:1; flex:0 0 100%; }
}

.roles { display:flex; flex-wrap:wrap; gap:.25rem 1rem; flex:1 1 320px; }
.transition { padding-bottom:1rem; border-bottom:1px solid var(--line); }
.transition.new { border:0; padding:0; }
.pick { display:flex; gap:.4rem; }
.pick select { margin:0; width:auto; }
.transition > label { flex:1 1 180px; }
.transition .roles { flex:1 1 420px; }
.actions { align-items:start; }
summary.button { list-style:none; } summary::-webkit-details-marker { display:none; }
details[open] { width:min(420px,85vw); padding:.75rem; background:var(--card); border:1px solid var(--line); border-radius:8px; }
details[open] label { margin:.75rem 0; }
.reason { margin:.25rem 0 0; padding-left:.75rem; border-left:3px solid var(--line); white-space:pre-wrap; overflow-wrap:anywhere; }
